@bpinternal/opapi
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -0,0 +0,0 @@ import { OpenApiZodAny, extendApi } from '@anatine/zod-openapi'; |
@@ -49,3 +49,3 @@ "use strict"; | ||
var defaultResponseStatus = 200; | ||
var tsFileHeader = "// This file was generated by the Opapi Generator\n/* eslint-disable */\n// @ts-nocheck"; | ||
var tsFileHeader = "// This file was generated by the Opapi Generator\n/* eslint-disable */\n"; | ||
var invalidLine = "import { URL, URLSearchParams } from 'url';"; | ||
@@ -444,4 +444,3 @@ | ||
useSingleRequestParameter: true, | ||
withNodeImports: false, | ||
withInterfaces: true | ||
withNodeImports: false | ||
}); | ||
@@ -463,6 +462,3 @@ const buffer = await client.downloadClient(id); | ||
// src/generators/errors.ts | ||
function generateErrors(errors) { | ||
const types = errors.map((error) => error.type); | ||
return ` | ||
const codes = { | ||
var codes = { | ||
HTTP_STATUS_BAD_REQUEST: 400, | ||
@@ -474,6 +470,18 @@ HTTP_STATUS_UNAUTHORIZED: 401, | ||
HTTP_STATUS_METHOD_NOT_ALLOWED: 405, | ||
HTTP_STATUS_REQUEST_TIMEOUT: 408, | ||
HTTP_STATUS_CONFLICT: 409, | ||
HTTP_STATUS_PAYLOAD_TOO_LARGE: 413, | ||
HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415, | ||
HTTP_STATUS_TOO_MANY_REQUESTS: 429, | ||
HTTP_STATUS_INTERNAL_SERVER_ERROR: 500, | ||
HTTP_STATUS_NOT_IMPLEMENTED: 501, | ||
HTTP_STATUS_BAD_GATEWAY: 502, | ||
HTTP_STATUS_SERVICE_UNAVAILABLE: 503, | ||
HTTP_STATUS_GATEWAY_TIMEOUT: 504 | ||
}; | ||
function generateErrors(errors) { | ||
const types = errors.map((error) => error.type); | ||
return ` | ||
const codes = { | ||
${Object.entries(codes).map(([name, code]) => ` ${name}: ${code},`).join("\n")} | ||
} as const | ||
@@ -508,3 +516,3 @@ | ||
export const isApiError = (thrown: unknown): thrown is ApiError => { | ||
return thrown instanceof BaseApiError || isObject(thrown) && thrown.isApiError === true | ||
return thrown instanceof BaseApiError || isObject(thrown) && (thrown as ApiError).isApiError === true | ||
} | ||
@@ -511,0 +519,0 @@ |
{ | ||
"name": "@bpinternal/opapi", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "", | ||
@@ -15,2 +15,7 @@ "main": "./dist/index.js", | ||
}, | ||
"scripts": { | ||
"test:e2e": "vitest", | ||
"build": "tsup src/index.ts --dts --format cjs,esm --clean", | ||
"type-check": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
@@ -47,8 +52,3 @@ "tsup": "^6.7.0", | ||
"author": "", | ||
"license": "ISC", | ||
"scripts": { | ||
"test:e2e": "vitest", | ||
"build": "tsup src/index.ts --dts --format cjs,esm --clean", | ||
"type-check": "tsc --noEmit" | ||
} | ||
} | ||
"license": "ISC" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82426
2098
1