diff --git a/.changeset/twelve-plants-invent.md b/.changeset/twelve-plants-invent.md new file mode 100644 index 00000000..6f33e26d --- /dev/null +++ b/.changeset/twelve-plants-invent.md @@ -0,0 +1,5 @@ +--- +"swagger-typescript-api": patch +--- + +Replace Prettier with Biome as the code formatter to improve performance during the code generation phase. diff --git a/README.md b/README.md index 1116822a..e206fc20 100644 --- a/README.md +++ b/README.md @@ -108,13 +108,6 @@ generateApi({ extractRequestBody: false, extractEnums: false, unwrapResponseData: false, - prettier: { - // By default prettier config is load from your project - printWidth: 120, - tabWidth: 2, - trailingComma: "all", - parser: "typescript", - }, defaultResponseType: "void", singleHttpClient: true, cleanOutput: false, diff --git a/package.json b/package.json index fcacb32d..fd722b93 100644 --- a/package.json +++ b/package.json @@ -43,16 +43,16 @@ "test": "vitest run" }, "dependencies": { + "@biomejs/js-api": "^0.7.1", + "@biomejs/wasm-nodejs": "^1.9.4", "@types/swagger-schema-official": "^2.0.25", "c12": "^3.0.2", "citty": "^0.1.6", "consola": "^3.4.2", - "cosmiconfig": "^9.0.0", "eta": "^2.2.0", "js-yaml": "^4.1.0", "lodash": "^4.17.21", "nanoid": "^5.1.5", - "prettier": "~3.5.3", "swagger-schema-official": "2.0.0-bab6bed", "swagger2openapi": "^7.0.8", "typescript": "~5.8.2" diff --git a/src/code-formatter.ts b/src/code-formatter.ts index 7954512e..a80a2ff1 100644 --- a/src/code-formatter.ts +++ b/src/code-formatter.ts @@ -1,4 +1,6 @@ -import * as prettier from "prettier"; +import * as path from "node:path"; +import { Biome, Distribution } from "@biomejs/js-api"; +import * as nanoid from "nanoid"; import * as typescript from "typescript"; import type { CodeGenConfig } from "./configuration.js"; @@ -34,23 +36,27 @@ export class CodeFormatter { return content; }; - prettierFormat = async (content: string) => { - const formatted = await prettier.format( - content, - this.config.prettierOptions, - ); - return formatted; + format = async (content: string) => { + const biome = await Biome.create({ distribution: Distribution.NODE }); + biome.applyConfiguration({ + files: { maxSize: Number.MAX_SAFE_INTEGER }, + formatter: { indentStyle: "space" }, + }); + const formatted = biome.formatContent(content, { + filePath: path.format({ name: nanoid.nanoid(), ext: "ts" }), + }); + return formatted.content; }; formatCode = async ( code: string, - { removeUnusedImports = true, prettierFormat = true } = {}, + { removeUnusedImports = true, format = true } = {}, ) => { if (removeUnusedImports) { code = this.removeUnusedImports(code); } - if (prettierFormat) { - code = await this.prettierFormat(code); + if (format) { + code = await this.format(code); } return code; }; diff --git a/src/configuration.ts b/src/configuration.ts index bd273c14..8824268f 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -1,4 +1,3 @@ -import * as cosmiconfig from "cosmiconfig"; import lodash from "lodash"; import type { OpenAPI } from "openapi-types"; import * as typescript from "typescript"; @@ -87,7 +86,6 @@ export class CodeGenConfig { outOfModuleApi: "Common", }; routeNameDuplicatesMap = new Map(); - prettierOptions = { ...CONSTANTS.PRETTIER_OPTIONS }; hooks: Hooks = { onPreBuildRoutePath: (_routePath: unknown) => void 0, onBuildRoutePath: (_routeData: unknown) => void 0, @@ -390,7 +388,6 @@ export class CodeGenConfig { templateExtensions = [".eta", ".ejs"]; constructor({ - prettierOptions = getDefaultPrettierOptions(), codeGenConstructs, primitiveTypeConstructs, constants, @@ -405,10 +402,6 @@ export class CodeGenConfig { this.update({ ...otherConfig, - prettierOptions: - prettierOptions === undefined - ? getDefaultPrettierOptions() - : prettierOptions, hooks: lodash.merge(this.hooks, hooks || {}), constants: { ...CONSTANTS, @@ -430,20 +423,3 @@ export class CodeGenConfig { objectAssign(this, update); }; } - -const getDefaultPrettierOptions = () => { - const prettier = cosmiconfig - .cosmiconfigSync("prettier", { - searchStrategy: "global", - }) - .search(); - - if (prettier) { - return { - ...prettier.config, - parser: "typescript", - }; - } - - return { ...CONSTANTS.PRETTIER_OPTIONS }; -}; diff --git a/src/constants.ts b/src/constants.ts index dbdf8abc..a64a9da6 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -21,13 +21,6 @@ export const HTTP_CLIENT = { AXIOS: "axios", } as const; -export const PRETTIER_OPTIONS = { - printWidth: 120, - tabWidth: 2, - trailingComma: "all", - parser: "typescript", -} as const; - export const PROJECT_VERSION = packageJson.version; export const RESERVED_BODY_ARG_NAMES = ["data", "body", "reqBody"]; diff --git a/tests/__snapshots__/extended.test.ts.snap b/tests/__snapshots__/extended.test.ts.snap index 38116f02..9408c5ae 100644 --- a/tests/__snapshots__/extended.test.ts.snap +++ b/tests/__snapshots__/extended.test.ts.snap @@ -2373,16 +2373,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -2401,7 +2407,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -2434,9 +2441,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -2447,8 +2460,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -2465,7 +2483,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -2478,7 +2499,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -2522,15 +2545,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -2688,7 +2722,9 @@ export class HttpClient { * We have client libraries to help you get started with your project: [Python](https://github.com/adafruit/io-client-python), [Ruby](https://github.com/adafruit/io-client-ruby), [Arduino C++](https://github.com/adafruit/Adafruit_IO_Arduino), [Javascript](https://github.com/adafruit/adafruit-io-node), and [Go](https://github.com/adafruit/io-client-go) are available. They're all open source, so if they don't already do what you want, you can fork and add any feature you'd like. * */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { user = { /** * No description @@ -2737,7 +2773,11 @@ export class Api extends HttpClient + createWebhookFeedData: ( + token: string, + payload: CreateWebhookFeedDataPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/webhooks/feed/\${token}\`, method: "POST", @@ -2758,7 +2798,10 @@ export class Api extends HttpClient + addFeedToGroup: ( + { groupKey, username, ...query }: AddFeedToGroupParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}/add\`, method: "POST", @@ -2777,7 +2820,10 @@ export class Api extends HttpClient + allActivities: ( + { username, ...query }: AllActivitiesParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/activities\`, method: "GET", @@ -2796,7 +2842,11 @@ export class Api extends HttpClient + allBlocks: ( + username: string, + dashboardId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${dashboardId}/blocks\`, method: "GET", @@ -2832,7 +2882,10 @@ export class Api extends HttpClient + allData: ( + { username, feedKey, ...query }: AllDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data\`, method: "GET", @@ -2869,7 +2922,10 @@ export class Api extends HttpClient + allGroupFeedData: ( + { username, groupKey, feedKey, ...query }: AllGroupFeedDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}/feeds/\${feedKey}/data\`, method: "GET", @@ -2888,7 +2944,11 @@ export class Api extends HttpClient + allGroupFeeds: ( + groupKey: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}/feeds\`, method: "GET", @@ -2924,7 +2984,12 @@ export class Api extends HttpClient + allPermissions: ( + username: string, + type: string, + typeId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/\${type}/\${typeId}/acl\`, method: "GET", @@ -2978,7 +3043,12 @@ export class Api extends HttpClient + batchCreateData: ( + username: string, + feedKey: string, + data: BatchCreateDataPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/batch\`, method: "POST", @@ -3024,7 +3094,10 @@ export class Api extends HttpClient + chartData: ( + { username, feedKey, ...query }: ChartDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/chart\`, method: "GET", @@ -3043,7 +3116,12 @@ export class Api extends HttpClient + createBlock: ( + username: string, + dashboardId: string, + block: CreateBlockPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${dashboardId}/blocks\`, method: "POST", @@ -3063,7 +3141,11 @@ export class Api extends HttpClient + createDashboard: ( + username: string, + dashboard: CreateDashboardPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards\`, method: "POST", @@ -3083,7 +3165,12 @@ export class Api extends HttpClient + createData: ( + username: string, + feedKey: string, + datum: CreateDataPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data\`, method: "POST", @@ -3103,7 +3190,11 @@ export class Api extends HttpClient + createFeed: ( + { username, ...query }: CreateFeedParams, + feed: CreateFeedPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds\`, method: "POST", @@ -3124,7 +3215,11 @@ export class Api extends HttpClient + createGroup: ( + username: string, + group: CreateGroupPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups\`, method: "POST", @@ -3169,7 +3264,12 @@ export class Api extends HttpClient + createGroupFeed: ( + username: string, + groupKey: string, + feed: CreateGroupFeedPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}/feeds\`, method: "POST", @@ -3241,7 +3341,11 @@ export class Api extends HttpClient + createToken: ( + username: string, + token: CreateTokenPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/tokens\`, method: "POST", @@ -3261,7 +3365,11 @@ export class Api extends HttpClient + createTrigger: ( + username: string, + trigger: CreateTriggerPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/triggers\`, method: "POST", @@ -3298,7 +3406,12 @@ export class Api extends HttpClient + destroyBlock: ( + username: string, + dashboardId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${dashboardId}/blocks/\${id}\`, method: "DELETE", @@ -3316,7 +3429,11 @@ export class Api extends HttpClient + destroyDashboard: ( + username: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${id}\`, method: "DELETE", @@ -3334,7 +3451,12 @@ export class Api extends HttpClient + destroyData: ( + username: string, + feedKey: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/\${id}\`, method: "DELETE", @@ -3352,7 +3474,11 @@ export class Api extends HttpClient + destroyFeed: ( + username: string, + feedKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}\`, method: "DELETE", @@ -3369,7 +3495,11 @@ export class Api extends HttpClient + destroyGroup: ( + username: string, + groupKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}\`, method: "DELETE", @@ -3387,7 +3517,13 @@ export class Api extends HttpClient + destroyPermission: ( + username: string, + type: string, + typeId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/\${type}/\${typeId}/acl/\${id}\`, method: "DELETE", @@ -3423,7 +3559,11 @@ export class Api extends HttpClient + destroyTrigger: ( + username: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/triggers/\${id}\`, method: "DELETE", @@ -3441,7 +3581,10 @@ export class Api extends HttpClient + firstData: ( + { username, feedKey, ...query }: FirstDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/first\`, method: "GET", @@ -3461,7 +3604,10 @@ export class Api extends HttpClient + getActivity: ( + { username, type, ...query }: GetActivityParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/activities/\${type}\`, method: "GET", @@ -3480,7 +3626,12 @@ export class Api extends HttpClient + getBlock: ( + username: string, + dashboardId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${dashboardId}/blocks/\${id}\`, method: "GET", @@ -3534,7 +3685,10 @@ export class Api extends HttpClient + getData: ( + { username, feedKey, id, ...query }: GetDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/\${id}\`, method: "GET", @@ -3571,7 +3725,11 @@ export class Api extends HttpClient + getFeedDetails: ( + username: string, + feedKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/details\`, method: "GET", @@ -3589,7 +3747,11 @@ export class Api extends HttpClient + getGroup: ( + username: string, + groupKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}\`, method: "GET", @@ -3607,7 +3769,13 @@ export class Api extends HttpClient + getPermission: ( + username: string, + type: string, + typeId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/\${type}/\${typeId}/acl/\${id}\`, method: "GET", @@ -3661,7 +3829,10 @@ export class Api extends HttpClient + lastData: ( + { username, feedKey, ...query }: LastDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/last\`, method: "GET", @@ -3681,7 +3852,10 @@ export class Api extends HttpClient + nextData: ( + { username, feedKey, ...query }: NextDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/next\`, method: "GET", @@ -3701,7 +3875,10 @@ export class Api extends HttpClient + previousData: ( + { username, feedKey, ...query }: PreviousDataParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/previous\`, method: "GET", @@ -3721,7 +3898,10 @@ export class Api extends HttpClient + removeFeedFromGroup: ( + { groupKey, username, ...query }: RemoveFeedFromGroupParams, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}/remove\`, method: "POST", @@ -3766,7 +3946,12 @@ export class Api extends HttpClient + replaceDashboard: ( + username: string, + id: string, + dashboard: ReplaceDashboardPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${id}\`, method: "PUT", @@ -3812,7 +3997,12 @@ export class Api extends HttpClient + replaceFeed: ( + username: string, + feedKey: string, + feed: ReplaceFeedPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}\`, method: "PUT", @@ -3832,7 +4022,12 @@ export class Api extends HttpClient + replaceGroup: ( + username: string, + groupKey: string, + group: ReplaceGroupPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}\`, method: "PUT", @@ -3879,7 +4074,12 @@ export class Api extends HttpClient + replaceToken: ( + username: string, + id: string, + token: ReplaceTokenPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/tokens/\${id}\`, method: "PUT", @@ -3899,7 +4099,12 @@ export class Api extends HttpClient + replaceTrigger: ( + username: string, + id: string, + trigger: ReplaceTriggerPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/triggers/\${id}\`, method: "PUT", @@ -3919,7 +4124,11 @@ export class Api extends HttpClient + retainData: ( + username: string, + feedKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/retain\`, method: "GET", @@ -3963,7 +4172,12 @@ export class Api extends HttpClient + updateDashboard: ( + username: string, + id: string, + dashboard: UpdateDashboardPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${id}\`, method: "PATCH", @@ -3983,7 +4197,13 @@ export class Api extends HttpClient + updateData: ( + username: string, + feedKey: string, + id: string, + datum: UpdateDataPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/\${id}\`, method: "PATCH", @@ -4003,7 +4223,12 @@ export class Api extends HttpClient + updateFeed: ( + username: string, + feedKey: string, + feed: UpdateFeedPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}\`, method: "PATCH", @@ -4023,7 +4248,12 @@ export class Api extends HttpClient + updateGroup: ( + username: string, + groupKey: string, + group: UpdateGroupPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}\`, method: "PATCH", @@ -4070,7 +4300,12 @@ export class Api extends HttpClient + updateToken: ( + username: string, + id: string, + token: UpdateTokenPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/tokens/\${id}\`, method: "PATCH", @@ -4090,7 +4325,12 @@ export class Api extends HttpClient + updateTrigger: ( + username: string, + id: string, + trigger: UpdateTriggerPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/triggers/\${id}\`, method: "PATCH", @@ -4147,16 +4387,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -4175,7 +4421,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -4208,9 +4455,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -4221,8 +4474,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -4239,7 +4497,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -4252,7 +4513,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -4296,15 +4559,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -4339,7 +4613,9 @@ export class HttpClient { * @title Additional properties Example * @version 1.0.0 */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -4382,16 +4658,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -4410,7 +4692,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -4443,9 +4726,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -4456,8 +4745,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -4474,7 +4768,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -4487,7 +4784,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -4531,15 +4830,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -4573,7 +4883,9 @@ export class HttpClient { /** * @title No title */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -4652,16 +4964,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -4680,7 +4998,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -4713,9 +5032,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -4726,8 +5051,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -4744,7 +5074,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -4757,7 +5090,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -4801,15 +5136,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -4844,7 +5190,9 @@ export class HttpClient { * @title Allof Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -4852,7 +5200,10 @@ export class Api extends HttpClient + petsPartialUpdate: ( + data: PetsPartialUpdatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pets\`, method: "PATCH", @@ -5558,16 +5909,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -5586,7 +5943,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -5619,9 +5977,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -5632,8 +5996,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -5650,7 +6019,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -5663,7 +6035,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -5707,15 +6081,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -5757,7 +6142,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description @@ -5804,7 +6191,10 @@ export class Api extends HttpClient + findPetsByStatus: ( + query: FindPetsByStatusParams, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/findByStatus\`, method: "GET", @@ -5842,7 +6232,10 @@ export class Api extends HttpClient + formUrlEncodedRequest: ( + data: FormUrlEncodedRequestPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/form-url-encoded\`, method: "POST", @@ -5861,7 +6254,10 @@ export class Api extends HttpClient + formUrlEncodedRequest2: ( + data: FormUrlEncodedRequest2Payload, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/end-form-url-encoded\`, method: "POST", @@ -5896,7 +6292,10 @@ export class Api extends HttpClient + singleFormUrlEncodedRequest: ( + data: SingleFormUrlEncodedRequestPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/single-form-url-encoded\`, method: "POST", @@ -5933,7 +6332,11 @@ export class Api extends HttpClient + updatePetWithForm: ( + petId: number, + data: UpdatePetWithFormPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/\${petId}\`, method: "POST", @@ -5952,7 +6355,11 @@ export class Api extends HttpClient + uploadFile: ( + petId: number, + data: UploadFilePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/\${petId}/uploadImage\`, method: "POST", @@ -6057,7 +6464,10 @@ export class Api extends HttpClient + createUsersWithArrayInput: ( + body: CreateUsersWithArrayInputPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/user/createWithArray\`, method: "POST", @@ -6074,7 +6484,10 @@ export class Api extends HttpClient + createUsersWithListInput: ( + body: CreateUsersWithListInputPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/user/createWithList\`, method: "POST", @@ -6281,16 +6694,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -6309,7 +6728,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -6342,9 +6762,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -6355,8 +6781,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -6373,7 +6804,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -6386,7 +6820,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -6430,15 +6866,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -6472,7 +6919,9 @@ export class HttpClient { /** * @title No title */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { api = { /** * No description @@ -6594,16 +7043,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -6622,7 +7077,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -6655,9 +7111,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -6668,8 +7130,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -6686,7 +7153,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -6699,7 +7169,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -6743,15 +7215,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -6786,7 +7269,9 @@ export class HttpClient { * @title Anyof Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -6794,7 +7279,10 @@ export class Api extends HttpClient + petsPartialUpdate: ( + data: PetsPartialUpdatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pets\`, method: "PATCH", @@ -6862,16 +7350,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -6890,7 +7384,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -6923,9 +7418,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -6936,8 +7437,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -6954,7 +7460,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -6967,7 +7476,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -7011,15 +7522,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -7054,7 +7576,9 @@ export class HttpClient { * @title Simple API overview * @version 2.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * No description * @@ -7181,16 +7705,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -7209,7 +7739,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -7242,9 +7773,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -7255,8 +7792,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -7273,7 +7815,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -7286,7 +7831,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -7330,15 +7877,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -7373,7 +7931,9 @@ export class HttpClient { * @title Simple API overview * @version v2 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * @description multiple line 1 multiple line 2 multiple line 3 * @@ -7430,7 +7990,10 @@ export class Api extends HttpClient + consumesPlainText: ( + someParm: ConsumesPlainTextPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/consumes-plain-text/\`, method: "POST", @@ -7944,16 +8507,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -7972,7 +8541,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -8005,9 +8575,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -8018,8 +8594,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -8036,7 +8617,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -8049,7 +8633,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -8093,15 +8679,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -8142,7 +8739,9 @@ export class HttpClient { * * Strong authentication, without the passwords. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { wrongPathParams1 = { /** * @description DDD @@ -8248,7 +8847,10 @@ export class Api extends HttpClient + keyRevoke: ( + { pk, ...query }: KeyRevokeParams, + params: RequestParams = {}, + ) => this.request({ path: \`/key/\${pk}\`, method: "DELETE", @@ -8264,7 +8866,10 @@ export class Api extends HttpClient + keyRevokeNosecret: ( + query: KeyRevokeNosecretParams, + params: RequestParams = {}, + ) => this.request({ path: \`/key\`, method: "DELETE", @@ -8297,7 +8902,11 @@ export class Api extends HttpClient + pushLoginRequest: ( + query: PushLoginRequestParams, + body: PushToken, + params: RequestParams = {}, + ) => this.request({ path: \`/login\`, method: "POST", @@ -8346,7 +8955,11 @@ export class Api extends HttpClient + signRequest: ( + query: SignRequestParams, + body: Claims, + params: RequestParams = {}, + ) => this.request({ path: \`/scope\`, method: "POST", @@ -8480,16 +9093,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -8508,7 +9127,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -8541,9 +9161,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -8554,8 +9180,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -8572,7 +9203,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -8585,7 +9219,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -8629,15 +9265,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -8672,7 +9319,9 @@ export class HttpClient { * @title Callback Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { streams = { /** * @description subscribes a client to receive out-of-band data @@ -8750,16 +9399,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -8778,7 +9433,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -8811,9 +9467,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -8824,8 +9486,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -8842,7 +9509,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -8855,7 +9525,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -8899,15 +9571,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -8944,7 +9627,9 @@ export class HttpClient { * * Description */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { api = { /** * No description @@ -9062,16 +9747,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -9090,7 +9781,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -9123,9 +9815,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -9136,8 +9834,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -9154,7 +9857,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -9167,7 +9873,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -9211,15 +9919,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -9254,7 +9973,9 @@ export class HttpClient { * @title No title * @baseUrl https://ffff.com */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -9369,16 +10090,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -9397,7 +10124,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -9430,9 +10158,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -9443,8 +10177,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -9461,7 +10200,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -9474,7 +10216,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -9518,15 +10262,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -9564,7 +10319,9 @@ export class HttpClient { * * The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { subscriptions = { /** * @description Creates a TDE certificate for a given server. @@ -9574,7 +10331,12 @@ export class Api extends HttpClient @@ -9692,16 +10454,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -9720,7 +10488,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -9753,9 +10522,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -9766,8 +10541,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -9784,7 +10564,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -9797,7 +10580,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -9841,15 +10626,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -9886,7 +10682,9 @@ export class HttpClient { * * Documentation */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { user = { /** * No description @@ -9895,7 +10693,11 @@ export class Api extends HttpClient + createFile: ( + user: string, + data: CreateFilePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${user}/foos\`, method: "POST", @@ -9988,16 +10790,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -10016,7 +10824,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -10049,9 +10858,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -10062,8 +10877,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -10080,7 +10900,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -10093,7 +10916,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -10137,15 +10962,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -10180,7 +11016,9 @@ export class HttpClient { * @title Title * @version v0.1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { uploadFile = { /** * No description @@ -10367,9 +11205,11 @@ export type ActionsGetAllowedActionsRepositoryData = SelectedActions; export type ActionsGetArtifactData = Artifact; -export type ActionsGetGithubActionsPermissionsOrganizationData = ActionsOrganizationPermissions; +export type ActionsGetGithubActionsPermissionsOrganizationData = + ActionsOrganizationPermissions; -export type ActionsGetGithubActionsPermissionsRepositoryData = ActionsRepositoryPermissions; +export type ActionsGetGithubActionsPermissionsRepositoryData = + ActionsRepositoryPermissions; export type ActionsGetJobForWorkflowRunData = Job; @@ -10823,7 +11663,8 @@ export interface ActionsSetSelectedReposForOrgSecretPayload { selected_repository_ids?: number[]; } -export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData = any; +export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData = + any; export interface ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload { /** List of repository IDs to enable for GitHub Actions. */ @@ -10867,7 +11708,8 @@ export type ActivityGetRepoSubscriptionData = RepositorySubscription; export type ActivityGetThreadData = Thread; -export type ActivityGetThreadSubscriptionForAuthenticatedUserData = ThreadSubscription; +export type ActivityGetThreadSubscriptionForAuthenticatedUserData = + ThreadSubscription; export type ActivityListEventsForAuthenticatedUserData = Event[]; @@ -11195,7 +12037,8 @@ export interface ActivityListStargazersForRepoParams { repo: string; } -export type ActivityListWatchedReposForAuthenticatedUserData = MinimalRepository[]; +export type ActivityListWatchedReposForAuthenticatedUserData = + MinimalRepository[]; export interface ActivityListWatchedReposForAuthenticatedUserParams { /** @@ -11920,7 +12763,8 @@ export interface AppsListReposAccessibleToInstallationParams { per_page?: number; } -export type AppsListSubscriptionsForAuthenticatedUserData = UserMarketplacePurchase[]; +export type AppsListSubscriptionsForAuthenticatedUserData = + UserMarketplacePurchase[]; export interface AppsListSubscriptionsForAuthenticatedUserParams { /** @@ -11935,7 +12779,8 @@ export interface AppsListSubscriptionsForAuthenticatedUserParams { per_page?: number; } -export type AppsListSubscriptionsForAuthenticatedUserStubbedData = UserMarketplacePurchase[]; +export type AppsListSubscriptionsForAuthenticatedUserStubbedData = + UserMarketplacePurchase[]; export interface AppsListSubscriptionsForAuthenticatedUserStubbedParams { /** @@ -13318,7 +14163,8 @@ export interface CodeScanningAlertCodeScanningAlertItems { 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 = CodeScanningAlertDismissedReasonEnum | null; +export type CodeScanningAlertDismissedReason = + CodeScanningAlertDismissedReasonEnum | null; export enum CodeScanningAlertDismissedReasonEnum { FalsePositive = "false positive", @@ -13429,7 +14275,8 @@ export type CodeScanningAnalysisToolName = string; export type CodeScanningGetAlertData = CodeScanningAlertCodeScanningAlert; -export type CodeScanningListAlertsForRepoData = CodeScanningAlertCodeScanningAlertItems[]; +export type CodeScanningListAlertsForRepoData = + CodeScanningAlertCodeScanningAlertItems[]; export interface CodeScanningListAlertsForRepoParams { owner: string; @@ -13440,7 +14287,8 @@ export interface CodeScanningListAlertsForRepoParams { state?: CodeScanningAlertState; } -export type CodeScanningListRecentAnalysesData = CodeScanningAnalysisCodeScanningAnalysis[]; +export type CodeScanningListRecentAnalysesData = + CodeScanningAnalysisCodeScanningAnalysis[]; export interface CodeScanningListRecentAnalysesParams { owner: string; @@ -14756,15 +15604,19 @@ export interface Enterprise { website_url?: string | null; } -export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData = any; +export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData = + any; export type EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData = any; -export type EnterpriseAdminCreateRegistrationTokenForEnterpriseData = AuthenticationToken; +export type EnterpriseAdminCreateRegistrationTokenForEnterpriseData = + AuthenticationToken; -export type EnterpriseAdminCreateRemoveTokenForEnterpriseData = AuthenticationToken; +export type EnterpriseAdminCreateRemoveTokenForEnterpriseData = + AuthenticationToken; -export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData = RunnerGroupsEnterprise; +export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData = + RunnerGroupsEnterprise; export interface EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload { /** Name of the runner group. */ @@ -14791,21 +15643,27 @@ export type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData = any; export type EnterpriseAdminDeleteUserFromEnterpriseData = any; -export type EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData = any; +export type EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData = + any; -export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData = any; +export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData = + any; export type EnterpriseAdminGetAllowedActionsEnterpriseData = SelectedActions; -export type EnterpriseAdminGetGithubActionsPermissionsEnterpriseData = ActionsEnterprisePermissions; +export type EnterpriseAdminGetGithubActionsPermissionsEnterpriseData = + ActionsEnterprisePermissions; -export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData = ScimEnterpriseGroup; +export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData = + ScimEnterpriseGroup; -export type EnterpriseAdminGetProvisioningInformationForEnterpriseUserData = ScimEnterpriseUser; +export type EnterpriseAdminGetProvisioningInformationForEnterpriseUserData = + ScimEnterpriseUser; export type EnterpriseAdminGetSelfHostedRunnerForEnterpriseData = Runner; -export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData = RunnerGroupsEnterprise; +export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData = + RunnerGroupsEnterprise; export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData { organizations: OrganizationSimple[]; @@ -14829,7 +15687,8 @@ export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise runnerGroupId: number; } -export type EnterpriseAdminListProvisionedGroupsEnterpriseData = ScimGroupListEnterprise; +export type EnterpriseAdminListProvisionedGroupsEnterpriseData = + ScimGroupListEnterprise; export interface EnterpriseAdminListProvisionedGroupsEnterpriseParams { /** Used for pagination: the number of results to return. */ @@ -14840,7 +15699,8 @@ export interface EnterpriseAdminListProvisionedGroupsEnterpriseParams { startIndex?: number; } -export type EnterpriseAdminListProvisionedIdentitiesEnterpriseData = ScimUserListEnterprise; +export type EnterpriseAdminListProvisionedIdentitiesEnterpriseData = + ScimUserListEnterprise; export interface EnterpriseAdminListProvisionedIdentitiesEnterpriseParams { /** Used for pagination: the number of results to return. */ @@ -14851,7 +15711,8 @@ export interface EnterpriseAdminListProvisionedIdentitiesEnterpriseParams { startIndex?: number; } -export type EnterpriseAdminListRunnerApplicationsForEnterpriseData = RunnerApplication[]; +export type EnterpriseAdminListRunnerApplicationsForEnterpriseData = + RunnerApplication[]; export interface EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData { organizations: OrganizationSimple[]; @@ -14935,7 +15796,8 @@ export interface EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseParams runnerGroupId: number; } -export type EnterpriseAdminProvisionAndInviteEnterpriseGroupData = ScimEnterpriseGroup; +export type EnterpriseAdminProvisionAndInviteEnterpriseGroupData = + ScimEnterpriseGroup; export interface EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload { /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ @@ -14948,7 +15810,8 @@ export interface EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload { schemas: string[]; } -export type EnterpriseAdminProvisionAndInviteEnterpriseUserData = ScimEnterpriseUser; +export type EnterpriseAdminProvisionAndInviteEnterpriseUserData = + ScimEnterpriseUser; export interface EnterpriseAdminProvisionAndInviteEnterpriseUserPayload { /** List of user emails. */ @@ -14976,9 +15839,11 @@ export interface EnterpriseAdminProvisionAndInviteEnterpriseUserPayload { userName: string; } -export type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData = any; +export type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData = + any; -export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData = any; +export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData = + any; export type EnterpriseAdminSetAllowedActionsEnterpriseData = any; @@ -14991,7 +15856,8 @@ export interface EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload { enabled_organizations: EnabledOrganizations; } -export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData = ScimEnterpriseGroup; +export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData = + ScimEnterpriseGroup; export interface EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload { /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ @@ -15004,7 +15870,8 @@ export interface EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPaylo schemas: string[]; } -export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserData = ScimEnterpriseUser; +export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserData = + ScimEnterpriseUser; export interface EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload { /** List of user emails. */ @@ -15032,14 +15899,16 @@ export interface EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayloa userName: string; } -export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData = any; +export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData = + any; export interface EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload { /** List of organization IDs that can access the runner group. */ selected_organization_ids: number[]; } -export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData = any; +export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData = + any; export interface EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload { /** List of organization IDs to enable for GitHub Actions. */ @@ -15053,7 +15922,8 @@ export interface EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload runners: number[]; } -export type EnterpriseAdminUpdateAttributeForEnterpriseGroupData = ScimEnterpriseGroup; +export type EnterpriseAdminUpdateAttributeForEnterpriseGroupData = + ScimEnterpriseGroup; export interface EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload { /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ @@ -15062,7 +15932,8 @@ export interface EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload { schemas: string[]; } -export type EnterpriseAdminUpdateAttributeForEnterpriseUserData = ScimEnterpriseUser; +export type EnterpriseAdminUpdateAttributeForEnterpriseUserData = + ScimEnterpriseUser; export interface EnterpriseAdminUpdateAttributeForEnterpriseUserPayload { /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ @@ -15071,7 +15942,8 @@ export interface EnterpriseAdminUpdateAttributeForEnterpriseUserPayload { schemas: string[]; } -export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData = RunnerGroupsEnterprise; +export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData = + RunnerGroupsEnterprise; export interface EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload { /** Name of the runner group. */ @@ -16824,7 +17696,8 @@ export interface InteractionLimitResponse { origin: string; } -export type InteractionsGetRestrictionsForAuthenticatedUserData = InteractionLimitResponse; +export type InteractionsGetRestrictionsForAuthenticatedUserData = + InteractionLimitResponse; export type InteractionsGetRestrictionsForOrgData = InteractionLimitResponse; @@ -16836,7 +17709,8 @@ export type InteractionsRemoveRestrictionsForOrgData = any; export type InteractionsRemoveRestrictionsForRepoData = any; -export type InteractionsSetRestrictionsForAuthenticatedUserData = InteractionLimitResponse; +export type InteractionsSetRestrictionsForAuthenticatedUserData = + InteractionLimitResponse; export type InteractionsSetRestrictionsForOrgData = InteractionLimitResponse; @@ -19209,7 +20083,8 @@ export type OauthAuthorizationsGetAuthorizationData = Authorization; export type OauthAuthorizationsGetGrantData = ApplicationGrant; -export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData = Authorization; +export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData = + Authorization; export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload { /** @@ -19231,7 +20106,8 @@ export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint scopes?: string[] | null; } -export type OauthAuthorizationsGetOrCreateAuthorizationForAppData = Authorization; +export type OauthAuthorizationsGetOrCreateAuthorizationForAppData = + Authorization; export interface OauthAuthorizationsGetOrCreateAuthorizationForAppPayload { /** @@ -23535,7 +24411,8 @@ export interface ReposCreateCommitCommentPayload { position?: number; } -export type ReposCreateCommitSignatureProtectionData = ProtectedBranchAdminEnforced; +export type ReposCreateCommitSignatureProtectionData = + ProtectedBranchAdminEnforced; export type ReposCreateCommitStatusData = Status; @@ -24111,7 +24988,8 @@ export enum ReposGetClonesParams1PerEnum { export type ReposGetCodeFrequencyStatsData = CodeFrequencyStat[]; -export type ReposGetCollaboratorPermissionLevelData = RepositoryCollaboratorPermission; +export type ReposGetCollaboratorPermissionLevelData = + RepositoryCollaboratorPermission; export type ReposGetCombinedStatusForRefData = CombinedCommitStatus; @@ -24121,7 +24999,8 @@ export type ReposGetCommitCommentData = CommitComment; export type ReposGetCommitData = Commit; -export type ReposGetCommitSignatureProtectionData = ProtectedBranchAdminEnforced; +export type ReposGetCommitSignatureProtectionData = + ProtectedBranchAdminEnforced; export type ReposGetCommunityProfileMetricsData = CommunityProfile; @@ -24156,7 +25035,8 @@ export type ReposGetPagesData = Page; export type ReposGetParticipationStatsData = ParticipationStats; -export type ReposGetPullRequestReviewProtectionData = ProtectedBranchPullRequestReview; +export type ReposGetPullRequestReviewProtectionData = + ProtectedBranchPullRequestReview; export type ReposGetPunchCardStatsData = CodeFrequencyStat[]; @@ -24672,7 +25552,8 @@ export enum ReposListForksParams1SortEnum { export type ReposListInvitationsData = RepositoryInvitation[]; -export type ReposListInvitationsForAuthenticatedUserData = RepositoryInvitation[]; +export type ReposListInvitationsForAuthenticatedUserData = + RepositoryInvitation[]; export interface ReposListInvitationsForAuthenticatedUserParams { /** @@ -25115,7 +25996,8 @@ export interface ReposUpdatePayload { visibility?: ReposUpdateVisibilityEnum; } -export type ReposUpdatePullRequestReviewProtectionData = ProtectedBranchPullRequestReview; +export type ReposUpdatePullRequestReviewProtectionData = + ProtectedBranchPullRequestReview; export interface ReposUpdatePullRequestReviewProtectionPayload { /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ @@ -26660,7 +27542,8 @@ export interface SecretScanningAlert { } /** **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 = SecretScanningAlertResolutionEnum | null; +export type SecretScanningAlertResolution = + SecretScanningAlertResolutionEnum | null; export enum SecretScanningAlertResolutionEnum { FalsePositive = "false_positive", @@ -30212,9 +31095,11 @@ export namespace Authorizations { clientId: string; }; export type RequestQuery = {}; - export type RequestBody = OauthAuthorizationsGetOrCreateAuthorizationForAppPayload; + export type RequestBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppPayload; export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsGetOrCreateAuthorizationForAppData; + export type ResponseBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppData; } /** @@ -30232,9 +31117,11 @@ export namespace Authorizations { fingerprint: string; }; export type RequestQuery = {}; - export type RequestBody = OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload; + export type RequestBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload; export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData; + export type ResponseBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData; } /** @@ -30474,7 +31361,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData; + export type ResponseBody = + EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** @@ -30496,7 +31384,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData; + export type ResponseBody = + EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData; } /** @@ -30514,7 +31403,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminCreateRegistrationTokenForEnterpriseData; + export type ResponseBody = + EnterpriseAdminCreateRegistrationTokenForEnterpriseData; } /** @@ -30532,7 +31422,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminCreateRemoveTokenForEnterpriseData; + export type ResponseBody = + EnterpriseAdminCreateRemoveTokenForEnterpriseData; } /** @@ -30548,9 +31439,11 @@ export namespace Enterprises { enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload; + export type RequestBody = + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData; + export type ResponseBody = + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData; } /** @@ -30570,7 +31463,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData; + export type ResponseBody = + EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData; } /** @@ -30590,7 +31484,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData; + export type ResponseBody = + EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData; } /** @@ -30610,7 +31505,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData; + export type ResponseBody = + EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData; } /** @@ -30630,7 +31526,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData; + export type ResponseBody = + EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData; } /** @@ -30666,7 +31563,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminGetGithubActionsPermissionsEnterpriseData; + export type ResponseBody = + EnterpriseAdminGetGithubActionsPermissionsEnterpriseData; } /** @@ -30686,7 +31584,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminGetSelfHostedRunnerForEnterpriseData; + export type ResponseBody = + EnterpriseAdminGetSelfHostedRunnerForEnterpriseData; } /** @@ -30706,7 +31605,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData; + export type ResponseBody = + EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData; } /** @@ -30737,7 +31637,8 @@ export namespace Enterprises { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData; + export type ResponseBody = + EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** @@ -30755,7 +31656,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListRunnerApplicationsForEnterpriseData; + export type ResponseBody = + EnterpriseAdminListRunnerApplicationsForEnterpriseData; } /** @@ -30784,7 +31686,8 @@ export namespace Enterprises { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData; + export type ResponseBody = + EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData; } /** @@ -30813,7 +31716,8 @@ export namespace Enterprises { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData; } /** @@ -30842,7 +31746,8 @@ export namespace Enterprises { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListSelfHostedRunnersForEnterpriseData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnersForEnterpriseData; } /** @@ -30873,7 +31778,8 @@ export namespace Enterprises { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData; } /** @@ -30895,7 +31801,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData; + export type ResponseBody = + EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** @@ -30917,7 +31824,8 @@ export namespace Enterprises { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData; + export type ResponseBody = + EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData; } /** @@ -30951,9 +31859,11 @@ export namespace Enterprises { enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload; + export type RequestBody = + EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminSetGithubActionsPermissionsEnterpriseData; + export type ResponseBody = + EnterpriseAdminSetGithubActionsPermissionsEnterpriseData; } /** @@ -30971,9 +31881,11 @@ export namespace Enterprises { runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload; + export type RequestBody = + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData; + export type ResponseBody = + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** @@ -30989,9 +31901,11 @@ export namespace Enterprises { enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload; + export type RequestBody = + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData; + export type ResponseBody = + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData; } /** @@ -31009,9 +31923,11 @@ export namespace Enterprises { runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload; + export type RequestBody = + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData; + export type ResponseBody = + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData; } /** @@ -31029,9 +31945,11 @@ export namespace Enterprises { runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload; + export type RequestBody = + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData; + export type ResponseBody = + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData; } } @@ -31964,7 +32882,8 @@ export namespace Notifications { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityGetThreadSubscriptionForAuthenticatedUserData; + export type ResponseBody = + ActivityGetThreadSubscriptionForAuthenticatedUserData; } /** @@ -32004,7 +32923,8 @@ export namespace Notifications { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListNotificationsForAuthenticatedUserData; + export type ResponseBody = + ActivityListNotificationsForAuthenticatedUserData; } /** @@ -32122,7 +33042,8 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData; + export type ResponseBody = + ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData; } /** @@ -32308,7 +33229,8 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDisableSelectedRepositoryGithubActionsOrganizationData; + export type ResponseBody = + ActionsDisableSelectedRepositoryGithubActionsOrganizationData; } /** @@ -32326,7 +33248,8 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsEnableSelectedRepositoryGithubActionsOrganizationData; + export type ResponseBody = + ActionsEnableSelectedRepositoryGithubActionsOrganizationData; } /** @@ -32360,7 +33283,8 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetGithubActionsPermissionsOrganizationData; + export type ResponseBody = + ActionsGetGithubActionsPermissionsOrganizationData; } /** @@ -32481,7 +33405,8 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListRepoAccessToSelfHostedRunnerGroupInOrgData; + export type ResponseBody = + ActionsListRepoAccessToSelfHostedRunnerGroupInOrgData; } /** @@ -32545,7 +33470,8 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData; + export type ResponseBody = + ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData; } /** @@ -32651,7 +33577,8 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData; + export type ResponseBody = + ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData; } /** @@ -32724,9 +33651,11 @@ export namespace Orgs { org: string; }; export type RequestQuery = {}; - export type RequestBody = ActionsSetGithubActionsPermissionsOrganizationPayload; + export type RequestBody = + ActionsSetGithubActionsPermissionsOrganizationPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsSetGithubActionsPermissionsOrganizationData; + export type ResponseBody = + ActionsSetGithubActionsPermissionsOrganizationData; } /** @@ -32743,9 +33672,11 @@ export namespace Orgs { runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload; + export type RequestBody = + ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgData; + export type ResponseBody = + ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgData; } /** @@ -32779,9 +33710,11 @@ export namespace Orgs { org: string; }; export type RequestQuery = {}; - export type RequestBody = ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload; + export type RequestBody = + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData; + export type ResponseBody = + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData; } /** @@ -33825,7 +34758,8 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsRemovePublicMembershipForAuthenticatedUserData; + export type ResponseBody = + OrgsRemovePublicMembershipForAuthenticatedUserData; } /** @@ -34019,7 +34953,8 @@ export namespace Orgs { teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForTeamDiscussionCommentInOrgPayload; + export type RequestBody = + ReactionsCreateForTeamDiscussionCommentInOrgPayload; export type RequestHeaders = {}; export type ResponseBody = ReactionsCreateForTeamDiscussionCommentInOrgData; } @@ -34380,7 +35315,8 @@ export namespace Orgs { teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload; + export type RequestBody = + TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload; export type RequestHeaders = {}; export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsInOrgData; } @@ -36205,7 +37141,8 @@ export namespace Repos { repo: string; }; export type RequestQuery = {}; - export type RequestBody = ActionsSetGithubActionsPermissionsRepositoryPayload; + export type RequestBody = + ActionsSetGithubActionsPermissionsRepositoryPayload; export type RequestHeaders = {}; export type ResponseBody = ActionsSetGithubActionsPermissionsRepositoryData; } @@ -36315,7 +37252,8 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListRepoNotificationsForAuthenticatedUserData; + export type ResponseBody = + ActivityListRepoNotificationsForAuthenticatedUserData; } /** @@ -42173,7 +43111,8 @@ export namespace Scim { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData; + export type ResponseBody = + EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData; } /** @@ -42193,7 +43132,8 @@ export namespace Scim { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminGetProvisioningInformationForEnterpriseUserData; + export type ResponseBody = + EnterpriseAdminGetProvisioningInformationForEnterpriseUserData; } /** @@ -42216,7 +43156,8 @@ export namespace Scim { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListProvisionedGroupsEnterpriseData; + export type ResponseBody = + EnterpriseAdminListProvisionedGroupsEnterpriseData; } /** @@ -42239,7 +43180,8 @@ export namespace Scim { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminListProvisionedIdentitiesEnterpriseData; + export type ResponseBody = + EnterpriseAdminListProvisionedIdentitiesEnterpriseData; } /** @@ -42255,9 +43197,11 @@ export namespace Scim { enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload; + export type RequestBody = + EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminProvisionAndInviteEnterpriseGroupData; + export type ResponseBody = + EnterpriseAdminProvisionAndInviteEnterpriseGroupData; } /** @@ -42273,9 +43217,11 @@ export namespace Scim { enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminProvisionAndInviteEnterpriseUserPayload; + export type RequestBody = + EnterpriseAdminProvisionAndInviteEnterpriseUserPayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminProvisionAndInviteEnterpriseUserData; + export type ResponseBody = + EnterpriseAdminProvisionAndInviteEnterpriseUserData; } /** @@ -42293,9 +43239,11 @@ export namespace Scim { scimGroupId: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload; + export type RequestBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData; + export type ResponseBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData; } /** @@ -42313,9 +43261,11 @@ export namespace Scim { scimUserId: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload; + export type RequestBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminSetInformationForProvisionedEnterpriseUserData; + export type ResponseBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseUserData; } /** @@ -42333,9 +43283,11 @@ export namespace Scim { scimGroupId: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload; + export type RequestBody = + EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminUpdateAttributeForEnterpriseGroupData; + export type ResponseBody = + EnterpriseAdminUpdateAttributeForEnterpriseGroupData; } /** @@ -42353,9 +43305,11 @@ export namespace Scim { scimUserId: string; }; export type RequestQuery = {}; - export type RequestBody = EnterpriseAdminUpdateAttributeForEnterpriseUserPayload; + export type RequestBody = + EnterpriseAdminUpdateAttributeForEnterpriseUserPayload; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminUpdateAttributeForEnterpriseUserData; + export type ResponseBody = + EnterpriseAdminUpdateAttributeForEnterpriseUserData; } /** @@ -42722,9 +43676,11 @@ export namespace Teams { teamId: number; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForTeamDiscussionCommentLegacyPayload; + export type RequestBody = + ReactionsCreateForTeamDiscussionCommentLegacyPayload; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForTeamDiscussionCommentLegacyData; + export type ResponseBody = + ReactionsCreateForTeamDiscussionCommentLegacyData; } /** @@ -42977,7 +43933,8 @@ export namespace Teams { teamId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload; + export type RequestBody = + TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload; export type RequestHeaders = {}; export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsLegacyData; } @@ -43525,7 +44482,8 @@ export namespace User { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityCheckRepoIsStarredByAuthenticatedUserData; + export type ResponseBody = + ActivityCheckRepoIsStarredByAuthenticatedUserData; } /** @@ -43671,7 +44629,8 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsListInstallationReposForAuthenticatedUserData; + export type ResponseBody = + AppsListInstallationReposForAuthenticatedUserData; } /** @@ -43749,7 +44708,8 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsListSubscriptionsForAuthenticatedUserStubbedData; + export type ResponseBody = + AppsListSubscriptionsForAuthenticatedUserStubbedData; } /** @@ -43783,7 +44743,8 @@ export namespace User { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsGetRestrictionsForAuthenticatedUserData; + export type ResponseBody = + InteractionsGetRestrictionsForAuthenticatedUserData; } /** @@ -43798,7 +44759,8 @@ export namespace User { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsRemoveRestrictionsForAuthenticatedUserData; + export type ResponseBody = + InteractionsRemoveRestrictionsForAuthenticatedUserData; } /** @@ -43813,7 +44775,8 @@ export namespace User { export type RequestQuery = {}; export type RequestBody = InteractionLimit; export type RequestHeaders = {}; - export type ResponseBody = InteractionsSetRestrictionsForAuthenticatedUserData; + export type ResponseBody = + InteractionsSetRestrictionsForAuthenticatedUserData; } /** @@ -44676,9 +45639,11 @@ export namespace User { export namespace UsersSetPrimaryEmailVisibilityForAuthenticated { export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = UsersSetPrimaryEmailVisibilityForAuthenticatedPayload; + export type RequestBody = + UsersSetPrimaryEmailVisibilityForAuthenticatedPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersSetPrimaryEmailVisibilityForAuthenticatedData; + export type ResponseBody = + UsersSetPrimaryEmailVisibilityForAuthenticatedData; } /** @@ -45370,16 +46335,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -45398,7 +46369,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -45431,9 +46403,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -45444,8 +46422,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -45462,7 +46445,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -45475,7 +46461,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -45519,15 +46507,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -45569,7 +46568,9 @@ export class HttpClient { * * GitHub's v3 REST API. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * @description Get Hypermedia links to resources accessible in GitHub's REST API * @@ -45625,7 +46626,10 @@ export class Api extends HttpClient + appsDeleteInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/app/installations/\${installationId}\`, method: "DELETE", @@ -45695,7 +46699,10 @@ export class Api extends HttpClient + appsListInstallations: ( + query: AppsListInstallationsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/app/installations\`, method: "GET", @@ -45712,7 +46719,10 @@ export class Api extends HttpClient + appsSuspendInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/app/installations/\${installationId}/suspended\`, method: "PUT", @@ -45727,7 +46737,10 @@ export class Api extends HttpClient + appsUnsuspendInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/app/installations/\${installationId}/suspended\`, method: "DELETE", @@ -45742,7 +46755,10 @@ export class Api extends HttpClient + appsUpdateWebhookConfigForApp: ( + data: AppsUpdateWebhookConfigForAppPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/app/hook/config\`, method: "PATCH", @@ -45762,7 +46778,10 @@ export class Api extends HttpClient - this.request({ + this.request< + AppsCreateFromManifestData, + BasicError | ValidationErrorSimple + >({ path: \`/app-manifests/\${code}/conversions\`, method: "POST", format: "json", @@ -45779,7 +46798,11 @@ export class Api extends HttpClient + appsCheckAuthorization: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "GET", @@ -45795,7 +46818,11 @@ export class Api extends HttpClient + appsCheckToken: ( + clientId: string, + data: AppsCheckTokenPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/token\`, method: "POST", @@ -45813,7 +46840,11 @@ export class Api extends HttpClient + appsDeleteAuthorization: ( + clientId: string, + data: AppsDeleteAuthorizationPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/grant\`, method: "DELETE", @@ -45830,7 +46861,11 @@ export class Api extends HttpClient + appsDeleteToken: ( + clientId: string, + data: AppsDeleteTokenPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/token\`, method: "DELETE", @@ -45848,7 +46883,11 @@ export class Api extends HttpClient + appsResetAuthorization: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "POST", @@ -45864,7 +46903,11 @@ export class Api extends HttpClient + appsResetToken: ( + clientId: string, + data: AppsResetTokenPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/token\`, method: "PATCH", @@ -45883,7 +46926,11 @@ export class Api extends HttpClient + appsRevokeAuthorizationForApplication: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "DELETE", @@ -45899,7 +46946,11 @@ export class Api extends HttpClient + appsRevokeGrantForApplication: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/grants/\${accessToken}\`, method: "DELETE", @@ -45914,7 +46965,11 @@ export class Api extends HttpClient + appsScopeToken: ( + clientId: string, + data: AppsScopeTokenPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/token/scoped\`, method: "POST", @@ -45933,7 +46988,10 @@ export class Api extends HttpClient + oauthAuthorizationsDeleteGrant: ( + grantId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/grants/\${grantId}\`, method: "DELETE", @@ -45949,7 +47007,10 @@ export class Api extends HttpClient + oauthAuthorizationsGetGrant: ( + grantId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/grants/\${grantId}\`, method: "GET", @@ -45966,7 +47027,10 @@ export class Api extends HttpClient + oauthAuthorizationsListGrants: ( + query: OauthAuthorizationsListGrantsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/grants\`, method: "GET", @@ -46013,7 +47077,10 @@ export class Api extends HttpClient - this.request({ + this.request< + OauthAuthorizationsCreateAuthorizationData, + BasicError | ValidationError + >({ path: \`/authorizations\`, method: "POST", body: data, @@ -46031,7 +47098,10 @@ export class Api extends HttpClient + oauthAuthorizationsDeleteAuthorization: ( + authorizationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/authorizations/\${authorizationId}\`, method: "DELETE", @@ -46047,7 +47117,10 @@ export class Api extends HttpClient + oauthAuthorizationsGetAuthorization: ( + authorizationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/authorizations/\${authorizationId}\`, method: "GET", @@ -46069,7 +47142,10 @@ export class Api extends HttpClient - this.request({ + this.request< + OauthAuthorizationsGetOrCreateAuthorizationForAppData, + BasicError | ValidationError + >({ path: \`/authorizations/clients/\${clientId}\`, method: "PUT", body: data, @@ -46093,7 +47169,10 @@ export class Api extends HttpClient - this.request({ + this.request< + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData, + ValidationError + >({ path: \`/authorizations/clients/\${clientId}/\${fingerprint}\`, method: "PUT", body: data, @@ -46137,14 +47216,16 @@ export class Api extends HttpClient - this.request({ - path: \`/authorizations/\${authorizationId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + this.request( + { + path: \`/authorizations/\${authorizationId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }, + ), }; codesOfConduct = { /** @@ -46249,7 +47330,10 @@ export class Api extends HttpClient + auditLogGetAuditLog: ( + { enterprise, ...query }: AuditLogGetAuditLogParams, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/audit-log\`, method: "GET", @@ -46266,7 +47350,10 @@ export class Api extends HttpClient + billingGetGithubActionsBillingGhe: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/settings/billing/actions\`, method: "GET", @@ -46282,7 +47369,10 @@ export class Api extends HttpClient + billingGetGithubPackagesBillingGhe: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/settings/billing/packages\`, method: "GET", @@ -46298,7 +47388,10 @@ export class Api extends HttpClient + billingGetSharedStorageBillingGhe: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, method: "GET", @@ -46320,7 +47413,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, method: "PUT", ...params, @@ -46340,7 +47436,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "PUT", ...params, @@ -46354,8 +47453,14 @@ export class Api extends HttpClient - this.request({ + enterpriseAdminCreateRegistrationTokenForEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => + this.request< + EnterpriseAdminCreateRegistrationTokenForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runners/registration-token\`, method: "POST", format: "json", @@ -46370,7 +47475,10 @@ export class Api extends HttpClient + enterpriseAdminCreateRemoveTokenForEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, method: "POST", @@ -46391,7 +47499,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "POST", body: data, @@ -46413,7 +47524,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, method: "DELETE", ...params, @@ -46432,7 +47546,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "DELETE", ...params, @@ -46451,7 +47568,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, method: "DELETE", ...params, @@ -46470,7 +47590,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, method: "PUT", ...params, @@ -46484,7 +47607,10 @@ export class Api extends HttpClient + enterpriseAdminGetAllowedActionsEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, method: "GET", @@ -46500,8 +47626,14 @@ export class Api extends HttpClient - this.request({ + enterpriseAdminGetGithubActionsPermissionsEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => + this.request< + EnterpriseAdminGetGithubActionsPermissionsEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/permissions\`, method: "GET", format: "json", @@ -46541,7 +47673,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", format: "json", @@ -46557,10 +47692,17 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, method: "GET", query: query, @@ -46576,13 +47718,18 @@ export class Api extends HttpClient - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/downloads\`, - method: "GET", - format: "json", - ...params, - }), + enterpriseAdminListRunnerApplicationsForEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/enterprises/\${enterprise}/actions/runners/downloads\`, + method: "GET", + format: "json", + ...params, + }, + ), /** * @description 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. @@ -46593,10 +47740,16 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, method: "GET", query: query, @@ -46613,10 +47766,16 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "GET", query: query, @@ -46633,7 +47792,10 @@ export class Api extends HttpClient this.request({ @@ -46653,10 +47815,17 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "GET", query: query, @@ -46678,7 +47847,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, method: "DELETE", ...params, @@ -46698,7 +47870,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "DELETE", ...params, @@ -46738,7 +47913,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminSetGithubActionsPermissionsEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/permissions\`, method: "PUT", body: data, @@ -46760,7 +47938,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, method: "PUT", body: data, @@ -46781,7 +47962,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, method: "PUT", body: data, @@ -46803,7 +47987,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "PUT", body: data, @@ -46825,7 +48012,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData, + any + >({ path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "PATCH", body: data, @@ -46843,7 +48033,10 @@ export class Api extends HttpClient + activityListPublicEvents: ( + query: ActivityListPublicEventsParams, + params: RequestParams = {}, + ) => this.request< ActivityListPublicEventsData, | BasicError @@ -46919,7 +48112,11 @@ export class Api extends HttpClient + gistsCreateComment: ( + gistId: string, + data: GistsCreateCommentPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/comments\`, method: "POST", @@ -46952,7 +48149,11 @@ export class Api extends HttpClient + gistsDeleteComment: ( + gistId: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/comments/\${commentId}\`, method: "DELETE", @@ -47011,7 +48212,11 @@ export class Api extends HttpClient + gistsGetComment: ( + gistId: string, + commentId: number, + params: RequestParams = {}, + ) => this.request< GistsGetCommentData, | { @@ -47039,7 +48244,11 @@ export class Api extends HttpClient + gistsGetRevision: ( + gistId: string, + sha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/\${sha}\`, method: "GET", @@ -47072,7 +48281,10 @@ export class Api extends HttpClient + gistsListComments: ( + { gistId, ...query }: GistsListCommentsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/comments\`, method: "GET", @@ -47089,7 +48301,10 @@ export class Api extends HttpClient + gistsListCommits: ( + { gistId, ...query }: GistsListCommitsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/commits\`, method: "GET", @@ -47106,7 +48321,10 @@ export class Api extends HttpClient + gistsListForks: ( + { gistId, ...query }: GistsListForksParams, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/forks\`, method: "GET", @@ -47123,7 +48341,10 @@ export class Api extends HttpClient + gistsListPublic: ( + query: GistsListPublicParams, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/public\`, method: "GET", @@ -47140,7 +48361,10 @@ export class Api extends HttpClient + gistsListStarred: ( + query: GistsListStarredParams, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/starred\`, method: "GET", @@ -47187,7 +48411,11 @@ export class Api extends HttpClient + gistsUpdate: ( + gistId: string, + data: GistsUpdatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}\`, method: "PATCH", @@ -47332,7 +48560,10 @@ export class Api extends HttpClient + licensesGetAllCommonlyUsed: ( + query: LicensesGetAllCommonlyUsedParams, + params: RequestParams = {}, + ) => this.request({ path: \`/licenses\`, method: "GET", @@ -47367,7 +48598,10 @@ export class Api extends HttpClient + markdownRenderRaw: ( + data: MarkdownRenderRawPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/markdown/raw\`, method: "POST", @@ -47385,8 +48619,14 @@ export class Api extends HttpClient - this.request({ + appsGetSubscriptionPlanForAccount: ( + accountId: number, + params: RequestParams = {}, + ) => + this.request< + AppsGetSubscriptionPlanForAccountData, + AppsGetSubscriptionPlanForAccountError + >({ path: \`/marketplace_listing/accounts/\${accountId}\`, method: "GET", format: "json", @@ -47401,8 +48641,14 @@ export class Api extends HttpClient - this.request({ + appsGetSubscriptionPlanForAccountStubbed: ( + accountId: number, + params: RequestParams = {}, + ) => + this.request< + AppsGetSubscriptionPlanForAccountStubbedData, + BasicError | void + >({ path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, method: "GET", format: "json", @@ -47417,7 +48663,10 @@ export class Api extends HttpClient + appsListAccountsForPlan: ( + { planId, ...query }: AppsListAccountsForPlanParams, + params: RequestParams = {}, + ) => this.request({ path: \`/marketplace_listing/plans/\${planId}/accounts\`, method: "GET", @@ -47471,7 +48720,10 @@ export class Api extends HttpClient + appsListPlansStubbed: ( + query: AppsListPlansStubbedParams, + params: RequestParams = {}, + ) => this.request({ path: \`/marketplace_listing/stubbed/plans\`, method: "GET", @@ -47527,7 +48779,10 @@ export class Api extends HttpClient + activityDeleteThreadSubscription: ( + threadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications/threads/\${threadId}/subscription\`, method: "DELETE", @@ -47558,8 +48813,14 @@ export class Api extends HttpClient - this.request({ + activityGetThreadSubscriptionForAuthenticatedUser: ( + threadId: number, + params: RequestParams = {}, + ) => + this.request< + ActivityGetThreadSubscriptionForAuthenticatedUserData, + BasicError + >({ path: \`/notifications/threads/\${threadId}/subscription\`, method: "GET", format: "json", @@ -47578,7 +48839,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ActivityListNotificationsForAuthenticatedUserData, + BasicError | ValidationError + >({ path: \`/notifications\`, method: "GET", query: query, @@ -47594,7 +48858,10 @@ export class Api extends HttpClient + activityMarkNotificationsAsRead: ( + data: ActivityMarkNotificationsAsReadPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications\`, method: "PUT", @@ -47767,7 +49034,10 @@ export class Api extends HttpClient + actionsCreateRegistrationTokenForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/registration-token\`, method: "POST", @@ -47821,7 +49091,11 @@ export class Api extends HttpClient + actionsDeleteOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "DELETE", @@ -47836,7 +49110,11 @@ export class Api extends HttpClient + actionsDeleteSelfHostedRunnerFromOrg: ( + org: string, + runnerId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, method: "DELETE", @@ -47851,7 +49129,11 @@ export class Api extends HttpClient + actionsDeleteSelfHostedRunnerGroupFromOrg: ( + org: string, + runnerGroupId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "DELETE", @@ -47871,7 +49153,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ActionsDisableSelectedRepositoryGithubActionsOrganizationData, + any + >({ path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, method: "DELETE", ...params, @@ -47890,7 +49175,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ActionsEnableSelectedRepositoryGithubActionsOrganizationData, + any + >({ path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, method: "PUT", ...params, @@ -47904,7 +49192,10 @@ export class Api extends HttpClient + actionsGetAllowedActionsOrganization: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/permissions/selected-actions\`, method: "GET", @@ -47920,7 +49211,10 @@ export class Api extends HttpClient + actionsGetGithubActionsPermissionsOrganization: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/permissions\`, method: "GET", @@ -47952,7 +49246,11 @@ export class Api extends HttpClient + actionsGetOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "GET", @@ -47968,7 +49266,11 @@ export class Api extends HttpClient + actionsGetSelfHostedRunnerForOrg: ( + org: string, + runnerId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, method: "GET", @@ -47984,7 +49286,11 @@ export class Api extends HttpClient + actionsGetSelfHostedRunnerGroupForOrg: ( + org: string, + runnerGroupId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", @@ -48000,7 +49306,10 @@ export class Api extends HttpClient + actionsListOrgSecrets: ( + { org, ...query }: ActionsListOrgSecretsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/secrets\`, method: "GET", @@ -48037,7 +49346,10 @@ export class Api extends HttpClient + actionsListRunnerApplicationsForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/downloads\`, method: "GET", @@ -48053,7 +49365,11 @@ export class Api extends HttpClient + actionsListSelectedReposForOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, method: "GET", @@ -48070,10 +49386,16 @@ export class Api extends HttpClient - this.request({ + this.request< + ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData, + any + >({ path: \`/orgs/\${org}/actions/permissions/repositories\`, method: "GET", query: query, @@ -48130,7 +49452,11 @@ export class Api extends HttpClient this.request({ @@ -48155,7 +49481,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData, + any + >({ path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, method: "DELETE", ...params, @@ -48209,7 +49538,11 @@ export class Api extends HttpClient + actionsSetAllowedActionsOrganization: ( + org: string, + data: SelectedActions, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/permissions/selected-actions\`, method: "PUT", @@ -48296,7 +49629,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData, + any + >({ path: \`/orgs/\${org}/actions/permissions/repositories\`, method: "PUT", body: data, @@ -48357,7 +49693,10 @@ export class Api extends HttpClient + activityListPublicOrgEvents: ( + { org, ...query }: ActivityListPublicOrgEventsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/events\`, method: "GET", @@ -48390,7 +49729,10 @@ export class Api extends HttpClient + billingGetGithubActionsBillingOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/settings/billing/actions\`, method: "GET", @@ -48406,7 +49748,10 @@ export class Api extends HttpClient + billingGetGithubPackagesBillingOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/settings/billing/packages\`, method: "GET", @@ -48422,7 +49767,10 @@ export class Api extends HttpClient + billingGetSharedStorageBillingOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/settings/billing/shared-storage\`, method: "GET", @@ -48438,7 +49786,10 @@ export class Api extends HttpClient + interactionsGetRestrictionsForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/interaction-limits\`, method: "GET", @@ -48454,7 +49805,10 @@ export class Api extends HttpClient + interactionsRemoveRestrictionsForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/interaction-limits\`, method: "DELETE", @@ -48469,7 +49823,11 @@ export class Api extends HttpClient + interactionsSetRestrictionsForOrg: ( + org: string, + data: InteractionLimit, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/interaction-limits\`, method: "PUT", @@ -48487,7 +49845,10 @@ export class Api extends HttpClient + issuesListForOrg: ( + { org, ...query }: IssuesListForOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/issues\`, method: "GET", @@ -48504,7 +49865,11 @@ export class Api extends HttpClient + migrationsDeleteArchiveForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, method: "DELETE", @@ -48519,7 +49884,11 @@ export class Api extends HttpClient + migrationsDownloadArchiveForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, method: "GET", @@ -48534,7 +49903,11 @@ export class Api extends HttpClient + migrationsGetStatusForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}\`, method: "GET", @@ -48550,7 +49923,10 @@ export class Api extends HttpClient + migrationsListForOrg: ( + { org, ...query }: MigrationsListForOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations\`, method: "GET", @@ -48587,7 +49963,11 @@ export class Api extends HttpClient + migrationsStartForOrg: ( + org: string, + data: MigrationsStartForOrgPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations\`, method: "POST", @@ -48605,7 +49985,12 @@ export class Api extends HttpClient + migrationsUnlockRepoForOrg: ( + org: string, + migrationId: number, + repoName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, method: "DELETE", @@ -48620,7 +50005,11 @@ export class Api extends HttpClient + orgsBlockUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/blocks/\${username}\`, method: "PUT", @@ -48635,7 +50024,11 @@ export class Api extends HttpClient + orgsCancelInvitation: ( + org: string, + invitationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/invitations/\${invitationId}\`, method: "DELETE", @@ -48650,7 +50043,11 @@ export class Api extends HttpClient + orgsCheckBlockedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/blocks/\${username}\`, method: "GET", @@ -48665,7 +50062,11 @@ export class Api extends HttpClient + orgsCheckMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -48680,7 +50081,11 @@ export class Api extends HttpClient + orgsCheckPublicMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -48695,8 +50100,15 @@ export class Api extends HttpClient - this.request({ + orgsConvertMemberToOutsideCollaborator: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request< + OrgsConvertMemberToOutsideCollaboratorData, + OrgsConvertMemberToOutsideCollaboratorError + >({ path: \`/orgs/\${org}/outside_collaborators/\${username}\`, method: "PUT", ...params, @@ -48710,7 +50122,11 @@ export class Api extends HttpClient + orgsCreateInvitation: ( + org: string, + data: OrgsCreateInvitationPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/invitations\`, method: "POST", @@ -48728,7 +50144,11 @@ export class Api extends HttpClient + orgsCreateWebhook: ( + org: string, + data: OrgsCreateWebhookPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks\`, method: "POST", @@ -48746,7 +50166,11 @@ export class Api extends HttpClient + orgsDeleteWebhook: ( + org: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks/\${hookId}\`, method: "DELETE", @@ -48777,7 +50201,10 @@ export class Api extends HttpClient + orgsGetAuditLog: ( + { org, ...query }: OrgsGetAuditLogParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/audit-log\`, method: "GET", @@ -48794,7 +50221,11 @@ export class Api extends HttpClient + orgsGetMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/memberships/\${username}\`, method: "GET", @@ -48826,7 +50257,11 @@ export class Api extends HttpClient + orgsGetWebhookConfigForOrg: ( + org: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks/\${hookId}/config\`, method: "GET", @@ -48842,7 +50277,10 @@ export class Api extends HttpClient + orgsListAppInstallations: ( + { org, ...query }: OrgsListAppInstallationsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/installations\`, method: "GET", @@ -48881,7 +50319,10 @@ export class Api extends HttpClient + orgsListFailedInvitations: ( + { org, ...query }: OrgsListFailedInvitationsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/failed_invitations\`, method: "GET", @@ -48918,7 +50359,10 @@ export class Api extends HttpClient + orgsListMembers: ( + { org, ...query }: OrgsListMembersParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members\`, method: "GET", @@ -48935,7 +50379,10 @@ export class Api extends HttpClient + orgsListOutsideCollaborators: ( + { org, ...query }: OrgsListOutsideCollaboratorsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/outside_collaborators\`, method: "GET", @@ -48952,7 +50399,10 @@ export class Api extends HttpClient + orgsListPendingInvitations: ( + { org, ...query }: OrgsListPendingInvitationsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/invitations\`, method: "GET", @@ -48969,7 +50419,10 @@ export class Api extends HttpClient + orgsListPublicMembers: ( + { org, ...query }: OrgsListPublicMembersParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members\`, method: "GET", @@ -49002,7 +50455,10 @@ export class Api extends HttpClient + orgsListWebhooks: ( + { org, ...query }: OrgsListWebhooksParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks\`, method: "GET", @@ -49019,7 +50475,11 @@ export class Api extends HttpClient + orgsPingWebhook: ( + org: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, method: "POST", @@ -49034,7 +50494,11 @@ export class Api extends HttpClient + orgsRemoveMember: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -49049,7 +50513,11 @@ export class Api extends HttpClient + orgsRemoveMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/memberships/\${username}\`, method: "DELETE", @@ -49064,8 +50532,15 @@ export class Api extends HttpClient - this.request({ + orgsRemoveOutsideCollaborator: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request< + OrgsRemoveOutsideCollaboratorData, + OrgsRemoveOutsideCollaboratorError + >({ path: \`/orgs/\${org}/outside_collaborators/\${username}\`, method: "DELETE", ...params, @@ -49079,7 +50554,11 @@ export class Api extends HttpClient + orgsRemovePublicMembershipForAuthenticatedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -49094,7 +50573,11 @@ export class Api extends HttpClient + orgsRemoveSamlSsoAuthorization: ( + org: string, + credentialId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, method: "DELETE", @@ -49132,12 +50615,18 @@ export class Api extends HttpClient - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "PUT", - ...params, - }), + orgsSetPublicMembershipForAuthenticatedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "PUT", + ...params, + }, + ), /** * No description @@ -49147,7 +50636,11 @@ export class Api extends HttpClient + orgsUnblockUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/blocks/\${username}\`, method: "DELETE", @@ -49162,7 +50655,11 @@ export class Api extends HttpClient + orgsUpdate: ( + org: string, + data: OrgsUpdatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}\`, method: "PATCH", @@ -49180,7 +50677,12 @@ export class Api extends HttpClient + orgsUpdateWebhook: ( + org: string, + hookId: number, + data: OrgsUpdateWebhookPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks/\${hookId}\`, method: "PATCH", @@ -49221,8 +50723,15 @@ export class Api extends HttpClient - this.request({ + projectsCreateForOrg: ( + org: string, + data: ProjectsCreateForOrgPayload, + params: RequestParams = {}, + ) => + this.request< + ProjectsCreateForOrgData, + BasicError | ValidationErrorSimple + >({ path: \`/orgs/\${org}/projects\`, method: "POST", body: data, @@ -49239,7 +50748,10 @@ export class Api extends HttpClient + projectsListForOrg: ( + { org, ...query }: ProjectsListForOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/projects\`, method: "GET", @@ -49349,7 +50861,13 @@ export class Api extends HttpClient this.request({ @@ -49369,7 +50887,12 @@ export class Api extends HttpClient this.request({ @@ -49388,7 +50911,11 @@ export class Api extends HttpClient + reposCreateInOrg: ( + org: string, + data: ReposCreateInOrgPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/repos\`, method: "POST", @@ -49406,7 +50933,10 @@ export class Api extends HttpClient + reposListForOrg: ( + { org, ...query }: ReposListForOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/repos\`, method: "GET", @@ -49430,7 +50960,10 @@ export class Api extends HttpClient - this.request({ + this.request< + TeamsAddOrUpdateMembershipForUserInOrgData, + TeamsAddOrUpdateMembershipForUserInOrgError + >({ path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, method: "PUT", body: data, @@ -49454,7 +50987,10 @@ export class Api extends HttpClient - this.request({ + this.request< + TeamsAddOrUpdateProjectPermissionsInOrgData, + TeamsAddOrUpdateProjectPermissionsInOrgError + >({ path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, method: "PUT", body: data, @@ -49537,7 +51073,11 @@ export class Api extends HttpClient + teamsCreate: ( + org: string, + data: TeamsCreatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams\`, method: "POST", @@ -49646,7 +51186,12 @@ export class Api extends HttpClient + teamsDeleteDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, method: "DELETE", @@ -49661,7 +51206,11 @@ export class Api extends HttpClient + teamsDeleteInOrg: ( + org: string, + teamSlug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}\`, method: "DELETE", @@ -49676,7 +51225,11 @@ export class Api extends HttpClient + teamsGetByName: ( + org: string, + teamSlug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}\`, method: "GET", @@ -49714,7 +51267,12 @@ export class Api extends HttpClient + teamsGetDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, method: "GET", @@ -49730,7 +51288,12 @@ export class Api extends HttpClient + teamsGetMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, method: "GET", @@ -49746,7 +51309,10 @@ export class Api extends HttpClient + teamsList: ( + { org, ...query }: TeamsListParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams\`, method: "GET", @@ -49763,7 +51329,10 @@ export class Api extends HttpClient + teamsListChildInOrg: ( + { org, teamSlug, ...query }: TeamsListChildInOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, method: "GET", @@ -49781,7 +51350,12 @@ export class Api extends HttpClient this.request({ @@ -49820,7 +51394,10 @@ export class Api extends HttpClient + teamsListIdpGroupsForOrg: ( + { org, ...query }: TeamsListIdpGroupsForOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/team-sync/groups\`, method: "GET", @@ -49837,7 +51414,11 @@ export class Api extends HttpClient + teamsListIdpGroupsInOrg: ( + org: string, + teamSlug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, method: "GET", @@ -49853,7 +51434,10 @@ export class Api extends HttpClient + teamsListMembersInOrg: ( + { org, teamSlug, ...query }: TeamsListMembersInOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, method: "GET", @@ -49890,7 +51474,10 @@ export class Api extends HttpClient + teamsListProjectsInOrg: ( + { org, teamSlug, ...query }: TeamsListProjectsInOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, method: "GET", @@ -49907,7 +51494,10 @@ export class Api extends HttpClient + teamsListReposInOrg: ( + { org, teamSlug, ...query }: TeamsListReposInOrgParams, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, method: "GET", @@ -49924,7 +51514,12 @@ export class Api extends HttpClient + teamsRemoveMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, method: "DELETE", @@ -49939,7 +51534,12 @@ export class Api extends HttpClient + teamsRemoveProjectInOrg: ( + org: string, + teamSlug: string, + projectId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, method: "DELETE", @@ -49954,7 +51554,13 @@ export class Api extends HttpClient + teamsRemoveRepoInOrg: ( + org: string, + teamSlug: string, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -50018,7 +51624,12 @@ export class Api extends HttpClient + teamsUpdateInOrg: ( + org: string, + teamSlug: string, + data: TeamsUpdateInOrgPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}\`, method: "PATCH", @@ -50067,7 +51678,11 @@ export class Api extends HttpClient + projectsCreateCard: ( + columnId: number, + data: ProjectsCreateCardPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/columns/\${columnId}/cards\`, method: "POST", @@ -50085,8 +51700,15 @@ export class Api extends HttpClient - this.request({ + projectsCreateColumn: ( + projectId: number, + data: ProjectsCreateColumnPayload, + params: RequestParams = {}, + ) => + this.request< + ProjectsCreateColumnData, + BasicError | ValidationErrorSimple + >({ path: \`/projects/\${projectId}/columns\`, method: "POST", body: data, @@ -50196,7 +51818,11 @@ export class Api extends HttpClient + projectsGetPermissionForUser: ( + projectId: number, + username: string, + params: RequestParams = {}, + ) => this.request< ProjectsGetPermissionForUserData, | BasicError @@ -50220,7 +51846,10 @@ export class Api extends HttpClient + projectsListCards: ( + { columnId, ...query }: ProjectsListCardsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/columns/\${columnId}/cards\`, method: "GET", @@ -50237,7 +51866,10 @@ export class Api extends HttpClient + projectsListCollaborators: ( + { projectId, ...query }: ProjectsListCollaboratorsParams, + params: RequestParams = {}, + ) => this.request< ProjectsListCollaboratorsData, | BasicError @@ -50262,7 +51894,10 @@ export class Api extends HttpClient + projectsListColumns: ( + { projectId, ...query }: ProjectsListColumnsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/\${projectId}/columns\`, method: "GET", @@ -50279,7 +51914,11 @@ export class Api extends HttpClient + projectsMoveCard: ( + cardId: number, + data: ProjectsMoveCardPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/columns/cards/\${cardId}/moves\`, method: "POST", @@ -50297,7 +51936,11 @@ export class Api extends HttpClient + projectsMoveColumn: ( + columnId: number, + data: ProjectsMoveColumnPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/columns/\${columnId}/moves\`, method: "POST", @@ -50315,7 +51958,11 @@ export class Api extends HttpClient + projectsRemoveCollaborator: ( + projectId: number, + username: string, + params: RequestParams = {}, + ) => this.request< ProjectsRemoveCollaboratorData, | BasicError @@ -50338,7 +51985,11 @@ export class Api extends HttpClient + projectsUpdate: ( + projectId: number, + data: ProjectsUpdatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/\${projectId}\`, method: "PATCH", @@ -50356,7 +52007,11 @@ export class Api extends HttpClient + projectsUpdateCard: ( + cardId: number, + data: ProjectsUpdateCardPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/columns/cards/\${cardId}\`, method: "PATCH", @@ -50374,7 +52029,11 @@ export class Api extends HttpClient + projectsUpdateColumn: ( + columnId: number, + data: ProjectsUpdateColumnPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/columns/\${columnId}\`, method: "PATCH", @@ -50434,7 +52093,12 @@ export class Api extends HttpClient + actionsCancelWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, method: "POST", @@ -50472,7 +52136,11 @@ export class Api extends HttpClient + actionsCreateRegistrationTokenForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, method: "POST", @@ -50488,7 +52156,11 @@ export class Api extends HttpClient + actionsCreateRemoveTokenForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, method: "POST", @@ -50527,7 +52199,12 @@ export class Api extends HttpClient + actionsDeleteArtifact: ( + owner: string, + repo: string, + artifactId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, method: "DELETE", @@ -50542,7 +52219,12 @@ export class Api extends HttpClient + actionsDeleteRepoSecret: ( + owner: string, + repo: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, method: "DELETE", @@ -50577,7 +52259,12 @@ export class Api extends HttpClient + actionsDeleteWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, method: "DELETE", @@ -50592,7 +52279,12 @@ export class Api extends HttpClient + actionsDeleteWorkflowRunLogs: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, method: "DELETE", @@ -50607,7 +52299,12 @@ export class Api extends HttpClient + actionsDisableWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, method: "PUT", @@ -50643,7 +52340,12 @@ export class Api extends HttpClient + actionsDownloadJobLogsForWorkflowRun: ( + owner: string, + repo: string, + jobId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, method: "GET", @@ -50658,7 +52360,12 @@ export class Api extends HttpClient + actionsDownloadWorkflowRunLogs: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, method: "GET", @@ -50673,7 +52380,12 @@ export class Api extends HttpClient + actionsEnableWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, method: "PUT", @@ -50688,7 +52400,11 @@ export class Api extends HttpClient + actionsGetAllowedActionsRepository: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, method: "GET", @@ -50704,7 +52420,12 @@ export class Api extends HttpClient + actionsGetArtifact: ( + owner: string, + repo: string, + artifactId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, method: "GET", @@ -50720,7 +52441,11 @@ export class Api extends HttpClient + actionsGetGithubActionsPermissionsRepository: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/permissions\`, method: "GET", @@ -50736,7 +52461,12 @@ export class Api extends HttpClient + actionsGetJobForWorkflowRun: ( + owner: string, + repo: string, + jobId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, method: "GET", @@ -50752,7 +52482,11 @@ export class Api extends HttpClient + actionsGetRepoPublicKey: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, method: "GET", @@ -50768,7 +52502,12 @@ export class Api extends HttpClient + actionsGetRepoSecret: ( + owner: string, + repo: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, method: "GET", @@ -50784,7 +52523,12 @@ export class Api extends HttpClient + actionsGetSelfHostedRunnerForRepo: ( + owner: string, + repo: string, + runnerId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, method: "GET", @@ -50800,7 +52544,12 @@ export class Api extends HttpClient + actionsGetWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, method: "GET", @@ -50816,7 +52565,12 @@ export class Api extends HttpClient + actionsGetWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, method: "GET", @@ -50832,7 +52586,12 @@ export class Api extends HttpClient + actionsGetWorkflowRunUsage: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, method: "GET", @@ -50848,7 +52607,12 @@ export class Api extends HttpClient + actionsGetWorkflowUsage: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, method: "GET", @@ -50904,7 +52668,10 @@ export class Api extends HttpClient + actionsListRepoSecrets: ( + { owner, repo, ...query }: ActionsListRepoSecretsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/secrets\`, method: "GET", @@ -50921,7 +52688,10 @@ export class Api extends HttpClient + actionsListRepoWorkflows: ( + { owner, repo, ...query }: ActionsListRepoWorkflowsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows\`, method: "GET", @@ -50938,7 +52708,11 @@ export class Api extends HttpClient + actionsListRunnerApplicationsForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, method: "GET", @@ -51034,7 +52808,12 @@ export class Api extends HttpClient + actionsReRunWorkflow: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, method: "POST", @@ -51093,7 +52872,11 @@ export class Api extends HttpClient + activityDeleteRepoSubscription: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -51108,7 +52891,11 @@ export class Api extends HttpClient + activityGetRepoSubscription: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -51124,7 +52911,10 @@ export class Api extends HttpClient + activityListRepoEvents: ( + { owner, repo, ...query }: ActivityListRepoEventsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/events\`, method: "GET", @@ -51142,7 +52932,11 @@ export class Api extends HttpClient this.request({ @@ -51246,7 +53040,11 @@ export class Api extends HttpClient + appsGetRepoInstallation: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/installation\`, method: "GET", @@ -51262,7 +53060,12 @@ export class Api extends HttpClient + checksCreate: ( + owner: string, + repo: string, + data: ChecksCreatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-runs\`, method: "POST", @@ -51280,7 +53083,12 @@ export class Api extends HttpClient + checksCreateSuite: ( + owner: string, + repo: string, + data: ChecksCreateSuitePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-suites\`, method: "POST", @@ -51298,7 +53106,12 @@ export class Api extends HttpClient + checksGet: ( + owner: string, + repo: string, + checkRunId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, method: "GET", @@ -51314,7 +53127,12 @@ export class Api extends HttpClient + checksGetSuite: ( + owner: string, + repo: string, + checkSuiteId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, method: "GET", @@ -51350,7 +53168,10 @@ export class Api extends HttpClient + checksListForRef: ( + { owner, repo, ref, ...query }: ChecksListForRefParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, method: "GET", @@ -51407,7 +53228,12 @@ export class Api extends HttpClient + checksRerequestSuite: ( + owner: string, + repo: string, + checkSuiteId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, method: "POST", @@ -51469,7 +53295,12 @@ export class Api extends HttpClient + codeScanningGetAlert: ( + owner: string, + repo: string, + alertNumber: number, + params: RequestParams = {}, + ) => this.request< CodeScanningGetAlertData, | void @@ -51587,7 +53418,11 @@ export class Api extends HttpClient + codesOfConductGetForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, method: "GET", @@ -51603,7 +53438,12 @@ export class Api extends HttpClient + gitCreateBlob: ( + owner: string, + repo: string, + data: GitCreateBlobPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs\`, method: "POST", @@ -51621,7 +53461,12 @@ export class Api extends HttpClient + gitCreateCommit: ( + owner: string, + repo: string, + data: GitCreateCommitPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits\`, method: "POST", @@ -51639,7 +53484,12 @@ export class Api extends HttpClient + gitCreateRef: ( + owner: string, + repo: string, + data: GitCreateRefPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs\`, method: "POST", @@ -51657,7 +53507,12 @@ export class Api extends HttpClient + gitCreateTag: ( + owner: string, + repo: string, + data: GitCreateTagPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags\`, method: "POST", @@ -51675,7 +53530,12 @@ export class Api extends HttpClient + gitCreateTree: ( + owner: string, + repo: string, + data: GitCreateTreePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/trees\`, method: "POST", @@ -51693,7 +53553,12 @@ export class Api extends HttpClient + gitDeleteRef: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -51708,7 +53573,12 @@ export class Api extends HttpClient + gitGetBlob: ( + owner: string, + repo: string, + fileSha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, method: "GET", @@ -51724,7 +53594,12 @@ export class Api extends HttpClient + gitGetCommit: ( + owner: string, + repo: string, + commitSha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, method: "GET", @@ -51740,7 +53615,12 @@ export class Api extends HttpClient + gitGetRef: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, method: "GET", @@ -51756,7 +53636,12 @@ export class Api extends HttpClient + gitGetTag: ( + owner: string, + repo: string, + tagSha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, method: "GET", @@ -51772,7 +53657,10 @@ export class Api extends HttpClient + gitGetTree: ( + { owner, repo, treeSha, ...query }: GitGetTreeParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, method: "GET", @@ -51789,7 +53677,10 @@ export class Api extends HttpClient + gitListMatchingRefs: ( + { owner, repo, ref, ...query }: GitListMatchingRefsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, method: "GET", @@ -51806,7 +53697,13 @@ export class Api extends HttpClient + gitUpdateRef: ( + owner: string, + repo: string, + ref: string, + data: GitUpdateRefPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "PATCH", @@ -51824,7 +53721,11 @@ export class Api extends HttpClient + interactionsGetRestrictionsForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/interaction-limits\`, method: "GET", @@ -51840,7 +53741,11 @@ export class Api extends HttpClient + interactionsRemoveRestrictionsForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/interaction-limits\`, method: "DELETE", @@ -51926,8 +53831,16 @@ export class Api extends HttpClient - this.request({ + issuesCheckUserCanBeAssigned: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => + this.request< + IssuesCheckUserCanBeAssignedData, + IssuesCheckUserCanBeAssignedError + >({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", ...params, @@ -51941,7 +53854,12 @@ export class Api extends HttpClient + issuesCreate: ( + owner: string, + repo: string, + data: IssuesCreatePayload, + params: RequestParams = {}, + ) => this.request< IssuesCreateData, | BasicError @@ -51992,7 +53910,12 @@ export class Api extends HttpClient + issuesCreateLabel: ( + owner: string, + repo: string, + data: IssuesCreateLabelPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", @@ -52033,7 +53956,12 @@ export class Api extends HttpClient + issuesDeleteComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -52048,7 +53976,12 @@ export class Api extends HttpClient + issuesDeleteLabel: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -52063,7 +53996,12 @@ export class Api extends HttpClient + issuesDeleteMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, method: "DELETE", @@ -52078,7 +54016,12 @@ export class Api extends HttpClient + issuesGet: ( + owner: string, + repo: string, + issueNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, method: "GET", @@ -52094,7 +54037,12 @@ export class Api extends HttpClient + issuesGetComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -52110,7 +54058,12 @@ export class Api extends HttpClient + issuesGetEvent: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -52126,7 +54079,12 @@ export class Api extends HttpClient + issuesGetLabel: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -52142,7 +54100,12 @@ export class Api extends HttpClient + issuesGetMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, method: "GET", @@ -52158,7 +54121,10 @@ export class Api extends HttpClient + issuesListAssignees: ( + { owner, repo, ...query }: IssuesListAssigneesParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/assignees\`, method: "GET", @@ -52199,13 +54165,15 @@ export class Api extends HttpClient - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + this.request( + { + path: \`/repos/\${owner}/\${repo}/issues/comments\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), /** * No description @@ -52215,7 +54183,10 @@ export class Api extends HttpClient + issuesListEvents: ( + { owner, repo, issueNumber, ...query }: IssuesListEventsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, method: "GET", @@ -52232,7 +54203,10 @@ export class Api extends HttpClient + issuesListEventsForRepo: ( + { owner, repo, ...query }: IssuesListEventsForRepoParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", @@ -52276,7 +54250,10 @@ export class Api extends HttpClient + issuesListForRepo: ( + { owner, repo, ...query }: IssuesListForRepoParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues\`, method: "GET", @@ -52294,7 +54271,12 @@ export class Api extends HttpClient this.request({ @@ -52313,7 +54295,10 @@ export class Api extends HttpClient + issuesListLabelsForRepo: ( + { owner, repo, ...query }: IssuesListLabelsForRepoParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels\`, method: "GET", @@ -52350,7 +54335,10 @@ export class Api extends HttpClient + issuesListMilestones: ( + { owner, repo, ...query }: IssuesListMilestonesParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones\`, method: "GET", @@ -52390,7 +54378,12 @@ export class Api extends HttpClient + issuesRemoveAllLabels: ( + owner: string, + repo: string, + issueNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, method: "DELETE", @@ -52429,7 +54422,13 @@ export class Api extends HttpClient + issuesRemoveLabel: ( + owner: string, + repo: string, + issueNumber: number, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, method: "DELETE", @@ -52469,7 +54468,12 @@ export class Api extends HttpClient + issuesUnlock: ( + owner: string, + repo: string, + issueNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, method: "DELETE", @@ -52589,7 +54593,11 @@ export class Api extends HttpClient + licensesGetForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/license\`, method: "GET", @@ -52605,7 +54613,11 @@ export class Api extends HttpClient + migrationsCancelImport: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/import\`, method: "DELETE", @@ -52640,7 +54652,11 @@ export class Api extends HttpClient + migrationsGetImportStatus: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/import\`, method: "GET", @@ -52656,7 +54672,11 @@ export class Api extends HttpClient + migrationsGetLargeFiles: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/import/large_files\`, method: "GET", @@ -52679,14 +54699,16 @@ export class Api extends HttpClient - this.request({ - path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + this.request( + { + path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }, + ), /** * @description 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/). @@ -52771,7 +54793,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ProjectsCreateForRepoData, + BasicError | ValidationErrorSimple + >({ path: \`/repos/\${owner}/\${repo}/projects\`, method: "POST", body: data, @@ -52788,14 +54813,19 @@ export class Api extends HttpClient - this.request({ - path: \`/repos/\${owner}/\${repo}/projects\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + projectsListForRepo: ( + { owner, repo, ...query }: ProjectsListForRepoParams, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/repos/\${owner}/\${repo}/projects\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), /** * No description @@ -52805,7 +54835,12 @@ export class Api extends HttpClient + pullsCheckIfMerged: ( + owner: string, + repo: string, + pullNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, method: "GET", @@ -52820,7 +54855,12 @@ export class Api extends HttpClient + pullsCreate: ( + owner: string, + repo: string, + data: PullsCreatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls\`, method: "POST", @@ -52918,7 +54958,10 @@ export class Api extends HttpClient - this.request({ + this.request< + PullsDeletePendingReviewData, + BasicError | ValidationErrorSimple + >({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, method: "DELETE", format: "json", @@ -52933,7 +54976,12 @@ export class Api extends HttpClient + pullsDeleteReviewComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -52973,7 +55021,12 @@ export class Api extends HttpClient + pullsGet: ( + owner: string, + repo: string, + pullNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, method: "GET", @@ -52989,7 +55042,13 @@ export class Api extends HttpClient + pullsGetReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, method: "GET", @@ -53005,7 +55064,12 @@ export class Api extends HttpClient + pullsGetReviewComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -53021,7 +55085,10 @@ export class Api extends HttpClient + pullsList: ( + { owner, repo, ...query }: PullsListParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls\`, method: "GET", @@ -53039,7 +55106,13 @@ export class Api extends HttpClient this.request({ @@ -53058,7 +55131,10 @@ export class Api extends HttpClient + pullsListCommits: ( + { owner, repo, pullNumber, ...query }: PullsListCommitsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, method: "GET", @@ -53075,7 +55151,10 @@ export class Api extends HttpClient + pullsListFiles: ( + { owner, repo, pullNumber, ...query }: PullsListFilesParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, method: "GET", @@ -53152,7 +55231,10 @@ export class Api extends HttpClient + pullsListReviews: ( + { owner, repo, pullNumber, ...query }: PullsListReviewsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, method: "GET", @@ -53660,7 +55742,12 @@ export class Api extends HttpClient this.request< @@ -53741,7 +55828,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ReposAddStatusCheckContextsData, + BasicError | ValidationError + >({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, method: "POST", body: data, @@ -53806,7 +55896,12 @@ export class Api extends HttpClient + reposCheckCollaborator: ( + owner: string, + repo: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, method: "GET", @@ -53821,7 +55916,11 @@ export class Api extends HttpClient + reposCheckVulnerabilityAlerts: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "GET", @@ -53836,7 +55935,13 @@ export class Api extends HttpClient + reposCompareCommits: ( + owner: string, + repo: string, + base: string, + head: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, method: "GET", @@ -53876,7 +55981,12 @@ export class Api extends HttpClient + reposCreateCommitSignatureProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "POST", @@ -54008,7 +56118,12 @@ export class Api extends HttpClient + reposCreateFork: ( + owner: string, + repo: string, + data: ReposCreateForkPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/forks\`, method: "POST", @@ -54033,7 +56148,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ReposCreateOrUpdateFileContentsData, + BasicError | ValidationError + >({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "PUT", body: data, @@ -54081,7 +56199,12 @@ export class Api extends HttpClient + reposCreateRelease: ( + owner: string, + repo: string, + data: ReposCreateReleasePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases\`, method: "POST", @@ -54122,7 +56245,12 @@ export class Api extends HttpClient + reposCreateWebhook: ( + owner: string, + repo: string, + data: ReposCreateWebhookPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks\`, method: "POST", @@ -54155,7 +56283,12 @@ export class Api extends HttpClient + reposDeleteAccessRestrictions: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, method: "DELETE", @@ -54170,7 +56303,12 @@ export class Api extends HttpClient + reposDeleteAdminBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, method: "DELETE", @@ -54185,7 +56323,12 @@ export class Api extends HttpClient + reposDeleteBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, method: "DELETE", @@ -54200,7 +56343,12 @@ export class Api extends HttpClient + reposDeleteCommitComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -54215,7 +56363,12 @@ export class Api extends HttpClient + reposDeleteCommitSignatureProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "DELETE", @@ -54230,7 +56383,12 @@ export class Api extends HttpClient + reposDeleteDeployKey: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -54245,8 +56403,16 @@ export class Api extends HttpClient - this.request({ + reposDeleteDeployment: ( + owner: string, + repo: string, + deploymentId: number, + params: RequestParams = {}, + ) => + this.request< + ReposDeleteDeploymentData, + BasicError | ValidationErrorSimple + >({ path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, method: "DELETE", ...params, @@ -54293,7 +56459,12 @@ export class Api extends HttpClient + reposDeleteInvitation: ( + owner: string, + repo: string, + invitationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, method: "DELETE", @@ -54308,7 +56479,11 @@ export class Api extends HttpClient + reposDeletePagesSite: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request< ReposDeletePagesSiteData, | BasicError @@ -54331,7 +56506,12 @@ export class Api extends HttpClient + reposDeletePullRequestReviewProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, method: "DELETE", @@ -54346,7 +56526,12 @@ export class Api extends HttpClient + reposDeleteRelease: ( + owner: string, + repo: string, + releaseId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "DELETE", @@ -54361,7 +56546,12 @@ export class Api extends HttpClient + reposDeleteReleaseAsset: ( + owner: string, + repo: string, + assetId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, method: "DELETE", @@ -54376,7 +56566,12 @@ export class Api extends HttpClient + reposDeleteWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -54391,7 +56586,11 @@ export class Api extends HttpClient + reposDisableAutomatedSecurityFixes: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, method: "DELETE", @@ -54406,7 +56605,11 @@ export class Api extends HttpClient + reposDisableVulnerabilityAlerts: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "DELETE", @@ -54421,7 +56624,12 @@ export class Api extends HttpClient + reposDownloadTarballArchive: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, method: "GET", @@ -54436,7 +56644,12 @@ export class Api extends HttpClient + reposDownloadZipballArchive: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, method: "GET", @@ -54451,7 +56664,11 @@ export class Api extends HttpClient + reposEnableAutomatedSecurityFixes: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, method: "PUT", @@ -54466,7 +56683,11 @@ export class Api extends HttpClient + reposEnableVulnerabilityAlerts: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "PUT", @@ -54497,7 +56718,12 @@ export class Api extends HttpClient + reposGetAccessRestrictions: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, method: "GET", @@ -54513,7 +56739,12 @@ export class Api extends HttpClient + reposGetAdminBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, method: "GET", @@ -54529,7 +56760,12 @@ export class Api extends HttpClient + reposGetAllStatusCheckContexts: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, method: "GET", @@ -54545,7 +56781,11 @@ export class Api extends HttpClient + reposGetAllTopics: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request< ReposGetAllTopicsData, | BasicError @@ -54589,7 +56829,12 @@ export class Api extends HttpClient + reposGetBranch: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request< ReposGetBranchData, | BasicError @@ -54612,7 +56857,12 @@ export class Api extends HttpClient + reposGetBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, method: "GET", @@ -54628,7 +56878,10 @@ export class Api extends HttpClient + reposGetClones: ( + { owner, repo, ...query }: ReposGetClonesParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/traffic/clones\`, method: "GET", @@ -54645,7 +56898,11 @@ export class Api extends HttpClient + reposGetCodeFrequencyStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -54661,7 +56918,12 @@ export class Api extends HttpClient + reposGetCollaboratorPermissionLevel: ( + owner: string, + repo: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, method: "GET", @@ -54677,7 +56939,12 @@ export class Api extends HttpClient + reposGetCombinedStatusForRef: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -54693,7 +56960,12 @@ export class Api extends HttpClient + reposGetCommit: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, method: "GET", @@ -54709,7 +56981,11 @@ export class Api extends HttpClient + reposGetCommitActivityStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -54725,7 +57001,12 @@ export class Api extends HttpClient + reposGetCommitComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -54741,7 +57022,12 @@ export class Api extends HttpClient + reposGetCommitSignatureProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "GET", @@ -54757,7 +57043,11 @@ export class Api extends HttpClient + reposGetCommunityProfileMetrics: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/community/profile\`, method: "GET", @@ -54773,7 +57063,10 @@ export class Api extends HttpClient + reposGetContent: ( + { owner, repo, path, ...query }: ReposGetContentParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "GET", @@ -54790,7 +57083,11 @@ export class Api extends HttpClient + reposGetContributorsStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -54806,7 +57103,12 @@ export class Api extends HttpClient + reposGetDeployKey: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -54822,7 +57124,12 @@ export class Api extends HttpClient + reposGetDeployment: ( + owner: string, + repo: string, + deploymentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, method: "GET", @@ -54867,7 +57174,11 @@ export class Api extends HttpClient + reposGetLatestPagesBuild: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, method: "GET", @@ -54883,7 +57194,11 @@ export class Api extends HttpClient + reposGetLatestRelease: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/latest\`, method: "GET", @@ -54915,7 +57230,12 @@ export class Api extends HttpClient + reposGetPagesBuild: ( + owner: string, + repo: string, + buildId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, method: "GET", @@ -54931,7 +57251,11 @@ export class Api extends HttpClient + reposGetParticipationStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -54947,7 +57271,12 @@ export class Api extends HttpClient + reposGetPullRequestReviewProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, method: "GET", @@ -54963,7 +57292,11 @@ export class Api extends HttpClient + reposGetPunchCardStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -54979,7 +57312,10 @@ export class Api extends HttpClient + reposGetReadme: ( + { owner, repo, ...query }: ReposGetReadmeParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/readme\`, method: "GET", @@ -54996,7 +57332,12 @@ export class Api extends HttpClient + reposGetRelease: ( + owner: string, + repo: string, + releaseId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "GET", @@ -55012,7 +57353,12 @@ export class Api extends HttpClient + reposGetReleaseAsset: ( + owner: string, + repo: string, + assetId: number, + params: RequestParams = {}, + ) => this.request< ReposGetReleaseAssetData, | BasicError @@ -55035,7 +57381,12 @@ export class Api extends HttpClient + reposGetReleaseByTag: ( + owner: string, + repo: string, + tag: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, method: "GET", @@ -55051,7 +57402,12 @@ export class Api extends HttpClient + reposGetStatusChecksProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, method: "GET", @@ -55088,7 +57444,11 @@ export class Api extends HttpClient + reposGetTopPaths: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, method: "GET", @@ -55104,7 +57464,11 @@ export class Api extends HttpClient + reposGetTopReferrers: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, method: "GET", @@ -55141,7 +57505,10 @@ export class Api extends HttpClient + reposGetViews: ( + { owner, repo, ...query }: ReposGetViewsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/traffic/views\`, method: "GET", @@ -55158,7 +57525,12 @@ export class Api extends HttpClient + reposGetWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -55174,7 +57546,12 @@ export class Api extends HttpClient + reposGetWebhookConfigForRepo: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, method: "GET", @@ -55190,7 +57567,10 @@ export class Api extends HttpClient + reposListBranches: ( + { owner, repo, ...query }: ReposListBranchesParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches\`, method: "GET", @@ -55207,7 +57587,12 @@ export class Api extends HttpClient + reposListBranchesForHeadCommit: ( + owner: string, + repo: string, + commitSha: string, + params: RequestParams = {}, + ) => this.request< ReposListBranchesForHeadCommitData, | { @@ -55230,7 +57615,10 @@ export class Api extends HttpClient + reposListCollaborators: ( + { owner, repo, ...query }: ReposListCollaboratorsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", @@ -55287,7 +57675,10 @@ export class Api extends HttpClient + reposListCommits: ( + { owner, repo, ...query }: ReposListCommitsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits\`, method: "GET", @@ -55324,7 +57715,10 @@ export class Api extends HttpClient + reposListContributors: ( + { owner, repo, ...query }: ReposListContributorsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contributors\`, method: "GET", @@ -55341,7 +57735,10 @@ export class Api extends HttpClient + reposListDeployKeys: ( + { owner, repo, ...query }: ReposListDeployKeysParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys\`, method: "GET", @@ -55358,7 +57755,10 @@ export class Api extends HttpClient + reposListDeployments: ( + { owner, repo, ...query }: ReposListDeploymentsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", @@ -55376,7 +57776,12 @@ export class Api extends HttpClient this.request({ @@ -55395,7 +57800,10 @@ export class Api extends HttpClient + reposListForks: ( + { owner, repo, ...query }: ReposListForksParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/forks\`, method: "GET", @@ -55412,7 +57820,10 @@ export class Api extends HttpClient + reposListInvitations: ( + { owner, repo, ...query }: ReposListInvitationsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/invitations\`, method: "GET", @@ -55429,7 +57840,11 @@ export class Api extends HttpClient + reposListLanguages: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/languages\`, method: "GET", @@ -55445,7 +57860,10 @@ export class Api extends HttpClient + reposListPagesBuilds: ( + { owner, repo, ...query }: ReposListPagesBuildsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pages/builds\`, method: "GET", @@ -55463,7 +57881,12 @@ export class Api extends HttpClient this.request< @@ -55508,7 +57931,10 @@ export class Api extends HttpClient + reposListReleases: ( + { owner, repo, ...query }: ReposListReleasesParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases\`, method: "GET", @@ -55525,7 +57951,10 @@ export class Api extends HttpClient + reposListTags: ( + { owner, repo, ...query }: ReposListTagsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/tags\`, method: "GET", @@ -55542,7 +57971,10 @@ export class Api extends HttpClient + reposListTeams: ( + { owner, repo, ...query }: ReposListTeamsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/teams\`, method: "GET", @@ -55559,7 +57991,10 @@ export class Api extends HttpClient + reposListWebhooks: ( + { owner, repo, ...query }: ReposListWebhooksParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks\`, method: "GET", @@ -55576,7 +58011,12 @@ export class Api extends HttpClient + reposMerge: ( + owner: string, + repo: string, + data: ReposMergePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/merges\`, method: "POST", @@ -55594,7 +58034,12 @@ export class Api extends HttpClient + reposPingWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, method: "POST", @@ -55633,7 +58078,12 @@ export class Api extends HttpClient + reposRemoveCollaborator: ( + owner: string, + repo: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, method: "DELETE", @@ -55655,7 +58105,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ReposRemoveStatusCheckContextsData, + BasicError | ValidationError + >({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, method: "DELETE", body: data, @@ -55672,7 +58125,12 @@ export class Api extends HttpClient + reposRemoveStatusCheckProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, method: "DELETE", @@ -55790,7 +58248,11 @@ export class Api extends HttpClient + reposRequestPagesBuild: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pages/builds\`, method: "POST", @@ -55806,7 +58268,12 @@ export class Api extends HttpClient + reposSetAdminBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, method: "POST", @@ -55853,7 +58320,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ReposSetStatusCheckContextsData, + BasicError | ValidationError + >({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, method: "PUT", body: data, @@ -55918,7 +58388,12 @@ export class Api extends HttpClient + reposTestPushWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -55933,7 +58408,12 @@ export class Api extends HttpClient + reposTransfer: ( + owner: string, + repo: string, + data: ReposTransferPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/transfer\`, method: "POST", @@ -55951,7 +58431,12 @@ export class Api extends HttpClient + reposUpdate: ( + owner: string, + repo: string, + data: ReposUpdatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}\`, method: "PATCH", @@ -56031,7 +58516,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ReposUpdateInformationAboutPagesSiteData, + BasicError | ValidationError + >({ path: \`/repos/\${owner}/\${repo}/pages\`, method: "PUT", body: data, @@ -56078,14 +58566,16 @@ export class Api extends HttpClient - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + this.request( + { + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }, + ), /** * @description Users with push access to the repository can edit a release. @@ -56150,7 +58640,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ReposUpdateStatusCheckProtectionData, + BasicError | ValidationError + >({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, method: "PATCH", body: data, @@ -56237,7 +58730,12 @@ export class Api extends HttpClient + secretScanningGetAlert: ( + owner: string, + repo: string, + alertNumber: AlertNumber, + params: RequestParams = {}, + ) => this.request< SecretScanningGetAlertData, void | { @@ -56319,7 +58817,10 @@ export class Api extends HttpClient + reposListPublic: ( + query: ReposListPublicParams, + params: RequestParams = {}, + ) => this.request({ path: \`/repositories\`, method: "GET", @@ -56356,7 +58857,11 @@ export class Api extends HttpClient + enterpriseAdminDeleteUserFromEnterprise: ( + enterprise: string, + scimUserId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "DELETE", @@ -56376,7 +58881,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData, + any + >({ path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, method: "GET", format: "json", @@ -56396,7 +58904,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminGetProvisioningInformationForEnterpriseUserData, + any + >({ path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "GET", format: "json", @@ -56412,7 +58923,10 @@ export class Api extends HttpClient this.request({ @@ -56432,16 +58946,21 @@ export class Api extends HttpClient - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + this.request( + { + path: \`/scim/v2/enterprises/\${enterprise}/Users\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), /** * @description **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. @@ -56501,7 +59020,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData, + any + >({ path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, method: "PUT", body: data, @@ -56524,7 +59046,10 @@ export class Api extends HttpClient - this.request({ + this.request< + EnterpriseAdminSetInformationForProvisionedEnterpriseUserData, + any + >({ path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "PUT", body: data, @@ -56587,7 +59112,11 @@ export class Api extends HttpClient + scimDeleteUserFromOrg: ( + org: string, + scimUserId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "DELETE", @@ -56602,7 +59131,11 @@ export class Api extends HttpClient + scimGetProvisioningInformationForUser: ( + org: string, + scimUserId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "GET", @@ -56638,7 +59171,11 @@ export class Api extends HttpClient + scimProvisionAndInviteUser: ( + org: string, + data: ScimProvisionAndInviteUserPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/scim/v2/organizations/\${org}/Users\`, method: "POST", @@ -56685,7 +59222,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ScimUpdateAttributeForUserData, + ScimUpdateAttributeForUserError + >({ path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "PATCH", body: data, @@ -56752,7 +59292,10 @@ export class Api extends HttpClient + searchIssuesAndPullRequests: ( + query: SearchIssuesAndPullRequestsParams, + params: RequestParams = {}, + ) => this.request< SearchIssuesAndPullRequestsData, | BasicError @@ -56920,7 +59463,12 @@ export class Api extends HttpClient this.request({ @@ -56941,7 +59489,11 @@ export class Api extends HttpClient this.request({ @@ -56961,7 +59513,11 @@ export class Api extends HttpClient + teamsAddMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "PUT", @@ -56983,7 +59539,10 @@ export class Api extends HttpClient - this.request({ + this.request< + TeamsAddOrUpdateMembershipForUserLegacyData, + TeamsAddOrUpdateMembershipForUserLegacyError + >({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "PUT", body: data, @@ -57007,7 +59566,10 @@ export class Api extends HttpClient - this.request({ + this.request< + TeamsAddOrUpdateProjectPermissionsLegacyData, + TeamsAddOrUpdateProjectPermissionsLegacyError + >({ path: \`/teams/\${teamId}/projects/\${projectId}\`, method: "PUT", body: data, @@ -57031,7 +59593,10 @@ export class Api extends HttpClient - this.request({ + this.request< + TeamsAddOrUpdateRepoPermissionsLegacyData, + BasicError | ValidationError + >({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", body: data, @@ -57048,7 +59613,11 @@ export class Api extends HttpClient + teamsCheckPermissionsForProjectLegacy: ( + teamId: number, + projectId: number, + params: RequestParams = {}, + ) => this.request< TeamsCheckPermissionsForProjectLegacyData, void | { @@ -57071,7 +59640,12 @@ export class Api extends HttpClient + teamsCheckPermissionsForRepoLegacy: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -57140,7 +59714,10 @@ export class Api extends HttpClient - this.request({ + this.request< + TeamsCreateOrUpdateIdpGroupConnectionsLegacyData, + BasicError | ValidationError + >({ path: \`/teams/\${teamId}/team-sync/group-mappings\`, method: "PATCH", body: data, @@ -57179,7 +59756,11 @@ export class Api extends HttpClient + teamsDeleteDiscussionLegacy: ( + teamId: number, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, method: "DELETE", @@ -57233,7 +59814,11 @@ export class Api extends HttpClient + teamsGetDiscussionLegacy: ( + teamId: number, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, method: "GET", @@ -57267,7 +59852,11 @@ export class Api extends HttpClient + teamsGetMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -57283,7 +59872,11 @@ export class Api extends HttpClient + teamsGetMembershipForUserLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -57300,7 +59893,10 @@ export class Api extends HttpClient + teamsListChildLegacy: ( + { teamId, ...query }: TeamsListChildLegacyParams, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/teams\`, method: "GET", @@ -57319,7 +59915,11 @@ export class Api extends HttpClient this.request({ @@ -57339,7 +59939,10 @@ export class Api extends HttpClient + teamsListDiscussionsLegacy: ( + { teamId, ...query }: TeamsListDiscussionsLegacyParams, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/discussions\`, method: "GET", @@ -57374,7 +59977,10 @@ export class Api extends HttpClient + teamsListMembersLegacy: ( + { teamId, ...query }: TeamsListMembersLegacyParams, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members\`, method: "GET", @@ -57413,7 +60019,10 @@ export class Api extends HttpClient + teamsListProjectsLegacy: ( + { teamId, ...query }: TeamsListProjectsLegacyParams, + params: RequestParams = {}, + ) => this.request< TeamsListProjectsLegacyData, | BasicError @@ -57438,7 +60047,10 @@ export class Api extends HttpClient + teamsListReposLegacy: ( + { teamId, ...query }: TeamsListReposLegacyParams, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos\`, method: "GET", @@ -57456,7 +60068,11 @@ export class Api extends HttpClient + teamsRemoveMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -57472,7 +60088,11 @@ export class Api extends HttpClient + teamsRemoveMembershipForUserLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -57488,7 +60108,11 @@ export class Api extends HttpClient + teamsRemoveProjectLegacy: ( + teamId: number, + projectId: number, + params: RequestParams = {}, + ) => this.request< TeamsRemoveProjectLegacyData, | BasicError @@ -57512,7 +60136,12 @@ export class Api extends HttpClient + teamsRemoveRepoLegacy: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -57577,7 +60206,11 @@ export class Api extends HttpClient + teamsUpdateLegacy: ( + teamId: number, + data: TeamsUpdateLegacyPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}\`, method: "PATCH", @@ -57596,7 +60229,11 @@ export class Api extends HttpClient + activityCheckRepoIsStarredByAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request< ActivityCheckRepoIsStarredByAuthenticatedUserData, ActivityCheckRepoIsStarredByAuthenticatedUserError @@ -57618,13 +60255,15 @@ export class Api extends HttpClient - this.request({ - path: \`/user/starred\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + this.request( + { + path: \`/user/starred\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), /** * @description Lists repositories the authenticated user is watching. @@ -57638,7 +60277,10 @@ export class Api extends HttpClient - this.request({ + this.request< + ActivityListWatchedReposForAuthenticatedUserData, + BasicError + >({ path: \`/user/subscriptions\`, method: "GET", query: query, @@ -57654,7 +60296,11 @@ export class Api extends HttpClient + activityStarRepoForAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/starred/\${owner}/\${repo}\`, method: "PUT", @@ -57669,7 +60315,11 @@ export class Api extends HttpClient + activityUnstarRepoForAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/starred/\${owner}/\${repo}\`, method: "DELETE", @@ -57684,7 +60334,11 @@ export class Api extends HttpClient + appsAddRepoToInstallation: ( + installationId: number, + repositoryId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, method: "PUT", @@ -57700,10 +60354,16 @@ export class Api extends HttpClient - this.request({ + this.request< + AppsListInstallationReposForAuthenticatedUserData, + BasicError + >({ path: \`/user/installations/\${installationId}/repositories\`, method: "GET", query: query, @@ -57770,7 +60430,10 @@ export class Api extends HttpClient - this.request({ + this.request< + AppsListSubscriptionsForAuthenticatedUserStubbedData, + BasicError + >({ path: \`/user/marketplace_purchases/stubbed\`, method: "GET", query: query, @@ -57786,7 +60449,11 @@ export class Api extends HttpClient + appsRemoveRepoFromInstallation: ( + installationId: number, + repositoryId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, method: "DELETE", @@ -57801,7 +60468,9 @@ export class Api extends HttpClient + interactionsGetRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => this.request({ path: \`/user/interaction-limits\`, method: "GET", @@ -57817,12 +60486,16 @@ export class Api extends HttpClient - this.request({ - path: \`/user/interaction-limits\`, - method: "DELETE", - ...params, - }), + interactionsRemoveRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => + this.request( + { + path: \`/user/interaction-limits\`, + method: "DELETE", + ...params, + }, + ), /** * @description 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. @@ -57832,8 +60505,14 @@ export class Api extends HttpClient - this.request({ + interactionsSetRestrictionsForAuthenticatedUser: ( + data: InteractionLimit, + params: RequestParams = {}, + ) => + this.request< + InteractionsSetRestrictionsForAuthenticatedUserData, + ValidationError + >({ path: \`/user/interaction-limits\`, method: "PUT", body: data, @@ -57850,7 +60529,10 @@ export class Api extends HttpClient + issuesListForAuthenticatedUser: ( + query: IssuesListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/user/issues\`, method: "GET", @@ -57867,12 +60549,17 @@ export class Api extends HttpClient - this.request({ - path: \`/user/migrations/\${migrationId}/archive\`, - method: "DELETE", - ...params, - }), + migrationsDeleteArchiveForAuthenticatedUser: ( + migrationId: number, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/user/migrations/\${migrationId}/archive\`, + method: "DELETE", + ...params, + }, + ), /** * @description 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. @@ -57882,7 +60569,10 @@ export class Api extends HttpClient + migrationsGetArchiveForAuthenticatedUser: ( + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/migrations/\${migrationId}/archive\`, method: "GET", @@ -57917,7 +60607,10 @@ export class Api extends HttpClient + migrationsListForAuthenticatedUser: ( + query: MigrationsListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/user/migrations\`, method: "GET", @@ -57958,7 +60651,10 @@ export class Api extends HttpClient - this.request({ + this.request< + MigrationsStartForAuthenticatedUserData, + BasicError | ValidationError + >({ path: \`/user/migrations\`, method: "POST", body: data, @@ -57975,7 +60671,11 @@ export class Api extends HttpClient + migrationsUnlockRepoForAuthenticatedUser: ( + migrationId: number, + repoName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, method: "DELETE", @@ -57990,7 +60690,10 @@ export class Api extends HttpClient + orgsGetMembershipForAuthenticatedUser: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/memberships/orgs/\${org}\`, method: "GET", @@ -58006,7 +60709,10 @@ export class Api extends HttpClient + orgsListForAuthenticatedUser: ( + query: OrgsListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/user/orgs\`, method: "GET", @@ -58027,7 +60733,10 @@ export class Api extends HttpClient - this.request({ + this.request< + OrgsListMembershipsForAuthenticatedUserData, + BasicError | ValidationError + >({ path: \`/user/memberships/orgs\`, method: "GET", query: query, @@ -58048,7 +60757,10 @@ export class Api extends HttpClient - this.request({ + this.request< + OrgsUpdateMembershipForAuthenticatedUserData, + BasicError | ValidationError + >({ path: \`/user/memberships/orgs/\${org}\`, method: "PATCH", body: data, @@ -58065,7 +60777,10 @@ export class Api extends HttpClient + projectsCreateForAuthenticatedUser: ( + data: ProjectsCreateForAuthenticatedUserPayload, + params: RequestParams = {}, + ) => this.request< ProjectsCreateForAuthenticatedUserData, | BasicError @@ -58106,8 +60821,14 @@ export class Api extends HttpClient - this.request({ + reposCreateForAuthenticatedUser: ( + data: ReposCreateForAuthenticatedUserPayload, + params: RequestParams = {}, + ) => + this.request< + ReposCreateForAuthenticatedUserData, + BasicError | ValidationError + >({ path: \`/user/repos\`, method: "POST", body: data, @@ -58124,7 +60845,10 @@ export class Api extends HttpClient + reposDeclineInvitation: ( + invitationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/repository_invitations/\${invitationId}\`, method: "DELETE", @@ -58139,8 +60863,14 @@ export class Api extends HttpClient - this.request({ + reposListForAuthenticatedUser: ( + query: ReposListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + ReposListForAuthenticatedUserData, + BasicError | ValidationError + >({ path: \`/user/repos\`, method: "GET", query: query, @@ -58176,7 +60906,10 @@ export class Api extends HttpClient + teamsListForAuthenticatedUser: ( + query: TeamsListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/user/teams\`, method: "GET", @@ -58193,8 +60926,14 @@ export class Api extends HttpClient - this.request({ + usersAddEmailForAuthenticated: ( + data: UsersAddEmailForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersAddEmailForAuthenticatedData, + BasicError | ValidationError + >({ path: \`/user/emails\`, method: "POST", body: data, @@ -58241,8 +60980,14 @@ export class Api extends HttpClient - this.request({ + usersCheckPersonIsFollowedByAuthenticated: ( + username: string, + params: RequestParams = {}, + ) => + this.request< + UsersCheckPersonIsFollowedByAuthenticatedData, + UsersCheckPersonIsFollowedByAuthenticatedError + >({ path: \`/user/following/\${username}\`, method: "GET", ...params, @@ -58256,8 +61001,14 @@ export class Api extends HttpClient - this.request({ + usersCreateGpgKeyForAuthenticated: ( + data: UsersCreateGpgKeyForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersCreateGpgKeyForAuthenticatedData, + BasicError | ValidationError + >({ path: \`/user/gpg_keys\`, method: "POST", body: data, @@ -58278,7 +61029,10 @@ export class Api extends HttpClient - this.request({ + this.request< + UsersCreatePublicSshKeyForAuthenticatedData, + BasicError | ValidationError + >({ path: \`/user/keys\`, method: "POST", body: data, @@ -58295,8 +61049,14 @@ export class Api extends HttpClient - this.request({ + usersDeleteEmailForAuthenticated: ( + data: UsersDeleteEmailForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersDeleteEmailForAuthenticatedData, + BasicError | ValidationError + >({ path: \`/user/emails\`, method: "DELETE", body: data, @@ -58312,8 +61072,14 @@ export class Api extends HttpClient - this.request({ + usersDeleteGpgKeyForAuthenticated: ( + gpgKeyId: number, + params: RequestParams = {}, + ) => + this.request< + UsersDeleteGpgKeyForAuthenticatedData, + BasicError | ValidationError + >({ path: \`/user/gpg_keys/\${gpgKeyId}\`, method: "DELETE", ...params, @@ -58327,7 +61093,10 @@ export class Api extends HttpClient + usersDeletePublicSshKeyForAuthenticated: ( + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/keys/\${keyId}\`, method: "DELETE", @@ -58373,7 +61142,10 @@ export class Api extends HttpClient + usersGetGpgKeyForAuthenticated: ( + gpgKeyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/gpg_keys/\${gpgKeyId}\`, method: "GET", @@ -58389,7 +61161,10 @@ export class Api extends HttpClient + usersGetPublicSshKeyForAuthenticated: ( + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/keys/\${keyId}\`, method: "GET", @@ -58428,7 +61203,10 @@ export class Api extends HttpClient + usersListEmailsForAuthenticated: ( + query: UsersListEmailsForAuthenticatedParams, + params: RequestParams = {}, + ) => this.request({ path: \`/user/emails\`, method: "GET", @@ -58445,7 +61223,10 @@ export class Api extends HttpClient + usersListFollowedByAuthenticated: ( + query: UsersListFollowedByAuthenticatedParams, + params: RequestParams = {}, + ) => this.request({ path: \`/user/following\`, method: "GET", @@ -58482,7 +61263,10 @@ export class Api extends HttpClient + usersListGpgKeysForAuthenticated: ( + query: UsersListGpgKeysForAuthenticatedParams, + params: RequestParams = {}, + ) => this.request({ path: \`/user/gpg_keys\`, method: "GET", @@ -58543,7 +61327,10 @@ export class Api extends HttpClient - this.request({ + this.request< + UsersSetPrimaryEmailVisibilityForAuthenticatedData, + BasicError | ValidationError + >({ path: \`/user/email/visibility\`, method: "PATCH", body: data, @@ -58590,7 +61377,10 @@ export class Api extends HttpClient + usersUpdateAuthenticated: ( + data: UsersUpdateAuthenticatedPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/user\`, method: "PATCH", @@ -58630,7 +61420,11 @@ export class Api extends HttpClient this.request({ @@ -58765,7 +61559,10 @@ export class Api extends HttpClient + billingGetGithubActionsBillingUser: ( + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/settings/billing/actions\`, method: "GET", @@ -58781,7 +61578,10 @@ export class Api extends HttpClient + billingGetGithubPackagesBillingUser: ( + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/settings/billing/packages\`, method: "GET", @@ -58797,7 +61597,10 @@ export class Api extends HttpClient + billingGetSharedStorageBillingUser: ( + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/settings/billing/shared-storage\`, method: "GET", @@ -58813,7 +61616,10 @@ export class Api extends HttpClient + gistsListForUser: ( + { username, ...query }: GistsListForUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/gists\`, method: "GET", @@ -58830,7 +61636,10 @@ export class Api extends HttpClient + orgsListForUser: ( + { username, ...query }: OrgsListForUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/orgs\`, method: "GET", @@ -58847,7 +61656,10 @@ export class Api extends HttpClient + projectsListForUser: ( + { username, ...query }: ProjectsListForUserParams, + params: RequestParams = {}, + ) => this.request< ProjectsListForUserData, | { @@ -58871,7 +61683,10 @@ export class Api extends HttpClient + reposListForUser: ( + { username, ...query }: ReposListForUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/repos\`, method: "GET", @@ -58888,7 +61703,11 @@ export class Api extends HttpClient + usersCheckFollowingForUser: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", @@ -58919,7 +61738,10 @@ export class Api extends HttpClient + usersGetContextForUser: ( + { username, ...query }: UsersGetContextForUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/hovercard\`, method: "GET", @@ -58953,7 +61775,10 @@ export class Api extends HttpClient + usersListFollowersForUser: ( + { username, ...query }: UsersListFollowersForUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/followers\`, method: "GET", @@ -58970,7 +61795,10 @@ export class Api extends HttpClient + usersListFollowingForUser: ( + { username, ...query }: UsersListFollowingForUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following\`, method: "GET", @@ -58987,7 +61815,10 @@ export class Api extends HttpClient + usersListGpgKeysForUser: ( + { username, ...query }: UsersListGpgKeysForUserParams, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/gpg_keys\`, method: "GET", @@ -59190,16 +62021,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -59218,7 +62055,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -59251,9 +62089,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -59264,8 +62108,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -59282,7 +62131,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -59295,7 +62147,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -59339,15 +62193,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -59389,7 +62254,9 @@ export class HttpClient { * Using Furkot API an application can list user trips and display stops for a specific trip. * Furkot API uses OAuth2 protocol to authorize applications to access data on behalf of users. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { trip = { /** * @description list stops for a trip identified by {trip_id} @@ -60171,16 +63038,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -60199,7 +63072,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -60232,9 +63106,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -60245,8 +63125,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -60263,7 +63148,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -60276,7 +63164,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -60320,15 +63210,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -60369,7 +63270,9 @@ export class HttpClient { * * Giphy API */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { gifs = { /** * @description Returns a GIF given that GIF's unique ID @@ -60532,7 +63435,10 @@ export class Api extends HttpClient + translateSticker: ( + query: TranslateStickerParams, + params: RequestParams = {}, + ) => this.request({ path: \`/stickers/translate\`, method: "GET", @@ -60551,7 +63457,10 @@ export class Api extends HttpClient + trendingStickers: ( + query: TrendingStickersParams, + params: RequestParams = {}, + ) => this.request({ path: \`/stickers/trending\`, method: "GET", @@ -60747,16 +63656,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -60775,7 +63690,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -60808,9 +63724,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -60821,8 +63743,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -60839,7 +63766,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -60852,7 +63782,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -60896,15 +63828,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -60939,7 +63882,9 @@ export class HttpClient { * @title Link Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { v20 = { /** * No description @@ -60947,7 +63892,12 @@ export class Api extends HttpClient + getPullRequestsById: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, method: "GET", @@ -60993,7 +63943,11 @@ export class Api extends HttpClient + getRepository: ( + username: string, + slug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}\`, method: "GET", @@ -61021,7 +63975,12 @@ export class Api extends HttpClient + mergePullRequest: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, method: "POST", @@ -61081,16 +64040,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -61109,7 +64074,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -61142,9 +64108,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -61155,8 +64127,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -61173,7 +64150,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -61186,7 +64166,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -61230,15 +64212,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -61273,7 +64266,9 @@ export class HttpClient { * @title Empty schema example * @version 1.0.0 */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -61348,16 +64343,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -61376,7 +64377,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -61409,9 +64411,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -61422,8 +64430,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -61440,7 +64453,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -61453,7 +64469,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -61497,15 +64515,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -61540,7 +64569,9 @@ export class HttpClient { * @title Oneof Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -61548,7 +64579,10 @@ export class Api extends HttpClient + petsPartialUpdate: ( + data: PetsPartialUpdatePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pets\`, method: "PATCH", @@ -61660,16 +64694,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -61688,7 +64728,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -61721,9 +64762,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -61734,8 +64781,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -61752,7 +64804,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -61765,7 +64820,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -61809,15 +64866,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -61854,7 +64922,9 @@ export class HttpClient { * @license MIT * @baseUrl http://unknown.io/v666 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -61864,7 +64934,10 @@ export class Api extends HttpClient + listPets: ( + { param1, param2, param3, ...query }: ListPetsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/pets/\${param1}/\${param2}/\${param3}\`, method: "GET", @@ -62304,16 +65377,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -62332,7 +65411,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -62365,9 +65445,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -62378,8 +65464,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -62396,7 +65487,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -62409,7 +65503,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -62453,15 +65549,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -62496,7 +65603,9 @@ export class HttpClient { * @title No title * @baseUrl http://localhost:8080/api/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { auth = { /** * No description @@ -62611,7 +65720,11 @@ export class Api extends HttpClient + updateJob: ( + id: string, + params: JobUpdateType, + requestParams: RequestParams = {}, + ) => this.request({ path: \`/jobs/\${id}\`, method: "PATCH", @@ -62680,7 +65793,11 @@ export class Api extends HttpClient + updateProject: ( + id: string, + data: ProjectUpdateType, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/\${id}\`, method: "PATCH", @@ -62823,16 +65940,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -62851,7 +65974,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -62884,9 +66008,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -62897,8 +66027,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -62915,7 +66050,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -62928,7 +66066,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -62972,15 +66112,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -63017,7 +66168,9 @@ export class HttpClient { * @license MIT * @baseUrl http://petstore.swagger.io/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -63197,16 +66350,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -63225,7 +66384,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -63258,9 +66418,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -63271,8 +66437,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -63289,7 +66460,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -63302,7 +66476,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -63346,15 +66522,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -63391,7 +66578,9 @@ export class HttpClient { * @license MIT * @baseUrl http://petstore.swagger.io/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -63596,16 +66785,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -63624,7 +66819,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -63657,9 +66853,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -63670,8 +66872,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -63688,7 +66895,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -63701,7 +66911,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -63745,15 +66957,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -63794,7 +67017,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Creates a new pet in the store. Duplicates are allowed @@ -64049,16 +67274,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -64077,7 +67308,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -64110,9 +67342,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -64123,8 +67361,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -64141,7 +67384,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -64154,7 +67400,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -64198,15 +67446,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -64247,7 +67506,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pathParams = { /** * No description @@ -64255,7 +67516,11 @@ export class Api extends HttpClient + pathParamFooBarBazList: ( + pathParam: string, + fooBarBaz: string, + params: RequestParams = {}, + ) => this.request({ path: \`/path-params/\${pathParam}/\${fooBarBaz}\`, method: "GET", @@ -64385,16 +67650,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -64413,7 +67684,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -64446,9 +67718,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -64459,8 +67737,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -64477,7 +67760,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -64490,7 +67776,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -64534,15 +67822,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -64583,7 +67882,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Returns all pets from the system that the user has access to @@ -64762,16 +68063,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -64790,7 +68097,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -64823,9 +68131,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -64836,8 +68150,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -64854,7 +68173,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -64867,7 +68189,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -64911,15 +68235,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -64960,7 +68295,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Creates a new pet in the store. Duplicates are allowed @@ -65578,16 +68915,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -65606,7 +68949,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -65639,9 +68983,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -65652,8 +69002,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -65670,7 +69025,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -65683,7 +69041,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -65727,15 +69087,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -65777,7 +69148,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description @@ -65824,7 +69197,10 @@ export class Api extends HttpClient + findPetsByStatus: ( + query: FindPetsByStatusParams, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/findByStatus\`, method: "GET", @@ -65900,7 +69276,11 @@ export class Api extends HttpClient + updatePetWithForm: ( + petId: number, + data: UpdatePetWithFormPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/\${petId}\`, method: "POST", @@ -65919,7 +69299,11 @@ export class Api extends HttpClient + uploadFile: ( + petId: number, + data: UploadFilePayload, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/\${petId}/uploadImage\`, method: "POST", @@ -66024,7 +69408,10 @@ export class Api extends HttpClient + createUsersWithArrayInput: ( + body: CreateUsersWithArrayInputPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/user/createWithArray\`, method: "POST", @@ -66041,7 +69428,10 @@ export class Api extends HttpClient + createUsersWithListInput: ( + body: CreateUsersWithListInputPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/user/createWithList\`, method: "POST", @@ -66285,16 +69675,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -66313,7 +69709,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -66346,9 +69743,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -66359,8 +69762,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -66377,7 +69785,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -66390,7 +69801,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -66434,15 +69847,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -66484,7 +69908,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Creates a new pet in the store. Duplicates are allowed @@ -66627,16 +70053,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -66655,7 +70087,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -66688,9 +70121,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -66701,8 +70140,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -66719,7 +70163,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -66732,7 +70179,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -66776,15 +70225,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -66821,7 +70281,9 @@ export class HttpClient { * @license MIT * @baseUrl http://unknown.io/v666 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { foobarbaz = { /** * No description @@ -66831,7 +70293,10 @@ export class Api extends HttpClient + listPets: ( + { query, ...queryParams }: ListPetsParams, + params: RequestParams = {}, + ) => this.request({ path: \`/foobarbaz/\${query}\`, method: "GET", @@ -66890,16 +70355,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -66918,7 +70389,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -66951,9 +70423,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -66964,8 +70442,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -66982,7 +70465,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -66995,7 +70481,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -67039,15 +70527,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -67081,7 +70580,9 @@ export class HttpClient { /** * @title No title */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -67139,16 +70640,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -67167,7 +70674,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -67200,9 +70708,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -67213,8 +70727,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -67231,7 +70750,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -67244,7 +70766,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -67288,15 +70812,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -67333,7 +70868,9 @@ export class HttpClient { * * Description */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { api = { /** * No description @@ -67425,16 +70962,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -67449,11 +70992,13 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = "https://virtserver.swaggerhub.com/sdfsdfsffs/sdfff/1.0.0"; + public baseUrl: string = + "https://virtserver.swaggerhub.com/sdfsdfsffs/sdfff/1.0.0"; private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -67486,9 +71031,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -67499,8 +71050,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -67517,7 +71073,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -67530,7 +71089,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -67574,15 +71135,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -67620,7 +71192,9 @@ export class HttpClient { * * This is an example of using OAuth2 Application Flow in a specification to describe security to your API. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { example = { /** * @description This is an example operation to show how security is applied to the call. @@ -68097,16 +71671,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -68125,7 +71705,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -68158,9 +71739,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -68171,8 +71758,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -68189,7 +71781,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -68202,7 +71797,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -68246,15 +71843,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -68289,7 +71897,9 @@ export class HttpClient { * @title No title * @baseUrl http://localhost:8080/api/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { auth = { /** * No description @@ -68495,7 +72105,11 @@ export class Api extends HttpClient + updateProject: ( + id: string, + data: ProjectUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/\${id}\`, method: "PATCH", @@ -68931,16 +72545,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -68959,7 +72579,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -68992,9 +72613,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -69005,8 +72632,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -69023,7 +72655,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -69036,7 +72671,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -69080,15 +72717,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -69126,7 +72774,9 @@ export class HttpClient { * * Move your app forward with the Uber API */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { products = { /** * @description The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order. @@ -70646,16 +74296,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -70674,7 +74330,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -70707,9 +74364,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -70720,8 +74383,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -70738,7 +74406,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -70751,7 +74422,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -70795,15 +74468,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -70845,7 +74529,9 @@ export class HttpClient { * webhooks to receive real-time events when new transactions hit your * account. It’s new, it’s exciting and it’s just the beginning. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { accounts = { /** * @description Retrieve a specific account by providing its unique identifier. @@ -70893,7 +74579,10 @@ export class Api extends HttpClient + transactionsList: ( + { accountId, ...query }: TransactionsListParams2, + params: RequestParams = {}, + ) => this.request({ path: \`/accounts/\${accountId}/transactions\`, method: "GET", @@ -70990,7 +74679,11 @@ export class Api extends HttpClient + relationshipsTagsCreate: ( + transactionId: string, + data: UpdateTransactionTagsRequest, + params: RequestParams = {}, + ) => this.request({ path: \`/transactions/\${transactionId}/relationships/tags\`, method: "POST", @@ -71009,7 +74702,11 @@ export class Api extends HttpClient + relationshipsTagsDelete: ( + transactionId: string, + data: UpdateTransactionTagsRequest, + params: RequestParams = {}, + ) => this.request({ path: \`/transactions/\${transactionId}/relationships/tags\`, method: "DELETE", @@ -71046,7 +74743,10 @@ export class Api extends HttpClient + transactionsList: ( + query: TransactionsListParams, + params: RequestParams = {}, + ) => this.request({ path: \`/transactions\`, method: "GET", @@ -71066,7 +74766,10 @@ export class Api extends HttpClient + logsList: ( + { webhookId, ...query }: LogsListParams, + params: RequestParams = {}, + ) => this.request({ path: \`/webhooks/\${webhookId}/logs\`, method: "GET", @@ -71319,16 +75022,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -71347,7 +75056,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -71380,9 +75090,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -71393,8 +75109,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -71411,7 +75132,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -71424,7 +75148,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -71468,15 +75194,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -71515,7 +75252,9 @@ export class HttpClient { * * The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * No description * @@ -71541,7 +75280,11 @@ export class Api extends HttpClient + listSearchableFields: ( + dataset: string, + version: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${dataset}/\${version}/fields\`, method: "GET", @@ -71557,7 +75300,12 @@ export class Api extends HttpClient + performSearch: ( + version: string, + dataset: string, + data: PerformSearchPayload, + params: RequestParams = {}, + ) => this.request({ path: \`/\${dataset}/\${version}/records\`, method: "POST", @@ -71616,16 +75364,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -71644,7 +75398,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -71677,9 +75432,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -71690,8 +75451,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -71708,7 +75474,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -71721,7 +75490,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -71765,15 +75536,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -71808,7 +75590,9 @@ export class HttpClient { * @title Test * @version test */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -72001,16 +75785,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -72029,7 +75819,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -72062,9 +75853,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -72075,8 +75872,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -72093,7 +75895,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -72106,7 +75911,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -72150,15 +75957,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -72193,7 +76011,9 @@ export class HttpClient { * @title Link Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { v20 = { /** * No description @@ -72201,7 +76021,12 @@ export class Api extends HttpClient + getPullRequestsById: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, method: "GET", @@ -72247,7 +76072,11 @@ export class Api extends HttpClient + getRepository: ( + username: string, + slug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}\`, method: "GET", @@ -72275,7 +76104,12 @@ export class Api extends HttpClient + mergePullRequest: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, method: "POST", diff --git a/tests/__snapshots__/simple.test.ts.snap b/tests/__snapshots__/simple.test.ts.snap index 4f43c666..5b8aa61a 100644 --- a/tests/__snapshots__/simple.test.ts.snap +++ b/tests/__snapshots__/simple.test.ts.snap @@ -192,16 +192,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -220,7 +226,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -253,9 +260,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -266,8 +279,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -284,7 +302,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -297,7 +318,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -341,15 +364,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -507,7 +541,9 @@ export class HttpClient { * We have client libraries to help you get started with your project: [Python](https://github.com/adafruit/io-client-python), [Ruby](https://github.com/adafruit/io-client-ruby), [Arduino C++](https://github.com/adafruit/Adafruit_IO_Arduino), [Javascript](https://github.com/adafruit/adafruit-io-node), and [Go](https://github.com/adafruit/io-client-go) are available. They're all open source, so if they don't already do what you want, you can fork and add any feature you'd like. * */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { user = { /** * No description @@ -719,7 +755,11 @@ export class Api extends HttpClient + allBlocks: ( + username: string, + dashboardId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${dashboardId}/blocks\`, method: "GET", @@ -777,7 +817,12 @@ export class Api extends HttpClient + destroyBlock: ( + username: string, + dashboardId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${dashboardId}/blocks/\${id}\`, method: "DELETE", @@ -795,7 +840,12 @@ export class Api extends HttpClient + getBlock: ( + username: string, + dashboardId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${dashboardId}/blocks/\${id}\`, method: "GET", @@ -895,7 +945,11 @@ export class Api extends HttpClient + destroyDashboard: ( + username: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/dashboards/\${id}\`, method: "DELETE", @@ -1040,7 +1094,11 @@ export class Api extends HttpClient + destroyFeed: ( + username: string, + feedKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}\`, method: "DELETE", @@ -1411,7 +1469,11 @@ export class Api extends HttpClient + retainData: ( + username: string, + feedKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/retain\`, method: "GET", @@ -1429,7 +1491,12 @@ export class Api extends HttpClient + destroyData: ( + username: string, + feedKey: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/data/\${id}\`, method: "DELETE", @@ -1543,7 +1610,11 @@ export class Api extends HttpClient + getFeedDetails: ( + username: string, + feedKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/feeds/\${feedKey}/details\`, method: "GET", @@ -1607,7 +1678,11 @@ export class Api extends HttpClient + destroyGroup: ( + username: string, + groupKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}\`, method: "DELETE", @@ -1625,7 +1700,11 @@ export class Api extends HttpClient + getGroup: ( + username: string, + groupKey: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}\`, method: "GET", @@ -1766,7 +1845,11 @@ export class Api extends HttpClient + allGroupFeeds: ( + groupKey: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/groups/\${groupKey}/feeds\`, method: "GET", @@ -2150,7 +2233,11 @@ export class Api extends HttpClient + destroyTrigger: ( + username: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/triggers/\${id}\`, method: "DELETE", @@ -2240,7 +2327,12 @@ export class Api extends HttpClient + allPermissions: ( + username: string, + type: string, + typeId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/\${type}/\${typeId}/acl\`, method: "GET", @@ -2290,7 +2382,13 @@ export class Api extends HttpClient + destroyPermission: ( + username: string, + type: string, + typeId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/\${type}/\${typeId}/acl/\${id}\`, method: "DELETE", @@ -2308,7 +2406,13 @@ export class Api extends HttpClient + getPermission: ( + username: string, + type: string, + typeId: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${username}/\${type}/\${typeId}/acl/\${id}\`, method: "GET", @@ -2429,16 +2533,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -2457,7 +2567,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -2490,9 +2601,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -2503,8 +2620,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -2521,7 +2643,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -2534,7 +2659,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -2578,15 +2705,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -2621,7 +2759,9 @@ export class HttpClient { * @title Additional properties Example * @version 1.0.0 */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -2664,16 +2804,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -2692,7 +2838,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -2725,9 +2872,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -2738,8 +2891,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -2756,7 +2914,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -2769,7 +2930,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -2813,15 +2976,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -2855,7 +3029,9 @@ export class HttpClient { /** * @title No title */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -2908,16 +3084,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -2936,7 +3118,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -2969,9 +3152,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -2982,8 +3171,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -3000,7 +3194,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -3013,7 +3210,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -3057,15 +3256,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -3100,7 +3310,9 @@ export class HttpClient { * @title Allof Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -3289,16 +3501,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -3317,7 +3535,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -3350,9 +3569,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -3363,8 +3588,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -3381,7 +3611,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -3394,7 +3627,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -3438,15 +3673,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -3488,7 +3734,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description @@ -4013,16 +4261,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -4041,7 +4295,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -4074,9 +4329,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -4087,8 +4348,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -4105,7 +4371,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -4118,7 +4387,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -4162,15 +4433,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -4204,7 +4486,9 @@ export class HttpClient { /** * @title No title */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { api = { /** * No description @@ -4308,16 +4592,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -4336,7 +4626,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -4369,9 +4660,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -4382,8 +4679,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -4400,7 +4702,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -4413,7 +4718,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -4457,15 +4764,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -4500,7 +4818,9 @@ export class HttpClient { * @title Anyof Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -4508,7 +4828,10 @@ export class Api extends HttpClient + petsPartialUpdate: ( + data: PetByAge | PetByType, + params: RequestParams = {}, + ) => this.request({ path: \`/pets\`, method: "PATCH", @@ -4556,16 +4879,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -4584,7 +4913,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -4617,9 +4947,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -4630,8 +4966,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -4648,7 +4989,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -4661,7 +5005,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -4705,15 +5051,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -4748,7 +5105,9 @@ export class HttpClient { * @title Simple API overview * @version 2.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * No description * @@ -4819,16 +5178,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -4847,7 +5212,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -4880,9 +5246,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -4893,8 +5265,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -4911,7 +5288,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -4924,7 +5304,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -4968,15 +5350,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -5011,7 +5404,9 @@ export class HttpClient { * @title Simple API overview * @version v2 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * @description multiple line 1 multiple line 2 multiple line 3 * @@ -5156,16 +5551,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -5184,7 +5585,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -5217,9 +5619,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -5230,8 +5638,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -5248,7 +5661,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -5261,7 +5677,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -5305,15 +5723,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -5354,7 +5783,9 @@ export class HttpClient { * * Strong authentication, without the passwords. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { wrongPathParams1 = { /** * @description DDD @@ -5764,16 +6195,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -5792,7 +6229,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -5825,9 +6263,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -5838,8 +6282,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -5856,7 +6305,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -5869,7 +6321,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -5913,15 +6367,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -5956,7 +6421,9 @@ export class HttpClient { * @title Callback Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { streams = { /** * @description subscribes a client to receive out-of-band data @@ -6032,16 +6499,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -6060,7 +6533,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -6093,9 +6567,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -6106,8 +6586,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -6124,7 +6609,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -6137,7 +6625,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -6181,15 +6671,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -6226,7 +6727,9 @@ export class HttpClient { * * Description */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { api = { /** * No description @@ -6344,16 +6847,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -6372,7 +6881,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -6405,9 +6915,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -6418,8 +6934,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -6436,7 +6957,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -6449,7 +6973,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -6493,15 +7019,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -6536,7 +7073,9 @@ export class HttpClient { * @title No title * @baseUrl https://ffff.com */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -6612,16 +7151,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -6640,7 +7185,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -6673,9 +7219,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -6686,8 +7238,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -6704,7 +7261,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -6717,7 +7277,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -6761,15 +7323,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -6807,7 +7380,9 @@ export class HttpClient { * * The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { subscriptions = { /** * @description Creates a TDE certificate for a given server. @@ -6894,16 +7469,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -6922,7 +7503,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -6955,9 +7537,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -6968,8 +7556,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -6986,7 +7579,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -6999,7 +7595,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -7043,15 +7641,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -7088,7 +7697,9 @@ export class HttpClient { * * Documentation */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { user = { /** * No description @@ -7174,16 +7785,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -7202,7 +7819,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -7235,9 +7853,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -7248,8 +7872,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -7266,7 +7895,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -7279,7 +7911,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -7323,15 +7957,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -7366,7 +8011,9 @@ export class HttpClient { * @title Title * @version v0.1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { uploadFile = { /** * No description @@ -8128,7 +8775,15 @@ export interface CheckRun { */ completed_at: string | null; /** @example "neutral" */ - conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null; + conclusion: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + | null; /** @example "https://example.com" */ details_url: string | null; /** @example "42" */ @@ -8187,7 +8842,15 @@ export interface CheckSuite { before: string | null; check_runs_url: string; /** @example "neutral" */ - conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null; + conclusion: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + | null; /** @format date-time */ created_at: string | null; /** @example "master" */ @@ -8386,7 +9049,11 @@ export interface CodeScanningAlertCodeScanningAlertItems { 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" | null; +export type CodeScanningAlertDismissedReason = + | "false positive" + | "won't fix" + | "used in tests" + | 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; @@ -9332,7 +9999,14 @@ export interface DeploymentStatus { * The state of the status. * @example "success" */ - state: "error" | "failure" | "inactive" | "pending" | "success" | "queued" | "in_progress"; + state: + | "error" + | "failure" + | "inactive" + | "pending" + | "success" + | "queued" + | "in_progress"; /** * Deprecated: the URL to associate with this status. * @format uri @@ -13563,7 +14237,15 @@ export interface Reaction { * The reaction to use * @example "heart" */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; /** * @format date-time * @example "2016-05-20T20:09:31Z" @@ -14715,7 +15397,12 @@ export interface SecretScanningAlert { } /** **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" | null; +export type SecretScanningAlertResolution = + | "false_positive" + | "wont_fix" + | "revoked" + | "used_in_tests" + | 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 enum SecretScanningAlertState { @@ -16059,16 +16746,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -16087,7 +16780,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -16120,9 +16814,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -16133,8 +16833,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -16151,7 +16856,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -16164,7 +16872,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -16208,15 +16918,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -16258,7 +16979,9 @@ export class HttpClient { * * GitHub's v3 REST API. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * @description Get Hypermedia links to resources accessible in GitHub's REST API * @@ -16473,7 +17196,10 @@ export class Api extends HttpClient + appsDeleteInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/app/installations/\${installationId}\`, method: "DELETE", @@ -16528,7 +17254,10 @@ export class Api extends HttpClient + appsSuspendInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/app/installations/\${installationId}/suspended\`, method: "PUT", @@ -16543,7 +17272,10 @@ export class Api extends HttpClient + appsUnsuspendInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/app/installations/\${installationId}/suspended\`, method: "DELETE", @@ -16618,7 +17350,10 @@ export class Api extends HttpClient + oauthAuthorizationsGetGrant: ( + grantId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/grants/\${grantId}\`, method: "GET", @@ -16635,7 +17370,10 @@ export class Api extends HttpClient + oauthAuthorizationsDeleteGrant: ( + grantId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/grants/\${grantId}\`, method: "DELETE", @@ -16675,7 +17413,11 @@ export class Api extends HttpClient + appsRevokeGrantForApplication: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/grants/\${accessToken}\`, method: "DELETE", @@ -16812,7 +17554,11 @@ export class Api extends HttpClient + appsCheckAuthorization: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "GET", @@ -16829,7 +17575,11 @@ export class Api extends HttpClient + appsResetAuthorization: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "POST", @@ -16846,7 +17596,11 @@ export class Api extends HttpClient + appsRevokeAuthorizationForApplication: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => this.request({ path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "DELETE", @@ -17051,7 +17805,10 @@ export class Api extends HttpClient + oauthAuthorizationsGetAuthorization: ( + authorizationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/authorizations/\${authorizationId}\`, method: "GET", @@ -17110,7 +17867,10 @@ export class Api extends HttpClient + oauthAuthorizationsDeleteAuthorization: ( + authorizationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/authorizations/\${authorizationId}\`, method: "DELETE", @@ -17233,7 +17993,10 @@ export class Api extends HttpClient + enterpriseAdminGetGithubActionsPermissionsEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/actions/permissions\`, method: "GET", @@ -17375,7 +18138,10 @@ export class Api extends HttpClient + enterpriseAdminGetAllowedActionsEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, method: "GET", @@ -17797,7 +18563,10 @@ export class Api extends HttpClient + enterpriseAdminListRunnerApplicationsForEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/actions/runners/downloads\`, method: "GET", @@ -17813,7 +18582,10 @@ export class Api extends HttpClient + enterpriseAdminCreateRegistrationTokenForEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/actions/runners/registration-token\`, method: "POST", @@ -17829,7 +18601,10 @@ export class Api extends HttpClient + enterpriseAdminCreateRemoveTokenForEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, method: "POST", @@ -17933,7 +18708,10 @@ export class Api extends HttpClient + billingGetGithubActionsBillingGhe: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/settings/billing/actions\`, method: "GET", @@ -17949,7 +18727,10 @@ export class Api extends HttpClient + billingGetGithubPackagesBillingGhe: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/settings/billing/packages\`, method: "GET", @@ -17965,7 +18746,10 @@ export class Api extends HttpClient + billingGetSharedStorageBillingGhe: ( + enterprise: string, + params: RequestParams = {}, + ) => this.request({ path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, method: "GET", @@ -18323,7 +19107,11 @@ export class Api extends HttpClient + gistsGetComment: ( + gistId: string, + commentId: number, + params: RequestParams = {}, + ) => this.request< GistComment, | { @@ -18381,7 +19169,11 @@ export class Api extends HttpClient + gistsDeleteComment: ( + gistId: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/comments/\${commentId}\`, method: "DELETE", @@ -18521,7 +19313,11 @@ export class Api extends HttpClient + gistsGetRevision: ( + gistId: string, + sha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${gistId}/\${sha}\`, method: "GET", @@ -18784,7 +19580,10 @@ export class Api extends HttpClient + appsGetSubscriptionPlanForAccount: ( + accountId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/marketplace_listing/accounts/\${accountId}\`, method: "GET", @@ -18870,7 +19669,10 @@ export class Api extends HttpClient + appsGetSubscriptionPlanForAccountStubbed: ( + accountId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, method: "GET", @@ -19118,7 +19920,10 @@ export class Api extends HttpClient + activityGetThreadSubscriptionForAuthenticatedUser: ( + threadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications/threads/\${threadId}/subscription\`, method: "GET", @@ -19162,7 +19967,10 @@ export class Api extends HttpClient + activityDeleteThreadSubscription: ( + threadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications/threads/\${threadId}/subscription\`, method: "DELETE", @@ -19365,7 +20173,10 @@ export class Api extends HttpClient + actionsGetGithubActionsPermissionsOrganization: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/permissions\`, method: "GET", @@ -19507,7 +20318,10 @@ export class Api extends HttpClient + actionsGetAllowedActionsOrganization: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/permissions/selected-actions\`, method: "GET", @@ -19523,7 +20337,11 @@ export class Api extends HttpClient + actionsSetAllowedActionsOrganization: ( + org: string, + data: SelectedActions, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/permissions/selected-actions\`, method: "PUT", @@ -19612,7 +20430,11 @@ export class Api extends HttpClient + actionsGetSelfHostedRunnerGroupForOrg: ( + org: string, + runnerGroupId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", @@ -19656,7 +20478,11 @@ export class Api extends HttpClient + actionsDeleteSelfHostedRunnerGroupFromOrg: ( + org: string, + runnerGroupId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "DELETE", @@ -19904,7 +20730,10 @@ export class Api extends HttpClient + actionsListRunnerApplicationsForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/downloads\`, method: "GET", @@ -19920,7 +20749,10 @@ export class Api extends HttpClient + actionsCreateRegistrationTokenForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/registration-token\`, method: "POST", @@ -19952,7 +20784,11 @@ export class Api extends HttpClient + actionsGetSelfHostedRunnerForOrg: ( + org: string, + runnerId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, method: "GET", @@ -19968,7 +20804,11 @@ export class Api extends HttpClient + actionsDeleteSelfHostedRunnerFromOrg: ( + org: string, + runnerId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, method: "DELETE", @@ -20037,7 +20877,11 @@ export class Api extends HttpClient + actionsGetOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "GET", @@ -20089,7 +20933,11 @@ export class Api extends HttpClient + actionsDeleteOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "DELETE", @@ -20104,7 +20952,11 @@ export class Api extends HttpClient + actionsListSelectedReposForOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => this.request< { repositories: MinimalRepository[]; @@ -20262,7 +21114,11 @@ export class Api extends HttpClient + orgsCheckBlockedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/blocks/\${username}\`, method: "GET", @@ -20277,7 +21133,11 @@ export class Api extends HttpClient + orgsBlockUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/blocks/\${username}\`, method: "PUT", @@ -20292,7 +21152,11 @@ export class Api extends HttpClient + orgsUnblockUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/blocks/\${username}\`, method: "DELETE", @@ -20323,7 +21187,11 @@ export class Api extends HttpClient + orgsRemoveSamlSsoAuthorization: ( + org: string, + credentialId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, method: "DELETE", @@ -20547,7 +21415,11 @@ export class Api extends HttpClient + orgsDeleteWebhook: ( + org: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks/\${hookId}\`, method: "DELETE", @@ -20562,7 +21434,11 @@ export class Api extends HttpClient + orgsGetWebhookConfigForOrg: ( + org: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks/\${hookId}/config\`, method: "GET", @@ -20610,7 +21486,11 @@ export class Api extends HttpClient + orgsPingWebhook: ( + org: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, method: "POST", @@ -20679,7 +21559,10 @@ export class Api extends HttpClient + interactionsGetRestrictionsForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/interaction-limits\`, method: "GET", @@ -20695,7 +21578,11 @@ export class Api extends HttpClient + interactionsSetRestrictionsForOrg: ( + org: string, + data: InteractionLimit, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/interaction-limits\`, method: "PUT", @@ -20713,7 +21600,10 @@ export class Api extends HttpClient + interactionsRemoveRestrictionsForOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/interaction-limits\`, method: "DELETE", @@ -20797,7 +21687,11 @@ export class Api extends HttpClient + orgsCancelInvitation: ( + org: string, + invitationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/invitations/\${invitationId}\`, method: "DELETE", @@ -20953,7 +21847,11 @@ export class Api extends HttpClient + orgsCheckMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -20968,7 +21866,11 @@ export class Api extends HttpClient + orgsRemoveMember: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -20983,7 +21885,11 @@ export class Api extends HttpClient + orgsGetMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/memberships/\${username}\`, method: "GET", @@ -21030,7 +21936,11 @@ export class Api extends HttpClient + orgsRemoveMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/memberships/\${username}\`, method: "DELETE", @@ -21113,7 +22023,11 @@ export class Api extends HttpClient + migrationsGetStatusForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}\`, method: "GET", @@ -21129,7 +22043,11 @@ export class Api extends HttpClient + migrationsDownloadArchiveForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, method: "GET", @@ -21144,7 +22062,11 @@ export class Api extends HttpClient + migrationsDeleteArchiveForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, method: "DELETE", @@ -21159,7 +22081,12 @@ export class Api extends HttpClient + migrationsUnlockRepoForOrg: ( + org: string, + migrationId: number, + repoName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, method: "DELETE", @@ -21246,7 +22173,11 @@ export class Api extends HttpClient + orgsConvertMemberToOutsideCollaborator: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request< void, | { @@ -21268,7 +22199,11 @@ export class Api extends HttpClient + orgsRemoveOutsideCollaborator: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request< void, { @@ -21385,7 +22320,11 @@ export class Api extends HttpClient + orgsCheckPublicMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -21400,7 +22339,11 @@ export class Api extends HttpClient + orgsSetPublicMembershipForAuthenticatedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "PUT", @@ -21415,7 +22358,11 @@ export class Api extends HttpClient + orgsRemovePublicMembershipForAuthenticatedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -21451,7 +22398,14 @@ export class Api extends HttpClient @@ -21561,7 +22515,10 @@ export class Api extends HttpClient + billingGetGithubActionsBillingOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/settings/billing/actions\`, method: "GET", @@ -21577,7 +22534,10 @@ export class Api extends HttpClient + billingGetGithubPackagesBillingOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/settings/billing/packages\`, method: "GET", @@ -21593,7 +22553,10 @@ export class Api extends HttpClient + billingGetSharedStorageBillingOrg: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/settings/billing/shared-storage\`, method: "GET", @@ -21725,7 +22688,11 @@ export class Api extends HttpClient + teamsGetByName: ( + org: string, + teamSlug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}\`, method: "GET", @@ -21788,7 +22755,11 @@ export class Api extends HttpClient + teamsDeleteInOrg: ( + org: string, + teamSlug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}\`, method: "DELETE", @@ -21874,7 +22845,12 @@ export class Api extends HttpClient + teamsGetDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, method: "GET", @@ -21919,7 +22895,12 @@ export class Api extends HttpClient + teamsDeleteDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, method: "DELETE", @@ -22078,7 +23059,15 @@ export class Api extends HttpClient extends HttpClient @@ -22164,7 +23161,15 @@ export class Api extends HttpClient extends HttpClient @@ -22316,7 +23329,12 @@ export class Api extends HttpClient + teamsGetMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, method: "GET", @@ -22374,7 +23392,12 @@ export class Api extends HttpClient + teamsRemoveMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, method: "DELETE", @@ -22481,7 +23504,12 @@ export class Api extends HttpClient + teamsRemoveProjectInOrg: ( + org: string, + teamSlug: string, + projectId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, method: "DELETE", @@ -22587,7 +23615,13 @@ export class Api extends HttpClient + teamsRemoveRepoInOrg: ( + org: string, + teamSlug: string, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -22602,7 +23636,11 @@ export class Api extends HttpClient + teamsListIdpGroupsInOrg: ( + org: string, + teamSlug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, method: "GET", @@ -23169,7 +24207,11 @@ export class Api extends HttpClient + projectsRemoveCollaborator: ( + projectId: number, + username: string, + params: RequestParams = {}, + ) => this.request< void, | BasicError @@ -23192,7 +24234,11 @@ export class Api extends HttpClient + projectsGetPermissionForUser: ( + projectId: number, + username: string, + params: RequestParams = {}, + ) => this.request< RepositoryCollaboratorPermission, | BasicError @@ -23480,7 +24526,12 @@ export class Api extends HttpClient + actionsGetArtifact: ( + owner: string, + repo: string, + artifactId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, method: "GET", @@ -23496,7 +24547,12 @@ export class Api extends HttpClient + actionsDeleteArtifact: ( + owner: string, + repo: string, + artifactId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, method: "DELETE", @@ -23532,7 +24588,12 @@ export class Api extends HttpClient + actionsGetJobForWorkflowRun: ( + owner: string, + repo: string, + jobId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, method: "GET", @@ -23548,7 +24609,12 @@ export class Api extends HttpClient + actionsDownloadJobLogsForWorkflowRun: ( + owner: string, + repo: string, + jobId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, method: "GET", @@ -23563,7 +24629,11 @@ export class Api extends HttpClient + actionsGetGithubActionsPermissionsRepository: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/permissions\`, method: "GET", @@ -23606,7 +24676,11 @@ export class Api extends HttpClient + actionsGetAllowedActionsRepository: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, method: "GET", @@ -23683,7 +24757,11 @@ export class Api extends HttpClient + actionsListRunnerApplicationsForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, method: "GET", @@ -23699,7 +24777,11 @@ export class Api extends HttpClient + actionsCreateRegistrationTokenForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, method: "POST", @@ -23715,7 +24797,11 @@ export class Api extends HttpClient + actionsCreateRemoveTokenForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, method: "POST", @@ -23731,7 +24817,12 @@ export class Api extends HttpClient + actionsGetSelfHostedRunnerForRepo: ( + owner: string, + repo: string, + runnerId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, method: "GET", @@ -23814,7 +24905,12 @@ export class Api extends HttpClient + actionsGetWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, method: "GET", @@ -23830,7 +24926,12 @@ export class Api extends HttpClient + actionsDeleteWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, method: "DELETE", @@ -23885,7 +24986,12 @@ export class Api extends HttpClient + actionsCancelWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, method: "POST", @@ -23947,7 +25053,12 @@ export class Api extends HttpClient + actionsDownloadWorkflowRunLogs: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, method: "GET", @@ -23962,7 +25073,12 @@ export class Api extends HttpClient + actionsDeleteWorkflowRunLogs: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, method: "DELETE", @@ -23977,7 +25093,12 @@ export class Api extends HttpClient + actionsReRunWorkflow: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, method: "POST", @@ -23992,7 +25113,12 @@ export class Api extends HttpClient + actionsGetWorkflowRunUsage: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, method: "GET", @@ -24047,7 +25173,11 @@ export class Api extends HttpClient + actionsGetRepoPublicKey: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, method: "GET", @@ -24063,7 +25193,12 @@ export class Api extends HttpClient + actionsGetRepoSecret: ( + owner: string, + repo: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, method: "GET", @@ -24107,7 +25242,12 @@ export class Api extends HttpClient + actionsDeleteRepoSecret: ( + owner: string, + repo: string, + secretName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, method: "DELETE", @@ -24161,7 +25301,12 @@ export class Api extends HttpClient + actionsGetWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, method: "GET", @@ -24177,7 +25322,12 @@ export class Api extends HttpClient + actionsDisableWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, method: "PUT", @@ -24220,7 +25370,12 @@ export class Api extends HttpClient + actionsEnableWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, method: "PUT", @@ -24283,7 +25438,12 @@ export class Api extends HttpClient + actionsGetWorkflowUsage: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, method: "GET", @@ -24332,7 +25492,12 @@ export class Api extends HttpClient + issuesCheckUserCanBeAssigned: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", @@ -24347,7 +25512,11 @@ export class Api extends HttpClient + reposEnableAutomatedSecurityFixes: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, method: "PUT", @@ -24362,7 +25531,11 @@ export class Api extends HttpClient + reposDisableAutomatedSecurityFixes: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, method: "DELETE", @@ -24412,7 +25585,12 @@ export class Api extends HttpClient + reposGetBranch: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request< BranchWithProtection, | BasicError @@ -24435,7 +25613,12 @@ export class Api extends HttpClient + reposGetBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, method: "GET", @@ -24524,7 +25707,12 @@ export class Api extends HttpClient + reposDeleteBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, method: "DELETE", @@ -24539,7 +25727,12 @@ export class Api extends HttpClient + reposGetAdminBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, method: "GET", @@ -24555,7 +25748,12 @@ export class Api extends HttpClient + reposSetAdminBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, method: "POST", @@ -24571,7 +25769,12 @@ export class Api extends HttpClient + reposDeleteAdminBranchProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, method: "DELETE", @@ -24586,7 +25789,12 @@ export class Api extends HttpClient + reposGetPullRequestReviewProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, method: "GET", @@ -24640,7 +25848,12 @@ export class Api extends HttpClient + reposDeletePullRequestReviewProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, method: "DELETE", @@ -24655,7 +25868,12 @@ export class Api extends HttpClient + reposGetCommitSignatureProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "GET", @@ -24671,7 +25889,12 @@ export class Api extends HttpClient + reposCreateCommitSignatureProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "POST", @@ -24687,7 +25910,12 @@ export class Api extends HttpClient + reposDeleteCommitSignatureProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "DELETE", @@ -24702,7 +25930,12 @@ export class Api extends HttpClient + reposGetStatusChecksProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, method: "GET", @@ -24747,7 +25980,12 @@ export class Api extends HttpClient + reposRemoveStatusCheckProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, method: "DELETE", @@ -24762,7 +26000,12 @@ export class Api extends HttpClient + reposGetAllStatusCheckContexts: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, method: "GET", @@ -24859,7 +26102,12 @@ export class Api extends HttpClient + reposGetAccessRestrictions: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, method: "GET", @@ -24875,7 +26123,12 @@ export class Api extends HttpClient + reposDeleteAccessRestrictions: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, method: "DELETE", @@ -25263,7 +26516,14 @@ export class Api extends HttpClient extends HttpClient + checksGet: ( + owner: string, + repo: string, + checkRunId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, method: "GET", @@ -25404,7 +26669,14 @@ export class Api extends HttpClient extends HttpClient + checksGetSuite: ( + owner: string, + repo: string, + checkSuiteId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, method: "GET", @@ -25642,7 +26919,12 @@ export class Api extends HttpClient + checksRerequestSuite: ( + owner: string, + repo: string, + checkSuiteId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, method: "POST", @@ -25691,7 +26973,12 @@ export class Api extends HttpClient + codeScanningGetAlert: ( + owner: string, + repo: string, + alertNumber: number, + params: RequestParams = {}, + ) => this.request< CodeScanningAlertCodeScanningAlert, | void @@ -25856,7 +27143,12 @@ export class Api extends HttpClient + reposCheckCollaborator: ( + owner: string, + repo: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, method: "GET", @@ -25908,7 +27200,12 @@ export class Api extends HttpClient + reposRemoveCollaborator: ( + owner: string, + repo: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, method: "DELETE", @@ -25923,7 +27220,12 @@ export class Api extends HttpClient + reposGetCollaboratorPermissionLevel: ( + owner: string, + repo: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, method: "GET", @@ -25972,7 +27274,12 @@ export class Api extends HttpClient + reposGetCommitComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -26015,7 +27322,12 @@ export class Api extends HttpClient + reposDeleteCommitComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -26036,7 +27348,15 @@ export class Api extends HttpClient extends HttpClient @@ -26171,7 +27499,12 @@ export class Api extends HttpClient + reposListBranchesForHeadCommit: ( + owner: string, + repo: string, + commitSha: string, + params: RequestParams = {}, + ) => this.request< BranchShort[], | { @@ -26301,7 +27634,12 @@ export class Api extends HttpClient + reposGetCommit: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, method: "GET", @@ -26413,7 +27751,12 @@ export class Api extends HttpClient + reposGetCombinedStatusForRef: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -26463,7 +27806,11 @@ export class Api extends HttpClient + codesOfConductGetForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, method: "GET", @@ -26479,7 +27826,11 @@ export class Api extends HttpClient + reposGetCommunityProfileMetrics: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/community/profile\`, method: "GET", @@ -26495,7 +27846,13 @@ export class Api extends HttpClient + reposCompareCommits: ( + owner: string, + repo: string, + base: string, + head: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, method: "GET", @@ -26801,7 +28158,12 @@ export class Api extends HttpClient + reposGetDeployment: ( + owner: string, + repo: string, + deploymentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, method: "GET", @@ -26817,7 +28179,12 @@ export class Api extends HttpClient + reposDeleteDeployment: ( + owner: string, + repo: string, + deploymentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, method: "DELETE", @@ -26897,7 +28264,14 @@ export class Api extends HttpClient extends HttpClient + gitGetBlob: ( + owner: string, + repo: string, + fileSha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, method: "GET", @@ -27173,7 +28552,12 @@ export class Api extends HttpClient + gitGetCommit: ( + owner: string, + repo: string, + commitSha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, method: "GET", @@ -27223,7 +28607,12 @@ export class Api extends HttpClient + gitGetRef: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, method: "GET", @@ -27301,7 +28690,12 @@ export class Api extends HttpClient + gitDeleteRef: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -27357,7 +28751,12 @@ export class Api extends HttpClient + gitGetTag: ( + owner: string, + repo: string, + tagSha: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, method: "GET", @@ -27533,7 +28932,12 @@ export class Api extends HttpClient + reposGetWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -27603,7 +29007,12 @@ export class Api extends HttpClient + reposDeleteWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -27618,7 +29027,12 @@ export class Api extends HttpClient + reposGetWebhookConfigForRepo: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, method: "GET", @@ -27667,7 +29081,12 @@ export class Api extends HttpClient + reposPingWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, method: "POST", @@ -27682,7 +29101,12 @@ export class Api extends HttpClient + reposTestPushWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -27697,7 +29121,11 @@ export class Api extends HttpClient + migrationsGetImportStatus: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/import\`, method: "GET", @@ -27779,7 +29207,11 @@ export class Api extends HttpClient + migrationsCancelImport: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/import\`, method: "DELETE", @@ -27850,7 +29282,11 @@ export class Api extends HttpClient + migrationsGetLargeFiles: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/import/large_files\`, method: "GET", @@ -27892,7 +29328,11 @@ export class Api extends HttpClient + appsGetRepoInstallation: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/installation\`, method: "GET", @@ -27908,7 +29348,11 @@ export class Api extends HttpClient + interactionsGetRestrictionsForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/interaction-limits\`, method: "GET", @@ -27947,7 +29391,11 @@ export class Api extends HttpClient + interactionsRemoveRestrictionsForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/interaction-limits\`, method: "DELETE", @@ -28022,7 +29470,12 @@ export class Api extends HttpClient + reposDeleteInvitation: ( + owner: string, + repo: string, + invitationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, method: "DELETE", @@ -28192,7 +29645,12 @@ export class Api extends HttpClient + issuesGetComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -28235,7 +29693,12 @@ export class Api extends HttpClient + issuesDeleteComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -28256,7 +29719,15 @@ export class Api extends HttpClient extends HttpClient @@ -28381,7 +29860,12 @@ export class Api extends HttpClient + issuesGetEvent: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -28397,7 +29881,12 @@ export class Api extends HttpClient + issuesGet: ( + owner: string, + repo: string, + issueNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, method: "GET", @@ -28708,7 +30197,12 @@ export class Api extends HttpClient + issuesRemoveAllLabels: ( + owner: string, + repo: string, + issueNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, method: "DELETE", @@ -28723,7 +30217,13 @@ export class Api extends HttpClient + issuesRemoveLabel: ( + owner: string, + repo: string, + issueNumber: number, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, method: "DELETE", @@ -28771,7 +30271,12 @@ export class Api extends HttpClient + issuesUnlock: ( + owner: string, + repo: string, + issueNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, method: "DELETE", @@ -28792,7 +30297,15 @@ export class Api extends HttpClient extends HttpClient @@ -28992,7 +30513,12 @@ export class Api extends HttpClient + reposGetDeployKey: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -29008,7 +30534,12 @@ export class Api extends HttpClient + reposDeleteDeployKey: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -29086,7 +30617,12 @@ export class Api extends HttpClient + issuesGetLabel: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -29133,7 +30669,12 @@ export class Api extends HttpClient + issuesDeleteLabel: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -29148,7 +30689,11 @@ export class Api extends HttpClient + reposListLanguages: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/languages\`, method: "GET", @@ -29164,7 +30709,11 @@ export class Api extends HttpClient + licensesGetForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/license\`, method: "GET", @@ -29302,7 +30851,12 @@ export class Api extends HttpClient + issuesGetMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, method: "GET", @@ -29354,7 +30908,12 @@ export class Api extends HttpClient + issuesDeleteMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, method: "DELETE", @@ -29571,7 +31130,11 @@ export class Api extends HttpClient + reposDeletePagesSite: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request< void, | BasicError @@ -29627,7 +31190,11 @@ export class Api extends HttpClient + reposRequestPagesBuild: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pages/builds\`, method: "POST", @@ -29643,7 +31210,11 @@ export class Api extends HttpClient + reposGetLatestPagesBuild: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, method: "GET", @@ -29659,7 +31230,12 @@ export class Api extends HttpClient + reposGetPagesBuild: ( + owner: string, + repo: string, + buildId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, method: "GET", @@ -29870,7 +31446,12 @@ export class Api extends HttpClient + pullsGetReviewComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -29913,7 +31494,12 @@ export class Api extends HttpClient + pullsDeleteReviewComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -29934,7 +31520,15 @@ export class Api extends HttpClient extends HttpClient @@ -30026,7 +31628,12 @@ export class Api extends HttpClient + pullsGet: ( + owner: string, + repo: string, + pullNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, method: "GET", @@ -30259,7 +31866,12 @@ export class Api extends HttpClient + pullsCheckIfMerged: ( + owner: string, + repo: string, + pullNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, method: "GET", @@ -30488,7 +32100,13 @@ export class Api extends HttpClient + pullsGetReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, method: "GET", @@ -30787,7 +32405,12 @@ export class Api extends HttpClient + reposGetReleaseAsset: ( + owner: string, + repo: string, + assetId: number, + params: RequestParams = {}, + ) => this.request< ReleaseAsset, | BasicError @@ -30841,7 +32464,12 @@ export class Api extends HttpClient + reposDeleteReleaseAsset: ( + owner: string, + repo: string, + assetId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, method: "DELETE", @@ -30856,7 +32484,11 @@ export class Api extends HttpClient + reposGetLatestRelease: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/latest\`, method: "GET", @@ -30872,7 +32504,12 @@ export class Api extends HttpClient + reposGetReleaseByTag: ( + owner: string, + repo: string, + tag: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, method: "GET", @@ -30888,7 +32525,12 @@ export class Api extends HttpClient + reposGetRelease: ( + owner: string, + repo: string, + releaseId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "GET", @@ -30941,7 +32583,12 @@ export class Api extends HttpClient + reposDeleteRelease: ( + owner: string, + repo: string, + releaseId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "DELETE", @@ -31060,7 +32707,12 @@ export class Api extends HttpClient + secretScanningGetAlert: ( + owner: string, + repo: string, + alertNumber: AlertNumber, + params: RequestParams = {}, + ) => this.request< SecretScanningAlert, void | { @@ -31152,7 +32804,11 @@ export class Api extends HttpClient + reposGetCodeFrequencyStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -31168,7 +32824,11 @@ export class Api extends HttpClient + reposGetCommitActivityStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -31184,7 +32844,11 @@ export class Api extends HttpClient + reposGetContributorsStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -31200,7 +32864,11 @@ export class Api extends HttpClient + reposGetParticipationStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -31216,7 +32884,11 @@ export class Api extends HttpClient + reposGetPunchCardStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -31305,7 +32977,11 @@ export class Api extends HttpClient + activityGetRepoSubscription: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -31349,7 +33025,11 @@ export class Api extends HttpClient + activityDeleteRepoSubscription: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -31397,7 +33077,12 @@ export class Api extends HttpClient + reposDownloadTarballArchive: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, method: "GET", @@ -31445,7 +33130,11 @@ export class Api extends HttpClient + reposGetAllTopics: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request< Topic, | BasicError @@ -31530,7 +33219,11 @@ export class Api extends HttpClient + reposGetTopPaths: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, method: "GET", @@ -31546,7 +33239,11 @@ export class Api extends HttpClient + reposGetTopReferrers: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, method: "GET", @@ -31618,7 +33315,11 @@ export class Api extends HttpClient + reposCheckVulnerabilityAlerts: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "GET", @@ -31633,7 +33334,11 @@ export class Api extends HttpClient + reposEnableVulnerabilityAlerts: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "PUT", @@ -31648,7 +33353,11 @@ export class Api extends HttpClient + reposDisableVulnerabilityAlerts: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "DELETE", @@ -31663,7 +33372,12 @@ export class Api extends HttpClient + reposDownloadZipballArchive: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, method: "GET", @@ -32066,7 +33780,11 @@ export class Api extends HttpClient + enterpriseAdminDeleteUserFromEnterprise: ( + enterprise: string, + scimUserId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "DELETE", @@ -32170,7 +33888,11 @@ export class Api extends HttpClient + scimGetProvisioningInformationForUser: ( + org: string, + scimUserId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "GET", @@ -32287,7 +34009,11 @@ export class Api extends HttpClient + scimDeleteUserFromOrg: ( + org: string, + scimUserId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "DELETE", @@ -32799,7 +34525,11 @@ export class Api extends HttpClient + teamsGetDiscussionLegacy: ( + teamId: number, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, method: "GET", @@ -32845,7 +34575,11 @@ export class Api extends HttpClient + teamsDeleteDiscussionLegacy: ( + teamId: number, + discussionNumber: number, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, method: "DELETE", @@ -33004,7 +34738,15 @@ export class Api extends HttpClient extends HttpClient @@ -33068,7 +34818,15 @@ export class Api extends HttpClient extends HttpClient @@ -33200,7 +34966,11 @@ export class Api extends HttpClient + teamsGetMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -33216,7 +34986,11 @@ export class Api extends HttpClient + teamsAddMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request< void, | BasicError @@ -33246,7 +35020,11 @@ export class Api extends HttpClient + teamsRemoveMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -33262,7 +35040,11 @@ export class Api extends HttpClient + teamsGetMembershipForUserLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -33325,7 +35107,11 @@ export class Api extends HttpClient + teamsRemoveMembershipForUserLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -33381,7 +35167,11 @@ export class Api extends HttpClient + teamsCheckPermissionsForProjectLegacy: ( + teamId: number, + projectId: number, + params: RequestParams = {}, + ) => this.request< TeamProject, void | { @@ -33448,7 +35238,11 @@ export class Api extends HttpClient + teamsRemoveProjectLegacy: ( + teamId: number, + projectId: number, + params: RequestParams = {}, + ) => this.request< void, | BasicError @@ -33505,7 +35299,12 @@ export class Api extends HttpClient + teamsCheckPermissionsForRepoLegacy: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -33556,7 +35355,12 @@ export class Api extends HttpClient + teamsRemoveRepoLegacy: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -33981,7 +35785,10 @@ export class Api extends HttpClient + usersCheckPersonIsFollowedByAuthenticated: ( + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/following/\${username}\`, method: "GET", @@ -34081,7 +35888,10 @@ export class Api extends HttpClient + usersGetGpgKeyForAuthenticated: ( + gpgKeyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/gpg_keys/\${gpgKeyId}\`, method: "GET", @@ -34097,7 +35907,10 @@ export class Api extends HttpClient + usersDeleteGpgKeyForAuthenticated: ( + gpgKeyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/gpg_keys/\${gpgKeyId}\`, method: "DELETE", @@ -34192,7 +36005,11 @@ export class Api extends HttpClient + appsAddRepoToInstallation: ( + installationId: number, + repositoryId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, method: "PUT", @@ -34207,7 +36024,11 @@ export class Api extends HttpClient + appsRemoveRepoFromInstallation: ( + installationId: number, + repositoryId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, method: "DELETE", @@ -34222,7 +36043,9 @@ export class Api extends HttpClient + interactionsGetRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => this.request({ path: \`/user/interaction-limits\`, method: "GET", @@ -34238,7 +36061,10 @@ export class Api extends HttpClient + interactionsSetRestrictionsForAuthenticatedUser: ( + data: InteractionLimit, + params: RequestParams = {}, + ) => this.request({ path: \`/user/interaction-limits\`, method: "PUT", @@ -34256,7 +36082,9 @@ export class Api extends HttpClient + interactionsRemoveRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => this.request({ path: \`/user/interaction-limits\`, method: "DELETE", @@ -34394,7 +36222,10 @@ export class Api extends HttpClient + usersGetPublicSshKeyForAuthenticated: ( + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/keys/\${keyId}\`, method: "GET", @@ -34410,7 +36241,10 @@ export class Api extends HttpClient + usersDeletePublicSshKeyForAuthenticated: ( + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/keys/\${keyId}\`, method: "DELETE", @@ -34520,7 +36354,10 @@ export class Api extends HttpClient + orgsGetMembershipForAuthenticatedUser: ( + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/memberships/orgs/\${org}\`, method: "GET", @@ -34653,7 +36490,10 @@ export class Api extends HttpClient + migrationsGetArchiveForAuthenticatedUser: ( + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/migrations/\${migrationId}/archive\`, method: "GET", @@ -34668,7 +36508,10 @@ export class Api extends HttpClient + migrationsDeleteArchiveForAuthenticatedUser: ( + migrationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/migrations/\${migrationId}/archive\`, method: "DELETE", @@ -34683,7 +36526,11 @@ export class Api extends HttpClient + migrationsUnlockRepoForAuthenticatedUser: ( + migrationId: number, + repoName: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, method: "DELETE", @@ -35047,7 +36894,10 @@ export class Api extends HttpClient + reposDeclineInvitation: ( + invitationId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/user/repository_invitations/\${invitationId}\`, method: "DELETE", @@ -35103,7 +36953,11 @@ export class Api extends HttpClient + activityCheckRepoIsStarredByAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/starred/\${owner}/\${repo}\`, method: "GET", @@ -35118,7 +36972,11 @@ export class Api extends HttpClient + activityStarRepoForAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/starred/\${owner}/\${repo}\`, method: "PUT", @@ -35133,7 +36991,11 @@ export class Api extends HttpClient + activityUnstarRepoForAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/starred/\${owner}/\${repo}\`, method: "DELETE", @@ -35416,7 +37278,11 @@ export class Api extends HttpClient + usersCheckFollowingForUser: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", @@ -35755,7 +37621,10 @@ export class Api extends HttpClient + billingGetGithubActionsBillingUser: ( + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/settings/billing/actions\`, method: "GET", @@ -35771,7 +37640,10 @@ export class Api extends HttpClient + billingGetGithubPackagesBillingUser: ( + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/settings/billing/packages\`, method: "GET", @@ -35787,7 +37659,10 @@ export class Api extends HttpClient + billingGetSharedStorageBillingUser: ( + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/settings/billing/shared-storage\`, method: "GET", @@ -35997,16 +37872,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -36025,7 +37906,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -36058,9 +37940,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -36071,8 +37959,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -36089,7 +37982,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -36102,7 +37998,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -36146,15 +38044,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -36196,7 +38105,9 @@ export class HttpClient { * Using Furkot API an application can list user trips and display stops for a specific trip. * Furkot API uses OAuth2 protocol to authorize applications to access data on behalf of users. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { trip = { /** * @description list user's trips @@ -36526,16 +38437,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -36554,7 +38471,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -36587,9 +38505,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -36600,8 +38524,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -36618,7 +38547,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -36631,7 +38563,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -36675,15 +38609,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -36724,7 +38669,9 @@ export class HttpClient { * * Giphy API */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { gifs = { /** * @description A multiget version of the get GIF by ID endpoint. @@ -37166,16 +39113,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -37194,7 +39147,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -37227,9 +39181,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -37240,8 +39200,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -37258,7 +39223,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -37271,7 +39239,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -37315,15 +39285,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -37358,7 +39339,9 @@ export class HttpClient { * @title Link Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { v20 = { /** * No description @@ -37394,7 +39377,11 @@ export class Api extends HttpClient + getRepository: ( + username: string, + slug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}\`, method: "GET", @@ -37430,7 +39417,12 @@ export class Api extends HttpClient + getPullRequestsById: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, method: "GET", @@ -37444,7 +39436,12 @@ export class Api extends HttpClient + mergePullRequest: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, method: "POST", @@ -37504,16 +39501,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -37532,7 +39535,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -37565,9 +39569,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -37578,8 +39588,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -37596,7 +39611,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -37609,7 +39627,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -37653,15 +39673,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -37696,7 +39727,9 @@ export class HttpClient { * @title Empty schema example * @version 1.0.0 */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -37745,16 +39778,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -37773,7 +39812,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -37806,9 +39846,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -37819,8 +39865,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -37837,7 +39888,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -37850,7 +39904,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -37894,15 +39950,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -37937,7 +40004,9 @@ export class HttpClient { * @title Oneof Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -37993,16 +40062,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -38021,7 +40096,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -38054,9 +40130,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -38067,8 +40149,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -38085,7 +40172,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -38098,7 +40188,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -38142,15 +40234,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -38187,7 +40290,9 @@ export class HttpClient { * @license MIT * @baseUrl http://unknown.io/v666 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -38442,16 +40547,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -38470,7 +40581,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -38503,9 +40615,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -38516,8 +40634,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -38534,7 +40657,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -38547,7 +40673,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -38591,15 +40719,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -38634,7 +40773,9 @@ export class HttpClient { * @title No title * @baseUrl http://localhost:8080/api/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { auth = { /** * No description @@ -38732,7 +40873,11 @@ export class Api extends HttpClient + updateJob: ( + id: string, + params: JobUpdateType, + requestParams: RequestParams = {}, + ) => this.request({ path: \`/jobs/\${id}\`, method: "PATCH", @@ -38803,7 +40948,11 @@ export class Api extends HttpClient + updateProject: ( + id: string, + data: ProjectUpdateType, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/\${id}\`, method: "PATCH", @@ -38885,16 +41034,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -38913,7 +41068,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -38946,9 +41102,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -38959,8 +41121,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -38977,7 +41144,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -38990,7 +41160,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -39034,15 +41206,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -39079,7 +41262,9 @@ export class HttpClient { * @license MIT * @baseUrl http://petstore.swagger.io/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -39192,16 +41377,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -39220,7 +41411,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -39253,9 +41445,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -39266,8 +41464,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -39284,7 +41487,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -39297,7 +41503,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -39341,15 +41549,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -39386,7 +41605,9 @@ export class HttpClient { * @license MIT * @baseUrl http://petstore.swagger.io/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * No description @@ -39500,16 +41721,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -39528,7 +41755,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -39561,9 +41789,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -39574,8 +41808,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -39592,7 +41831,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -39605,7 +41847,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -39649,15 +41893,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -39698,7 +41953,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Returns all pets from the system that the user has access to Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. @@ -39844,16 +42101,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -39872,7 +42135,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -39905,9 +42169,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -39918,8 +42188,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -39936,7 +42211,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -39949,7 +42227,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -39993,15 +42273,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -40042,7 +42333,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pathParams = { /** * No description @@ -40050,7 +42343,11 @@ export class Api extends HttpClient + pathParamFooBarBazList: ( + pathParam: string, + fooBarBaz: string, + params: RequestParams = {}, + ) => this.request({ path: \`/path-params/\${pathParam}/\${fooBarBaz}\`, method: "GET", @@ -40174,16 +42471,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -40202,7 +42505,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -40235,9 +42539,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -40248,8 +42558,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -40266,7 +42581,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -40279,7 +42597,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -40323,15 +42643,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -40372,7 +42703,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Returns all pets from the system that the user has access to @@ -40451,16 +42784,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -40479,7 +42818,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -40512,9 +42852,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -40525,8 +42871,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -40543,7 +42894,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -40556,7 +42910,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -40600,15 +42956,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -40649,7 +43016,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Returns all pets from the system that the user has access to @@ -40820,16 +43189,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -40848,7 +43223,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -40881,9 +43257,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -40894,8 +43276,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -40912,7 +43299,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -40925,7 +43315,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -40969,15 +43361,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -41019,7 +43422,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * @description Returns a single pet @@ -41465,16 +43870,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -41493,7 +43904,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -41526,9 +43938,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -41539,8 +43957,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -41557,7 +43980,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -41570,7 +43996,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -41614,15 +44042,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -41664,7 +44103,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Returns all pets from the system that the user has access to @@ -41774,16 +44215,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -41802,7 +44249,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -41835,9 +44283,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -41848,8 +44302,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -41866,7 +44325,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -41879,7 +44341,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -41923,15 +44387,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -41968,7 +44443,9 @@ export class HttpClient { * @license MIT * @baseUrl http://unknown.io/v666 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { foobarbaz = { /** * No description @@ -42047,16 +44524,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -42075,7 +44558,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -42108,9 +44592,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -42121,8 +44611,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -42139,7 +44634,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -42152,7 +44650,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -42196,15 +44696,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -42238,7 +44749,9 @@ export class HttpClient { /** * @title No title */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -42277,16 +44790,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -42305,7 +44824,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -42338,9 +44858,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -42351,8 +44877,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -42369,7 +44900,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -42382,7 +44916,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -42426,15 +44962,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -42471,7 +45018,9 @@ export class HttpClient { * * Description */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { api = { /** * No description @@ -42531,16 +45080,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -42555,11 +45110,13 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = "https://virtserver.swaggerhub.com/sdfsdfsffs/sdfff/1.0.0"; + public baseUrl: string = + "https://virtserver.swaggerhub.com/sdfsdfsffs/sdfff/1.0.0"; private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -42592,9 +45149,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -42605,8 +45168,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -42623,7 +45191,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -42636,7 +45207,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -42680,15 +45253,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -42726,7 +45310,9 @@ export class HttpClient { * * This is an example of using OAuth2 Application Flow in a specification to describe security to your API. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { example = { /** * @description This is an example operation to show how security is applied to the call. @@ -42909,16 +45495,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -42937,7 +45529,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -42970,9 +45563,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -42983,8 +45582,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -43001,7 +45605,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -43014,7 +45621,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -43058,15 +45667,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -43101,7 +45721,9 @@ export class HttpClient { * @title No title * @baseUrl http://localhost:8080/api/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { auth = { /** * No description @@ -43307,7 +45929,11 @@ export class Api extends HttpClient + updateProject: ( + id: string, + data: ProjectUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/\${id}\`, method: "PATCH", @@ -43509,16 +46135,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -43537,7 +46169,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -43570,9 +46203,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -43583,8 +46222,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -43601,7 +46245,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -43614,7 +46261,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -43658,15 +46307,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -43704,7 +46364,9 @@ export class HttpClient { * * Move your app forward with the Uber API */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { products = { /** * @description The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order. @@ -44649,16 +47311,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -44677,7 +47345,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -44710,9 +47379,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -44723,8 +47398,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -44741,7 +47421,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -44754,7 +47437,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -44798,15 +47483,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -44848,7 +47544,9 @@ export class HttpClient { * webhooks to receive real-time events when new transactions hit your * account. It’s new, it’s exciting and it’s just the beginning. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { accounts = { /** * @description Retrieve a paginated list of all accounts for the currently authenticated user. The returned list is paginated and can be scrolled by following the \`prev\` and \`next\` links where present. @@ -45070,7 +47768,11 @@ export class Api extends HttpClient + relationshipsTagsCreate: ( + transactionId: string, + data: UpdateTransactionTagsRequest, + params: RequestParams = {}, + ) => this.request({ path: \`/transactions/\${transactionId}/relationships/tags\`, method: "POST", @@ -45089,7 +47791,11 @@ export class Api extends HttpClient + relationshipsTagsDelete: ( + transactionId: string, + data: UpdateTransactionTagsRequest, + params: RequestParams = {}, + ) => this.request({ path: \`/transactions/\${transactionId}/relationships/tags\`, method: "DELETE", @@ -45387,16 +48093,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -45415,7 +48127,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -45448,9 +48161,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -45461,8 +48180,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -45479,7 +48203,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -45492,7 +48219,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -45536,15 +48265,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -45583,7 +48323,9 @@ export class HttpClient { * * The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { /** * No description * @@ -45609,7 +48351,11 @@ export class Api extends HttpClient + listSearchableFields: ( + dataset: string, + version: string, + params: RequestParams = {}, + ) => this.request({ path: \`/\${dataset}/\${version}/fields\`, method: "GET", @@ -45701,16 +48447,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -45729,7 +48481,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -45762,9 +48515,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -45775,8 +48534,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -45793,7 +48557,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -45806,7 +48573,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -45850,15 +48619,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -45893,7 +48673,9 @@ export class HttpClient { * @title Test * @version test */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; @@ -45956,16 +48738,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -45984,7 +48772,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -46017,9 +48806,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -46030,8 +48825,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -46048,7 +48848,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -46061,7 +48864,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -46105,15 +48910,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -46148,7 +48964,9 @@ export class HttpClient { * @title Link Example * @version 1.0.0 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { v20 = { /** * No description @@ -46184,7 +49002,11 @@ export class Api extends HttpClient + getRepository: ( + username: string, + slug: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}\`, method: "GET", @@ -46220,7 +49042,12 @@ export class Api extends HttpClient + getPullRequestsById: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, method: "GET", @@ -46234,7 +49061,12 @@ export class Api extends HttpClient + mergePullRequest: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => this.request({ path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, method: "POST", diff --git a/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap b/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap index dc60a814..7319b5a4 100644 --- a/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap +++ b/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap @@ -63,16 +63,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -91,7 +97,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -124,9 +131,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -137,8 +150,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -155,7 +173,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -168,7 +189,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -212,15 +235,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -256,7 +290,9 @@ export class HttpClient { * @version 1.6.3 * @baseUrl //localhost:8083 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { api = { /** * No description diff --git a/tests/spec/axios/__snapshots__/basic.test.ts.snap b/tests/spec/axios/__snapshots__/basic.test.ts.snap index e0ee8b9d..b67816fe 100644 --- a/tests/spec/axios/__snapshots__/basic.test.ts.snap +++ b/tests/spec/axios/__snapshots__/basic.test.ts.snap @@ -1911,12 +1911,19 @@ export interface UserUpdate { export type Users = User[]; -import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios"; +import type { + AxiosInstance, + AxiosRequestConfig, + AxiosResponse, + HeadersDefaults, + ResponseType, +} from "axios"; import axios from "axios"; export type QueryParamsType = Record; -export interface FullRequestParams extends Omit { +export interface FullRequestParams + extends Omit { /** set parameter to \`true\` for call \`securityWorker\` for this request */ secure?: boolean; /** request path */ @@ -1931,9 +1938,13 @@ export interface FullRequestParams extends Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; -export interface ApiConfig extends Omit { +export interface ApiConfig + extends Omit { securityWorker?: ( securityData: SecurityDataType | null, ) => Promise | AxiosRequestConfig | void; @@ -1955,8 +1966,16 @@ export class HttpClient { private secure?: boolean; private format?: ResponseType; - constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { - this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "https://api.github.com" }); + constructor({ + securityWorker, + secure, + format, + ...axiosConfig + }: ApiConfig = {}) { + this.instance = axios.create({ + ...axiosConfig, + baseURL: axiosConfig.baseURL || "https://api.github.com", + }); this.secure = secure; this.format = format; this.securityWorker = securityWorker; @@ -1966,7 +1985,10 @@ export class HttpClient { this.securityData = data; }; - protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + protected mergeRequestParams( + params1: AxiosRequestConfig, + params2?: AxiosRequestConfig, + ): AxiosRequestConfig { const method = params1.method || (params2 && params2.method); return { @@ -1974,7 +1996,11 @@ export class HttpClient { ...params1, ...(params2 || {}), headers: { - ...((method && this.instance.defaults.headers[method.toLowerCase() as keyof HeadersDefaults]) || {}), + ...((method && + this.instance.defaults.headers[ + method.toLowerCase() as keyof HeadersDefaults + ]) || + {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, @@ -1995,11 +2021,15 @@ export class HttpClient { } return Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; - const propertyContent: any[] = property instanceof Array ? property : [property]; + const propertyContent: any[] = + property instanceof Array ? property : [property]; for (const formItem of propertyContent) { const isFileType = formItem instanceof Blob || formItem instanceof File; - formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem)); + formData.append( + key, + isFileType ? formItem : this.stringifyFormItem(formItem), + ); } return formData; @@ -2023,11 +2053,21 @@ export class HttpClient { const requestParams = this.mergeRequestParams(params, secureParams); const responseFormat = format || this.format || undefined; - if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + if ( + type === ContentType.FormData && + body && + body !== null && + typeof body === "object" + ) { body = this.createFormData(body as Record); } - if (type === ContentType.Text && body && body !== null && typeof body !== "string") { + if ( + type === ContentType.Text && + body && + body !== null && + typeof body !== "string" + ) { body = JSON.stringify(body); } @@ -2054,7 +2094,9 @@ export class HttpClient { * * Powerful collaboration, code review, and code management for open source and private projects. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { someTest = { /** * @description This type should test bug https://github.com/acacode/swagger-typescript-api/issues/156 NOTE: all properties should be required @@ -2271,7 +2313,11 @@ export class Api extends HttpClient + gistsPartialUpdate: ( + id: number, + body: PatchGist, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}\`, method: "PATCH", @@ -2301,7 +2347,11 @@ export class Api extends HttpClient + commentsCreate: ( + id: number, + body: CommentBody, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments\`, method: "POST", @@ -2317,7 +2367,11 @@ export class Api extends HttpClient + commentsDelete: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "DELETE", @@ -2330,7 +2384,11 @@ export class Api extends HttpClient + commentsDetail: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "GET", @@ -2344,7 +2402,12 @@ export class Api extends HttpClient + commentsPartialUpdate: ( + id: number, + commentId: number, + body: Comment, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "PATCH", @@ -2671,7 +2734,10 @@ export class Api extends HttpClient + notificationsUpdate: ( + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications\`, method: "PUT", @@ -2740,7 +2806,11 @@ export class Api extends HttpClient + threadsSubscriptionUpdate: ( + id: number, + body: PutSubscription, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications/threads/\${id}/subscription\`, method: "PUT", @@ -2771,7 +2841,11 @@ export class Api extends HttpClient + orgsPartialUpdate: ( + org: string, + body: PatchOrg, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}\`, method: "PATCH", @@ -2854,7 +2928,11 @@ export class Api extends HttpClient + membersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -2867,7 +2945,11 @@ export class Api extends HttpClient + membersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -2894,7 +2976,11 @@ export class Api extends HttpClient + publicMembersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -2907,7 +2993,11 @@ export class Api extends HttpClient + publicMembersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -2920,7 +3010,11 @@ export class Api extends HttpClient + publicMembersUpdate: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "PUT", @@ -2985,7 +3079,11 @@ export class Api extends HttpClient + teamsCreate: ( + org: string, + body: OrgTeamsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams\`, method: "POST", @@ -3044,7 +3142,12 @@ export class Api extends HttpClient + reposPartialUpdate: ( + owner: string, + repo: string, + body: RepoEdit, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}\`, method: "PATCH", @@ -3074,7 +3177,12 @@ export class Api extends HttpClient + assigneesDetail: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", @@ -3101,7 +3209,12 @@ export class Api extends HttpClient + branchesDetail: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, method: "GET", @@ -3115,7 +3228,11 @@ export class Api extends HttpClient + collaboratorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", @@ -3129,7 +3246,12 @@ export class Api extends HttpClient + collaboratorsDelete: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "DELETE", @@ -3142,7 +3264,12 @@ export class Api extends HttpClient + collaboratorsDetail: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "GET", @@ -3155,7 +3282,12 @@ export class Api extends HttpClient + collaboratorsUpdate: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "PUT", @@ -3182,7 +3314,12 @@ export class Api extends HttpClient + commentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -3195,7 +3332,12 @@ export class Api extends HttpClient + commentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -3265,7 +3407,12 @@ export class Api extends HttpClient + commitsStatusList: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -3279,7 +3426,12 @@ export class Api extends HttpClient + commitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}\`, method: "GET", @@ -3293,7 +3445,12 @@ export class Api extends HttpClient + commitsCommentsList: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}/comments\`, method: "GET", @@ -3329,7 +3486,13 @@ export class Api extends HttpClient + compareDetail: ( + owner: string, + repo: string, + baseId: string, + headId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/compare/\${baseId}...\${headId}\`, method: "GET", @@ -3343,7 +3506,13 @@ export class Api extends HttpClient + contentsDelete: ( + owner: string, + repo: string, + path: string, + body: DeleteFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "DELETE", @@ -3385,7 +3554,13 @@ export class Api extends HttpClient + contentsUpdate: ( + owner: string, + repo: string, + path: string, + body: CreateFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "PUT", @@ -3424,7 +3599,11 @@ export class Api extends HttpClient + deploymentsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", @@ -3438,7 +3617,12 @@ export class Api extends HttpClient + deploymentsCreate: ( + owner: string, + repo: string, + body: Deployment, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "POST", @@ -3454,7 +3638,12 @@ export class Api extends HttpClient + deploymentsStatusesList: ( + owner: string, + repo: string, + id: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${id}/statuses\`, method: "GET", @@ -3505,7 +3694,12 @@ export class Api extends HttpClient + downloadsDelete: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "DELETE", @@ -3519,7 +3713,12 @@ export class Api extends HttpClient + downloadsDetail: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "GET", @@ -3570,7 +3769,12 @@ export class Api extends HttpClient + forksCreate: ( + owner: string, + repo: string, + body: ForkBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/forks\`, method: "POST", @@ -3586,7 +3790,12 @@ export class Api extends HttpClient + gitBlobsCreate: ( + owner: string, + repo: string, + body: Blob, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs\`, method: "POST", @@ -3602,7 +3811,12 @@ export class Api extends HttpClient + gitBlobsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${shaCode}\`, method: "GET", @@ -3616,7 +3830,12 @@ export class Api extends HttpClient + gitCommitsCreate: ( + owner: string, + repo: string, + body: RepoCommitBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits\`, method: "POST", @@ -3632,7 +3851,12 @@ export class Api extends HttpClient + gitCommitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${shaCode}\`, method: "GET", @@ -3660,7 +3884,12 @@ export class Api extends HttpClient + gitRefsCreate: ( + owner: string, + repo: string, + body: RefsBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs\`, method: "POST", @@ -3676,7 +3905,12 @@ export class Api extends HttpClient + gitRefsDelete: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -3689,7 +3923,12 @@ export class Api extends HttpClient + gitRefsDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "GET", @@ -3703,7 +3942,13 @@ export class Api extends HttpClient + gitRefsPartialUpdate: ( + owner: string, + repo: string, + ref: string, + body: GitRefPatch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "PATCH", @@ -3719,7 +3964,12 @@ export class Api extends HttpClient + gitTagsCreate: ( + owner: string, + repo: string, + body: TagBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags\`, method: "POST", @@ -3735,7 +3985,12 @@ export class Api extends HttpClient + gitTagsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${shaCode}\`, method: "GET", @@ -3749,7 +4004,12 @@ export class Api extends HttpClient + gitTreesCreate: ( + owner: string, + repo: string, + body: Tree, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/trees\`, method: "POST", @@ -3803,7 +4063,12 @@ export class Api extends HttpClient + hooksCreate: ( + owner: string, + repo: string, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks\`, method: "POST", @@ -3819,7 +4084,12 @@ export class Api extends HttpClient + hooksDelete: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -3832,7 +4102,12 @@ export class Api extends HttpClient + hooksDetail: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -3846,7 +4121,13 @@ export class Api extends HttpClient + hooksPartialUpdate: ( + owner: string, + repo: string, + hookId: number, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "PATCH", @@ -3862,7 +4143,12 @@ export class Api extends HttpClient + hooksTestsCreate: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -3915,7 +4201,12 @@ export class Api extends HttpClient + issuesCreate: ( + owner: string, + repo: string, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", @@ -3960,7 +4251,12 @@ export class Api extends HttpClient + issuesCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -3973,7 +4269,12 @@ export class Api extends HttpClient + issuesCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -4009,7 +4310,11 @@ export class Api extends HttpClient + issuesEventsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", @@ -4023,7 +4328,12 @@ export class Api extends HttpClient + issuesEventsDetail: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -4037,7 +4347,12 @@ export class Api extends HttpClient + issuesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "GET", @@ -4051,7 +4366,13 @@ export class Api extends HttpClient + issuesPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "PATCH", @@ -4069,7 +4390,12 @@ export class Api extends HttpClient + issuesCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/comments\`, method: "GET", @@ -4107,7 +4433,12 @@ export class Api extends HttpClient + issuesEventsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/events\`, method: "GET", @@ -4121,9 +4452,14 @@ export class Api extends HttpClient - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, + issuesLabelsDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "DELETE", ...params, }), @@ -4134,7 +4470,12 @@ export class Api extends HttpClient + issuesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "GET", @@ -4148,7 +4489,13 @@ export class Api extends HttpClient + issuesLabelsCreate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "POST", @@ -4164,7 +4511,13 @@ export class Api extends HttpClient + issuesLabelsUpdate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "PUT", @@ -4182,7 +4535,13 @@ export class Api extends HttpClient + issuesLabelsDelete2: ( + owner: string, + repo: string, + number: number, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels/\${name}\`, method: "DELETE", @@ -4209,7 +4568,12 @@ export class Api extends HttpClient + keysCreate: ( + owner: string, + repo: string, + body: UserKeysPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys\`, method: "POST", @@ -4225,7 +4589,12 @@ export class Api extends HttpClient + keysDelete: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -4238,7 +4607,12 @@ export class Api extends HttpClient + keysDetail: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -4266,7 +4640,12 @@ export class Api extends HttpClient + labelsCreate: ( + owner: string, + repo: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", @@ -4282,7 +4661,12 @@ export class Api extends HttpClient + labelsDelete: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -4295,7 +4679,12 @@ export class Api extends HttpClient + labelsDetail: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -4309,7 +4698,13 @@ export class Api extends HttpClient + labelsPartialUpdate: ( + owner: string, + repo: string, + name: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "PATCH", @@ -4339,7 +4734,12 @@ export class Api extends HttpClient + mergesCreate: ( + owner: string, + repo: string, + body: MergesBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/merges\`, method: "POST", @@ -4385,7 +4785,12 @@ export class Api extends HttpClient + milestonesCreate: ( + owner: string, + repo: string, + body: MilestoneUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones\`, method: "POST", @@ -4401,7 +4806,12 @@ export class Api extends HttpClient + milestonesDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "DELETE", @@ -4414,7 +4824,12 @@ export class Api extends HttpClient + milestonesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "GET", @@ -4450,7 +4865,12 @@ export class Api extends HttpClient + milestonesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}/labels\`, method: "GET", @@ -4497,7 +4917,12 @@ export class Api extends HttpClient + notificationsUpdate: ( + owner: string, + repo: string, + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/notifications\`, method: "PUT", @@ -4545,7 +4970,12 @@ export class Api extends HttpClient + pullsCreate: ( + owner: string, + repo: string, + body: PullsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls\`, method: "POST", @@ -4590,7 +5020,12 @@ export class Api extends HttpClient + pullsCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -4603,7 +5038,12 @@ export class Api extends HttpClient + pullsCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -4639,7 +5079,12 @@ export class Api extends HttpClient + pullsDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "GET", @@ -4653,7 +5098,13 @@ export class Api extends HttpClient + pullsPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: PullUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "PATCH", @@ -4671,7 +5122,12 @@ export class Api extends HttpClient + pullsCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/comments\`, method: "GET", @@ -4707,7 +5163,12 @@ export class Api extends HttpClient + pullsCommitsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/commits\`, method: "GET", @@ -4721,7 +5182,12 @@ export class Api extends HttpClient + pullsFilesList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/files\`, method: "GET", @@ -4735,7 +5201,12 @@ export class Api extends HttpClient + pullsMergeList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "GET", @@ -4748,7 +5219,13 @@ export class Api extends HttpClient + pullsMergeUpdate: ( + owner: string, + repo: string, + number: number, + body: MergePullBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "PUT", @@ -4801,7 +5278,12 @@ export class Api extends HttpClient + releasesCreate: ( + owner: string, + repo: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases\`, method: "POST", @@ -4817,7 +5299,12 @@ export class Api extends HttpClient + releasesAssetsDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "DELETE", @@ -4830,7 +5317,12 @@ export class Api extends HttpClient + releasesAssetsDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "GET", @@ -4866,7 +5358,12 @@ export class Api extends HttpClient + releasesDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "DELETE", @@ -4879,7 +5376,12 @@ export class Api extends HttpClient + releasesDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "GET", @@ -4893,7 +5395,13 @@ export class Api extends HttpClient + releasesPartialUpdate: ( + owner: string, + repo: string, + id: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "PATCH", @@ -4909,7 +5417,12 @@ export class Api extends HttpClient + releasesAssetsList: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}/assets\`, method: "GET", @@ -4937,7 +5450,11 @@ export class Api extends HttpClient + statsCodeFrequencyList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -4951,7 +5468,11 @@ export class Api extends HttpClient + statsCommitActivityList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -4965,7 +5486,11 @@ export class Api extends HttpClient + statsContributorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -4979,7 +5504,11 @@ export class Api extends HttpClient + statsParticipationList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -4993,7 +5522,11 @@ export class Api extends HttpClient + statsPunchCardList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -5007,7 +5540,12 @@ export class Api extends HttpClient + statusesDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "GET", @@ -5021,7 +5559,13 @@ export class Api extends HttpClient + statusesCreate: ( + owner: string, + repo: string, + ref: string, + body: HeadBranch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "POST", @@ -5037,7 +5581,11 @@ export class Api extends HttpClient + subscribersList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", @@ -5051,7 +5599,11 @@ export class Api extends HttpClient + subscriptionDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -5064,7 +5616,11 @@ export class Api extends HttpClient + subscriptionList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -5078,7 +5634,12 @@ export class Api extends HttpClient + subscriptionUpdate: ( + owner: string, + repo: string, + body: SubscriptionBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "PUT", @@ -5368,7 +5929,11 @@ export class Api extends HttpClient + teamsPartialUpdate: ( + teamId: number, + body: EditTeam, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}\`, method: "PATCH", @@ -5399,7 +5964,11 @@ export class Api extends HttpClient + membersDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -5413,7 +5982,11 @@ export class Api extends HttpClient + membersDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -5427,7 +6000,11 @@ export class Api extends HttpClient + membersUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "PUT", @@ -5440,7 +6017,11 @@ export class Api extends HttpClient + membershipsDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -5453,7 +6034,11 @@ export class Api extends HttpClient + membershipsDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -5467,7 +6052,11 @@ export class Api extends HttpClient + membershipsUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "PUT", @@ -5495,7 +6084,12 @@ export class Api extends HttpClient + reposDelete: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -5508,7 +6102,12 @@ export class Api extends HttpClient + reposDetail: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -5521,7 +6120,12 @@ export class Api extends HttpClient + reposUpdate: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", @@ -5898,7 +6502,11 @@ export class Api extends HttpClient + subscriptionsDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "DELETE", @@ -5912,7 +6520,11 @@ export class Api extends HttpClient + subscriptionsDetail: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "GET", @@ -5926,7 +6538,11 @@ export class Api extends HttpClient + subscriptionsUpdate: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "PUT", @@ -6002,7 +6618,11 @@ export class Api extends HttpClient + eventsOrgsDetail: ( + username: string, + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/events/orgs/\${org}\`, method: "GET", @@ -6029,7 +6649,11 @@ export class Api extends HttpClient + followingDetail: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", diff --git a/tests/spec/axiosSingleHttpClient/__snapshots__/basic.test.ts.snap b/tests/spec/axiosSingleHttpClient/__snapshots__/basic.test.ts.snap index c9b04cea..4ccdd2bd 100644 --- a/tests/spec/axiosSingleHttpClient/__snapshots__/basic.test.ts.snap +++ b/tests/spec/axiosSingleHttpClient/__snapshots__/basic.test.ts.snap @@ -1911,12 +1911,19 @@ export interface UserUpdate { export type Users = User[]; -import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios"; +import type { + AxiosInstance, + AxiosRequestConfig, + AxiosResponse, + HeadersDefaults, + ResponseType, +} from "axios"; import axios from "axios"; export type QueryParamsType = Record; -export interface FullRequestParams extends Omit { +export interface FullRequestParams + extends Omit { /** set parameter to \`true\` for call \`securityWorker\` for this request */ secure?: boolean; /** request path */ @@ -1931,9 +1938,13 @@ export interface FullRequestParams extends Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; -export interface ApiConfig extends Omit { +export interface ApiConfig + extends Omit { securityWorker?: ( securityData: SecurityDataType | null, ) => Promise | AxiosRequestConfig | void; @@ -1955,8 +1966,16 @@ export class HttpClient { private secure?: boolean; private format?: ResponseType; - constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { - this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "https://api.github.com" }); + constructor({ + securityWorker, + secure, + format, + ...axiosConfig + }: ApiConfig = {}) { + this.instance = axios.create({ + ...axiosConfig, + baseURL: axiosConfig.baseURL || "https://api.github.com", + }); this.secure = secure; this.format = format; this.securityWorker = securityWorker; @@ -1966,7 +1985,10 @@ export class HttpClient { this.securityData = data; }; - protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + protected mergeRequestParams( + params1: AxiosRequestConfig, + params2?: AxiosRequestConfig, + ): AxiosRequestConfig { const method = params1.method || (params2 && params2.method); return { @@ -1974,7 +1996,11 @@ export class HttpClient { ...params1, ...(params2 || {}), headers: { - ...((method && this.instance.defaults.headers[method.toLowerCase() as keyof HeadersDefaults]) || {}), + ...((method && + this.instance.defaults.headers[ + method.toLowerCase() as keyof HeadersDefaults + ]) || + {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, @@ -1995,11 +2021,15 @@ export class HttpClient { } return Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; - const propertyContent: any[] = property instanceof Array ? property : [property]; + const propertyContent: any[] = + property instanceof Array ? property : [property]; for (const formItem of propertyContent) { const isFileType = formItem instanceof Blob || formItem instanceof File; - formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem)); + formData.append( + key, + isFileType ? formItem : this.stringifyFormItem(formItem), + ); } return formData; @@ -2023,11 +2053,21 @@ export class HttpClient { const requestParams = this.mergeRequestParams(params, secureParams); const responseFormat = format || this.format || undefined; - if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + if ( + type === ContentType.FormData && + body && + body !== null && + typeof body === "object" + ) { body = this.createFormData(body as Record); } - if (type === ContentType.Text && body && body !== null && typeof body !== "string") { + if ( + type === ContentType.Text && + body && + body !== null && + typeof body !== "string" + ) { body = JSON.stringify(body); } @@ -2277,7 +2317,11 @@ export class Api { * @name GistsPartialUpdate * @request PATCH:/gists/{id} */ - gistsPartialUpdate: (id: number, body: PatchGist, params: RequestParams = {}) => + gistsPartialUpdate: ( + id: number, + body: PatchGist, + params: RequestParams = {}, + ) => this.http.request({ path: \`/gists/\${id}\`, method: "PATCH", @@ -2307,7 +2351,11 @@ export class Api { * @name CommentsCreate * @request POST:/gists/{id}/comments */ - commentsCreate: (id: number, body: CommentBody, params: RequestParams = {}) => + commentsCreate: ( + id: number, + body: CommentBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/gists/\${id}/comments\`, method: "POST", @@ -2323,7 +2371,11 @@ export class Api { * @name CommentsDelete * @request DELETE:/gists/{id}/comments/{commentId} */ - commentsDelete: (id: number, commentId: number, params: RequestParams = {}) => + commentsDelete: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "DELETE", @@ -2336,7 +2388,11 @@ export class Api { * @name CommentsDetail * @request GET:/gists/{id}/comments/{commentId} */ - commentsDetail: (id: number, commentId: number, params: RequestParams = {}) => + commentsDetail: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "GET", @@ -2350,7 +2406,12 @@ export class Api { * @name CommentsPartialUpdate * @request PATCH:/gists/{id}/comments/{commentId} */ - commentsPartialUpdate: (id: number, commentId: number, body: Comment, params: RequestParams = {}) => + commentsPartialUpdate: ( + id: number, + commentId: number, + body: Comment, + params: RequestParams = {}, + ) => this.http.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "PATCH", @@ -2677,7 +2738,10 @@ export class Api { * @name NotificationsUpdate * @request PUT:/notifications */ - notificationsUpdate: (body: NotificationMarkRead, params: RequestParams = {}) => + notificationsUpdate: ( + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.http.request({ path: \`/notifications\`, method: "PUT", @@ -2746,7 +2810,11 @@ export class Api { * @name ThreadsSubscriptionUpdate * @request PUT:/notifications/threads/{id}/subscription */ - threadsSubscriptionUpdate: (id: number, body: PutSubscription, params: RequestParams = {}) => + threadsSubscriptionUpdate: ( + id: number, + body: PutSubscription, + params: RequestParams = {}, + ) => this.http.request({ path: \`/notifications/threads/\${id}/subscription\`, method: "PUT", @@ -2777,7 +2845,11 @@ export class Api { * @name OrgsPartialUpdate * @request PATCH:/orgs/{org} */ - orgsPartialUpdate: (org: string, body: PatchOrg, params: RequestParams = {}) => + orgsPartialUpdate: ( + org: string, + body: PatchOrg, + params: RequestParams = {}, + ) => this.http.request({ path: \`/orgs/\${org}\`, method: "PATCH", @@ -2860,7 +2932,11 @@ export class Api { * @name MembersDelete * @request DELETE:/orgs/{org}/members/{username} */ - membersDelete: (org: string, username: string, params: RequestParams = {}) => + membersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -2873,7 +2949,11 @@ export class Api { * @name MembersDetail * @request GET:/orgs/{org}/members/{username} */ - membersDetail: (org: string, username: string, params: RequestParams = {}) => + membersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -2900,7 +2980,11 @@ export class Api { * @name PublicMembersDelete * @request DELETE:/orgs/{org}/public_members/{username} */ - publicMembersDelete: (org: string, username: string, params: RequestParams = {}) => + publicMembersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -2913,7 +2997,11 @@ export class Api { * @name PublicMembersDetail * @request GET:/orgs/{org}/public_members/{username} */ - publicMembersDetail: (org: string, username: string, params: RequestParams = {}) => + publicMembersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -2926,7 +3014,11 @@ export class Api { * @name PublicMembersUpdate * @request PUT:/orgs/{org}/public_members/{username} */ - publicMembersUpdate: (org: string, username: string, params: RequestParams = {}) => + publicMembersUpdate: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "PUT", @@ -2991,7 +3083,11 @@ export class Api { * @name TeamsCreate * @request POST:/orgs/{org}/teams */ - teamsCreate: (org: string, body: OrgTeamsPost, params: RequestParams = {}) => + teamsCreate: ( + org: string, + body: OrgTeamsPost, + params: RequestParams = {}, + ) => this.http.request({ path: \`/orgs/\${org}/teams\`, method: "POST", @@ -3050,7 +3146,12 @@ export class Api { * @name ReposPartialUpdate * @request PATCH:/repos/{owner}/{repo} */ - reposPartialUpdate: (owner: string, repo: string, body: RepoEdit, params: RequestParams = {}) => + reposPartialUpdate: ( + owner: string, + repo: string, + body: RepoEdit, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}\`, method: "PATCH", @@ -3080,7 +3181,12 @@ export class Api { * @name AssigneesDetail * @request GET:/repos/{owner}/{repo}/assignees/{assignee} */ - assigneesDetail: (owner: string, repo: string, assignee: string, params: RequestParams = {}) => + assigneesDetail: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", @@ -3107,7 +3213,12 @@ export class Api { * @name BranchesDetail * @request GET:/repos/{owner}/{repo}/branches/{branch} */ - branchesDetail: (owner: string, repo: string, branch: string, params: RequestParams = {}) => + branchesDetail: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, method: "GET", @@ -3121,7 +3232,11 @@ export class Api { * @name CollaboratorsList * @request GET:/repos/{owner}/{repo}/collaborators */ - collaboratorsList: (owner: string, repo: string, params: RequestParams = {}) => + collaboratorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", @@ -3135,7 +3250,12 @@ export class Api { * @name CollaboratorsDelete * @request DELETE:/repos/{owner}/{repo}/collaborators/{user} */ - collaboratorsDelete: (owner: string, repo: string, user: string, params: RequestParams = {}) => + collaboratorsDelete: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "DELETE", @@ -3148,7 +3268,12 @@ export class Api { * @name CollaboratorsDetail * @request GET:/repos/{owner}/{repo}/collaborators/{user} */ - collaboratorsDetail: (owner: string, repo: string, user: string, params: RequestParams = {}) => + collaboratorsDetail: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "GET", @@ -3161,7 +3286,12 @@ export class Api { * @name CollaboratorsUpdate * @request PUT:/repos/{owner}/{repo}/collaborators/{user} */ - collaboratorsUpdate: (owner: string, repo: string, user: string, params: RequestParams = {}) => + collaboratorsUpdate: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "PUT", @@ -3188,7 +3318,12 @@ export class Api { * @name CommentsDelete * @request DELETE:/repos/{owner}/{repo}/comments/{commentId} */ - commentsDelete: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + commentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -3201,7 +3336,12 @@ export class Api { * @name CommentsDetail * @request GET:/repos/{owner}/{repo}/comments/{commentId} */ - commentsDetail: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + commentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -3271,7 +3411,12 @@ export class Api { * @name CommitsStatusList * @request GET:/repos/{owner}/{repo}/commits/{ref}/status */ - commitsStatusList: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + commitsStatusList: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -3285,7 +3430,12 @@ export class Api { * @name CommitsDetail * @request GET:/repos/{owner}/{repo}/commits/{shaCode} */ - commitsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + commitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}\`, method: "GET", @@ -3299,7 +3449,12 @@ export class Api { * @name CommitsCommentsList * @request GET:/repos/{owner}/{repo}/commits/{shaCode}/comments */ - commitsCommentsList: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + commitsCommentsList: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}/comments\`, method: "GET", @@ -3335,7 +3490,13 @@ export class Api { * @name CompareDetail * @request GET:/repos/{owner}/{repo}/compare/{baseId}...{headId} */ - compareDetail: (owner: string, repo: string, baseId: string, headId: string, params: RequestParams = {}) => + compareDetail: ( + owner: string, + repo: string, + baseId: string, + headId: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/compare/\${baseId}...\${headId}\`, method: "GET", @@ -3349,7 +3510,13 @@ export class Api { * @name ContentsDelete * @request DELETE:/repos/{owner}/{repo}/contents/{path} */ - contentsDelete: (owner: string, repo: string, path: string, body: DeleteFileBody, params: RequestParams = {}) => + contentsDelete: ( + owner: string, + repo: string, + path: string, + body: DeleteFileBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "DELETE", @@ -3391,7 +3558,13 @@ export class Api { * @name ContentsUpdate * @request PUT:/repos/{owner}/{repo}/contents/{path} */ - contentsUpdate: (owner: string, repo: string, path: string, body: CreateFileBody, params: RequestParams = {}) => + contentsUpdate: ( + owner: string, + repo: string, + path: string, + body: CreateFileBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "PUT", @@ -3430,7 +3603,11 @@ export class Api { * @name DeploymentsList * @request GET:/repos/{owner}/{repo}/deployments */ - deploymentsList: (owner: string, repo: string, params: RequestParams = {}) => + deploymentsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", @@ -3444,7 +3621,12 @@ export class Api { * @name DeploymentsCreate * @request POST:/repos/{owner}/{repo}/deployments */ - deploymentsCreate: (owner: string, repo: string, body: Deployment, params: RequestParams = {}) => + deploymentsCreate: ( + owner: string, + repo: string, + body: Deployment, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "POST", @@ -3460,7 +3642,12 @@ export class Api { * @name DeploymentsStatusesList * @request GET:/repos/{owner}/{repo}/deployments/{id}/statuses */ - deploymentsStatusesList: (owner: string, repo: string, id: number, params: RequestParams = {}) => + deploymentsStatusesList: ( + owner: string, + repo: string, + id: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${id}/statuses\`, method: "GET", @@ -3511,7 +3698,12 @@ export class Api { * @request DELETE:/repos/{owner}/{repo}/downloads/{downloadId} * @deprecated */ - downloadsDelete: (owner: string, repo: string, downloadId: number, params: RequestParams = {}) => + downloadsDelete: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "DELETE", @@ -3525,7 +3717,12 @@ export class Api { * @request GET:/repos/{owner}/{repo}/downloads/{downloadId} * @deprecated */ - downloadsDetail: (owner: string, repo: string, downloadId: number, params: RequestParams = {}) => + downloadsDetail: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "GET", @@ -3576,7 +3773,12 @@ export class Api { * @name ForksCreate * @request POST:/repos/{owner}/{repo}/forks */ - forksCreate: (owner: string, repo: string, body: ForkBody, params: RequestParams = {}) => + forksCreate: ( + owner: string, + repo: string, + body: ForkBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/forks\`, method: "POST", @@ -3592,7 +3794,12 @@ export class Api { * @name GitBlobsCreate * @request POST:/repos/{owner}/{repo}/git/blobs */ - gitBlobsCreate: (owner: string, repo: string, body: Blob, params: RequestParams = {}) => + gitBlobsCreate: ( + owner: string, + repo: string, + body: Blob, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/blobs\`, method: "POST", @@ -3608,7 +3815,12 @@ export class Api { * @name GitBlobsDetail * @request GET:/repos/{owner}/{repo}/git/blobs/{shaCode} */ - gitBlobsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + gitBlobsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${shaCode}\`, method: "GET", @@ -3622,7 +3834,12 @@ export class Api { * @name GitCommitsCreate * @request POST:/repos/{owner}/{repo}/git/commits */ - gitCommitsCreate: (owner: string, repo: string, body: RepoCommitBody, params: RequestParams = {}) => + gitCommitsCreate: ( + owner: string, + repo: string, + body: RepoCommitBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/commits\`, method: "POST", @@ -3638,7 +3855,12 @@ export class Api { * @name GitCommitsDetail * @request GET:/repos/{owner}/{repo}/git/commits/{shaCode} */ - gitCommitsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + gitCommitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${shaCode}\`, method: "GET", @@ -3666,7 +3888,12 @@ export class Api { * @name GitRefsCreate * @request POST:/repos/{owner}/{repo}/git/refs */ - gitRefsCreate: (owner: string, repo: string, body: RefsBody, params: RequestParams = {}) => + gitRefsCreate: ( + owner: string, + repo: string, + body: RefsBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/refs\`, method: "POST", @@ -3682,7 +3909,12 @@ export class Api { * @name GitRefsDelete * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} */ - gitRefsDelete: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + gitRefsDelete: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -3695,7 +3927,12 @@ export class Api { * @name GitRefsDetail * @request GET:/repos/{owner}/{repo}/git/refs/{ref} */ - gitRefsDetail: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + gitRefsDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "GET", @@ -3709,7 +3946,13 @@ export class Api { * @name GitRefsPartialUpdate * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} */ - gitRefsPartialUpdate: (owner: string, repo: string, ref: string, body: GitRefPatch, params: RequestParams = {}) => + gitRefsPartialUpdate: ( + owner: string, + repo: string, + ref: string, + body: GitRefPatch, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "PATCH", @@ -3725,7 +3968,12 @@ export class Api { * @name GitTagsCreate * @request POST:/repos/{owner}/{repo}/git/tags */ - gitTagsCreate: (owner: string, repo: string, body: TagBody, params: RequestParams = {}) => + gitTagsCreate: ( + owner: string, + repo: string, + body: TagBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/tags\`, method: "POST", @@ -3741,7 +3989,12 @@ export class Api { * @name GitTagsDetail * @request GET:/repos/{owner}/{repo}/git/tags/{shaCode} */ - gitTagsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + gitTagsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${shaCode}\`, method: "GET", @@ -3755,7 +4008,12 @@ export class Api { * @name GitTreesCreate * @request POST:/repos/{owner}/{repo}/git/trees */ - gitTreesCreate: (owner: string, repo: string, body: Tree, params: RequestParams = {}) => + gitTreesCreate: ( + owner: string, + repo: string, + body: Tree, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/git/trees\`, method: "POST", @@ -3809,7 +4067,12 @@ export class Api { * @name HooksCreate * @request POST:/repos/{owner}/{repo}/hooks */ - hooksCreate: (owner: string, repo: string, body: HookBody, params: RequestParams = {}) => + hooksCreate: ( + owner: string, + repo: string, + body: HookBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/hooks\`, method: "POST", @@ -3825,7 +4088,12 @@ export class Api { * @name HooksDelete * @request DELETE:/repos/{owner}/{repo}/hooks/{hookId} */ - hooksDelete: (owner: string, repo: string, hookId: number, params: RequestParams = {}) => + hooksDelete: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -3838,7 +4106,12 @@ export class Api { * @name HooksDetail * @request GET:/repos/{owner}/{repo}/hooks/{hookId} */ - hooksDetail: (owner: string, repo: string, hookId: number, params: RequestParams = {}) => + hooksDetail: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -3852,7 +4125,13 @@ export class Api { * @name HooksPartialUpdate * @request PATCH:/repos/{owner}/{repo}/hooks/{hookId} */ - hooksPartialUpdate: (owner: string, repo: string, hookId: number, body: HookBody, params: RequestParams = {}) => + hooksPartialUpdate: ( + owner: string, + repo: string, + hookId: number, + body: HookBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "PATCH", @@ -3868,7 +4147,12 @@ export class Api { * @name HooksTestsCreate * @request POST:/repos/{owner}/{repo}/hooks/{hookId}/tests */ - hooksTestsCreate: (owner: string, repo: string, hookId: number, params: RequestParams = {}) => + hooksTestsCreate: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -3921,7 +4205,12 @@ export class Api { * @name IssuesCreate * @request POST:/repos/{owner}/{repo}/issues */ - issuesCreate: (owner: string, repo: string, body: Issue, params: RequestParams = {}) => + issuesCreate: ( + owner: string, + repo: string, + body: Issue, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", @@ -3966,7 +4255,12 @@ export class Api { * @name IssuesCommentsDelete * @request DELETE:/repos/{owner}/{repo}/issues/comments/{commentId} */ - issuesCommentsDelete: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + issuesCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -3979,7 +4273,12 @@ export class Api { * @name IssuesCommentsDetail * @request GET:/repos/{owner}/{repo}/issues/comments/{commentId} */ - issuesCommentsDetail: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + issuesCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -4015,7 +4314,11 @@ export class Api { * @name IssuesEventsList * @request GET:/repos/{owner}/{repo}/issues/events */ - issuesEventsList: (owner: string, repo: string, params: RequestParams = {}) => + issuesEventsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", @@ -4029,7 +4332,12 @@ export class Api { * @name IssuesEventsDetail * @request GET:/repos/{owner}/{repo}/issues/events/{eventId} */ - issuesEventsDetail: (owner: string, repo: string, eventId: number, params: RequestParams = {}) => + issuesEventsDetail: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -4043,7 +4351,12 @@ export class Api { * @name IssuesDetail * @request GET:/repos/{owner}/{repo}/issues/{number} */ - issuesDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + issuesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "GET", @@ -4057,7 +4370,13 @@ export class Api { * @name IssuesPartialUpdate * @request PATCH:/repos/{owner}/{repo}/issues/{number} */ - issuesPartialUpdate: (owner: string, repo: string, number: number, body: Issue, params: RequestParams = {}) => + issuesPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: Issue, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "PATCH", @@ -4075,7 +4394,12 @@ export class Api { * @originalName issuesCommentsList * @duplicate */ - issuesCommentsList2: (owner: string, repo: string, number: number, params: RequestParams = {}) => + issuesCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/comments\`, method: "GET", @@ -4113,7 +4437,12 @@ export class Api { * @originalName issuesEventsList * @duplicate */ - issuesEventsList2: (owner: string, repo: string, number: number, params: RequestParams = {}) => + issuesEventsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/events\`, method: "GET", @@ -4127,9 +4456,14 @@ export class Api { * @name IssuesLabelsDelete * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels */ - issuesLabelsDelete: (owner: string, repo: string, number: number, params: RequestParams = {}) => - this.http.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, + issuesLabelsDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => + this.http.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "DELETE", ...params, }), @@ -4140,7 +4474,12 @@ export class Api { * @name IssuesLabelsList * @request GET:/repos/{owner}/{repo}/issues/{number}/labels */ - issuesLabelsList: (owner: string, repo: string, number: number, params: RequestParams = {}) => + issuesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "GET", @@ -4154,7 +4493,13 @@ export class Api { * @name IssuesLabelsCreate * @request POST:/repos/{owner}/{repo}/issues/{number}/labels */ - issuesLabelsCreate: (owner: string, repo: string, number: number, body: EmailsPost, params: RequestParams = {}) => + issuesLabelsCreate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "POST", @@ -4170,7 +4515,13 @@ export class Api { * @name IssuesLabelsUpdate * @request PUT:/repos/{owner}/{repo}/issues/{number}/labels */ - issuesLabelsUpdate: (owner: string, repo: string, number: number, body: EmailsPost, params: RequestParams = {}) => + issuesLabelsUpdate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "PUT", @@ -4188,7 +4539,13 @@ export class Api { * @originalName issuesLabelsDelete * @duplicate */ - issuesLabelsDelete2: (owner: string, repo: string, number: number, name: string, params: RequestParams = {}) => + issuesLabelsDelete2: ( + owner: string, + repo: string, + number: number, + name: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels/\${name}\`, method: "DELETE", @@ -4215,7 +4572,12 @@ export class Api { * @name KeysCreate * @request POST:/repos/{owner}/{repo}/keys */ - keysCreate: (owner: string, repo: string, body: UserKeysPost, params: RequestParams = {}) => + keysCreate: ( + owner: string, + repo: string, + body: UserKeysPost, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/keys\`, method: "POST", @@ -4231,7 +4593,12 @@ export class Api { * @name KeysDelete * @request DELETE:/repos/{owner}/{repo}/keys/{keyId} */ - keysDelete: (owner: string, repo: string, keyId: number, params: RequestParams = {}) => + keysDelete: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -4244,7 +4611,12 @@ export class Api { * @name KeysDetail * @request GET:/repos/{owner}/{repo}/keys/{keyId} */ - keysDetail: (owner: string, repo: string, keyId: number, params: RequestParams = {}) => + keysDetail: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -4272,7 +4644,12 @@ export class Api { * @name LabelsCreate * @request POST:/repos/{owner}/{repo}/labels */ - labelsCreate: (owner: string, repo: string, body: EmailsPost, params: RequestParams = {}) => + labelsCreate: ( + owner: string, + repo: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", @@ -4288,7 +4665,12 @@ export class Api { * @name LabelsDelete * @request DELETE:/repos/{owner}/{repo}/labels/{name} */ - labelsDelete: (owner: string, repo: string, name: string, params: RequestParams = {}) => + labelsDelete: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -4301,7 +4683,12 @@ export class Api { * @name LabelsDetail * @request GET:/repos/{owner}/{repo}/labels/{name} */ - labelsDetail: (owner: string, repo: string, name: string, params: RequestParams = {}) => + labelsDetail: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -4315,7 +4702,13 @@ export class Api { * @name LabelsPartialUpdate * @request PATCH:/repos/{owner}/{repo}/labels/{name} */ - labelsPartialUpdate: (owner: string, repo: string, name: string, body: EmailsPost, params: RequestParams = {}) => + labelsPartialUpdate: ( + owner: string, + repo: string, + name: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "PATCH", @@ -4345,7 +4738,12 @@ export class Api { * @name MergesCreate * @request POST:/repos/{owner}/{repo}/merges */ - mergesCreate: (owner: string, repo: string, body: MergesBody, params: RequestParams = {}) => + mergesCreate: ( + owner: string, + repo: string, + body: MergesBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/merges\`, method: "POST", @@ -4391,7 +4789,12 @@ export class Api { * @name MilestonesCreate * @request POST:/repos/{owner}/{repo}/milestones */ - milestonesCreate: (owner: string, repo: string, body: MilestoneUpdate, params: RequestParams = {}) => + milestonesCreate: ( + owner: string, + repo: string, + body: MilestoneUpdate, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/milestones\`, method: "POST", @@ -4407,7 +4810,12 @@ export class Api { * @name MilestonesDelete * @request DELETE:/repos/{owner}/{repo}/milestones/{number} */ - milestonesDelete: (owner: string, repo: string, number: number, params: RequestParams = {}) => + milestonesDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "DELETE", @@ -4420,7 +4828,12 @@ export class Api { * @name MilestonesDetail * @request GET:/repos/{owner}/{repo}/milestones/{number} */ - milestonesDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + milestonesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "GET", @@ -4456,7 +4869,12 @@ export class Api { * @name MilestonesLabelsList * @request GET:/repos/{owner}/{repo}/milestones/{number}/labels */ - milestonesLabelsList: (owner: string, repo: string, number: number, params: RequestParams = {}) => + milestonesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}/labels\`, method: "GET", @@ -4503,7 +4921,12 @@ export class Api { * @name NotificationsUpdate * @request PUT:/repos/{owner}/{repo}/notifications */ - notificationsUpdate: (owner: string, repo: string, body: NotificationMarkRead, params: RequestParams = {}) => + notificationsUpdate: ( + owner: string, + repo: string, + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/notifications\`, method: "PUT", @@ -4551,7 +4974,12 @@ export class Api { * @name PullsCreate * @request POST:/repos/{owner}/{repo}/pulls */ - pullsCreate: (owner: string, repo: string, body: PullsPost, params: RequestParams = {}) => + pullsCreate: ( + owner: string, + repo: string, + body: PullsPost, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls\`, method: "POST", @@ -4596,7 +5024,12 @@ export class Api { * @name PullsCommentsDelete * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{commentId} */ - pullsCommentsDelete: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + pullsCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -4609,7 +5042,12 @@ export class Api { * @name PullsCommentsDetail * @request GET:/repos/{owner}/{repo}/pulls/comments/{commentId} */ - pullsCommentsDetail: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + pullsCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -4645,7 +5083,12 @@ export class Api { * @name PullsDetail * @request GET:/repos/{owner}/{repo}/pulls/{number} */ - pullsDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + pullsDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "GET", @@ -4659,7 +5102,13 @@ export class Api { * @name PullsPartialUpdate * @request PATCH:/repos/{owner}/{repo}/pulls/{number} */ - pullsPartialUpdate: (owner: string, repo: string, number: number, body: PullUpdate, params: RequestParams = {}) => + pullsPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: PullUpdate, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "PATCH", @@ -4677,7 +5126,12 @@ export class Api { * @originalName pullsCommentsList * @duplicate */ - pullsCommentsList2: (owner: string, repo: string, number: number, params: RequestParams = {}) => + pullsCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/comments\`, method: "GET", @@ -4713,7 +5167,12 @@ export class Api { * @name PullsCommitsList * @request GET:/repos/{owner}/{repo}/pulls/{number}/commits */ - pullsCommitsList: (owner: string, repo: string, number: number, params: RequestParams = {}) => + pullsCommitsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/commits\`, method: "GET", @@ -4727,7 +5186,12 @@ export class Api { * @name PullsFilesList * @request GET:/repos/{owner}/{repo}/pulls/{number}/files */ - pullsFilesList: (owner: string, repo: string, number: number, params: RequestParams = {}) => + pullsFilesList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/files\`, method: "GET", @@ -4741,7 +5205,12 @@ export class Api { * @name PullsMergeList * @request GET:/repos/{owner}/{repo}/pulls/{number}/merge */ - pullsMergeList: (owner: string, repo: string, number: number, params: RequestParams = {}) => + pullsMergeList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "GET", @@ -4754,7 +5223,13 @@ export class Api { * @name PullsMergeUpdate * @request PUT:/repos/{owner}/{repo}/pulls/{number}/merge */ - pullsMergeUpdate: (owner: string, repo: string, number: number, body: MergePullBody, params: RequestParams = {}) => + pullsMergeUpdate: ( + owner: string, + repo: string, + number: number, + body: MergePullBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "PUT", @@ -4807,7 +5282,12 @@ export class Api { * @name ReleasesCreate * @request POST:/repos/{owner}/{repo}/releases */ - releasesCreate: (owner: string, repo: string, body: ReleaseCreate, params: RequestParams = {}) => + releasesCreate: ( + owner: string, + repo: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/releases\`, method: "POST", @@ -4823,7 +5303,12 @@ export class Api { * @name ReleasesAssetsDelete * @request DELETE:/repos/{owner}/{repo}/releases/assets/{id} */ - releasesAssetsDelete: (owner: string, repo: string, id: string, params: RequestParams = {}) => + releasesAssetsDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "DELETE", @@ -4836,7 +5321,12 @@ export class Api { * @name ReleasesAssetsDetail * @request GET:/repos/{owner}/{repo}/releases/assets/{id} */ - releasesAssetsDetail: (owner: string, repo: string, id: string, params: RequestParams = {}) => + releasesAssetsDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "GET", @@ -4872,7 +5362,12 @@ export class Api { * @name ReleasesDelete * @request DELETE:/repos/{owner}/{repo}/releases/{id} */ - releasesDelete: (owner: string, repo: string, id: string, params: RequestParams = {}) => + releasesDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "DELETE", @@ -4885,7 +5380,12 @@ export class Api { * @name ReleasesDetail * @request GET:/repos/{owner}/{repo}/releases/{id} */ - releasesDetail: (owner: string, repo: string, id: string, params: RequestParams = {}) => + releasesDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "GET", @@ -4899,7 +5399,13 @@ export class Api { * @name ReleasesPartialUpdate * @request PATCH:/repos/{owner}/{repo}/releases/{id} */ - releasesPartialUpdate: (owner: string, repo: string, id: string, body: ReleaseCreate, params: RequestParams = {}) => + releasesPartialUpdate: ( + owner: string, + repo: string, + id: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "PATCH", @@ -4915,7 +5421,12 @@ export class Api { * @name ReleasesAssetsList * @request GET:/repos/{owner}/{repo}/releases/{id}/assets */ - releasesAssetsList: (owner: string, repo: string, id: string, params: RequestParams = {}) => + releasesAssetsList: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}/assets\`, method: "GET", @@ -4943,7 +5454,11 @@ export class Api { * @name StatsCodeFrequencyList * @request GET:/repos/{owner}/{repo}/stats/code_frequency */ - statsCodeFrequencyList: (owner: string, repo: string, params: RequestParams = {}) => + statsCodeFrequencyList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -4957,7 +5472,11 @@ export class Api { * @name StatsCommitActivityList * @request GET:/repos/{owner}/{repo}/stats/commit_activity */ - statsCommitActivityList: (owner: string, repo: string, params: RequestParams = {}) => + statsCommitActivityList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -4971,7 +5490,11 @@ export class Api { * @name StatsContributorsList * @request GET:/repos/{owner}/{repo}/stats/contributors */ - statsContributorsList: (owner: string, repo: string, params: RequestParams = {}) => + statsContributorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -4985,7 +5508,11 @@ export class Api { * @name StatsParticipationList * @request GET:/repos/{owner}/{repo}/stats/participation */ - statsParticipationList: (owner: string, repo: string, params: RequestParams = {}) => + statsParticipationList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -4999,7 +5526,11 @@ export class Api { * @name StatsPunchCardList * @request GET:/repos/{owner}/{repo}/stats/punch_card */ - statsPunchCardList: (owner: string, repo: string, params: RequestParams = {}) => + statsPunchCardList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -5013,7 +5544,12 @@ export class Api { * @name StatusesDetail * @request GET:/repos/{owner}/{repo}/statuses/{ref} */ - statusesDetail: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + statusesDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "GET", @@ -5027,7 +5563,13 @@ export class Api { * @name StatusesCreate * @request POST:/repos/{owner}/{repo}/statuses/{ref} */ - statusesCreate: (owner: string, repo: string, ref: string, body: HeadBranch, params: RequestParams = {}) => + statusesCreate: ( + owner: string, + repo: string, + ref: string, + body: HeadBranch, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "POST", @@ -5043,7 +5585,11 @@ export class Api { * @name SubscribersList * @request GET:/repos/{owner}/{repo}/subscribers */ - subscribersList: (owner: string, repo: string, params: RequestParams = {}) => + subscribersList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", @@ -5057,7 +5603,11 @@ export class Api { * @name SubscriptionDelete * @request DELETE:/repos/{owner}/{repo}/subscription */ - subscriptionDelete: (owner: string, repo: string, params: RequestParams = {}) => + subscriptionDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -5070,7 +5620,11 @@ export class Api { * @name SubscriptionList * @request GET:/repos/{owner}/{repo}/subscription */ - subscriptionList: (owner: string, repo: string, params: RequestParams = {}) => + subscriptionList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -5084,7 +5638,12 @@ export class Api { * @name SubscriptionUpdate * @request PUT:/repos/{owner}/{repo}/subscription */ - subscriptionUpdate: (owner: string, repo: string, body: SubscriptionBody, params: RequestParams = {}) => + subscriptionUpdate: ( + owner: string, + repo: string, + body: SubscriptionBody, + params: RequestParams = {}, + ) => this.http.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "PUT", @@ -5374,7 +5933,11 @@ export class Api { * @name TeamsPartialUpdate * @request PATCH:/teams/{teamId} */ - teamsPartialUpdate: (teamId: number, body: EditTeam, params: RequestParams = {}) => + teamsPartialUpdate: ( + teamId: number, + body: EditTeam, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}\`, method: "PATCH", @@ -5405,7 +5968,11 @@ export class Api { * @request DELETE:/teams/{teamId}/members/{username} * @deprecated */ - membersDelete: (teamId: number, username: string, params: RequestParams = {}) => + membersDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -5419,7 +5986,11 @@ export class Api { * @request GET:/teams/{teamId}/members/{username} * @deprecated */ - membersDetail: (teamId: number, username: string, params: RequestParams = {}) => + membersDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -5433,7 +6004,11 @@ export class Api { * @request PUT:/teams/{teamId}/members/{username} * @deprecated */ - membersUpdate: (teamId: number, username: string, params: RequestParams = {}) => + membersUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "PUT", @@ -5446,7 +6021,11 @@ export class Api { * @name MembershipsDelete * @request DELETE:/teams/{teamId}/memberships/{username} */ - membershipsDelete: (teamId: number, username: string, params: RequestParams = {}) => + membershipsDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -5459,7 +6038,11 @@ export class Api { * @name MembershipsDetail * @request GET:/teams/{teamId}/memberships/{username} */ - membershipsDetail: (teamId: number, username: string, params: RequestParams = {}) => + membershipsDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -5473,7 +6056,11 @@ export class Api { * @name MembershipsUpdate * @request PUT:/teams/{teamId}/memberships/{username} */ - membershipsUpdate: (teamId: number, username: string, params: RequestParams = {}) => + membershipsUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "PUT", @@ -5501,7 +6088,12 @@ export class Api { * @name ReposDelete * @request DELETE:/teams/{teamId}/repos/{owner}/{repo} */ - reposDelete: (teamId: number, owner: string, repo: string, params: RequestParams = {}) => + reposDelete: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -5514,7 +6106,12 @@ export class Api { * @name ReposDetail * @request GET:/teams/{teamId}/repos/{owner}/{repo} */ - reposDetail: (teamId: number, owner: string, repo: string, params: RequestParams = {}) => + reposDetail: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -5527,7 +6124,12 @@ export class Api { * @name ReposUpdate * @request PUT:/teams/{teamId}/repos/{owner}/{repo} */ - reposUpdate: (teamId: number, owner: string, repo: string, params: RequestParams = {}) => + reposUpdate: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", @@ -5904,7 +6506,11 @@ export class Api { * @request DELETE:/user/subscriptions/{owner}/{repo} * @deprecated */ - subscriptionsDelete: (owner: string, repo: string, params: RequestParams = {}) => + subscriptionsDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "DELETE", @@ -5918,7 +6524,11 @@ export class Api { * @request GET:/user/subscriptions/{owner}/{repo} * @deprecated */ - subscriptionsDetail: (owner: string, repo: string, params: RequestParams = {}) => + subscriptionsDetail: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "GET", @@ -5932,7 +6542,11 @@ export class Api { * @request PUT:/user/subscriptions/{owner}/{repo} * @deprecated */ - subscriptionsUpdate: (owner: string, repo: string, params: RequestParams = {}) => + subscriptionsUpdate: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "PUT", @@ -6008,7 +6622,11 @@ export class Api { * @name EventsOrgsDetail * @request GET:/users/{username}/events/orgs/{org} */ - eventsOrgsDetail: (username: string, org: string, params: RequestParams = {}) => + eventsOrgsDetail: ( + username: string, + org: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/users/\${username}/events/orgs/\${org}\`, method: "GET", @@ -6035,7 +6653,11 @@ export class Api { * @name FollowingDetail * @request GET:/users/{username}/following/{targetUser} */ - followingDetail: (username: string, targetUser: string, params: RequestParams = {}) => + followingDetail: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.http.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", diff --git a/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap b/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap index 6d1acce1..9e90641f 100644 --- a/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap +++ b/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap @@ -35,16 +35,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -63,7 +69,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -96,9 +103,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -109,8 +122,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -127,7 +145,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -140,7 +161,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,15 +207,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -227,7 +261,9 @@ export class HttpClient { * @title No title * @baseUrl https://example.com */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { test = { /** * @description Test diff --git a/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap b/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap index 723d90fb..b8d60d05 100644 --- a/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap +++ b/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap @@ -75,16 +75,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -103,7 +109,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -136,9 +143,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -149,8 +162,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -167,7 +185,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -180,7 +201,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -224,15 +247,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -273,7 +307,9 @@ export class HttpClient { * * Strong authentication, without the passwords. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { key = { /** * @description Revoke an Authentiq ID using email & phone. If called with \`email\` and \`phone\` only, a verification code will be sent by email. Do a second call adding \`code\` to complete the revocation. diff --git a/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap b/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap index c3867fde..2371e64c 100644 --- a/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap +++ b/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap @@ -35,16 +35,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -63,7 +69,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -96,9 +103,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -109,8 +122,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -127,7 +145,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -140,7 +161,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,15 +207,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -233,7 +267,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Returns all pets from the system that the user has access to Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. diff --git a/tests/spec/deprecated/__snapshots__/basic.test.ts.snap b/tests/spec/deprecated/__snapshots__/basic.test.ts.snap index 33fb2a46..745c29a3 100644 --- a/tests/spec/deprecated/__snapshots__/basic.test.ts.snap +++ b/tests/spec/deprecated/__snapshots__/basic.test.ts.snap @@ -35,16 +35,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -63,7 +69,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -96,9 +103,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -109,8 +122,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -127,7 +145,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -140,7 +161,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,15 +207,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -233,7 +267,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pets = { /** * @description Returns all pets from the system that the user has access to Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. diff --git a/tests/spec/discriminator/__snapshots__/basic.test.ts.snap b/tests/spec/discriminator/__snapshots__/basic.test.ts.snap index 8b0c6bc9..18a9f445 100644 --- a/tests/spec/discriminator/__snapshots__/basic.test.ts.snap +++ b/tests/spec/discriminator/__snapshots__/basic.test.ts.snap @@ -46,7 +46,10 @@ export type FileBlockWithEnumDTO = BaseBlockDtoWithEnum & { }; export type BlockDTO = BaseBlockDto & - (BaseBlockDtoTypeMapping<"csv", CsvBlockDTO> | BaseBlockDtoTypeMapping<"file", FileBlockDTO>); + ( + | BaseBlockDtoTypeMapping<"csv", CsvBlockDTO> + | BaseBlockDtoTypeMapping<"file", FileBlockDTO> + ); export type CsvBlockDTO = BaseBlockDto & { /** @default "csv" */ @@ -61,7 +64,11 @@ export type FileBlockDTO = BaseBlockDto & { }; export type Pet = BasePet & - (BasePetPetTypeMapping<"dog", Dog> | BasePetPetTypeMapping<"cat", Cat> | BasePetPetTypeMapping<"lizard", Lizard>); + ( + | BasePetPetTypeMapping<"dog", Dog> + | BasePetPetTypeMapping<"cat", Cat> + | BasePetPetTypeMapping<"lizard", Lizard> + ); export type PetOnlyDiscriminator = | ({ @@ -111,11 +118,12 @@ export type LizardWithEnum = BasePetWithEnum & { lovesRocks?: boolean; }; -export type InvalidDiscriminatorPropertyName = BaseInvalidDiscriminatorPropertyName & - ( - | BaseInvalidDiscriminatorPropertyNameTypeMapping<"num", number> - | BaseInvalidDiscriminatorPropertyNameTypeMapping<"str", string> - ); +export type InvalidDiscriminatorPropertyName = + BaseInvalidDiscriminatorPropertyName & + ( + | BaseInvalidDiscriminatorPropertyNameTypeMapping<"num", number> + | BaseInvalidDiscriminatorPropertyNameTypeMapping<"str", string> + ); /** kek pek */ export type Variant = diff --git a/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap b/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap index 6d14845d..a19e7f6e 100644 --- a/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap +++ b/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap @@ -37,16 +37,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -65,7 +71,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -98,9 +105,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -111,8 +124,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -129,7 +147,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -142,7 +163,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -186,15 +209,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -229,7 +263,9 @@ export class HttpClient { * @title unset * @version unset */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { foobar = { /** * No description diff --git a/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap b/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap index 002814ef..12814a14 100644 --- a/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap +++ b/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap @@ -227,16 +227,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -255,7 +261,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -288,9 +295,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -301,8 +314,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -319,7 +337,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -332,7 +353,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -376,15 +399,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -419,7 +453,9 @@ export class HttpClient { * @title No title * @baseUrl http://localhost:8080/api/v1 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { auth = { /** * No description @@ -588,7 +624,11 @@ export class Api extends HttpClient + updateProject: ( + id: string, + data: ProjectUpdateType, + params: RequestParams = {}, + ) => this.request({ path: \`/projects/\${id}\`, method: "PATCH", diff --git a/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap b/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap index ed78ae39..56d240df 100644 --- a/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap @@ -204,16 +204,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -232,7 +238,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -265,9 +272,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -278,8 +291,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -296,7 +314,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -309,7 +330,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -353,15 +376,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -403,7 +437,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description @@ -476,7 +512,10 @@ export class Api extends HttpClient + singleFormUrlEncodedRequest: ( + data: SingleFormUrlEncodedRequestPayloadTTT, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/single-form-url-encoded\`, method: "POST", @@ -493,7 +532,10 @@ export class Api extends HttpClient + formUrlEncodedRequest: ( + data: FormUrlEncodedRequestPayloadTTT, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/form-url-encoded\`, method: "POST", @@ -512,7 +554,10 @@ export class Api extends HttpClient + formUrlEncodedRequest2: ( + data: FormUrlEncodedRequest2PayloadTTT, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/end-form-url-encoded\`, method: "POST", @@ -574,7 +619,11 @@ export class Api extends HttpClient + updatePetWithForm: ( + petId: number, + data: UpdatePetWithFormPayloadTTT, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/\${petId}\`, method: "POST", @@ -610,7 +659,11 @@ export class Api extends HttpClient + uploadFile: ( + petId: number, + data: UploadFilePayloadTTT, + params: RequestParams = {}, + ) => this.request({ path: \`/pet/\${petId}/uploadImage\`, method: "POST", @@ -715,7 +768,10 @@ export class Api extends HttpClient + createUsersWithArrayInput: ( + body: CreateUsersWithArrayInputPayloadTTT, + params: RequestParams = {}, + ) => this.request({ path: \`/user/createWithArray\`, method: "POST", @@ -732,7 +788,10 @@ export class Api extends HttpClient + createUsersWithListInput: ( + body: CreateUsersWithListInputPayloadTTT, + params: RequestParams = {}, + ) => this.request({ path: \`/user/createWithList\`, method: "POST", diff --git a/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap b/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap index cad67c31..d5b1f33e 100644 --- a/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap @@ -110,16 +110,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -138,7 +144,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -171,9 +178,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -184,8 +197,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -202,7 +220,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -215,7 +236,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -259,15 +282,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -308,7 +342,9 @@ export class HttpClient { * * Strong authentication, without the passwords. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { key = { /** * @description Revoke an Authentiq ID using email & phone. If called with \`email\` and \`phone\` only, a verification code will be sent by email. Do a second call adding \`code\` to complete the revocation. @@ -317,7 +353,10 @@ export class Api extends HttpClient + keyRevokeNosecret: ( + query: KeyRevokeNosecretParams, + params: RequestParams = {}, + ) => this.request< { /** pending or done */ @@ -362,7 +401,10 @@ export class Api extends HttpClient + keyRevoke: ( + { barBaz, pk, ...query }: KeyRevokeParams, + params: RequestParams = {}, + ) => this.request({ path: \`/key/\${barBaz}/\${pk}\`, method: "DELETE", @@ -379,7 +421,10 @@ export class Api extends HttpClient + keyRevoke2: ( + { pk, ...query }: KeyRevoke2Params, + params: RequestParams = {}, + ) => this.request< { /** done */ @@ -530,7 +575,11 @@ export class Api extends HttpClient + pushLoginRequest: ( + query: PushLoginRequestParams, + body: PushToken, + params: RequestParams = {}, + ) => this.request< { /** sent */ @@ -554,7 +603,11 @@ export class Api extends HttpClient + signRequest: ( + query: SignRequestParams, + body: Claims, + params: RequestParams = {}, + ) => this.request< { /** 20-character ID */ diff --git a/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap b/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap index 0f42c0f2..5e5b57b4 100644 --- a/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap @@ -190,16 +190,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -218,7 +224,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -251,9 +258,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -264,8 +277,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -282,7 +300,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -295,7 +316,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -339,15 +362,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -389,7 +423,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description diff --git a/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap b/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap index 67db784b..ecf1592f 100644 --- a/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap @@ -185,16 +185,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -213,7 +219,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -246,9 +253,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -259,8 +272,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -277,7 +295,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -290,7 +311,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -334,15 +357,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -384,7 +418,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description diff --git a/tests/spec/js/__snapshots__/basic.test.ts.snap b/tests/spec/js/__snapshots__/basic.test.ts.snap index b3765c7a..d70bd7ec 100644 --- a/tests/spec/js/__snapshots__/basic.test.ts.snap +++ b/tests/spec/js/__snapshots__/basic.test.ts.snap @@ -28,7 +28,10 @@ export class HttpClient { secure; format; constructor({ securityWorker, secure, format, ...axiosConfig } = {}) { - this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "https://api.github.com" }); + this.instance = axios.create({ + ...axiosConfig, + baseURL: axiosConfig.baseURL || "https://api.github.com", + }); this.secure = secure; this.format = format; this.securityWorker = securityWorker; @@ -43,7 +46,8 @@ export class HttpClient { ...params1, ...(params2 || {}), headers: { - ...((method && this.instance.defaults.headers[method.toLowerCase()]) || {}), + ...((method && this.instance.defaults.headers[method.toLowerCase()]) || + {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, @@ -65,7 +69,10 @@ export class HttpClient { const propertyContent = property instanceof Array ? property : [property]; for (const formItem of propertyContent) { const isFileType = formItem instanceof Blob || formItem instanceof File; - formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem)); + formData.append( + key, + isFileType ? formItem : this.stringifyFormItem(formItem), + ); } return formData; }, new FormData()); @@ -78,10 +85,20 @@ export class HttpClient { {}; const requestParams = this.mergeRequestParams(params, secureParams); const responseFormat = format || this.format || undefined; - if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + if ( + type === ContentType.FormData && + body && + body !== null && + typeof body === "object" + ) { body = this.createFormData(body); } - if (type === ContentType.Text && body && body !== null && typeof body !== "string") { + if ( + type === ContentType.Text && + body && + body !== null && + typeof body !== "string" + ) { body = JSON.stringify(body); } return this.instance.request({ diff --git a/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap b/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap index 2d8d2822..339665bc 100644 --- a/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap +++ b/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap @@ -51,9 +51,15 @@ export class HttpClient { } toQueryString(rawQuery) { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } addQueryParams(rawQuery) { @@ -62,8 +68,13 @@ export class HttpClient { } contentFormatters = { [ContentType.Json]: (input) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -110,7 +121,17 @@ export class HttpClient { this.abortControllers.delete(cancelToken); } }; - request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => { + request = async ({ + body, + secure, + path, + type, + query, + format, + baseUrl, + cancelToken, + ...params + }) => { const secureParams = ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && @@ -120,15 +141,26 @@ export class HttpClient { const queryString = query && this.toQueryString(query); const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone(); r.data = null; r.error = null; diff --git a/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap b/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap index 84a2dd15..a327a70d 100644 --- a/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap +++ b/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap @@ -160,16 +160,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -188,7 +194,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -221,9 +228,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -234,8 +247,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -252,7 +270,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -265,7 +286,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -309,15 +332,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -359,7 +393,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description diff --git a/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap b/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap index 6bca7c9c..e8973292 100644 --- a/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap +++ b/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap @@ -160,16 +160,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -188,7 +194,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -221,9 +228,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -234,8 +247,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -252,7 +270,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -265,7 +286,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -309,15 +332,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -359,7 +393,9 @@ export class HttpClient { * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key \`special-key\` to test the authorization filters. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { pet = { /** * No description diff --git a/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap b/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap index e5461dd3..32a50eb0 100644 --- a/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap +++ b/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap @@ -35,16 +35,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -63,7 +69,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -96,9 +103,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -109,8 +122,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -127,7 +145,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -140,7 +161,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,15 +207,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -233,7 +267,9 @@ export class HttpClient { * * A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { wrongPathParams1 = { /** * @description DDD diff --git a/tests/spec/patch/__snapshots__/basic.test.ts.snap b/tests/spec/patch/__snapshots__/basic.test.ts.snap index 330de766..ec3eeb14 100644 --- a/tests/spec/patch/__snapshots__/basic.test.ts.snap +++ b/tests/spec/patch/__snapshots__/basic.test.ts.snap @@ -1792,16 +1792,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -1820,7 +1826,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -1853,9 +1860,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -1866,8 +1879,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -1884,7 +1902,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -1897,7 +1918,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -1941,15 +1964,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -1987,7 +2021,9 @@ export class HttpClient { * @baseUrl https://api.github.com * @externalDocs https://developer.github.com/v3/ */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { someTest = { /** * No description @@ -2192,7 +2228,11 @@ export class Api extends HttpClient + gistsPartialUpdate: ( + id: number, + body: PatchGist, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}\`, method: "PATCH", @@ -2222,7 +2262,11 @@ export class Api extends HttpClient + commentsCreate: ( + id: number, + body: CommentBody, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments\`, method: "POST", @@ -2238,7 +2282,11 @@ export class Api extends HttpClient + commentsDelete: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "DELETE", @@ -2251,7 +2299,11 @@ export class Api extends HttpClient + commentsDetail: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "GET", @@ -2265,7 +2317,12 @@ export class Api extends HttpClient + commentsPartialUpdate: ( + id: number, + commentId: number, + body: Comment, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "PATCH", @@ -2563,7 +2620,10 @@ export class Api extends HttpClient + notificationsUpdate: ( + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications\`, method: "PUT", @@ -2632,7 +2692,11 @@ export class Api extends HttpClient + threadsSubscriptionUpdate: ( + id: number, + body: PutSubscription, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications/threads/\${id}/subscription\`, method: "PUT", @@ -2663,7 +2727,11 @@ export class Api extends HttpClient + orgsPartialUpdate: ( + org: string, + body: PatchOrg, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}\`, method: "PATCH", @@ -2737,7 +2805,11 @@ export class Api extends HttpClient + membersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -2750,7 +2822,11 @@ export class Api extends HttpClient + membersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -2777,7 +2853,11 @@ export class Api extends HttpClient + publicMembersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -2790,7 +2870,11 @@ export class Api extends HttpClient + publicMembersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -2803,7 +2887,11 @@ export class Api extends HttpClient + publicMembersUpdate: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "PUT", @@ -2868,7 +2956,11 @@ export class Api extends HttpClient + teamsCreate: ( + org: string, + body: OrgTeamsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams\`, method: "POST", @@ -2927,7 +3019,12 @@ export class Api extends HttpClient + reposPartialUpdate: ( + owner: string, + repo: string, + body: RepoEdit, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}\`, method: "PATCH", @@ -2957,7 +3054,12 @@ export class Api extends HttpClient + assigneesDetail: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", @@ -2984,7 +3086,12 @@ export class Api extends HttpClient + branchesDetail: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, method: "GET", @@ -2998,7 +3105,11 @@ export class Api extends HttpClient + collaboratorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", @@ -3012,7 +3123,12 @@ export class Api extends HttpClient + collaboratorsDelete: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "DELETE", @@ -3025,7 +3141,12 @@ export class Api extends HttpClient + collaboratorsDetail: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "GET", @@ -3038,7 +3159,12 @@ export class Api extends HttpClient + collaboratorsUpdate: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "PUT", @@ -3065,7 +3191,12 @@ export class Api extends HttpClient + commentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -3078,7 +3209,12 @@ export class Api extends HttpClient + commentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -3140,7 +3276,12 @@ export class Api extends HttpClient + commitsStatusList: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -3154,7 +3295,12 @@ export class Api extends HttpClient + commitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}\`, method: "GET", @@ -3168,7 +3314,12 @@ export class Api extends HttpClient + commitsCommentsList: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}/comments\`, method: "GET", @@ -3204,7 +3355,13 @@ export class Api extends HttpClient + compareDetail: ( + owner: string, + repo: string, + baseId: string, + headId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/compare/\${baseId}...\${headId}\`, method: "GET", @@ -3218,7 +3375,13 @@ export class Api extends HttpClient + contentsDelete: ( + owner: string, + repo: string, + path: string, + body: DeleteFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "DELETE", @@ -3258,7 +3421,13 @@ export class Api extends HttpClient + contentsUpdate: ( + owner: string, + repo: string, + path: string, + body: CreateFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "PUT", @@ -3296,7 +3465,11 @@ export class Api extends HttpClient + deploymentsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", @@ -3310,7 +3483,12 @@ export class Api extends HttpClient + deploymentsCreate: ( + owner: string, + repo: string, + body: Deployment, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "POST", @@ -3326,7 +3504,12 @@ export class Api extends HttpClient + deploymentsStatusesList: ( + owner: string, + repo: string, + id: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${id}/statuses\`, method: "GET", @@ -3377,7 +3560,12 @@ export class Api extends HttpClient + downloadsDelete: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "DELETE", @@ -3391,7 +3579,12 @@ export class Api extends HttpClient + downloadsDetail: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "GET", @@ -3442,7 +3635,12 @@ export class Api extends HttpClient + forksCreate: ( + owner: string, + repo: string, + body: ForkBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/forks\`, method: "POST", @@ -3458,7 +3656,12 @@ export class Api extends HttpClient + gitBlobsCreate: ( + owner: string, + repo: string, + body: Blob, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs\`, method: "POST", @@ -3474,7 +3677,12 @@ export class Api extends HttpClient + gitBlobsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${shaCode}\`, method: "GET", @@ -3488,7 +3696,12 @@ export class Api extends HttpClient + gitCommitsCreate: ( + owner: string, + repo: string, + body: RepoCommitBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits\`, method: "POST", @@ -3504,7 +3717,12 @@ export class Api extends HttpClient + gitCommitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${shaCode}\`, method: "GET", @@ -3532,7 +3750,12 @@ export class Api extends HttpClient + gitRefsCreate: ( + owner: string, + repo: string, + body: RefsBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs\`, method: "POST", @@ -3548,7 +3771,12 @@ export class Api extends HttpClient + gitRefsDelete: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -3561,7 +3789,12 @@ export class Api extends HttpClient + gitRefsDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "GET", @@ -3575,7 +3808,13 @@ export class Api extends HttpClient + gitRefsPartialUpdate: ( + owner: string, + repo: string, + ref: string, + body: GitRefPatch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "PATCH", @@ -3591,7 +3830,12 @@ export class Api extends HttpClient + gitTagsCreate: ( + owner: string, + repo: string, + body: TagBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags\`, method: "POST", @@ -3607,7 +3851,12 @@ export class Api extends HttpClient + gitTagsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${shaCode}\`, method: "GET", @@ -3621,7 +3870,12 @@ export class Api extends HttpClient + gitTreesCreate: ( + owner: string, + repo: string, + body: Tree, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/trees\`, method: "POST", @@ -3674,7 +3928,12 @@ export class Api extends HttpClient + hooksCreate: ( + owner: string, + repo: string, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks\`, method: "POST", @@ -3690,7 +3949,12 @@ export class Api extends HttpClient + hooksDelete: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -3703,7 +3967,12 @@ export class Api extends HttpClient + hooksDetail: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -3717,7 +3986,13 @@ export class Api extends HttpClient + hooksPartialUpdate: ( + owner: string, + repo: string, + hookId: number, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "PATCH", @@ -3733,7 +4008,12 @@ export class Api extends HttpClient + hooksTestsCreate: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -3777,7 +4057,12 @@ export class Api extends HttpClient + issuesCreate: ( + owner: string, + repo: string, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", @@ -3817,7 +4102,12 @@ export class Api extends HttpClient + issuesCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -3830,7 +4120,12 @@ export class Api extends HttpClient + issuesCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -3866,7 +4161,11 @@ export class Api extends HttpClient + issuesEventsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", @@ -3880,7 +4179,12 @@ export class Api extends HttpClient + issuesEventsDetail: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -3894,7 +4198,12 @@ export class Api extends HttpClient + issuesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "GET", @@ -3908,7 +4217,13 @@ export class Api extends HttpClient + issuesPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "PATCH", @@ -3926,7 +4241,12 @@ export class Api extends HttpClient + issuesCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/comments\`, method: "GET", @@ -3964,7 +4284,12 @@ export class Api extends HttpClient + issuesEventsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/events\`, method: "GET", @@ -3978,7 +4303,12 @@ export class Api extends HttpClient + issuesLabelsDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "DELETE", @@ -3991,7 +4321,12 @@ export class Api extends HttpClient + issuesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "GET", @@ -4005,7 +4340,13 @@ export class Api extends HttpClient + issuesLabelsCreate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "POST", @@ -4021,7 +4362,13 @@ export class Api extends HttpClient + issuesLabelsUpdate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "PUT", @@ -4039,7 +4386,13 @@ export class Api extends HttpClient + issuesLabelsDelete2: ( + owner: string, + repo: string, + number: number, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels/\${name}\`, method: "DELETE", @@ -4066,7 +4419,12 @@ export class Api extends HttpClient + keysCreate: ( + owner: string, + repo: string, + body: UserKeysPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys\`, method: "POST", @@ -4082,7 +4440,12 @@ export class Api extends HttpClient + keysDelete: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -4095,7 +4458,12 @@ export class Api extends HttpClient + keysDetail: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -4123,7 +4491,12 @@ export class Api extends HttpClient + labelsCreate: ( + owner: string, + repo: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", @@ -4139,7 +4512,12 @@ export class Api extends HttpClient + labelsDelete: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -4152,7 +4530,12 @@ export class Api extends HttpClient + labelsDetail: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -4166,7 +4549,13 @@ export class Api extends HttpClient + labelsPartialUpdate: ( + owner: string, + repo: string, + name: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "PATCH", @@ -4196,7 +4585,12 @@ export class Api extends HttpClient + mergesCreate: ( + owner: string, + repo: string, + body: MergesBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/merges\`, method: "POST", @@ -4238,7 +4632,12 @@ export class Api extends HttpClient + milestonesCreate: ( + owner: string, + repo: string, + body: MilestoneUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones\`, method: "POST", @@ -4254,7 +4653,12 @@ export class Api extends HttpClient + milestonesDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "DELETE", @@ -4267,7 +4671,12 @@ export class Api extends HttpClient + milestonesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "GET", @@ -4303,7 +4712,12 @@ export class Api extends HttpClient + milestonesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}/labels\`, method: "GET", @@ -4341,7 +4755,12 @@ export class Api extends HttpClient + notificationsUpdate: ( + owner: string, + repo: string, + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/notifications\`, method: "PUT", @@ -4381,7 +4800,12 @@ export class Api extends HttpClient + pullsCreate: ( + owner: string, + repo: string, + body: PullsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls\`, method: "POST", @@ -4421,7 +4845,12 @@ export class Api extends HttpClient + pullsCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -4434,7 +4863,12 @@ export class Api extends HttpClient + pullsCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -4470,7 +4904,12 @@ export class Api extends HttpClient + pullsDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "GET", @@ -4484,7 +4923,13 @@ export class Api extends HttpClient + pullsPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: PullUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "PATCH", @@ -4502,7 +4947,12 @@ export class Api extends HttpClient + pullsCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/comments\`, method: "GET", @@ -4538,7 +4988,12 @@ export class Api extends HttpClient + pullsCommitsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/commits\`, method: "GET", @@ -4552,7 +5007,12 @@ export class Api extends HttpClient + pullsFilesList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/files\`, method: "GET", @@ -4566,7 +5026,12 @@ export class Api extends HttpClient + pullsMergeList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "GET", @@ -4579,7 +5044,13 @@ export class Api extends HttpClient + pullsMergeUpdate: ( + owner: string, + repo: string, + number: number, + body: MergePullBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "PUT", @@ -4631,7 +5102,12 @@ export class Api extends HttpClient + releasesCreate: ( + owner: string, + repo: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases\`, method: "POST", @@ -4647,7 +5123,12 @@ export class Api extends HttpClient + releasesAssetsDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "DELETE", @@ -4660,7 +5141,12 @@ export class Api extends HttpClient + releasesAssetsDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "GET", @@ -4696,7 +5182,12 @@ export class Api extends HttpClient + releasesDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "DELETE", @@ -4709,7 +5200,12 @@ export class Api extends HttpClient + releasesDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "GET", @@ -4723,7 +5219,13 @@ export class Api extends HttpClient + releasesPartialUpdate: ( + owner: string, + repo: string, + id: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "PATCH", @@ -4739,7 +5241,12 @@ export class Api extends HttpClient + releasesAssetsList: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}/assets\`, method: "GET", @@ -4767,7 +5274,11 @@ export class Api extends HttpClient + statsCodeFrequencyList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -4781,7 +5292,11 @@ export class Api extends HttpClient + statsCommitActivityList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -4795,7 +5310,11 @@ export class Api extends HttpClient + statsContributorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -4809,7 +5328,11 @@ export class Api extends HttpClient + statsParticipationList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -4823,7 +5346,11 @@ export class Api extends HttpClient + statsPunchCardList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -4837,7 +5364,12 @@ export class Api extends HttpClient + statusesDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "GET", @@ -4851,7 +5383,13 @@ export class Api extends HttpClient + statusesCreate: ( + owner: string, + repo: string, + ref: string, + body: HeadBranch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "POST", @@ -4867,7 +5405,11 @@ export class Api extends HttpClient + subscribersList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", @@ -4881,7 +5423,11 @@ export class Api extends HttpClient + subscriptionDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -4894,7 +5440,11 @@ export class Api extends HttpClient + subscriptionList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -4908,7 +5458,12 @@ export class Api extends HttpClient + subscriptionUpdate: ( + owner: string, + repo: string, + body: SubscriptionBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "PUT", @@ -5129,7 +5684,11 @@ export class Api extends HttpClient + teamsPartialUpdate: ( + teamId: number, + body: EditTeam, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}\`, method: "PATCH", @@ -5160,7 +5719,11 @@ export class Api extends HttpClient + membersDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -5174,7 +5737,11 @@ export class Api extends HttpClient + membersDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -5188,7 +5755,11 @@ export class Api extends HttpClient + membersUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "PUT", @@ -5201,7 +5772,11 @@ export class Api extends HttpClient + membershipsDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -5214,7 +5789,11 @@ export class Api extends HttpClient + membershipsDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -5228,7 +5807,11 @@ export class Api extends HttpClient + membershipsUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "PUT", @@ -5256,7 +5839,12 @@ export class Api extends HttpClient + reposDelete: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -5269,7 +5857,12 @@ export class Api extends HttpClient + reposDetail: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -5282,7 +5875,12 @@ export class Api extends HttpClient + reposUpdate: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", @@ -5649,7 +6247,11 @@ export class Api extends HttpClient + subscriptionsDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "DELETE", @@ -5663,7 +6265,11 @@ export class Api extends HttpClient + subscriptionsDetail: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "GET", @@ -5677,7 +6283,11 @@ export class Api extends HttpClient + subscriptionsUpdate: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "PUT", @@ -5752,7 +6362,11 @@ export class Api extends HttpClient + eventsOrgsDetail: ( + username: string, + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/events/orgs/\${org}\`, method: "GET", @@ -5779,7 +6393,11 @@ export class Api extends HttpClient + followingDetail: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", diff --git a/tests/spec/responses/__snapshots__/basic.test.ts.snap b/tests/spec/responses/__snapshots__/basic.test.ts.snap index e3b257ee..e05b1299 100644 --- a/tests/spec/responses/__snapshots__/basic.test.ts.snap +++ b/tests/spec/responses/__snapshots__/basic.test.ts.snap @@ -75,16 +75,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -103,7 +109,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -136,9 +143,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -149,8 +162,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -167,7 +185,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -180,7 +201,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -224,15 +247,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -273,7 +307,9 @@ export class HttpClient { * * Strong authentication, without the passwords. */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { key = { /** * @description Revoke an Authentiq ID using email & phone. If called with \`email\` and \`phone\` only, a verification code will be sent by email. Do a second call adding \`code\` to complete the revocation. diff --git a/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap b/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap index e9ccc47c..02db71c7 100644 --- a/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap +++ b/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap @@ -35,16 +35,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -63,7 +69,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -96,9 +103,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -109,8 +122,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -127,7 +145,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -140,7 +161,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,15 +207,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; diff --git a/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap b/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap index 513e8bbe..2ff4304a 100644 --- a/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap +++ b/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap @@ -1792,16 +1792,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -1820,7 +1826,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -1853,9 +1860,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -1866,8 +1879,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -1884,7 +1902,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -1897,7 +1918,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -1941,15 +1964,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -1984,7 +2018,9 @@ export class HttpClient { * @title GitHub * @version v3 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { someop = { /** * No description @@ -2196,7 +2232,11 @@ export class Api extends HttpClient + gistsPartialUpdate: ( + id: number, + body: PatchGist, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}\`, method: "PATCH", @@ -2226,7 +2266,11 @@ export class Api extends HttpClient + commentsCreate: ( + id: number, + body: CommentBody, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments\`, method: "POST", @@ -2242,7 +2286,11 @@ export class Api extends HttpClient + commentsDelete: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "DELETE", @@ -2255,7 +2303,11 @@ export class Api extends HttpClient + commentsDetail: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "GET", @@ -2269,7 +2321,12 @@ export class Api extends HttpClient + commentsPartialUpdate: ( + id: number, + commentId: number, + body: Comment, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "PATCH", @@ -2557,7 +2614,10 @@ export class Api extends HttpClient + notificationsUpdate: ( + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications\`, method: "PUT", @@ -2626,7 +2686,11 @@ export class Api extends HttpClient + threadsSubscriptionUpdate: ( + id: number, + body: PutSubscription, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications/threads/\${id}/subscription\`, method: "PUT", @@ -2657,7 +2721,11 @@ export class Api extends HttpClient + orgsPartialUpdate: ( + org: string, + body: PatchOrg, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}\`, method: "PATCH", @@ -2727,7 +2795,11 @@ export class Api extends HttpClient + membersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -2740,7 +2812,11 @@ export class Api extends HttpClient + membersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -2767,7 +2843,11 @@ export class Api extends HttpClient + publicMembersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -2780,7 +2860,11 @@ export class Api extends HttpClient + publicMembersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -2793,7 +2877,11 @@ export class Api extends HttpClient + publicMembersUpdate: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "PUT", @@ -2857,7 +2945,11 @@ export class Api extends HttpClient + teamsCreate: ( + org: string, + body: OrgTeamsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams\`, method: "POST", @@ -2916,7 +3008,12 @@ export class Api extends HttpClient + reposPartialUpdate: ( + owner: string, + repo: string, + body: RepoEdit, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}\`, method: "PATCH", @@ -2946,7 +3043,12 @@ export class Api extends HttpClient + assigneesDetail: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", @@ -2973,7 +3075,12 @@ export class Api extends HttpClient + branchesDetail: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, method: "GET", @@ -2987,7 +3094,11 @@ export class Api extends HttpClient + collaboratorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", @@ -3001,7 +3112,12 @@ export class Api extends HttpClient + collaboratorsDelete: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "DELETE", @@ -3014,7 +3130,12 @@ export class Api extends HttpClient + collaboratorsDetail: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "GET", @@ -3027,7 +3148,12 @@ export class Api extends HttpClient + collaboratorsUpdate: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "PUT", @@ -3054,7 +3180,12 @@ export class Api extends HttpClient + commentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -3067,7 +3198,12 @@ export class Api extends HttpClient + commentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -3129,7 +3265,12 @@ export class Api extends HttpClient + commitsStatusList: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -3143,7 +3284,12 @@ export class Api extends HttpClient + commitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}\`, method: "GET", @@ -3157,7 +3303,12 @@ export class Api extends HttpClient + commitsCommentsList: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}/comments\`, method: "GET", @@ -3193,7 +3344,13 @@ export class Api extends HttpClient + compareDetail: ( + owner: string, + repo: string, + baseId: string, + headId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/compare/\${baseId}...\${headId}\`, method: "GET", @@ -3207,7 +3364,13 @@ export class Api extends HttpClient + contentsDelete: ( + owner: string, + repo: string, + path: string, + body: DeleteFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "DELETE", @@ -3247,7 +3410,13 @@ export class Api extends HttpClient + contentsUpdate: ( + owner: string, + repo: string, + path: string, + body: CreateFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "PUT", @@ -3285,7 +3454,11 @@ export class Api extends HttpClient + deploymentsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", @@ -3299,7 +3472,12 @@ export class Api extends HttpClient + deploymentsCreate: ( + owner: string, + repo: string, + body: Deployment, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "POST", @@ -3315,7 +3493,12 @@ export class Api extends HttpClient + deploymentsStatusesList: ( + owner: string, + repo: string, + id: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${id}/statuses\`, method: "GET", @@ -3364,7 +3547,12 @@ export class Api extends HttpClient + downloadsDelete: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "DELETE", @@ -3377,7 +3565,12 @@ export class Api extends HttpClient + downloadsDetail: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "GET", @@ -3427,7 +3620,12 @@ export class Api extends HttpClient + forksCreate: ( + owner: string, + repo: string, + body: ForkBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/forks\`, method: "POST", @@ -3443,7 +3641,12 @@ export class Api extends HttpClient + gitBlobsCreate: ( + owner: string, + repo: string, + body: Blob, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs\`, method: "POST", @@ -3459,7 +3662,12 @@ export class Api extends HttpClient + gitBlobsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${shaCode}\`, method: "GET", @@ -3473,7 +3681,12 @@ export class Api extends HttpClient + gitCommitsCreate: ( + owner: string, + repo: string, + body: RepoCommitBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits\`, method: "POST", @@ -3489,7 +3702,12 @@ export class Api extends HttpClient + gitCommitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${shaCode}\`, method: "GET", @@ -3517,7 +3735,12 @@ export class Api extends HttpClient + gitRefsCreate: ( + owner: string, + repo: string, + body: RefsBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs\`, method: "POST", @@ -3533,7 +3756,12 @@ export class Api extends HttpClient + gitRefsDelete: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -3546,7 +3774,12 @@ export class Api extends HttpClient + gitRefsDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "GET", @@ -3560,7 +3793,13 @@ export class Api extends HttpClient + gitRefsPartialUpdate: ( + owner: string, + repo: string, + ref: string, + body: GitRefPatch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "PATCH", @@ -3576,7 +3815,12 @@ export class Api extends HttpClient + gitTagsCreate: ( + owner: string, + repo: string, + body: TagBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags\`, method: "POST", @@ -3592,7 +3836,12 @@ export class Api extends HttpClient + gitTagsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${shaCode}\`, method: "GET", @@ -3606,7 +3855,12 @@ export class Api extends HttpClient + gitTreesCreate: ( + owner: string, + repo: string, + body: Tree, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/trees\`, method: "POST", @@ -3659,7 +3913,12 @@ export class Api extends HttpClient + hooksCreate: ( + owner: string, + repo: string, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks\`, method: "POST", @@ -3675,7 +3934,12 @@ export class Api extends HttpClient + hooksDelete: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -3688,7 +3952,12 @@ export class Api extends HttpClient + hooksDetail: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -3702,7 +3971,13 @@ export class Api extends HttpClient + hooksPartialUpdate: ( + owner: string, + repo: string, + hookId: number, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "PATCH", @@ -3718,7 +3993,12 @@ export class Api extends HttpClient + hooksTestsCreate: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -3758,7 +4038,12 @@ export class Api extends HttpClient + issuesCreate: ( + owner: string, + repo: string, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", @@ -3798,7 +4083,12 @@ export class Api extends HttpClient + issuesCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -3811,7 +4101,12 @@ export class Api extends HttpClient + issuesCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -3847,7 +4142,11 @@ export class Api extends HttpClient + issuesEventsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", @@ -3861,7 +4160,12 @@ export class Api extends HttpClient + issuesEventsDetail: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -3875,7 +4179,12 @@ export class Api extends HttpClient + issuesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "GET", @@ -3889,7 +4198,13 @@ export class Api extends HttpClient + issuesPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "PATCH", @@ -3907,7 +4222,12 @@ export class Api extends HttpClient + issuesCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/comments\`, method: "GET", @@ -3945,7 +4265,12 @@ export class Api extends HttpClient + issuesEventsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/events\`, method: "GET", @@ -3959,7 +4284,12 @@ export class Api extends HttpClient + issuesLabelsDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "DELETE", @@ -3972,7 +4302,12 @@ export class Api extends HttpClient + issuesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "GET", @@ -3986,7 +4321,13 @@ export class Api extends HttpClient + issuesLabelsCreate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "POST", @@ -4002,7 +4343,13 @@ export class Api extends HttpClient + issuesLabelsUpdate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "PUT", @@ -4020,7 +4367,13 @@ export class Api extends HttpClient + issuesLabelsDelete2: ( + owner: string, + repo: string, + number: number, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels/\${name}\`, method: "DELETE", @@ -4047,7 +4400,12 @@ export class Api extends HttpClient + keysCreate: ( + owner: string, + repo: string, + body: UserKeysPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys\`, method: "POST", @@ -4063,7 +4421,12 @@ export class Api extends HttpClient + keysDelete: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -4076,7 +4439,12 @@ export class Api extends HttpClient + keysDetail: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -4104,7 +4472,12 @@ export class Api extends HttpClient + labelsCreate: ( + owner: string, + repo: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", @@ -4120,7 +4493,12 @@ export class Api extends HttpClient + labelsDelete: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -4133,7 +4511,12 @@ export class Api extends HttpClient + labelsDetail: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -4147,7 +4530,13 @@ export class Api extends HttpClient + labelsPartialUpdate: ( + owner: string, + repo: string, + name: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "PATCH", @@ -4177,7 +4566,12 @@ export class Api extends HttpClient + mergesCreate: ( + owner: string, + repo: string, + body: MergesBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/merges\`, method: "POST", @@ -4217,7 +4611,12 @@ export class Api extends HttpClient + milestonesCreate: ( + owner: string, + repo: string, + body: MilestoneUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones\`, method: "POST", @@ -4233,7 +4632,12 @@ export class Api extends HttpClient + milestonesDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "DELETE", @@ -4246,7 +4650,12 @@ export class Api extends HttpClient + milestonesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "GET", @@ -4282,7 +4691,12 @@ export class Api extends HttpClient + milestonesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}/labels\`, method: "GET", @@ -4320,7 +4734,12 @@ export class Api extends HttpClient + notificationsUpdate: ( + owner: string, + repo: string, + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/notifications\`, method: "PUT", @@ -4359,7 +4778,12 @@ export class Api extends HttpClient + pullsCreate: ( + owner: string, + repo: string, + body: PullsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls\`, method: "POST", @@ -4399,7 +4823,12 @@ export class Api extends HttpClient + pullsCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -4412,7 +4841,12 @@ export class Api extends HttpClient + pullsCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -4448,7 +4882,12 @@ export class Api extends HttpClient + pullsDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "GET", @@ -4462,7 +4901,13 @@ export class Api extends HttpClient + pullsPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: PullUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "PATCH", @@ -4480,7 +4925,12 @@ export class Api extends HttpClient + pullsCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/comments\`, method: "GET", @@ -4516,7 +4966,12 @@ export class Api extends HttpClient + pullsCommitsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/commits\`, method: "GET", @@ -4530,7 +4985,12 @@ export class Api extends HttpClient + pullsFilesList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/files\`, method: "GET", @@ -4544,7 +5004,12 @@ export class Api extends HttpClient + pullsMergeList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "GET", @@ -4557,7 +5022,13 @@ export class Api extends HttpClient + pullsMergeUpdate: ( + owner: string, + repo: string, + number: number, + body: MergePullBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "PUT", @@ -4609,7 +5080,12 @@ export class Api extends HttpClient + releasesCreate: ( + owner: string, + repo: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases\`, method: "POST", @@ -4625,7 +5101,12 @@ export class Api extends HttpClient + releasesAssetsDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "DELETE", @@ -4638,7 +5119,12 @@ export class Api extends HttpClient + releasesAssetsDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "GET", @@ -4674,7 +5160,12 @@ export class Api extends HttpClient + releasesDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "DELETE", @@ -4687,7 +5178,12 @@ export class Api extends HttpClient + releasesDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "GET", @@ -4701,7 +5197,13 @@ export class Api extends HttpClient + releasesPartialUpdate: ( + owner: string, + repo: string, + id: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "PATCH", @@ -4717,7 +5219,12 @@ export class Api extends HttpClient + releasesAssetsList: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}/assets\`, method: "GET", @@ -4745,7 +5252,11 @@ export class Api extends HttpClient + statsCodeFrequencyList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -4759,7 +5270,11 @@ export class Api extends HttpClient + statsCommitActivityList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -4773,7 +5288,11 @@ export class Api extends HttpClient + statsContributorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -4787,7 +5306,11 @@ export class Api extends HttpClient + statsParticipationList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -4801,7 +5324,11 @@ export class Api extends HttpClient + statsPunchCardList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -4815,7 +5342,12 @@ export class Api extends HttpClient + statusesDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "GET", @@ -4829,7 +5361,13 @@ export class Api extends HttpClient + statusesCreate: ( + owner: string, + repo: string, + ref: string, + body: HeadBranch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "POST", @@ -4845,7 +5383,11 @@ export class Api extends HttpClient + subscribersList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", @@ -4859,7 +5401,11 @@ export class Api extends HttpClient + subscriptionDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -4872,7 +5418,11 @@ export class Api extends HttpClient + subscriptionList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -4886,7 +5436,12 @@ export class Api extends HttpClient + subscriptionUpdate: ( + owner: string, + repo: string, + body: SubscriptionBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "PUT", @@ -5103,7 +5658,11 @@ export class Api extends HttpClient + teamsPartialUpdate: ( + teamId: number, + body: EditTeam, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}\`, method: "PATCH", @@ -5133,7 +5692,11 @@ export class Api extends HttpClient + membersDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -5146,7 +5709,11 @@ export class Api extends HttpClient + membersDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -5159,7 +5726,11 @@ export class Api extends HttpClient + membersUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "PUT", @@ -5172,7 +5743,11 @@ export class Api extends HttpClient + membershipsDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -5185,7 +5760,11 @@ export class Api extends HttpClient + membershipsDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -5199,7 +5778,11 @@ export class Api extends HttpClient + membershipsUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "PUT", @@ -5227,7 +5810,12 @@ export class Api extends HttpClient + reposDelete: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -5240,7 +5828,12 @@ export class Api extends HttpClient + reposDetail: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -5253,7 +5846,12 @@ export class Api extends HttpClient + reposUpdate: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", @@ -5613,7 +6211,11 @@ export class Api extends HttpClient + subscriptionsDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "DELETE", @@ -5626,7 +6228,11 @@ export class Api extends HttpClient + subscriptionsDetail: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "GET", @@ -5639,7 +6245,11 @@ export class Api extends HttpClient + subscriptionsUpdate: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "PUT", @@ -5714,7 +6324,11 @@ export class Api extends HttpClient + eventsOrgsDetail: ( + username: string, + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/events/orgs/\${org}\`, method: "GET", @@ -5741,7 +6355,11 @@ export class Api extends HttpClient + followingDetail: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", diff --git a/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap b/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap index b0401771..99b87768 100644 --- a/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap +++ b/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap @@ -1792,16 +1792,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -1820,7 +1826,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -1853,9 +1860,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -1866,8 +1879,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -1884,7 +1902,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -1897,7 +1918,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -1941,15 +1964,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -1984,7 +2018,9 @@ export class HttpClient { * @title GitHub * @version v3 */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { someop = { /** * No description @@ -2196,7 +2232,11 @@ export class Api extends HttpClient + gistsPartialUpdate: ( + id: number, + body: PatchGist, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}\`, method: "PATCH", @@ -2226,7 +2266,11 @@ export class Api extends HttpClient + commentsCreate: ( + id: number, + body: CommentBody, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments\`, method: "POST", @@ -2242,7 +2286,11 @@ export class Api extends HttpClient + commentsDelete: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "DELETE", @@ -2255,7 +2303,11 @@ export class Api extends HttpClient + commentsDetail: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "GET", @@ -2269,7 +2321,12 @@ export class Api extends HttpClient + commentsPartialUpdate: ( + id: number, + commentId: number, + body: Comment, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "PATCH", @@ -2557,7 +2614,10 @@ export class Api extends HttpClient + notificationsUpdate: ( + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications\`, method: "PUT", @@ -2626,7 +2686,11 @@ export class Api extends HttpClient + threadsSubscriptionUpdate: ( + id: number, + body: PutSubscription, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications/threads/\${id}/subscription\`, method: "PUT", @@ -2657,7 +2721,11 @@ export class Api extends HttpClient + orgsPartialUpdate: ( + org: string, + body: PatchOrg, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}\`, method: "PATCH", @@ -2727,7 +2795,11 @@ export class Api extends HttpClient + membersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -2740,7 +2812,11 @@ export class Api extends HttpClient + membersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -2767,7 +2843,11 @@ export class Api extends HttpClient + publicMembersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -2780,7 +2860,11 @@ export class Api extends HttpClient + publicMembersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -2793,7 +2877,11 @@ export class Api extends HttpClient + publicMembersUpdate: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "PUT", @@ -2857,7 +2945,11 @@ export class Api extends HttpClient + teamsCreate: ( + org: string, + body: OrgTeamsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams\`, method: "POST", @@ -2916,7 +3008,12 @@ export class Api extends HttpClient + reposPartialUpdate: ( + owner: string, + repo: string, + body: RepoEdit, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}\`, method: "PATCH", @@ -2946,7 +3043,12 @@ export class Api extends HttpClient + assigneesDetail: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", @@ -2973,7 +3075,12 @@ export class Api extends HttpClient + branchesDetail: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, method: "GET", @@ -2987,7 +3094,11 @@ export class Api extends HttpClient + collaboratorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", @@ -3001,7 +3112,12 @@ export class Api extends HttpClient + collaboratorsDelete: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "DELETE", @@ -3014,7 +3130,12 @@ export class Api extends HttpClient + collaboratorsDetail: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "GET", @@ -3027,7 +3148,12 @@ export class Api extends HttpClient + collaboratorsUpdate: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "PUT", @@ -3054,7 +3180,12 @@ export class Api extends HttpClient + commentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -3067,7 +3198,12 @@ export class Api extends HttpClient + commentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -3129,7 +3265,12 @@ export class Api extends HttpClient + commitsStatusList: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -3143,7 +3284,12 @@ export class Api extends HttpClient + commitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}\`, method: "GET", @@ -3157,7 +3303,12 @@ export class Api extends HttpClient + commitsCommentsList: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}/comments\`, method: "GET", @@ -3193,7 +3344,13 @@ export class Api extends HttpClient + compareDetail: ( + owner: string, + repo: string, + baseId: string, + headId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/compare/\${baseId}...\${headId}\`, method: "GET", @@ -3207,7 +3364,13 @@ export class Api extends HttpClient + contentsDelete: ( + owner: string, + repo: string, + path: string, + body: DeleteFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "DELETE", @@ -3247,7 +3410,13 @@ export class Api extends HttpClient + contentsUpdate: ( + owner: string, + repo: string, + path: string, + body: CreateFileBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "PUT", @@ -3285,7 +3454,11 @@ export class Api extends HttpClient + deploymentsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", @@ -3299,7 +3472,12 @@ export class Api extends HttpClient + deploymentsCreate: ( + owner: string, + repo: string, + body: Deployment, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "POST", @@ -3315,7 +3493,12 @@ export class Api extends HttpClient + deploymentsStatusesList: ( + owner: string, + repo: string, + id: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${id}/statuses\`, method: "GET", @@ -3364,7 +3547,12 @@ export class Api extends HttpClient + downloadsDelete: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "DELETE", @@ -3377,7 +3565,12 @@ export class Api extends HttpClient + downloadsDetail: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "GET", @@ -3427,7 +3620,12 @@ export class Api extends HttpClient + forksCreate: ( + owner: string, + repo: string, + body: ForkBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/forks\`, method: "POST", @@ -3443,7 +3641,12 @@ export class Api extends HttpClient + gitBlobsCreate: ( + owner: string, + repo: string, + body: Blob, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs\`, method: "POST", @@ -3459,7 +3662,12 @@ export class Api extends HttpClient + gitBlobsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${shaCode}\`, method: "GET", @@ -3473,7 +3681,12 @@ export class Api extends HttpClient + gitCommitsCreate: ( + owner: string, + repo: string, + body: RepoCommitBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits\`, method: "POST", @@ -3489,7 +3702,12 @@ export class Api extends HttpClient + gitCommitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${shaCode}\`, method: "GET", @@ -3517,7 +3735,12 @@ export class Api extends HttpClient + gitRefsCreate: ( + owner: string, + repo: string, + body: RefsBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs\`, method: "POST", @@ -3533,7 +3756,12 @@ export class Api extends HttpClient + gitRefsDelete: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -3546,7 +3774,12 @@ export class Api extends HttpClient + gitRefsDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "GET", @@ -3560,7 +3793,13 @@ export class Api extends HttpClient + gitRefsPartialUpdate: ( + owner: string, + repo: string, + ref: string, + body: GitRefPatch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "PATCH", @@ -3576,7 +3815,12 @@ export class Api extends HttpClient + gitTagsCreate: ( + owner: string, + repo: string, + body: TagBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags\`, method: "POST", @@ -3592,7 +3836,12 @@ export class Api extends HttpClient + gitTagsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${shaCode}\`, method: "GET", @@ -3606,7 +3855,12 @@ export class Api extends HttpClient + gitTreesCreate: ( + owner: string, + repo: string, + body: Tree, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/trees\`, method: "POST", @@ -3659,7 +3913,12 @@ export class Api extends HttpClient + hooksCreate: ( + owner: string, + repo: string, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks\`, method: "POST", @@ -3675,7 +3934,12 @@ export class Api extends HttpClient + hooksDelete: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -3688,7 +3952,12 @@ export class Api extends HttpClient + hooksDetail: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -3702,7 +3971,13 @@ export class Api extends HttpClient + hooksPartialUpdate: ( + owner: string, + repo: string, + hookId: number, + body: HookBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "PATCH", @@ -3718,7 +3993,12 @@ export class Api extends HttpClient + hooksTestsCreate: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -3758,7 +4038,12 @@ export class Api extends HttpClient + issuesCreate: ( + owner: string, + repo: string, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", @@ -3798,7 +4083,12 @@ export class Api extends HttpClient + issuesCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -3811,7 +4101,12 @@ export class Api extends HttpClient + issuesCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -3847,7 +4142,11 @@ export class Api extends HttpClient + issuesEventsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", @@ -3861,7 +4160,12 @@ export class Api extends HttpClient + issuesEventsDetail: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -3875,7 +4179,12 @@ export class Api extends HttpClient + issuesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "GET", @@ -3889,7 +4198,13 @@ export class Api extends HttpClient + issuesPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: Issue, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "PATCH", @@ -3907,7 +4222,12 @@ export class Api extends HttpClient + issuesCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/comments\`, method: "GET", @@ -3945,7 +4265,12 @@ export class Api extends HttpClient + issuesEventsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/events\`, method: "GET", @@ -3959,7 +4284,12 @@ export class Api extends HttpClient + issuesLabelsDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "DELETE", @@ -3972,7 +4302,12 @@ export class Api extends HttpClient + issuesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "GET", @@ -3986,7 +4321,13 @@ export class Api extends HttpClient + issuesLabelsCreate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "POST", @@ -4002,7 +4343,13 @@ export class Api extends HttpClient + issuesLabelsUpdate: ( + owner: string, + repo: string, + number: number, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "PUT", @@ -4020,7 +4367,13 @@ export class Api extends HttpClient + issuesLabelsDelete2: ( + owner: string, + repo: string, + number: number, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels/\${name}\`, method: "DELETE", @@ -4047,7 +4400,12 @@ export class Api extends HttpClient + keysCreate: ( + owner: string, + repo: string, + body: UserKeysPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys\`, method: "POST", @@ -4063,7 +4421,12 @@ export class Api extends HttpClient + keysDelete: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -4076,7 +4439,12 @@ export class Api extends HttpClient + keysDetail: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -4104,7 +4472,12 @@ export class Api extends HttpClient + labelsCreate: ( + owner: string, + repo: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", @@ -4120,7 +4493,12 @@ export class Api extends HttpClient + labelsDelete: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -4133,7 +4511,12 @@ export class Api extends HttpClient + labelsDetail: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -4147,7 +4530,13 @@ export class Api extends HttpClient + labelsPartialUpdate: ( + owner: string, + repo: string, + name: string, + body: EmailsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "PATCH", @@ -4177,7 +4566,12 @@ export class Api extends HttpClient + mergesCreate: ( + owner: string, + repo: string, + body: MergesBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/merges\`, method: "POST", @@ -4217,7 +4611,12 @@ export class Api extends HttpClient + milestonesCreate: ( + owner: string, + repo: string, + body: MilestoneUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones\`, method: "POST", @@ -4233,7 +4632,12 @@ export class Api extends HttpClient + milestonesDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "DELETE", @@ -4246,7 +4650,12 @@ export class Api extends HttpClient + milestonesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "GET", @@ -4282,7 +4691,12 @@ export class Api extends HttpClient + milestonesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}/labels\`, method: "GET", @@ -4320,7 +4734,12 @@ export class Api extends HttpClient + notificationsUpdate: ( + owner: string, + repo: string, + body: NotificationMarkRead, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/notifications\`, method: "PUT", @@ -4359,7 +4778,12 @@ export class Api extends HttpClient + pullsCreate: ( + owner: string, + repo: string, + body: PullsPost, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls\`, method: "POST", @@ -4399,7 +4823,12 @@ export class Api extends HttpClient + pullsCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -4412,7 +4841,12 @@ export class Api extends HttpClient + pullsCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -4448,7 +4882,12 @@ export class Api extends HttpClient + pullsDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "GET", @@ -4462,7 +4901,13 @@ export class Api extends HttpClient + pullsPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: PullUpdate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "PATCH", @@ -4480,7 +4925,12 @@ export class Api extends HttpClient + pullsCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/comments\`, method: "GET", @@ -4516,7 +4966,12 @@ export class Api extends HttpClient + pullsCommitsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/commits\`, method: "GET", @@ -4530,7 +4985,12 @@ export class Api extends HttpClient + pullsFilesList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/files\`, method: "GET", @@ -4544,7 +5004,12 @@ export class Api extends HttpClient + pullsMergeList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "GET", @@ -4557,7 +5022,13 @@ export class Api extends HttpClient + pullsMergeUpdate: ( + owner: string, + repo: string, + number: number, + body: MergePullBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "PUT", @@ -4609,7 +5080,12 @@ export class Api extends HttpClient + releasesCreate: ( + owner: string, + repo: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases\`, method: "POST", @@ -4625,7 +5101,12 @@ export class Api extends HttpClient + releasesAssetsDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "DELETE", @@ -4638,7 +5119,12 @@ export class Api extends HttpClient + releasesAssetsDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "GET", @@ -4674,7 +5160,12 @@ export class Api extends HttpClient + releasesDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "DELETE", @@ -4687,7 +5178,12 @@ export class Api extends HttpClient + releasesDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "GET", @@ -4701,7 +5197,13 @@ export class Api extends HttpClient + releasesPartialUpdate: ( + owner: string, + repo: string, + id: string, + body: ReleaseCreate, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "PATCH", @@ -4717,7 +5219,12 @@ export class Api extends HttpClient + releasesAssetsList: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}/assets\`, method: "GET", @@ -4745,7 +5252,11 @@ export class Api extends HttpClient + statsCodeFrequencyList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -4759,7 +5270,11 @@ export class Api extends HttpClient + statsCommitActivityList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -4773,7 +5288,11 @@ export class Api extends HttpClient + statsContributorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -4787,7 +5306,11 @@ export class Api extends HttpClient + statsParticipationList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -4801,7 +5324,11 @@ export class Api extends HttpClient + statsPunchCardList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -4815,7 +5342,12 @@ export class Api extends HttpClient + statusesDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "GET", @@ -4829,7 +5361,13 @@ export class Api extends HttpClient + statusesCreate: ( + owner: string, + repo: string, + ref: string, + body: HeadBranch, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "POST", @@ -4845,7 +5383,11 @@ export class Api extends HttpClient + subscribersList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", @@ -4859,7 +5401,11 @@ export class Api extends HttpClient + subscriptionDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -4872,7 +5418,11 @@ export class Api extends HttpClient + subscriptionList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -4886,7 +5436,12 @@ export class Api extends HttpClient + subscriptionUpdate: ( + owner: string, + repo: string, + body: SubscriptionBody, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "PUT", @@ -5103,7 +5658,11 @@ export class Api extends HttpClient + teamsPartialUpdate: ( + teamId: number, + body: EditTeam, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}\`, method: "PATCH", @@ -5133,7 +5692,11 @@ export class Api extends HttpClient + membersDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -5146,7 +5709,11 @@ export class Api extends HttpClient + membersDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -5159,7 +5726,11 @@ export class Api extends HttpClient + membersUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "PUT", @@ -5172,7 +5743,11 @@ export class Api extends HttpClient + membershipsDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -5185,7 +5760,11 @@ export class Api extends HttpClient + membershipsDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -5199,7 +5778,11 @@ export class Api extends HttpClient + membershipsUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "PUT", @@ -5227,7 +5810,12 @@ export class Api extends HttpClient + reposDelete: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -5240,7 +5828,12 @@ export class Api extends HttpClient + reposDetail: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -5253,7 +5846,12 @@ export class Api extends HttpClient + reposUpdate: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", @@ -5613,7 +6211,11 @@ export class Api extends HttpClient + subscriptionsDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "DELETE", @@ -5626,7 +6228,11 @@ export class Api extends HttpClient + subscriptionsDetail: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "GET", @@ -5639,7 +6245,11 @@ export class Api extends HttpClient + subscriptionsUpdate: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "PUT", @@ -5714,7 +6324,11 @@ export class Api extends HttpClient + eventsOrgsDetail: ( + username: string, + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/events/orgs/\${org}\`, method: "GET", @@ -5741,7 +6355,11 @@ export class Api extends HttpClient + followingDetail: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", diff --git a/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap b/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap index c00507a6..c9c87110 100644 --- a/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap +++ b/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap @@ -72,9 +72,11 @@ export interface SwaggerTypeAssetPatchGeneratedDataContract { name: string; } -export type SwaggerTypeAssetsGeneratedDataContract = SwaggerTypeAssetGeneratedDataContract[]; +export type SwaggerTypeAssetsGeneratedDataContract = + SwaggerTypeAssetGeneratedDataContract[]; -export type SwaggerTypeAssigneesGeneratedDataContract = SwaggerTypeUserGeneratedDataContract[]; +export type SwaggerTypeAssigneesGeneratedDataContract = + SwaggerTypeUserGeneratedDataContract[]; export interface SwaggerTypeBlobGeneratedDataContract { content?: string; @@ -507,7 +509,8 @@ export interface SwaggerTypeDownloadGeneratedDataContract { url?: string; } -export type SwaggerTypeDownloadsGeneratedDataContract = SwaggerTypeDownloadGeneratedDataContract[]; +export type SwaggerTypeDownloadsGeneratedDataContract = + SwaggerTypeDownloadGeneratedDataContract[]; export interface SwaggerTypeEditTeamGeneratedDataContract { name: string; @@ -533,7 +536,8 @@ export interface SwaggerTypeEventGeneratedDataContract { type?: string; } -export type SwaggerTypeEventsGeneratedDataContract = SwaggerTypeEventGeneratedDataContract[]; +export type SwaggerTypeEventsGeneratedDataContract = + SwaggerTypeEventGeneratedDataContract[]; export interface SwaggerTypeFeedsGeneratedDataContract { _links?: { @@ -574,7 +578,8 @@ export interface SwaggerTypeForkBodyGeneratedDataContract { organization?: string; } -export type SwaggerTypeForksGeneratedDataContract = SwaggerTypeReposGeneratedDataContract; +export type SwaggerTypeForksGeneratedDataContract = + SwaggerTypeReposGeneratedDataContract; export interface SwaggerTypeGistGeneratedDataContract { comments?: number; @@ -754,7 +759,8 @@ export interface SwaggerTypeIssueEventGeneratedDataContract { url?: string; } -export type SwaggerTypeIssueEventsGeneratedDataContract = SwaggerTypeIssueEventGeneratedDataContract[]; +export type SwaggerTypeIssueEventsGeneratedDataContract = + SwaggerTypeIssueEventGeneratedDataContract[]; export type SwaggerTypeIssuesGeneratedDataContract = { assignee?: SwaggerTypeUserGeneratedDataContract; @@ -975,7 +981,8 @@ export interface SwaggerTypeOrgTeamsPostGeneratedDataContract { repo_names?: string[]; } -export type SwaggerTypeOrganizationGeneratedDataContract = SwaggerTypeActorGeneratedDataContract; +export type SwaggerTypeOrganizationGeneratedDataContract = + SwaggerTypeActorGeneratedDataContract; export interface SwaggerTypeOrganizationAsTeamMemberGeneratedDataContract { errors?: { @@ -1505,7 +1512,8 @@ export interface SwaggerTypeRepoEditGeneratedDataContract { private?: boolean; } -export type SwaggerTypeReposGeneratedDataContract = SwaggerTypeRepoGeneratedDataContract[]; +export type SwaggerTypeReposGeneratedDataContract = + SwaggerTypeRepoGeneratedDataContract[]; export interface SwaggerTypeSearchCodeGeneratedDataContract { items?: { @@ -1683,7 +1691,8 @@ export interface SwaggerTypeTagBodyGeneratedDataContract { type: "commit" | "tree" | "blob"; } -export type SwaggerTypeTagsGeneratedDataContract = SwaggerTypeTagGeneratedDataContract[]; +export type SwaggerTypeTagsGeneratedDataContract = + SwaggerTypeTagGeneratedDataContract[]; export interface SwaggerTypeTeamGeneratedDataContract { id?: number; @@ -1699,7 +1708,8 @@ export interface SwaggerTypeTeamMembershipGeneratedDataContract { url?: string; } -export type SwaggerTypeTeamReposGeneratedDataContract = SwaggerTypeReposGeneratedDataContract; +export type SwaggerTypeTeamReposGeneratedDataContract = + SwaggerTypeReposGeneratedDataContract; export type SwaggerTypeTeamsGeneratedDataContract = { id?: number; @@ -1742,7 +1752,8 @@ export interface SwaggerTypeTreesGeneratedDataContract { url?: string; } -export type SwaggerTypeUserGeneratedDataContract = SwaggerTypeActorGeneratedDataContract; +export type SwaggerTypeUserGeneratedDataContract = + SwaggerTypeActorGeneratedDataContract; export type SwaggerTypeUserEmailsGeneratedDataContract = string[]; @@ -1768,7 +1779,8 @@ export interface SwaggerTypeUserUpdateGeneratedDataContract { name?: string; } -export type SwaggerTypeUsersGeneratedDataContract = SwaggerTypeUserGeneratedDataContract[]; +export type SwaggerTypeUsersGeneratedDataContract = + SwaggerTypeUserGeneratedDataContract[]; export type QueryParamsType = Record; export type ResponseFormat = keyof Omit; @@ -1792,16 +1804,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -1820,7 +1838,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -1853,9 +1872,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -1866,8 +1891,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -1884,7 +1914,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -1897,7 +1930,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -1941,15 +1976,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -1987,7 +2033,9 @@ export class HttpClient { * @baseUrl https://api.github.com * @externalDocs https://developer.github.com/v3/ */ -export class Api extends HttpClient { +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { someTest = { /** * No description @@ -2158,7 +2206,10 @@ export class Api extends HttpClient + gistsCreate: ( + body: SwaggerTypePostGistGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/gists\`, method: "POST", @@ -2251,7 +2302,11 @@ export class Api extends HttpClient + gistsPartialUpdate: ( + id: number, + body: SwaggerTypePatchGistGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}\`, method: "PATCH", @@ -2285,7 +2340,11 @@ export class Api extends HttpClient + commentsCreate: ( + id: number, + body: SwaggerTypeCommentBodyGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments\`, method: "POST", @@ -2303,7 +2362,11 @@ export class Api extends HttpClient + commentsDelete: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "DELETE", @@ -2318,7 +2381,11 @@ export class Api extends HttpClient + commentsDetail: ( + id: number, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/gists/\${id}/comments/\${commentId}\`, method: "GET", @@ -2493,12 +2560,14 @@ export class Api extends HttpClient - this.request({ - path: \`/legacy/issues/search/\${owner}/\${repository}/\${state}/\${keyword}\`, - method: "GET", - format: "json", - ...params, - }), + this.request( + { + path: \`/legacy/issues/search/\${owner}/\${repository}/\${state}/\${keyword}\`, + method: "GET", + format: "json", + ...params, + }, + ), /** * No description @@ -2520,7 +2589,10 @@ export class Api extends HttpClient - this.request({ + this.request< + SwaggerTypeSearchRepositoriesByKeywordGeneratedDataContract, + void + >({ path: \`/legacy/repos/search/\${keyword}\`, method: "GET", query: query, @@ -2581,7 +2653,10 @@ export class Api extends HttpClient + markdownCreate: ( + body: SwaggerTypeMarkdownGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/markdown\`, method: "POST", @@ -2673,7 +2748,10 @@ export class Api extends HttpClient + notificationsUpdate: ( + body: SwaggerTypeNotificationMarkReadGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/notifications\`, method: "PUT", @@ -2791,7 +2869,11 @@ export class Api extends HttpClient + orgsPartialUpdate: ( + org: string, + body: SwaggerTypePatchOrgGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}\`, method: "PATCH", @@ -2874,7 +2956,11 @@ export class Api extends HttpClient + membersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "DELETE", @@ -2891,7 +2977,11 @@ export class Api extends HttpClient + membersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/members/\${username}\`, method: "GET", @@ -2922,7 +3012,11 @@ export class Api extends HttpClient + publicMembersDelete: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", @@ -2938,7 +3032,11 @@ export class Api extends HttpClient + publicMembersDetail: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", @@ -2953,7 +3051,11 @@ export class Api extends HttpClient + publicMembersUpdate: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/public_members/\${username}\`, method: "PUT", @@ -2992,7 +3094,11 @@ export class Api extends HttpClient + reposCreate: ( + org: string, + body: SwaggerTypePostRepoGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/repos\`, method: "POST", @@ -3026,7 +3132,11 @@ export class Api extends HttpClient + teamsCreate: ( + org: string, + body: SwaggerTypeOrgTeamsPostGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/orgs/\${org}/teams\`, method: "POST", @@ -3133,7 +3243,12 @@ export class Api extends HttpClient + assigneesDetail: ( + owner: string, + repo: string, + assignee: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", @@ -3164,7 +3279,12 @@ export class Api extends HttpClient + branchesDetail: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, method: "GET", @@ -3180,7 +3300,11 @@ export class Api extends HttpClient + collaboratorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", @@ -3196,7 +3320,12 @@ export class Api extends HttpClient + collaboratorsDelete: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "DELETE", @@ -3212,7 +3341,12 @@ export class Api extends HttpClient + collaboratorsDetail: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "GET", @@ -3227,7 +3361,12 @@ export class Api extends HttpClient + collaboratorsUpdate: ( + owner: string, + repo: string, + user: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/collaborators/\${user}\`, method: "PUT", @@ -3258,7 +3397,12 @@ export class Api extends HttpClient + commentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "DELETE", @@ -3273,7 +3417,12 @@ export class Api extends HttpClient + commentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", @@ -3341,7 +3490,12 @@ export class Api extends HttpClient + commitsStatusList: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", @@ -3357,7 +3511,12 @@ export class Api extends HttpClient + commitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}\`, method: "GET", @@ -3373,7 +3532,12 @@ export class Api extends HttpClient + commitsCommentsList: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/commits/\${shaCode}/comments\`, method: "GET", @@ -3413,7 +3577,13 @@ export class Api extends HttpClient + compareDetail: ( + owner: string, + repo: string, + baseId: string, + headId: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/compare/\${baseId}...\${headId}\`, method: "GET", @@ -3527,7 +3697,11 @@ export class Api extends HttpClient + deploymentsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", @@ -3566,7 +3740,12 @@ export class Api extends HttpClient + deploymentsStatusesList: ( + owner: string, + repo: string, + id: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/deployments/\${id}/statuses\`, method: "GET", @@ -3623,7 +3802,12 @@ export class Api extends HttpClient + downloadsDelete: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "DELETE", @@ -3639,7 +3823,12 @@ export class Api extends HttpClient + downloadsDetail: ( + owner: string, + repo: string, + downloadId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/downloads/\${downloadId}\`, method: "GET", @@ -3742,7 +3931,12 @@ export class Api extends HttpClient + gitBlobsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/blobs/\${shaCode}\`, method: "GET", @@ -3781,7 +3975,12 @@ export class Api extends HttpClient + gitCommitsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/commits/\${shaCode}\`, method: "GET", @@ -3836,7 +4035,12 @@ export class Api extends HttpClient + gitRefsDelete: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "DELETE", @@ -3851,7 +4055,12 @@ export class Api extends HttpClient + gitRefsDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, method: "GET", @@ -3914,7 +4123,12 @@ export class Api extends HttpClient + gitTagsDetail: ( + owner: string, + repo: string, + shaCode: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/git/tags/\${shaCode}\`, method: "GET", @@ -4017,7 +4231,12 @@ export class Api extends HttpClient + hooksDelete: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", @@ -4032,7 +4251,12 @@ export class Api extends HttpClient + hooksDetail: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", @@ -4072,7 +4296,12 @@ export class Api extends HttpClient + hooksTestsCreate: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, method: "POST", @@ -4169,7 +4398,12 @@ export class Api extends HttpClient + issuesCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", @@ -4184,7 +4418,12 @@ export class Api extends HttpClient + issuesCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", @@ -4224,7 +4463,11 @@ export class Api extends HttpClient + issuesEventsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", @@ -4240,7 +4483,12 @@ export class Api extends HttpClient + issuesEventsDetail: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", @@ -4256,7 +4504,12 @@ export class Api extends HttpClient + issuesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}\`, method: "GET", @@ -4298,7 +4551,12 @@ export class Api extends HttpClient + issuesCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/comments\`, method: "GET", @@ -4340,7 +4598,12 @@ export class Api extends HttpClient + issuesEventsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/events\`, method: "GET", @@ -4356,7 +4619,12 @@ export class Api extends HttpClient + issuesLabelsDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "DELETE", @@ -4371,7 +4639,12 @@ export class Api extends HttpClient + issuesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels\`, method: "GET", @@ -4437,7 +4710,13 @@ export class Api extends HttpClient + issuesLabelsDelete2: ( + owner: string, + repo: string, + number: number, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/issues/\${number}/labels/\${name}\`, method: "DELETE", @@ -4491,7 +4770,12 @@ export class Api extends HttpClient + keysDelete: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", @@ -4506,7 +4790,12 @@ export class Api extends HttpClient + keysDetail: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", @@ -4561,7 +4850,12 @@ export class Api extends HttpClient + labelsDelete: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", @@ -4576,7 +4870,12 @@ export class Api extends HttpClient + labelsDetail: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", @@ -4712,7 +5011,12 @@ export class Api extends HttpClient + milestonesDelete: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "DELETE", @@ -4727,7 +5031,12 @@ export class Api extends HttpClient + milestonesDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}\`, method: "GET", @@ -4767,7 +5076,12 @@ export class Api extends HttpClient + milestonesLabelsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/milestones/\${number}/labels\`, method: "GET", @@ -4907,7 +5221,12 @@ export class Api extends HttpClient + pullsCommentsDelete: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", @@ -4922,7 +5241,12 @@ export class Api extends HttpClient + pullsCommentsDetail: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", @@ -4962,7 +5286,12 @@ export class Api extends HttpClient + pullsDetail: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}\`, method: "GET", @@ -5004,7 +5333,12 @@ export class Api extends HttpClient + pullsCommentsList2: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/comments\`, method: "GET", @@ -5044,7 +5378,12 @@ export class Api extends HttpClient + pullsCommitsList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/commits\`, method: "GET", @@ -5060,7 +5399,12 @@ export class Api extends HttpClient + pullsFilesList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/files\`, method: "GET", @@ -5077,7 +5421,12 @@ export class Api extends HttpClient + pullsMergeList: ( + owner: string, + repo: string, + number: number, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "GET", @@ -5100,7 +5449,10 @@ export class Api extends HttpClient - this.request({ + this.request< + SwaggerTypeMergeGeneratedDataContract, + void | SwaggerTypeMergeGeneratedDataContract + >({ path: \`/repos/\${owner}/\${repo}/pulls/\${number}/merge\`, method: "PUT", body: body, @@ -5180,7 +5532,12 @@ export class Api extends HttpClient + releasesAssetsDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "DELETE", @@ -5195,7 +5552,12 @@ export class Api extends HttpClient + releasesAssetsDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/assets/\${id}\`, method: "GET", @@ -5235,7 +5597,12 @@ export class Api extends HttpClient + releasesDelete: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "DELETE", @@ -5250,7 +5617,12 @@ export class Api extends HttpClient + releasesDetail: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}\`, method: "GET", @@ -5290,7 +5662,12 @@ export class Api extends HttpClient + releasesAssetsList: ( + owner: string, + repo: string, + id: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/releases/\${id}/assets\`, method: "GET", @@ -5322,7 +5699,11 @@ export class Api extends HttpClient + statsCodeFrequencyList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, method: "GET", @@ -5338,7 +5719,11 @@ export class Api extends HttpClient + statsCommitActivityList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, method: "GET", @@ -5354,7 +5739,11 @@ export class Api extends HttpClient + statsContributorsList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", @@ -5370,7 +5759,11 @@ export class Api extends HttpClient + statsParticipationList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/participation\`, method: "GET", @@ -5386,7 +5779,11 @@ export class Api extends HttpClient + statsPunchCardList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, method: "GET", @@ -5402,7 +5799,12 @@ export class Api extends HttpClient + statusesDetail: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/statuses/\${ref}\`, method: "GET", @@ -5442,7 +5844,11 @@ export class Api extends HttpClient + subscribersList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", @@ -5458,7 +5864,11 @@ export class Api extends HttpClient + subscriptionDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", @@ -5473,7 +5883,11 @@ export class Api extends HttpClient + subscriptionList: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", @@ -5739,7 +6153,11 @@ export class Api extends HttpClient + teamsPartialUpdate: ( + teamId: number, + body: SwaggerTypeEditTeamGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}\`, method: "PATCH", @@ -5774,7 +6192,11 @@ export class Api extends HttpClient + membersDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "DELETE", @@ -5791,7 +6213,11 @@ export class Api extends HttpClient + membersDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/members/\${username}\`, method: "GET", @@ -5808,8 +6234,15 @@ export class Api extends HttpClient - this.request({ + membersUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => + this.request< + void, + void | SwaggerTypeOrganizationAsTeamMemberGeneratedDataContract + >({ path: \`/teams/\${teamId}/members/\${username}\`, method: "PUT", ...params, @@ -5823,7 +6256,11 @@ export class Api extends HttpClient + membershipsDelete: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "DELETE", @@ -5839,7 +6276,11 @@ export class Api extends HttpClient + membershipsDetail: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", @@ -5856,7 +6297,11 @@ export class Api extends HttpClient + membershipsUpdate: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => this.request< SwaggerTypeTeamMembershipGeneratedDataContract, void | SwaggerTypeOrganizationAsTeamMemberGeneratedDataContract @@ -5891,7 +6336,12 @@ export class Api extends HttpClient + reposDelete: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", @@ -5905,7 +6355,12 @@ export class Api extends HttpClient + reposDetail: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", @@ -5919,7 +6374,12 @@ export class Api extends HttpClient + reposUpdate: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", @@ -5951,7 +6411,10 @@ export class Api extends HttpClient + userPartialUpdate: ( + body: SwaggerTypeUserUpdateGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/user\`, method: "PATCH", @@ -5969,7 +6432,10 @@ export class Api extends HttpClient + emailsDelete: ( + body: SwaggerTypeUserEmailsGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/user/emails\`, method: "DELETE", @@ -6000,7 +6466,10 @@ export class Api extends HttpClient + emailsCreate: ( + body: SwaggerTypeEmailsPostGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/user/emails\`, method: "POST", @@ -6142,7 +6611,10 @@ export class Api extends HttpClient + keysCreate: ( + body: SwaggerTypeUserKeysPostGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/user/keys\`, method: "POST", @@ -6230,7 +6702,10 @@ export class Api extends HttpClient + reposCreate: ( + body: SwaggerTypePostRepoGeneratedDataContract, + params: RequestParams = {}, + ) => this.request({ path: \`/user/repos\`, method: "POST", @@ -6335,7 +6810,11 @@ export class Api extends HttpClient + subscriptionsDelete: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "DELETE", @@ -6352,7 +6831,11 @@ export class Api extends HttpClient + subscriptionsDetail: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "GET", @@ -6368,7 +6851,11 @@ export class Api extends HttpClient + subscriptionsUpdate: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => this.request({ path: \`/user/subscriptions/\${owner}/\${repo}\`, method: "PUT", @@ -6451,7 +6938,11 @@ export class Api extends HttpClient + eventsOrgsDetail: ( + username: string, + org: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/events/orgs/\${org}\`, method: "GET", @@ -6483,7 +6974,11 @@ export class Api extends HttpClient + followingDetail: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => this.request({ path: \`/users/\${username}/following/\${targetUser}\`, method: "GET", diff --git a/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap b/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap index 0c61c1f0..1c1b52d6 100644 --- a/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap +++ b/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap @@ -47,16 +47,22 @@ export interface FullRequestParams extends Omit { cancelToken?: CancelToken; } -export type RequestParams = Omit; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; customFetch?: typeof fetch; } -export interface HttpResponse extends Response { +export interface HttpResponse + extends Response { data: D; error: E; } @@ -75,7 +81,8 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", @@ -108,9 +115,15 @@ export class HttpClient { protected toQueryString(rawQuery?: QueryParamsType): string { const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); return keys - .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) .join("&"); } @@ -121,8 +134,13 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, [ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; @@ -139,7 +157,10 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { return { ...this.baseApiParams, ...params1, @@ -152,7 +173,9 @@ export class HttpClient { }; } - protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -196,15 +219,26 @@ export class HttpClient { const payloadFormatter = this.contentFormatters[type || ContentType.Json]; const responseFormat = format || requestParams.format; - return this.customFetch(\`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { + ).then(async (response) => { const r = response.clone() as HttpResponse; r.data = null as unknown as T; r.error = null as unknown as E; @@ -239,6 +273,8 @@ export class HttpClient { * @title No title * @baseUrl http://localhost:8080/api/v1 */ -export class Api extends HttpClient {} +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} " `; diff --git a/types/index.ts b/types/index.ts index 50ef1233..42736d93 100644 --- a/types/index.ts +++ b/types/index.ts @@ -107,10 +107,6 @@ interface GenerateApiParamsBase { * extract response error type to data contract */ extractResponseError?: boolean; - /** - * prettier configuration - */ - prettier?: object; /** * Output only errors to console (default: false) */ diff --git a/yarn.lock b/yarn.lock index 22aed9ce..c15f82e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,24 +5,6 @@ __metadata: version: 8 cacheKey: 10c0 -"@babel/code-frame@npm:^7.0.0": - version: 7.26.2 - resolution: "@babel/code-frame@npm:7.26.2" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.25.9" - js-tokens: "npm:^4.0.0" - picocolors: "npm:^1.0.0" - checksum: 10c0/7d79621a6849183c415486af99b1a20b84737e8c11cd55b6544f688c51ce1fd710e6d869c3dd21232023da272a79b91efb3e83b5bc2dc65c1187c5fcd1b72ea8 - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-validator-identifier@npm:7.25.9" - checksum: 10c0/4fc6f830177b7b7e887ad3277ddb3b91d81e6c4a24151540d9d1023e8dc6b1c0505f0f0628ae653601eb4388a8db45c1c14b2c07a9173837aef7e4116456259d - languageName: node - linkType: hard - "@babel/runtime@npm:^7.5.5": version: 7.27.0 resolution: "@babel/runtime@npm:7.27.0" @@ -123,6 +105,31 @@ __metadata: languageName: node linkType: hard +"@biomejs/js-api@npm:^0.7.1": + version: 0.7.1 + resolution: "@biomejs/js-api@npm:0.7.1" + peerDependencies: + "@biomejs/wasm-bundler": ^1.9.2 + "@biomejs/wasm-nodejs": ^1.9.2 + "@biomejs/wasm-web": ^1.9.2 + peerDependenciesMeta: + "@biomejs/wasm-bundler": + optional: true + "@biomejs/wasm-nodejs": + optional: true + "@biomejs/wasm-web": + optional: true + checksum: 10c0/eb2be90535d44c74f769a45a19f74f4e4d0cdbfe609c00e03003077ab1c66c7c7f7fd71af916294cf049167861e2b92343299279a18dd9746f5362038be32cac + languageName: node + linkType: hard + +"@biomejs/wasm-nodejs@npm:^1.9.4": + version: 1.9.4 + resolution: "@biomejs/wasm-nodejs@npm:1.9.4" + checksum: 10c0/9cb7c1fefbb3c4445a241d060b909b4856203277cf5a8d1745eb84511170889bb95555813388015bbf98e25c1cf15a203068ec31de9d51c07442386af2e3c7a4 + languageName: node + linkType: hard + "@changesets/apply-release-plan@npm:^7.0.10": version: 7.0.10 resolution: "@changesets/apply-release-plan@npm:7.0.10" @@ -1223,13 +1230,6 @@ __metadata: languageName: node linkType: hard -"callsites@npm:^3.0.0": - version: 3.1.0 - resolution: "callsites@npm:3.1.0" - checksum: 10c0/fff92277400eb06c3079f9e74f3af120db9f8ea03bad0e84d9aede54bbe2d44a56cccb5f6cf12211f93f52306df87077ecec5b712794c5a9b5dac6d615a3f301 - languageName: node - linkType: hard - "chai@npm:^5.2.0": version: 5.2.0 resolution: "chai@npm:5.2.0" @@ -1353,23 +1353,6 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^9.0.0": - version: 9.0.0 - resolution: "cosmiconfig@npm:9.0.0" - dependencies: - env-paths: "npm:^2.2.1" - import-fresh: "npm:^3.3.0" - js-yaml: "npm:^4.1.0" - parse-json: "npm:^5.2.0" - peerDependencies: - typescript: ">=4.9.5" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/1c1703be4f02a250b1d6ca3267e408ce16abfe8364193891afc94c2d5c060b69611fdc8d97af74b7e6d5d1aac0ab2fb94d6b079573146bc2d756c2484ce5f0ee - languageName: node - linkType: hard - "cross-spawn@npm:^7.0.5, cross-spawn@npm:^7.0.6": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" @@ -1509,7 +1492,7 @@ __metadata: languageName: node linkType: hard -"env-paths@npm:^2.2.0, env-paths@npm:^2.2.1": +"env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" checksum: 10c0/285325677bf00e30845e330eec32894f5105529db97496ee3f598478e50f008c5352a41a30e5e72ec9de8a542b5a570b85699cd63bd2bc646dbcb9f311d83bc4 @@ -1523,15 +1506,6 @@ __metadata: languageName: node linkType: hard -"error-ex@npm:^1.3.1": - version: 1.3.2 - resolution: "error-ex@npm:1.3.2" - dependencies: - is-arrayish: "npm:^0.2.1" - checksum: 10c0/ba827f89369b4c93382cfca5a264d059dfefdaa56ecc5e338ffa58a6471f5ed93b71a20add1d52290a4873d92381174382658c885ac1a2305f7baca363ce9cce - languageName: node - linkType: hard - "es-define-property@npm:^1.0.1": version: 1.0.1 resolution: "es-define-property@npm:1.0.1" @@ -2085,16 +2059,6 @@ __metadata: languageName: node linkType: hard -"import-fresh@npm:^3.3.0": - version: 3.3.1 - resolution: "import-fresh@npm:3.3.1" - dependencies: - parent-module: "npm:^1.0.0" - resolve-from: "npm:^4.0.0" - checksum: 10c0/bf8cc494872fef783249709385ae883b447e3eb09db0ebd15dcead7d9afe7224dad7bd7591c6b73b0b19b3c0f9640eb8ee884f01cfaf2887ab995b0b36a0cbec - languageName: node - linkType: hard - "imurmurhash@npm:^0.1.4": version: 0.1.4 resolution: "imurmurhash@npm:0.1.4" @@ -2112,13 +2076,6 @@ __metadata: languageName: node linkType: hard -"is-arrayish@npm:^0.2.1": - version: 0.2.1 - resolution: "is-arrayish@npm:0.2.1" - checksum: 10c0/e7fb686a739068bb70f860b39b67afc62acc62e36bb61c5f965768abce1873b379c563e61dd2adad96ebb7edf6651111b385e490cf508378959b0ed4cac4e729 - languageName: node - linkType: hard - "is-extglob@npm:^2.1.1": version: 2.1.1 resolution: "is-extglob@npm:2.1.1" @@ -2208,13 +2165,6 @@ __metadata: languageName: node linkType: hard -"js-tokens@npm:^4.0.0": - version: 4.0.0 - resolution: "js-tokens@npm:4.0.0" - checksum: 10c0/e248708d377aa058eacf2037b07ded847790e6de892bbad3dac0abba2e759cb9f121b00099a65195616badcb6eca8d14d975cb3e89eb1cfda644756402c8aeed - languageName: node - linkType: hard - "js-yaml@npm:^3.13.1, js-yaml@npm:^3.6.1": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" @@ -2245,13 +2195,6 @@ __metadata: languageName: node linkType: hard -"json-parse-even-better-errors@npm:^2.3.0": - version: 2.3.1 - resolution: "json-parse-even-better-errors@npm:2.3.1" - checksum: 10c0/140932564c8f0b88455432e0f33c4cb4086b8868e37524e07e723f4eaedb9425bdc2bafd71bd1d9765bd15fd1e2d126972bc83990f55c467168c228c24d665f3 - languageName: node - linkType: hard - "jsonfile@npm:^4.0.0": version: 4.0.0 resolution: "jsonfile@npm:4.0.0" @@ -2784,27 +2727,6 @@ __metadata: languageName: node linkType: hard -"parent-module@npm:^1.0.0": - version: 1.0.1 - resolution: "parent-module@npm:1.0.1" - dependencies: - callsites: "npm:^3.0.0" - checksum: 10c0/c63d6e80000d4babd11978e0d3fee386ca7752a02b035fd2435960ffaa7219dc42146f07069fb65e6e8bf1caef89daf9af7535a39bddf354d78bf50d8294f556 - languageName: node - linkType: hard - -"parse-json@npm:^5.2.0": - version: 5.2.0 - resolution: "parse-json@npm:5.2.0" - dependencies: - "@babel/code-frame": "npm:^7.0.0" - error-ex: "npm:^1.3.1" - json-parse-even-better-errors: "npm:^2.3.0" - lines-and-columns: "npm:^1.1.6" - checksum: 10c0/77947f2253005be7a12d858aedbafa09c9ae39eb4863adf330f7b416ca4f4a08132e453e08de2db46459256fb66afaac5ee758b44fe6541b7cdaf9d252e59585 - languageName: node - linkType: hard - "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -2857,7 +2779,7 @@ __metadata: languageName: node linkType: hard -"picocolors@npm:^1.0.0, picocolors@npm:^1.1.0, picocolors@npm:^1.1.1": +"picocolors@npm:^1.1.0, picocolors@npm:^1.1.1": version: 1.1.1 resolution: "picocolors@npm:1.1.1" checksum: 10c0/e2e3e8170ab9d7c7421969adaa7e1b31434f789afb9b3f115f6b96d91945041ac3ceb02e9ec6fe6510ff036bcc0bf91e69a1772edc0b707e12b19c0f2d6bcf58 @@ -2946,15 +2868,6 @@ __metadata: languageName: node linkType: hard -"prettier@npm:~3.5.3": - version: 3.5.3 - resolution: "prettier@npm:3.5.3" - bin: - prettier: bin/prettier.cjs - checksum: 10c0/3880cb90b9dc0635819ab52ff571518c35bd7f15a6e80a2054c05dbc8a3aa6e74f135519e91197de63705bcb38388ded7e7230e2178432a1468005406238b877 - languageName: node - linkType: hard - "proc-log@npm:^5.0.0": version: 5.0.0 resolution: "proc-log@npm:5.0.0" @@ -3050,13 +2963,6 @@ __metadata: languageName: node linkType: hard -"resolve-from@npm:^4.0.0": - version: 4.0.0 - resolution: "resolve-from@npm:4.0.0" - checksum: 10c0/8408eec31a3112ef96e3746c37be7d64020cda07c03a920f5024e77290a218ea758b26ca9529fd7b1ad283947f34b2291c1c0f6aa0ed34acfdda9c6014c8d190 - languageName: node - linkType: hard - "resolve-from@npm:^5.0.0": version: 5.0.0 resolution: "resolve-from@npm:5.0.0" @@ -3450,6 +3356,8 @@ __metadata: resolution: "swagger-typescript-api@workspace:." dependencies: "@biomejs/biome": "npm:1.9.4" + "@biomejs/js-api": "npm:^0.7.1" + "@biomejs/wasm-nodejs": "npm:^1.9.4" "@changesets/changelog-github": "npm:0.5.1" "@changesets/cli": "npm:2.28.1" "@tsconfig/node18": "npm:18.2.4" @@ -3463,13 +3371,11 @@ __metadata: c12: "npm:^3.0.2" citty: "npm:^0.1.6" consola: "npm:^3.4.2" - cosmiconfig: "npm:^9.0.0" eta: "npm:^2.2.0" js-yaml: "npm:^4.1.0" lodash: "npm:^4.17.21" nanoid: "npm:^5.1.5" openapi-types: "npm:12.1.3" - prettier: "npm:~3.5.3" swagger-schema-official: "npm:2.0.0-bab6bed" swagger2openapi: "npm:^7.0.8" tsup: "npm:8.4.0"