@scalar/openapi-parser
Advanced tools
Comparing version 0.10.4 to 0.10.5
# @scalar/openapi-parser | ||
## 0.10.5 | ||
### Patch Changes | ||
- a30e7cc: fix: package doesn’t work with `moduleResolution: NodeNext` | ||
## 0.10.4 | ||
@@ -4,0 +10,0 @@ |
@@ -1,5 +0,5 @@ | ||
export * from './configuration/index.js'; | ||
export * from './lib'; | ||
export * from './types'; | ||
export * from './utils'; | ||
export * from './configuration/index.ts'; | ||
export * from './lib/Validator/index.ts'; | ||
export * from './types/index.ts'; | ||
export * from './utils/index.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,3 @@ | ||
export * from './Validator.js'; | ||
export * from '../../utils/resolveReferences.js'; | ||
export * from './Validator.ts'; | ||
export * from '../../utils/resolveReferences.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
import Ajv04 from 'ajv-draft-04'; | ||
import Ajv2020 from 'ajv/dist/2020.js'; | ||
import { type OpenApiVersion } from '../../configuration/index.js'; | ||
import type { AnyObject, Filesystem, ThrowOnErrorOption, ValidateResult } from '../../types'; | ||
import { type OpenApiVersion } from '../../configuration/index.ts'; | ||
import type { AnyObject, Filesystem, ThrowOnErrorOption, ValidateResult } from '../../types/index.ts'; | ||
/** | ||
@@ -6,0 +6,0 @@ * Configure available JSON Schema versions |
@@ -118,2 +118,3 @@ import Ajv04 from 'ajv-draft-04'; | ||
// https://ajv.js.org/packages/ajv-formats.html#formats | ||
// @ts-expect-error ajv-formats is not well typed | ||
addFormats(ajv); | ||
@@ -120,0 +121,0 @@ // OpenAPI 3.1 uses media-range format |
@@ -1,2 +0,2 @@ | ||
import type { LoadPlugin } from '../../utils/load'; | ||
import type { LoadPlugin } from '../../utils/load/load.ts'; | ||
export declare const fetchUrlsDefaultConfiguration: { | ||
@@ -3,0 +3,0 @@ limit: number; |
@@ -1,2 +0,2 @@ | ||
export * from './fetchUrls.js'; | ||
export * from './fetchUrls.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export * from './readFiles.js'; | ||
export * from './readFiles.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import type { LoadPlugin } from '../../utils/load'; | ||
import type { LoadPlugin } from '../../utils/load/load.ts'; | ||
export declare const readFiles: () => LoadPlugin; | ||
//# sourceMappingURL=readFiles.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export * as path from './path.js'; | ||
export * as path from './path.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
import type { OpenAPI } from '@scalar/openapi-types'; | ||
import type { ERRORS, OpenApiVersion } from '../configuration/index.js'; | ||
import type { ERRORS, OpenApiVersion } from '../configuration/index.ts'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Merge types with each other |
// Basic | ||
const eq = (x) => (y) => x === y; | ||
const not = (fn) => (x) => !fn(x); | ||
const getValues = (o) => Object.values(o); | ||
const notUndefined = (x) => x !== undefined; | ||
// Error | ||
@@ -14,18 +11,10 @@ const isXError = (x) => (error) => error.keyword === x; | ||
const isEnumError = isXError('enum'); | ||
const getErrors = (node) => (node && node.errors) || []; | ||
const getErrors = (node) => node?.errors || []; | ||
// Node | ||
const getChildren = (node) => (node && getValues(node.children)) || []; | ||
const getSiblings = (parent /*: Node */) => (node /*: Node */) => getChildren(parent).filter(not(eq(node))); | ||
const concatAll = | ||
/* ::<T> */ | ||
(xs /*: $ReadOnlyArray<T> */) => (ys /* : $ReadOnlyArray<T> */) => ys.reduce((zs, z) => zs.concat(z), xs); | ||
const getSiblings = | ||
(parent /*: Node */) => (node /*: Node */) /*: $ReadOnlyArray<Node> */ => | ||
getChildren(parent).filter(not(eq(node))); | ||
const concatAll = | ||
/* ::<T> */ | ||
(xs /*: $ReadOnlyArray<T> */) => | ||
(ys /* : $ReadOnlyArray<T> */) /* : $ReadOnlyArray<T> */ => | ||
ys.reduce((zs, z) => zs.concat(z), xs); | ||
export { concatAll, getChildren, getErrors, getSiblings, isAnyOfError, isEnumError, isRequiredError, notUndefined }; |
@@ -1,3 +0,3 @@ | ||
import type { AnyApiDefinitionFormat, DereferenceResult, Filesystem } from '../types'; | ||
import { type ResolveReferencesOptions } from './resolveReferences.js'; | ||
import type { AnyApiDefinitionFormat, DereferenceResult, Filesystem } from '../types/index.ts'; | ||
import { type ResolveReferencesOptions } from './resolveReferences.ts'; | ||
export type DereferenceOptions = ResolveReferencesOptions; | ||
@@ -4,0 +4,0 @@ /** |
import type { UnknownObject } from '@scalar/types/utils'; | ||
import type { DetailsResult } from '../types'; | ||
import type { DetailsResult } from '../types/index.ts'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Get versions of the OpenAPI document. |
@@ -1,2 +0,2 @@ | ||
import type { AnyApiDefinitionFormat, AnyObject, FilterResult } from '../types'; | ||
import type { AnyApiDefinitionFormat, AnyObject, FilterResult } from '../types/index.ts'; | ||
export type FilterCallback = (schema: AnyObject) => boolean; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import type { Filesystem, FilesystemEntry } from '../types'; | ||
import type { Filesystem, FilesystemEntry } from '../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Return just the entrypoint of the filesystem. |
@@ -1,2 +0,2 @@ | ||
import type { AnyObject } from '../types'; | ||
import type { AnyObject } from '../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Walks through the specification and returns all references as an array. |
@@ -1,27 +0,27 @@ | ||
export * from './dereference.js'; | ||
export * from './details.js'; | ||
export * from './escapeJsonPointer.js'; | ||
export * from './filter.js'; | ||
export * from './getEntrypoint.js'; | ||
export * from './getListOfReferences.js'; | ||
export * from './getSegmentsFromPath.js'; | ||
export * from './isFilesystem.js'; | ||
export * from './isJson.js'; | ||
export * from './isObject.js'; | ||
export * from './isYaml.js'; | ||
export * from './load'; | ||
export * from './load/load.js'; | ||
export * from './normalize.js'; | ||
export * from './openapi'; | ||
export * from './resolveReferences.js'; | ||
export * from './toJson.js'; | ||
export * from './toYaml.js'; | ||
export * from './transformErrors.js'; | ||
export * from './traverse.js'; | ||
export * from './unescapeJsonPointer.js'; | ||
export * from './upgrade.js'; | ||
export * from './upgradeFromThreeToThreeOne.js'; | ||
export * from './upgradeFromTwoToThree.js'; | ||
export * from './validate.js'; | ||
export * from './transform'; | ||
export * from './dereference.ts'; | ||
export * from './details.ts'; | ||
export * from './escapeJsonPointer.ts'; | ||
export * from './filter.ts'; | ||
export * from './getEntrypoint.ts'; | ||
export * from './getListOfReferences.ts'; | ||
export * from './getSegmentsFromPath.ts'; | ||
export * from './isFilesystem.ts'; | ||
export * from './isJson.ts'; | ||
export * from './isObject.ts'; | ||
export * from './isYaml.ts'; | ||
export * from './load/index.ts'; | ||
export * from './load/load.ts'; | ||
export * from './normalize.ts'; | ||
export * from './openapi/index.ts'; | ||
export * from './resolveReferences.ts'; | ||
export * from './toJson.ts'; | ||
export * from './toYaml.ts'; | ||
export * from './transformErrors.ts'; | ||
export * from './traverse.ts'; | ||
export * from './unescapeJsonPointer.ts'; | ||
export * from './upgrade.ts'; | ||
export * from './upgradeFromThreeToThreeOne.ts'; | ||
export * from './upgradeFromTwoToThree.ts'; | ||
export * from './validate.ts'; | ||
export * from './transform/index.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export * from './load.js'; | ||
export * from './load.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { AnyApiDefinitionFormat, Filesystem, LoadResult, ThrowOnErrorOption } from '../../types'; | ||
import type { AnyApiDefinitionFormat, Filesystem, LoadResult, ThrowOnErrorOption } from '../../types/index.ts'; | ||
export type LoadPlugin = { | ||
@@ -3,0 +3,0 @@ check: (value?: any) => boolean; |
@@ -1,3 +0,3 @@ | ||
import type { AnyObject, Filesystem, FilesystemEntry } from '../types'; | ||
import type { AnyObject, Filesystem, FilesystemEntry } from '../types/index.ts'; | ||
export declare function makeFilesystem(value: string | AnyObject | Filesystem, overwrites?: Partial<FilesystemEntry>): Filesystem; | ||
//# sourceMappingURL=makeFilesystem.d.ts.map |
import type { UnknownObject } from '@scalar/types/utils'; | ||
import type { Filesystem } from '../types'; | ||
import type { Filesystem } from '../types/index.ts'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Normalize the OpenAPI document (YAML, JSON, object) to a JavaScript object. |
@@ -1,3 +0,3 @@ | ||
import type { Queue, Task } from '../../../types'; | ||
import { details as detailsUtility } from '../../details.js'; | ||
import type { Queue, Task } from '../../../types/index.ts'; | ||
import { details as detailsUtility } from '../../details.ts'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Run the chained tasks and return just some basic information about the OpenAPI document |
@@ -1,2 +0,2 @@ | ||
import type { Filesystem, Queue, Task } from '../../../types'; | ||
import type { Filesystem, Queue, Task } from '../../../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Run the chained tasks and return just the filesystem |
@@ -1,2 +0,2 @@ | ||
import type { CommandChain, Queue, Task } from '../../../types'; | ||
import type { CommandChain, Queue, Task } from '../../../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Run the chained tasks and return the results |
@@ -1,2 +0,2 @@ | ||
import type { Queue, Task } from '../../../types'; | ||
import type { Queue, Task } from '../../../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Run the chained tasks and return the results |
@@ -1,2 +0,2 @@ | ||
import type { Queue, Task } from '../../../types'; | ||
import type { Queue, Task } from '../../../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Run the chained tasks and return the results |
@@ -1,3 +0,3 @@ | ||
import type { DereferenceResult, Queue, Task } from '../../../types'; | ||
import type { DereferenceOptions } from '../../dereference.js'; | ||
import type { DereferenceResult, Queue, Task } from '../../../types/index.ts'; | ||
import type { DereferenceOptions } from '../../dereference.ts'; | ||
declare global { | ||
@@ -18,5 +18,5 @@ interface Commands { | ||
export declare function dereferenceCommand<T extends Task[]>(previousQueue: Queue<T>, options?: DereferenceOptions): { | ||
details: () => Promise<import("../../../index.js").DetailsResult>; | ||
files: () => Promise<import("../../../index.js").Filesystem>; | ||
get: () => Promise<import("../../../index.js").CommandChain<[...T, { | ||
details: () => Promise<import("../../../types/index.ts").DetailsResult>; | ||
files: () => Promise<import("../../../types/index.ts").Filesystem>; | ||
get: () => Promise<import("../../../types/index.ts").CommandChain<[...T, { | ||
name: "dereference"; | ||
@@ -23,0 +23,0 @@ options?: DereferenceOptions; |
@@ -1,4 +0,4 @@ | ||
import type { FilterResult, Queue, Task } from '../../../types'; | ||
import type { DereferenceOptions } from '../../dereference.js'; | ||
import type { FilterCallback } from '../../filter.js'; | ||
import type { FilterResult, Queue, Task } from '../../../types/index.ts'; | ||
import type { DereferenceOptions } from '../../dereference.ts'; | ||
import type { FilterCallback } from '../../filter.ts'; | ||
declare global { | ||
@@ -20,5 +20,5 @@ interface Commands { | ||
dereference: (dereferenceOptions?: DereferenceOptions) => { | ||
details: () => Promise<import("../../../index.js").DetailsResult>; | ||
files: () => Promise<import("../../../index.js").Filesystem>; | ||
get: () => Promise<import("../../../index.js").CommandChain<[...T, { | ||
details: () => Promise<import("../../../types/index.ts").DetailsResult>; | ||
files: () => Promise<import("../../../types/index.ts").Filesystem>; | ||
get: () => Promise<import("../../../types/index.ts").CommandChain<[...T, { | ||
name: "filter"; | ||
@@ -33,5 +33,5 @@ options?: FilterCallback; | ||
}; | ||
details: () => Promise<import("../../../index.js").DetailsResult>; | ||
files: () => Promise<import("../../../index.js").Filesystem>; | ||
get: () => Promise<import("../../../index.js").CommandChain<[...T, { | ||
details: () => Promise<import("../../../types/index.ts").DetailsResult>; | ||
files: () => Promise<import("../../../types/index.ts").Filesystem>; | ||
get: () => Promise<import("../../../types/index.ts").CommandChain<[...T, { | ||
name: "filter"; | ||
@@ -38,0 +38,0 @@ options?: FilterCallback; |
@@ -1,2 +0,2 @@ | ||
export * from './openapi.js'; | ||
export * from './openapi.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { Queue, Task } from '../../../types'; | ||
import type { Queue, Task } from '../../../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Add a new task to the existing queue |
@@ -1,2 +0,2 @@ | ||
import type { CommandChain, Queue, Task } from '../../../types'; | ||
import type { CommandChain, Queue, Task } from '../../../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Takes a queue of tasks and works through them |
import { dereference } from '../../dereference.js'; | ||
import { filter } from '../../filter.js'; | ||
import { load } from '../../load/load.js'; | ||
import { upgrade } from '../../upgrade.js'; | ||
import { validate } from '../../validate.js'; | ||
import { load } from '../../load/load.js'; | ||
@@ -7,0 +7,0 @@ /** |
import type { OpenAPI } from '@scalar/openapi-types'; | ||
import type { AnyObject, ErrorObject, Filesystem, FilesystemEntry, ThrowOnErrorOption } from '../types'; | ||
import type { AnyObject, ErrorObject, Filesystem, FilesystemEntry, ThrowOnErrorOption } from '../types/index.ts'; | ||
export type ResolveReferencesResult = { | ||
@@ -4,0 +4,0 @@ valid: boolean; |
@@ -1,3 +0,3 @@ | ||
import type { AnyObject } from '../types'; | ||
import type { AnyObject } from '../types/index.ts'; | ||
export declare const toJson: (value: AnyObject) => string; | ||
//# sourceMappingURL=toJson.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import type { AnyObject } from '../types'; | ||
import type { AnyObject } from '../types/index.ts'; | ||
export declare const toYaml: (value: AnyObject) => string; | ||
//# sourceMappingURL=toYaml.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export * from './sanitize.js'; | ||
export * from './sanitize.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
import type { OpenAPI } from '@scalar/openapi-types'; | ||
import type { AnyObject } from '../../types'; | ||
export { DEFAULT_OPENAPI_VERSION } from './utils/addLatestOpenApiVersion.js'; | ||
export { DEFAULT_TITLE, DEFAULT_VERSION } from './utils/addInfoObject.js'; | ||
import type { AnyObject } from '../../types/index.ts'; | ||
export { DEFAULT_OPENAPI_VERSION } from './utils/addLatestOpenApiVersion.ts'; | ||
export { DEFAULT_TITLE, DEFAULT_VERSION } from './utils/addInfoObject.ts'; | ||
/** | ||
@@ -6,0 +6,0 @@ * Make an OpenAPI document a valid and clean OpenAPI document |
@@ -1,2 +0,2 @@ | ||
import type { AnyObject } from '../../../types'; | ||
import type { AnyObject } from '../../../types/index.ts'; | ||
export declare const DEFAULT_TITLE = "API"; | ||
@@ -3,0 +3,0 @@ export declare const DEFAULT_VERSION = "1.0"; |
@@ -1,2 +0,2 @@ | ||
import type { AnyObject } from '../../../types'; | ||
import type { AnyObject } from '../../../types/index.ts'; | ||
export declare const DEFAULT_OPENAPI_VERSION = "3.1.1"; | ||
@@ -3,0 +3,0 @@ export declare const addLatestOpenApiVersion: (definition: AnyObject) => { |
@@ -1,3 +0,3 @@ | ||
import type { AnyObject } from '../../../types'; | ||
import type { AnyObject } from '../../../types/index.ts'; | ||
export declare const addMissingTags: (definition: AnyObject) => AnyObject; | ||
//# sourceMappingURL=addMissingTags.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import type { AnyObject } from '../../../types'; | ||
import type { AnyObject } from '../../../types/index.ts'; | ||
export declare const normalizeSecuritySchemes: (definition: AnyObject) => AnyObject; | ||
//# sourceMappingURL=normalizeSecuritySchemes.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import type { AnyObject } from '../../../types'; | ||
import type { AnyObject } from '../../../types/index.ts'; | ||
export declare const rejectSwaggerDocuments: (defintion: AnyObject) => AnyObject; | ||
//# sourceMappingURL=rejectSwaggerDocuments.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { AnyObject } from '../types'; | ||
import type { AnyObject } from '../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Transforms ajv errors, finds the positions in the schema and returns an enriched format. |
@@ -1,2 +0,2 @@ | ||
import type { AnyObject } from '../types'; | ||
import type { AnyObject } from '../types/index.ts'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Recursively traverses the specification and applies the transform function to each node. |
import type { OpenAPIV3_1 } from '@scalar/openapi-types'; | ||
import type { AnyObject, Filesystem, UpgradeResult } from '../types'; | ||
import type { AnyObject, Filesystem, UpgradeResult } from '../types/index.ts'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Upgrade specification to OpenAPI 3.1.0 |
@@ -1,2 +0,2 @@ | ||
import type { AnyObject, Filesystem, ThrowOnErrorOption, ValidateResult } from '../types'; | ||
import type { AnyObject, Filesystem, ThrowOnErrorOption, ValidateResult } from '../types/index.ts'; | ||
export type ValidateOptions = ThrowOnErrorOption; | ||
@@ -3,0 +3,0 @@ /** |
@@ -0,3 +1,3 @@ | ||
import { Validator } from '../lib/Validator/Validator.js'; | ||
import { makeFilesystem } from './makeFilesystem.js'; | ||
import { Validator } from '../lib/Validator/Validator.js'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -20,3 +20,3 @@ { | ||
], | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"engines": { | ||
@@ -69,4 +69,4 @@ "node": ">=18" | ||
"@scalar/build-tooling": "0.1.12", | ||
"@scalar/openapi-types": "0.1.6", | ||
"@scalar/types": "0.0.26" | ||
"@scalar/openapi-types": "0.1.7", | ||
"@scalar/types": "0.0.31" | ||
}, | ||
@@ -73,0 +73,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2009998
28426