oas 25.2.2 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -3
- package/README.md +1 -1
- package/dist/analyzer/index.cjs +7 -7
- package/dist/analyzer/index.cjs.map +1 -1
- package/dist/analyzer/index.js +6 -6
- package/dist/analyzer/index.js.map +1 -1
- package/dist/{chunk-DAS55TQF.cjs → chunk-2A73SW7A.cjs} +87 -38
- package/dist/chunk-2A73SW7A.cjs.map +1 -0
- package/dist/{chunk-CPI37LBJ.cjs → chunk-4LYTGC26.cjs} +53 -36
- package/dist/chunk-4LYTGC26.cjs.map +1 -0
- package/dist/{chunk-QMLWI5HD.js → chunk-DPTPURCR.js} +1 -1
- package/dist/chunk-DPTPURCR.js.map +1 -0
- package/dist/{chunk-P2SB77YR.js → chunk-L2OVXZK3.js} +1 -1
- package/dist/{chunk-P2SB77YR.js.map → chunk-L2OVXZK3.js.map} +1 -1
- package/dist/{chunk-TG4VCYD4.cjs → chunk-QBBP72GC.cjs} +13 -13
- package/dist/chunk-QBBP72GC.cjs.map +1 -0
- package/dist/{chunk-CLQZGF6D.js → chunk-QVVE46I7.js} +61 -12
- package/dist/chunk-QVVE46I7.js.map +1 -0
- package/dist/{chunk-V6OITOCT.js → chunk-SKTFIIOT.js} +36 -19
- package/dist/chunk-SKTFIIOT.js.map +1 -0
- package/dist/{chunk-VIIXOUMH.cjs → chunk-TDI4MZLI.cjs} +2 -2
- package/dist/chunk-TDI4MZLI.cjs.map +1 -0
- package/dist/{chunk-W7MR5CC7.js → chunk-VMOLPNIM.js} +3 -3
- package/dist/chunk-VMOLPNIM.js.map +1 -0
- package/dist/{chunk-4DQE5VZI.cjs → chunk-VSXG73AZ.cjs} +1 -1
- package/dist/chunk-VSXG73AZ.cjs.map +1 -0
- package/dist/{chunk-SITXIAYE.js → chunk-W2TD4LSC.js} +2 -2
- package/dist/chunk-W2TD4LSC.js.map +1 -0
- package/dist/{chunk-YHO3AOX6.cjs → chunk-XS7VDTTT.cjs} +1 -1
- package/dist/{chunk-YHO3AOX6.cjs.map → chunk-XS7VDTTT.cjs.map} +1 -1
- package/dist/{extensions-DYrxWRh4.d.ts → extensions-Bv1ipECR.d.ts} +23 -28
- package/dist/{extensions-CaiwqAu-.d.cts → extensions-DCqurkah.d.cts} +23 -28
- package/dist/extensions.cjs +2 -2
- package/dist/extensions.d.cts +1 -1
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +10 -17
- package/dist/index.d.ts +10 -17
- package/dist/index.js +6 -6
- package/dist/operation/index.cjs +6 -6
- package/dist/operation/index.d.cts +1 -1
- package/dist/operation/index.d.ts +1 -1
- package/dist/operation/index.js +5 -5
- package/dist/operation/lib/get-parameters-as-json-schema.cjs +4 -4
- package/dist/operation/lib/get-parameters-as-json-schema.d.cts +1 -1
- package/dist/operation/lib/get-parameters-as-json-schema.d.ts +1 -1
- package/dist/operation/lib/get-parameters-as-json-schema.js +3 -3
- package/dist/reducer/index.cjs.map +1 -1
- package/dist/reducer/index.js.map +1 -1
- package/dist/types.cjs +2 -2
- package/dist/types.d.cts +5 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.js +1 -1
- package/dist/utils.cjs +5 -5
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +4 -4
- package/package.json +8 -10
- package/dist/chunk-4DQE5VZI.cjs.map +0 -1
- package/dist/chunk-CLQZGF6D.js.map +0 -1
- package/dist/chunk-CPI37LBJ.cjs.map +0 -1
- package/dist/chunk-DAS55TQF.cjs.map +0 -1
- package/dist/chunk-QMLWI5HD.js.map +0 -1
- package/dist/chunk-SITXIAYE.js.map +0 -1
- package/dist/chunk-TG4VCYD4.cjs.map +0 -1
- package/dist/chunk-V6OITOCT.js.map +0 -1
- package/dist/chunk-VIIXOUMH.cjs.map +0 -1
- package/dist/chunk-W7MR5CC7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/erunion/code/readme/oas/packages/oas/dist/chunk-YHO3AOX6.cjs","../src/extensions.ts"],"names":[],"mappings":"AAAA;AC+BO,IAAM,aAAA,EAAe,cAAA;AAoBrB,IAAM,iBAAA,EAAmB,kBAAA;AAwBzB,IAAM,QAAA,EAAU,SAAA;AAmBhB,IAAM,gBAAA,EAAkB,iBAAA;AAiBxB,IAAM,cAAA,EAAgB,eAAA;AAuBtB,IAAM,mBAAA,EAAqB,oBAAA;AAoB3B,IAAM,cAAA,EAAgB,eAAA;AAiBtB,IAAM,kBAAA,EAAoB,mBAAA;AAc1B,IAAM,YAAA,EAAc,aAAA;AAepB,IAAM,oBAAA,EAAsB,qBAAA;AAkE5B,IAAM,kBAAA,EAAgC;AAAA,EAC3C,CAAC,YAAY,CAAA,EAAG,KAAA,CAAA;AAAA,EAChB,CAAC,mBAAmB,CAAA,EAAG,KAAA;AAAA,EACvB,CAAC,gBAAgB,CAAA,EAAG,IAAA;AAAA,EACpB,CAAC,OAAO,CAAA,EAAG,KAAA,CAAA;AAAA,EACX,CAAC,eAAe,CAAA,EAAG,IAAA;AAAA,EACnB,CAAC,aAAa,CAAA,EAAG,CAAC,CAAA;AAAA,EAClB,CAAC,kBAAkB,CAAA,EAAG,CAAC,MAAA,EAAQ,OAAA,EAAS,MAAA,EAAQ,QAAA,EAAU,MAAA,EAAQ,QAAQ,CAAA;AAAA,EAC1E,CAAC,aAAa,CAAA,EAAG,IAAA;AAAA,EACjB,CAAC,iBAAiB,CAAA,EAAG,CAAC,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,QAAA,EAAU,MAAA,EAAQ,QAAQ,CAAA;AAAA,EAChF,CAAC,WAAW,CAAA,EAAG;AACjB,CAAA;AAMO,SAAS,gBAAA,CAAiB,SAAA,EAAsC,GAAA,EAAkB;AACvF,EAAA,OAAO,OAAA,CAAQ,IAAA,GAAO,UAAA,GAAa,GAAG,CAAA;AACxC;AAMO,SAAS,YAAA,CAAa,SAAA,EAAsC,GAAA,EAAkB,SAAA,EAAuB;AAC1G,EAAA,GAAA,CAAI,SAAA,EAAW;AACb,IAAA,GAAA,CAAI,SAAA,CAAU,YAAA,CAAa,UAAU,CAAA,EAAG;AACtC,MAAA,MAAM,KAAA,EAAO,SAAA,CAAU,YAAA,CAAa,UAAU,CAAA;AAC9C,MAAA,GAAA,CAAI,KAAA,GAAQ,OAAO,KAAA,IAAS,SAAA,GAAY,UAAA,GAAa,IAAA,EAAM;AACzD,QAAA,OAAO,IAAA,CAAK,SAA6B,CAAA;AAAA,MAC3C;AAAA,IACF;AAEA,IAAA,GAAA,CAAI,SAAA,CAAU,YAAA,CAAa,CAAA,EAAA,EAAK,SAAS,CAAA,CAAA;AACJ,MAAA;AACH,IAAA;AACO,MAAA;AACzC,IAAA;AACF,EAAA;AAIgC,EAAA;AACI,IAAA;AACpC,EAAA;AAEuC,EAAA;AACR,IAAA;AACW,IAAA;AACG,MAAA;AAC3C,IAAA;AACF,EAAA;AAE0C,EAAA;AACX,IAAA;AACW,EAAA;AAClB,IAAA;AACxB,EAAA;AAGoC,EAAA;AACoB,IAAA;AACxD,EAAA;AAEO,EAAA;AACT;AAUE;AAEuC,EAAA;AACH,EAAA;AACQ,EAAA;AAEJ,EAAA;AACL,IAAA;AACnC,EAAA;AAEqC,EAAA;AACO,EAAA;AACT,IAAA;AACnC,EAAA;AACF;AD7R8C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/erunion/code/readme/oas/packages/oas/dist/chunk-YHO3AOX6.cjs","sourcesContent":[null,"import type { Operation } from './operation/index.js';\nimport type { OASDocument } from './types.js';\n\n/**\n * Enables custom-written code samples to be set for your operations. Use this if you have specific\n * formatting that may not be followed by the auto-generated code samples. Custom code samples are\n * treated as static content.\n *\n * This extension only be placed at the operation level.\n *\n * @defaultValue []\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#custom-code-samples}\n * @example\n * {\n * \"x-readme\": {\n * \"code-samples\": [\n * {\n * \"language\": \"curl\",\n * \"code\": \"curl -X POST https://api.example.com/v2/alert\",\n * \"name\": \"Custom cURL snippet\",\n * \"install\": \"brew install curl\"\n * },\n * {\n * \"language\": \"php\",\n * \"code\": \"<?php echo \\\"This is our custom PHP code snippet.\\\"; ?>\",\n * \"name\": \"Custom PHP snippet\"\n * }\n * ]\n * }\n * }\n */\nexport const CODE_SAMPLES = 'code-samples';\n\n/**\n * Disables the API Explorer's \"Try It\" button, preventing users from making API requests from\n * within your docs. Users will still be able to fill out any entry fields (path or query\n * parameters, etc.), and code snippets will be auto-generated based on the user's input, however\n * to interact with your API the user will need to copy the code snippet and execute it outside of\n * your docs.\n *\n * This **does not** disable your API Reference documentation.\n *\n * @defaultValue true\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#disable-the-api-explorer}\n * @example\n * {\n * \"x-readme\": {\n * \"explorer-enabled\": true\n * }\n * }\n */\nexport const EXPLORER_ENABLED = 'explorer-enabled';\n\n/**\n * Adds static headers to add to each request. Use this when there are specific headers unique to\n * your API.\n *\n * @defaultValue []\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#static-headers}\n * @example\n * {\n * \"x-readme\": {\n * \"headers\": [\n * {\n * \"key\": \"X-Static-Header-One\",\n * \"value\": \"owlbert\"\n * },\n * {\n * \"key\": \"X-Static-Header-Two\",\n * \"value\": \"owlivia\"\n * }\n * ]\n * }\n * }\n */\nexport const HEADERS = 'headers';\n\n/**\n * Disables API requests from the API Explorer's \"Try It\" button from being sent into our [API\n * Metrics](https://readme.com/metrics) for you and your users. Additionally on any API endpoint\n * that this is disabled on your users will not see lists or graphs of previous requests they've\n * made against that API endpoint — either through the API Explorer's interactivity or through one\n * of our [Metrics SDKs](https://docs.readme.com/main/docs/api-metrics-setup) (if you have those\n * installed on your API).\n *\n * @defaultValue true\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#disable-api-metrics}\n * @example\n * {\n * \"x-readme\": {\n * \"metrics-defaults\": false\n * }\n * }\n */\nexport const METRICS_ENABLED = 'metrics-enabled';\n\n/**\n * Configuration options for OAuth flows in the API Explorer.\n *\n * @defaultValue {}\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#oauth-options}\n * @example\n * {\n * \"x-readme\": {\n * \"oauth-options\": {\n * \"scopeSeparator\": \",\",\n * \"useInsecureClientAuthentication\": true\n * }\n * }\n * }\n */\nexport const OAUTH_OPTIONS = 'oauth-options';\n\n/**\n * Controls the order of parameters on your API Reference pages.\n *\n * Your custom ordering **must** contain all of our available parameter types:\n *\n * - `path`: Path parameters\n * - `query`: Query parameters\n * - `body`: Non-`application/x-www-form-urlencoded` request body payloads\n * - `cookie`: Cookie parameters\n * - `form`: `application/x-www-form-urlencoded` request body payloads\n * - `header`: Header parameters\n *\n * @defaultValue ['path', 'query', 'body', 'cookie', 'form', 'header']\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#parameter-ordering}\n * @example\n * {\n * \"x-readme\": {\n * \"parameter-ordering\": ['path', 'query', 'header', 'cookie', 'body', 'form']\n * }\n * }\n */\nexport const PARAMETER_ORDERING = 'parameter-ordering';\n\n/**\n * Toggles the CORS proxy used when making API requests from within your docs (via the \"Try It\"\n * button). If your API is already set up to return CORS headers, you can safely disable this\n * feature.\n *\n * Disabling the CORS proxy will make the request directly from the user's browser and will prevent\n * [Metrics](https://docs.readme.com/main/docs/getting-started-with-metrics) data from being logged\n * by us unless [Metrics have already set up on your backend](https://docs.readme.com/main/docs/api-metrics-setup).\n *\n * @defaultValue true\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#cors-proxy-enabled}\n * @example\n * {\n * \"x-readme\": {\n * \"proxy-enabled\": true\n * }\n * }\n */\nexport const PROXY_ENABLED = 'proxy-enabled';\n\n/**\n * Toggles what languages are shown by default for code samples in the API Explorer. This only\n * affects what languages are initially shown to the user; if the user picks another language from\n * the three-dot menu, that language and the respective auto-generated code snippet will also appear\n * as an option in the API Explorer.\n *\n * @defaultValue ['shell', 'node', 'ruby', 'php', 'python', 'java', 'csharp']\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#code-sample-languages}\n * @example\n * {\n * \"x-readme\": {\n * \"samples-languages\": [\"shell\", \"node\", \"ruby\", \"javascript\", \"python\"]\n * }\n * }\n */\nexport const SAMPLES_LANGUAGES = 'samples-languages';\n\n/**\n * Toggles if you will see code snippets for ReadMe's SDK code generator tool `api`.\n *\n * @defaultValue true\n * @see {@link https://api.readme.dev}\n * @example\n * {\n * \"x-readme\": {\n * \"simple-mode\": false\n * }\n * }\n */\nexport const SIMPLE_MODE = 'simple-mode';\n\n/**\n * If `true`, tags are generated from the file top-down. If `false`, we sort the tags\n * based off the `tags` array in the OAS file.\n *\n * @defaultValue false\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#disable-tag-sorting}\n * @example\n * {\n * \"x-readme\": {\n * \"disable-tag-sorting\": true\n * }\n * }\n */\nexport const DISABLE_TAG_SORTING = 'disable-tag-sorting';\n\nexport interface Extensions {\n [CODE_SAMPLES]: {\n /**\n * Custom code snippet\n * @example \"curl -X POST https://api.example.com/v2/alert\"\n */\n code: string;\n /**\n * Corresponding response example\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#corresponding-response-examples}\n */\n correspondingExample?: string;\n /**\n * Library installation instructions\n * @example \"brew install httpie\"\n * @example \"npm install node-fetch@2 --save\"\n */\n install?: string;\n /**\n * Language for syntax highlighting\n * @example shell\n */\n language: string;\n /**\n * Optional title for code sample\n * @example \"Custom cURL snippet\"\n */\n name?: string;\n }[];\n [DISABLE_TAG_SORTING]: boolean;\n [EXPLORER_ENABLED]: boolean;\n [HEADERS]: Record<string, number | string>[];\n [METRICS_ENABLED]: boolean;\n [OAUTH_OPTIONS]: {\n /**\n * Scope separator for passing scopes. This value will be URL-encoded.\n *\n * @example \",\"\n * @example \"+\"\n * @default \" \"\n * @see {@link https://datatracker.ietf.org/doc/html/rfc6749#section-3.3} Scope separators information from OAuth 2.0 specification\n */\n scopeSeparator?: string;\n\n /**\n * When enabled, the client credentials (i.e., `client_id` and `client_secret`) are sent in the request body (NOT recommended).\n * When disabled (the default), client credentials are sent using the HTTP Basic Authentication scheme.\n *\n * This is applicable for all requests to the token endpoint.\n *\n * @see {@link https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1}\n * @see {@link https://datatracker.ietf.org/doc/html/rfc6749#section-3.2}\n *\n * @example true\n * @default false\n */\n useInsecureClientAuthentication?: boolean;\n };\n [PARAMETER_ORDERING]: ('body' | 'cookie' | 'form' | 'header' | 'path' | 'query')[];\n [PROXY_ENABLED]: boolean;\n [SAMPLES_LANGUAGES]: string[];\n [SIMPLE_MODE]: boolean;\n}\n\nexport const extensionDefaults: Extensions = {\n [CODE_SAMPLES]: undefined,\n [DISABLE_TAG_SORTING]: false,\n [EXPLORER_ENABLED]: true,\n [HEADERS]: undefined,\n [METRICS_ENABLED]: true,\n [OAUTH_OPTIONS]: {},\n [PARAMETER_ORDERING]: ['path', 'query', 'body', 'cookie', 'form', 'header'],\n [PROXY_ENABLED]: true,\n [SAMPLES_LANGUAGES]: ['shell', 'node', 'ruby', 'php', 'python', 'java', 'csharp'],\n [SIMPLE_MODE]: true,\n};\n\n/**\n * Determing if an OpenAPI definition has an extension set in its root schema.\n *\n */\nexport function hasRootExtension(extension: string | keyof Extensions, api: OASDocument) {\n return Boolean(api && extension in api);\n}\n\n/**\n * Retrieve a custom specification extension off of the API definition.\n *\n */\nexport function getExtension(extension: string | keyof Extensions, api: OASDocument, operation?: Operation) {\n if (operation) {\n if (operation.hasExtension('x-readme')) {\n const data = operation.getExtension('x-readme') as Extensions;\n if (data && typeof data === 'object' && extension in data) {\n return data[extension as keyof Extensions];\n }\n }\n\n if (operation.hasExtension(`x-${extension}`)) {\n return operation.getExtension(`x-${extension}`);\n } else if (operation.hasExtension(extension)) {\n return operation.getExtension(extension);\n }\n }\n\n // Because our `code-samples` extension is intended for operation-level use, if it's instead\n // placed at the API definition root level then we should ignore it and return our set defaults.\n if (extension === CODE_SAMPLES) {\n return extensionDefaults[extension];\n }\n\n if (hasRootExtension('x-readme', api)) {\n const data = api?.['x-readme'] as Extensions;\n if (data && typeof data === 'object' && extension in data) {\n return data[extension as keyof Extensions];\n }\n }\n\n if (hasRootExtension(`x-${extension}`, api)) {\n return api?.[`x-${extension}`];\n } else if (hasRootExtension(extension, api)) {\n return api?.[extension];\n }\n\n // If this is otherwise an extension of our own then we should return the default value for it.\n if (extension in extensionDefaults) {\n return extensionDefaults[extension as keyof Extensions];\n }\n\n return undefined;\n}\n\n/**\n * Validate that the data for an instanceof our `PARAMETER_ORDERING` extension is properly\n * configured.\n *\n * @private\n */\nexport function validateParameterOrdering(\n ordering: (typeof extensionDefaults)[typeof PARAMETER_ORDERING] | undefined,\n extension: string,\n) {\n const defaultValue = extensionDefaults[PARAMETER_ORDERING];\n const requiredLength = defaultValue.length;\n const defaultsHuman = `${defaultValue.slice(0, -1).join(', ')}, and ${defaultValue.slice(-1)}`;\n\n if (ordering.length !== requiredLength) {\n throw new TypeError(`\"${extension}\" must contain ${requiredLength} items comprised of: ${defaultsHuman}`);\n }\n\n const intersection = ordering.filter(value => defaultValue.includes(value.toLowerCase() as any));\n if (intersection.length !== requiredLength) {\n throw new TypeError(`\"${extension}\" must contain ${requiredLength} items comprised of: ${defaultsHuman}`);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/erunion/code/readme/oas/packages/oas/dist/chunk-XS7VDTTT.cjs","../src/extensions.ts"],"names":[],"mappings":"AAAA;AC+BO,IAAM,aAAA,EAAe,cAAA;AAoBrB,IAAM,iBAAA,EAAmB,kBAAA;AAwBzB,IAAM,QAAA,EAAU,SAAA;AAmBhB,IAAM,gBAAA,EAAkB,iBAAA;AAiBxB,IAAM,cAAA,EAAgB,eAAA;AAuBtB,IAAM,mBAAA,EAAqB,oBAAA;AAoB3B,IAAM,cAAA,EAAgB,eAAA;AAiBtB,IAAM,kBAAA,EAAoB,mBAAA;AAc1B,IAAM,YAAA,EAAc,aAAA;AAepB,IAAM,oBAAA,EAAsB,qBAAA;AAkE5B,IAAM,kBAAA,EAAgC;AAAA,EAC3C,CAAC,YAAY,CAAA,EAAG,KAAA,CAAA;AAAA,EAChB,CAAC,mBAAmB,CAAA,EAAG,KAAA;AAAA,EACvB,CAAC,gBAAgB,CAAA,EAAG,IAAA;AAAA,EACpB,CAAC,OAAO,CAAA,EAAG,KAAA,CAAA;AAAA,EACX,CAAC,eAAe,CAAA,EAAG,IAAA;AAAA,EACnB,CAAC,aAAa,CAAA,EAAG,CAAC,CAAA;AAAA,EAClB,CAAC,kBAAkB,CAAA,EAAG,CAAC,MAAA,EAAQ,OAAA,EAAS,MAAA,EAAQ,QAAA,EAAU,MAAA,EAAQ,QAAQ,CAAA;AAAA,EAC1E,CAAC,aAAa,CAAA,EAAG,IAAA;AAAA,EACjB,CAAC,iBAAiB,CAAA,EAAG,CAAC,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,QAAA,EAAU,MAAA,EAAQ,QAAQ,CAAA;AAAA,EAChF,CAAC,WAAW,CAAA,EAAG;AACjB,CAAA;AAMO,SAAS,gBAAA,CAAiB,SAAA,EAAsC,GAAA,EAA2B;AAChG,EAAA,OAAO,OAAA,CAAQ,IAAA,GAAO,UAAA,GAAa,GAAG,CAAA;AACxC;AAMO,SAAS,YAAA,CAAa,SAAA,EAAsC,GAAA,EAAkB,SAAA,EAA4B;AAC/G,EAAA,GAAA,CAAI,SAAA,EAAW;AACb,IAAA,GAAA,CAAI,SAAA,CAAU,YAAA,CAAa,UAAU,CAAA,EAAG;AACtC,MAAA,MAAM,KAAA,EAAO,SAAA,CAAU,YAAA,CAAa,UAAU,CAAA;AAC9C,MAAA,GAAA,CAAI,KAAA,GAAQ,OAAO,KAAA,IAAS,SAAA,GAAY,UAAA,GAAa,IAAA,EAAM;AACzD,QAAA,OAAO,IAAA,CAAK,SAA6B,CAAA;AAAA,MAC3C;AAAA,IACF;AAEA,IAAA,GAAA,CAAI,SAAA,CAAU,YAAA,CAAa,CAAA,EAAA,EAAK,SAAS,CAAA,CAAA;AACJ,MAAA;AACH,IAAA;AACO,MAAA;AACzC,IAAA;AACF,EAAA;AAIgC,EAAA;AACI,IAAA;AACpC,EAAA;AAEuC,EAAA;AACR,IAAA;AACW,IAAA;AACG,MAAA;AAC3C,IAAA;AACF,EAAA;AAE0C,EAAA;AACX,IAAA;AACW,EAAA;AAClB,IAAA;AACxB,EAAA;AAGoC,EAAA;AACoB,IAAA;AACxD,EAAA;AAEO,EAAA;AACT;AAUE;AAEuC,EAAA;AACH,EAAA;AACQ,EAAA;AAEJ,EAAA;AACL,IAAA;AACnC,EAAA;AAEqC,EAAA;AACO,EAAA;AACT,IAAA;AACnC,EAAA;AACF;AD7R8C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/erunion/code/readme/oas/packages/oas/dist/chunk-XS7VDTTT.cjs","sourcesContent":[null,"import type { Operation } from './operation/index.js';\nimport type { OASDocument } from './types.js';\n\n/**\n * Enables custom-written code samples to be set for your operations. Use this if you have specific\n * formatting that may not be followed by the auto-generated code samples. Custom code samples are\n * treated as static content.\n *\n * This extension only be placed at the operation level.\n *\n * @defaultValue []\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#custom-code-samples}\n * @example\n * {\n * \"x-readme\": {\n * \"code-samples\": [\n * {\n * \"language\": \"curl\",\n * \"code\": \"curl -X POST https://api.example.com/v2/alert\",\n * \"name\": \"Custom cURL snippet\",\n * \"install\": \"brew install curl\"\n * },\n * {\n * \"language\": \"php\",\n * \"code\": \"<?php echo \\\"This is our custom PHP code snippet.\\\"; ?>\",\n * \"name\": \"Custom PHP snippet\"\n * }\n * ]\n * }\n * }\n */\nexport const CODE_SAMPLES = 'code-samples';\n\n/**\n * Disables the API Explorer's \"Try It\" button, preventing users from making API requests from\n * within your docs. Users will still be able to fill out any entry fields (path or query\n * parameters, etc.), and code snippets will be auto-generated based on the user's input, however\n * to interact with your API the user will need to copy the code snippet and execute it outside of\n * your docs.\n *\n * This **does not** disable your API Reference documentation.\n *\n * @defaultValue true\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#disable-the-api-explorer}\n * @example\n * {\n * \"x-readme\": {\n * \"explorer-enabled\": true\n * }\n * }\n */\nexport const EXPLORER_ENABLED = 'explorer-enabled';\n\n/**\n * Adds static headers to add to each request. Use this when there are specific headers unique to\n * your API.\n *\n * @defaultValue []\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#static-headers}\n * @example\n * {\n * \"x-readme\": {\n * \"headers\": [\n * {\n * \"key\": \"X-Static-Header-One\",\n * \"value\": \"owlbert\"\n * },\n * {\n * \"key\": \"X-Static-Header-Two\",\n * \"value\": \"owlivia\"\n * }\n * ]\n * }\n * }\n */\nexport const HEADERS = 'headers';\n\n/**\n * Disables API requests from the API Explorer's \"Try It\" button from being sent into our [API\n * Metrics](https://readme.com/metrics) for you and your users. Additionally on any API endpoint\n * that this is disabled on your users will not see lists or graphs of previous requests they've\n * made against that API endpoint — either through the API Explorer's interactivity or through one\n * of our [Metrics SDKs](https://docs.readme.com/main/docs/api-metrics-setup) (if you have those\n * installed on your API).\n *\n * @defaultValue true\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#disable-api-metrics}\n * @example\n * {\n * \"x-readme\": {\n * \"metrics-defaults\": false\n * }\n * }\n */\nexport const METRICS_ENABLED = 'metrics-enabled';\n\n/**\n * Configuration options for OAuth flows in the API Explorer.\n *\n * @defaultValue {}\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#oauth-options}\n * @example\n * {\n * \"x-readme\": {\n * \"oauth-options\": {\n * \"scopeSeparator\": \",\",\n * \"useInsecureClientAuthentication\": true\n * }\n * }\n * }\n */\nexport const OAUTH_OPTIONS = 'oauth-options';\n\n/**\n * Controls the order of parameters on your API Reference pages.\n *\n * Your custom ordering **must** contain all of our available parameter types:\n *\n * - `path`: Path parameters\n * - `query`: Query parameters\n * - `body`: Non-`application/x-www-form-urlencoded` request body payloads\n * - `cookie`: Cookie parameters\n * - `form`: `application/x-www-form-urlencoded` request body payloads\n * - `header`: Header parameters\n *\n * @defaultValue ['path', 'query', 'body', 'cookie', 'form', 'header']\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#parameter-ordering}\n * @example\n * {\n * \"x-readme\": {\n * \"parameter-ordering\": ['path', 'query', 'header', 'cookie', 'body', 'form']\n * }\n * }\n */\nexport const PARAMETER_ORDERING = 'parameter-ordering';\n\n/**\n * Toggles the CORS proxy used when making API requests from within your docs (via the \"Try It\"\n * button). If your API is already set up to return CORS headers, you can safely disable this\n * feature.\n *\n * Disabling the CORS proxy will make the request directly from the user's browser and will prevent\n * [Metrics](https://docs.readme.com/main/docs/getting-started-with-metrics) data from being logged\n * by us unless [Metrics have already set up on your backend](https://docs.readme.com/main/docs/api-metrics-setup).\n *\n * @defaultValue true\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#cors-proxy-enabled}\n * @example\n * {\n * \"x-readme\": {\n * \"proxy-enabled\": true\n * }\n * }\n */\nexport const PROXY_ENABLED = 'proxy-enabled';\n\n/**\n * Toggles what languages are shown by default for code samples in the API Explorer. This only\n * affects what languages are initially shown to the user; if the user picks another language from\n * the three-dot menu, that language and the respective auto-generated code snippet will also appear\n * as an option in the API Explorer.\n *\n * @defaultValue ['shell', 'node', 'ruby', 'php', 'python', 'java', 'csharp']\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#code-sample-languages}\n * @example\n * {\n * \"x-readme\": {\n * \"samples-languages\": [\"shell\", \"node\", \"ruby\", \"javascript\", \"python\"]\n * }\n * }\n */\nexport const SAMPLES_LANGUAGES = 'samples-languages';\n\n/**\n * Toggles if you will see code snippets for ReadMe's SDK code generator tool `api`.\n *\n * @defaultValue true\n * @see {@link https://api.readme.dev}\n * @example\n * {\n * \"x-readme\": {\n * \"simple-mode\": false\n * }\n * }\n */\nexport const SIMPLE_MODE = 'simple-mode';\n\n/**\n * If `true`, tags are generated from the file top-down. If `false`, we sort the tags\n * based off the `tags` array in the OAS file.\n *\n * @defaultValue false\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#disable-tag-sorting}\n * @example\n * {\n * \"x-readme\": {\n * \"disable-tag-sorting\": true\n * }\n * }\n */\nexport const DISABLE_TAG_SORTING = 'disable-tag-sorting';\n\nexport interface Extensions {\n [CODE_SAMPLES]: {\n /**\n * Custom code snippet\n * @example \"curl -X POST https://api.example.com/v2/alert\"\n */\n code: string;\n /**\n * Corresponding response example\n * @see {@link https://docs.readme.com/main/docs/openapi-extensions#corresponding-response-examples}\n */\n correspondingExample?: string;\n /**\n * Library installation instructions\n * @example \"brew install httpie\"\n * @example \"npm install node-fetch@2 --save\"\n */\n install?: string;\n /**\n * Language for syntax highlighting\n * @example shell\n */\n language: string;\n /**\n * Optional title for code sample\n * @example \"Custom cURL snippet\"\n */\n name?: string;\n }[];\n [DISABLE_TAG_SORTING]: boolean;\n [EXPLORER_ENABLED]: boolean;\n [HEADERS]: Record<string, number | string>[];\n [METRICS_ENABLED]: boolean;\n [OAUTH_OPTIONS]: {\n /**\n * Scope separator for passing scopes. This value will be URL-encoded.\n *\n * @example \",\"\n * @example \"+\"\n * @default \" \"\n * @see {@link https://datatracker.ietf.org/doc/html/rfc6749#section-3.3} Scope separators information from OAuth 2.0 specification\n */\n scopeSeparator?: string;\n\n /**\n * When enabled, the client credentials (i.e., `client_id` and `client_secret`) are sent in the request body (NOT recommended).\n * When disabled (the default), client credentials are sent using the HTTP Basic Authentication scheme.\n *\n * This is applicable for all requests to the token endpoint.\n *\n * @see {@link https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1}\n * @see {@link https://datatracker.ietf.org/doc/html/rfc6749#section-3.2}\n *\n * @example true\n * @default false\n */\n useInsecureClientAuthentication?: boolean;\n };\n [PARAMETER_ORDERING]: ('body' | 'cookie' | 'form' | 'header' | 'path' | 'query')[];\n [PROXY_ENABLED]: boolean;\n [SAMPLES_LANGUAGES]: string[];\n [SIMPLE_MODE]: boolean;\n}\n\nexport const extensionDefaults: Extensions = {\n [CODE_SAMPLES]: undefined,\n [DISABLE_TAG_SORTING]: false,\n [EXPLORER_ENABLED]: true,\n [HEADERS]: undefined,\n [METRICS_ENABLED]: true,\n [OAUTH_OPTIONS]: {},\n [PARAMETER_ORDERING]: ['path', 'query', 'body', 'cookie', 'form', 'header'],\n [PROXY_ENABLED]: true,\n [SAMPLES_LANGUAGES]: ['shell', 'node', 'ruby', 'php', 'python', 'java', 'csharp'],\n [SIMPLE_MODE]: true,\n};\n\n/**\n * Determing if an OpenAPI definition has an extension set in its root schema.\n *\n */\nexport function hasRootExtension(extension: string | keyof Extensions, api: OASDocument): boolean {\n return Boolean(api && extension in api);\n}\n\n/**\n * Retrieve a custom specification extension off of the API definition.\n *\n */\nexport function getExtension(extension: string | keyof Extensions, api: OASDocument, operation?: Operation): any {\n if (operation) {\n if (operation.hasExtension('x-readme')) {\n const data = operation.getExtension('x-readme') as Extensions;\n if (data && typeof data === 'object' && extension in data) {\n return data[extension as keyof Extensions];\n }\n }\n\n if (operation.hasExtension(`x-${extension}`)) {\n return operation.getExtension(`x-${extension}`);\n } else if (operation.hasExtension(extension)) {\n return operation.getExtension(extension);\n }\n }\n\n // Because our `code-samples` extension is intended for operation-level use, if it's instead\n // placed at the API definition root level then we should ignore it and return our set defaults.\n if (extension === CODE_SAMPLES) {\n return extensionDefaults[extension];\n }\n\n if (hasRootExtension('x-readme', api)) {\n const data = api?.['x-readme'] as Extensions;\n if (data && typeof data === 'object' && extension in data) {\n return data[extension as keyof Extensions];\n }\n }\n\n if (hasRootExtension(`x-${extension}`, api)) {\n return api?.[`x-${extension}`];\n } else if (hasRootExtension(extension, api)) {\n return api?.[extension];\n }\n\n // If this is otherwise an extension of our own then we should return the default value for it.\n if (extension in extensionDefaults) {\n return extensionDefaults[extension as keyof Extensions];\n }\n\n return undefined;\n}\n\n/**\n * Validate that the data for an instanceof our `PARAMETER_ORDERING` extension is properly\n * configured.\n *\n * @private\n */\nexport function validateParameterOrdering(\n ordering: (typeof extensionDefaults)[typeof PARAMETER_ORDERING] | undefined,\n extension: string,\n): void {\n const defaultValue = extensionDefaults[PARAMETER_ORDERING];\n const requiredLength = defaultValue.length;\n const defaultsHuman = `${defaultValue.slice(0, -1).join(', ')}, and ${defaultValue.slice(-1)}`;\n\n if (ordering.length !== requiredLength) {\n throw new TypeError(`\"${extension}\" must contain ${requiredLength} items comprised of: ${defaultsHuman}`);\n }\n\n const intersection = ordering.filter(value => defaultValue.includes(value.toLowerCase() as any));\n if (intersection.length !== requiredLength) {\n throw new TypeError(`\"${extension}\" must contain ${requiredLength} items comprised of: ${defaultsHuman}`);\n }\n}\n"]}
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { SchemaObject, OASDocument, DataForHAR, OperationObject, HttpMethods, SecurityRequirementObject, KeyedSecuritySchemeObject, SecurityType, TagObject, ParameterObject, MediaTypeObject, ResponseObject, PathItemObject, OAS31Document } from './types.js';
|
|
2
2
|
|
|
3
|
+
interface MediaTypeExample {
|
|
4
|
+
description?: string;
|
|
5
|
+
summary?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
value: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type ResponseExamples = {
|
|
11
|
+
mediaTypes: Record<string, MediaTypeExample[]>;
|
|
12
|
+
onlyHeaders?: boolean;
|
|
13
|
+
status: string;
|
|
14
|
+
}[];
|
|
15
|
+
|
|
16
|
+
type CallbackExamples = {
|
|
17
|
+
example: ResponseExamples;
|
|
18
|
+
expression: string;
|
|
19
|
+
identifier: string;
|
|
20
|
+
method: string;
|
|
21
|
+
}[];
|
|
22
|
+
|
|
3
23
|
interface SchemaWrapper {
|
|
4
24
|
$schema?: string;
|
|
5
25
|
deprecatedProps?: SchemaWrapper;
|
|
@@ -53,26 +73,6 @@ interface getParametersAsJSONSchemaOptions {
|
|
|
53
73
|
}
|
|
54
74
|
declare function getParametersAsJSONSchema(operation: Operation, api: OASDocument, opts?: getParametersAsJSONSchemaOptions): SchemaWrapper[];
|
|
55
75
|
|
|
56
|
-
interface MediaTypeExample {
|
|
57
|
-
description?: string;
|
|
58
|
-
summary?: string;
|
|
59
|
-
title?: string;
|
|
60
|
-
value: unknown;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
type ResponseExamples = {
|
|
64
|
-
mediaTypes: Record<string, MediaTypeExample[]>;
|
|
65
|
-
onlyHeaders?: boolean;
|
|
66
|
-
status: string;
|
|
67
|
-
}[];
|
|
68
|
-
|
|
69
|
-
type CallbackExamples = {
|
|
70
|
-
example: ResponseExamples;
|
|
71
|
-
expression: string;
|
|
72
|
-
identifier: string;
|
|
73
|
-
method: string;
|
|
74
|
-
}[];
|
|
75
|
-
|
|
76
76
|
type RequestBodyExamples = {
|
|
77
77
|
examples: MediaTypeExample[];
|
|
78
78
|
mediaType: string;
|
|
@@ -306,12 +306,7 @@ declare class Operation {
|
|
|
306
306
|
* name, just make sure to return your transformed schema.
|
|
307
307
|
*/
|
|
308
308
|
transformer?: (schema: SchemaObject) => SchemaObject;
|
|
309
|
-
}):
|
|
310
|
-
description?: string;
|
|
311
|
-
label: string;
|
|
312
|
-
schema: SchemaObject;
|
|
313
|
-
type: string[] | string;
|
|
314
|
-
}[];
|
|
309
|
+
}): SchemaObject;
|
|
315
310
|
/**
|
|
316
311
|
* Get an array of all valid response status codes for this operation.
|
|
317
312
|
*
|
|
@@ -405,7 +400,7 @@ declare class Operation {
|
|
|
405
400
|
*
|
|
406
401
|
* @deprecated Use `oas.getExtension(extension, operation)` instead.
|
|
407
402
|
*/
|
|
408
|
-
getExtension(extension: string | keyof Extensions):
|
|
403
|
+
getExtension(extension: string | keyof Extensions): any;
|
|
409
404
|
/**
|
|
410
405
|
* Returns an object with groups of all example definitions (body/header/query/path/response/etc.).
|
|
411
406
|
* The examples are grouped by their key when defined via the `examples` map.
|
|
@@ -710,7 +705,7 @@ declare function hasRootExtension(extension: string | keyof Extensions, api: OAS
|
|
|
710
705
|
* Retrieve a custom specification extension off of the API definition.
|
|
711
706
|
*
|
|
712
707
|
*/
|
|
713
|
-
declare function getExtension(extension: string | keyof Extensions, api: OASDocument, operation?: Operation):
|
|
708
|
+
declare function getExtension(extension: string | keyof Extensions, api: OASDocument, operation?: Operation): any;
|
|
714
709
|
/**
|
|
715
710
|
* Validate that the data for an instanceof our `PARAMETER_ORDERING` extension is properly
|
|
716
711
|
* configured.
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { SchemaObject, OASDocument, DataForHAR, OperationObject, HttpMethods, SecurityRequirementObject, KeyedSecuritySchemeObject, SecurityType, TagObject, ParameterObject, MediaTypeObject, ResponseObject, PathItemObject, OAS31Document } from './types.cjs';
|
|
2
2
|
|
|
3
|
+
interface MediaTypeExample {
|
|
4
|
+
description?: string;
|
|
5
|
+
summary?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
value: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type ResponseExamples = {
|
|
11
|
+
mediaTypes: Record<string, MediaTypeExample[]>;
|
|
12
|
+
onlyHeaders?: boolean;
|
|
13
|
+
status: string;
|
|
14
|
+
}[];
|
|
15
|
+
|
|
16
|
+
type CallbackExamples = {
|
|
17
|
+
example: ResponseExamples;
|
|
18
|
+
expression: string;
|
|
19
|
+
identifier: string;
|
|
20
|
+
method: string;
|
|
21
|
+
}[];
|
|
22
|
+
|
|
3
23
|
interface SchemaWrapper {
|
|
4
24
|
$schema?: string;
|
|
5
25
|
deprecatedProps?: SchemaWrapper;
|
|
@@ -53,26 +73,6 @@ interface getParametersAsJSONSchemaOptions {
|
|
|
53
73
|
}
|
|
54
74
|
declare function getParametersAsJSONSchema(operation: Operation, api: OASDocument, opts?: getParametersAsJSONSchemaOptions): SchemaWrapper[];
|
|
55
75
|
|
|
56
|
-
interface MediaTypeExample {
|
|
57
|
-
description?: string;
|
|
58
|
-
summary?: string;
|
|
59
|
-
title?: string;
|
|
60
|
-
value: unknown;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
type ResponseExamples = {
|
|
64
|
-
mediaTypes: Record<string, MediaTypeExample[]>;
|
|
65
|
-
onlyHeaders?: boolean;
|
|
66
|
-
status: string;
|
|
67
|
-
}[];
|
|
68
|
-
|
|
69
|
-
type CallbackExamples = {
|
|
70
|
-
example: ResponseExamples;
|
|
71
|
-
expression: string;
|
|
72
|
-
identifier: string;
|
|
73
|
-
method: string;
|
|
74
|
-
}[];
|
|
75
|
-
|
|
76
76
|
type RequestBodyExamples = {
|
|
77
77
|
examples: MediaTypeExample[];
|
|
78
78
|
mediaType: string;
|
|
@@ -306,12 +306,7 @@ declare class Operation {
|
|
|
306
306
|
* name, just make sure to return your transformed schema.
|
|
307
307
|
*/
|
|
308
308
|
transformer?: (schema: SchemaObject) => SchemaObject;
|
|
309
|
-
}):
|
|
310
|
-
description?: string;
|
|
311
|
-
label: string;
|
|
312
|
-
schema: SchemaObject;
|
|
313
|
-
type: string[] | string;
|
|
314
|
-
}[];
|
|
309
|
+
}): SchemaObject;
|
|
315
310
|
/**
|
|
316
311
|
* Get an array of all valid response status codes for this operation.
|
|
317
312
|
*
|
|
@@ -405,7 +400,7 @@ declare class Operation {
|
|
|
405
400
|
*
|
|
406
401
|
* @deprecated Use `oas.getExtension(extension, operation)` instead.
|
|
407
402
|
*/
|
|
408
|
-
getExtension(extension: string | keyof Extensions):
|
|
403
|
+
getExtension(extension: string | keyof Extensions): any;
|
|
409
404
|
/**
|
|
410
405
|
* Returns an object with groups of all example definitions (body/header/query/path/response/etc.).
|
|
411
406
|
* The examples are grouped by their key when defined via the `examples` map.
|
|
@@ -710,7 +705,7 @@ declare function hasRootExtension(extension: string | keyof Extensions, api: OAS
|
|
|
710
705
|
* Retrieve a custom specification extension off of the API definition.
|
|
711
706
|
*
|
|
712
707
|
*/
|
|
713
|
-
declare function getExtension(extension: string | keyof Extensions, api: OASDocument, operation?: Operation):
|
|
708
|
+
declare function getExtension(extension: string | keyof Extensions, api: OASDocument, operation?: Operation): any;
|
|
714
709
|
/**
|
|
715
710
|
* Validate that the data for an instanceof our `PARAMETER_ORDERING` extension is properly
|
|
716
711
|
* configured.
|
package/dist/extensions.cjs
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkXS7VDTTTcjs = require('./chunk-XS7VDTTT.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -29,5 +29,5 @@ var _chunkYHO3AOX6cjs = require('./chunk-YHO3AOX6.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
exports.CODE_SAMPLES =
|
|
32
|
+
exports.CODE_SAMPLES = _chunkXS7VDTTTcjs.CODE_SAMPLES; exports.DISABLE_TAG_SORTING = _chunkXS7VDTTTcjs.DISABLE_TAG_SORTING; exports.EXPLORER_ENABLED = _chunkXS7VDTTTcjs.EXPLORER_ENABLED; exports.HEADERS = _chunkXS7VDTTTcjs.HEADERS; exports.METRICS_ENABLED = _chunkXS7VDTTTcjs.METRICS_ENABLED; exports.OAUTH_OPTIONS = _chunkXS7VDTTTcjs.OAUTH_OPTIONS; exports.PARAMETER_ORDERING = _chunkXS7VDTTTcjs.PARAMETER_ORDERING; exports.PROXY_ENABLED = _chunkXS7VDTTTcjs.PROXY_ENABLED; exports.SAMPLES_LANGUAGES = _chunkXS7VDTTTcjs.SAMPLES_LANGUAGES; exports.SIMPLE_MODE = _chunkXS7VDTTTcjs.SIMPLE_MODE; exports.extensionDefaults = _chunkXS7VDTTTcjs.extensionDefaults; exports.getExtension = _chunkXS7VDTTTcjs.getExtension; exports.hasRootExtension = _chunkXS7VDTTTcjs.hasRootExtension; exports.validateParameterOrdering = _chunkXS7VDTTTcjs.validateParameterOrdering;
|
|
33
33
|
//# sourceMappingURL=extensions.cjs.map
|
package/dist/extensions.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as CODE_SAMPLES, D as DISABLE_TAG_SORTING, c as EXPLORER_ENABLED, E as Extensions, H as HEADERS, M as METRICS_ENABLED, d as OAUTH_OPTIONS, P as PARAMETER_ORDERING, e as PROXY_ENABLED, f as SAMPLES_LANGUAGES, h as SIMPLE_MODE, i as extensionDefaults, k as getExtension, j as hasRootExtension, v as validateParameterOrdering } from './extensions-
|
|
1
|
+
export { b as CODE_SAMPLES, D as DISABLE_TAG_SORTING, c as EXPLORER_ENABLED, E as Extensions, H as HEADERS, M as METRICS_ENABLED, d as OAUTH_OPTIONS, P as PARAMETER_ORDERING, e as PROXY_ENABLED, f as SAMPLES_LANGUAGES, h as SIMPLE_MODE, i as extensionDefaults, k as getExtension, j as hasRootExtension, v as validateParameterOrdering } from './extensions-DCqurkah.cjs';
|
|
2
2
|
import './types.cjs';
|
|
3
3
|
import 'json-schema';
|
|
4
4
|
import 'openapi-types';
|
package/dist/extensions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as CODE_SAMPLES, D as DISABLE_TAG_SORTING, c as EXPLORER_ENABLED, E as Extensions, H as HEADERS, M as METRICS_ENABLED, d as OAUTH_OPTIONS, P as PARAMETER_ORDERING, e as PROXY_ENABLED, f as SAMPLES_LANGUAGES, h as SIMPLE_MODE, i as extensionDefaults, k as getExtension, j as hasRootExtension, v as validateParameterOrdering } from './extensions-
|
|
1
|
+
export { b as CODE_SAMPLES, D as DISABLE_TAG_SORTING, c as EXPLORER_ENABLED, E as Extensions, H as HEADERS, M as METRICS_ENABLED, d as OAUTH_OPTIONS, P as PARAMETER_ORDERING, e as PROXY_ENABLED, f as SAMPLES_LANGUAGES, h as SIMPLE_MODE, i as extensionDefaults, k as getExtension, j as hasRootExtension, v as validateParameterOrdering } from './extensions-Bv1ipECR.js';
|
|
2
2
|
import './types.js';
|
|
3
3
|
import 'json-schema';
|
|
4
4
|
import 'openapi-types';
|
package/dist/extensions.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
3
|
+
var _chunk4LYTGC26cjs = require('./chunk-4LYTGC26.cjs');
|
|
4
|
+
require('./chunk-2A73SW7A.cjs');
|
|
5
|
+
require('./chunk-TDI4MZLI.cjs');
|
|
6
|
+
require('./chunk-QBBP72GC.cjs');
|
|
7
|
+
require('./chunk-XS7VDTTT.cjs');
|
|
8
|
+
require('./chunk-VSXG73AZ.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = _chunk4LYTGC26cjs.Oas;
|
|
12
12
|
|
|
13
13
|
module.exports = exports.default;
|
|
14
14
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { OASDocument, User, ServerVariable, HttpMethods, PathsObject } from './types.cjs';
|
|
1
|
+
import { O as Operation, W as Webhook, E as Extensions } from './extensions-DCqurkah.cjs';
|
|
2
|
+
import { OASDocument, User, ServerVariable, ServerVariablesObject, Servers, HttpMethods, AuthForHAR, PathsObject } from './types.cjs';
|
|
4
3
|
import { Match, ParamData } from 'path-to-regexp';
|
|
5
4
|
import 'json-schema';
|
|
5
|
+
import 'openapi-types';
|
|
6
6
|
|
|
7
7
|
interface PathMatch {
|
|
8
8
|
match?: Match<ParamData>;
|
|
@@ -69,9 +69,7 @@ declare class Oas {
|
|
|
69
69
|
*/
|
|
70
70
|
getDefinition(): OASDocument;
|
|
71
71
|
url(selected?: number, variables?: ServerVariable): string;
|
|
72
|
-
variables(selected?: number):
|
|
73
|
-
[variable: string]: openapi_types.OpenAPIV3.ServerVariableObject;
|
|
74
|
-
};
|
|
72
|
+
variables(selected?: number): ServerVariablesObject;
|
|
75
73
|
defaultVariables(selected?: number): ServerVariable;
|
|
76
74
|
splitUrl(selected?: number): ({
|
|
77
75
|
/**
|
|
@@ -114,10 +112,7 @@ declare class Oas {
|
|
|
114
112
|
*
|
|
115
113
|
* @param baseUrl A given URL to extract server variables out of.
|
|
116
114
|
*/
|
|
117
|
-
splitVariables(baseUrl: string):
|
|
118
|
-
selected: number;
|
|
119
|
-
variables: Record<string, string | number>;
|
|
120
|
-
};
|
|
115
|
+
splitVariables(baseUrl: string): Servers | false;
|
|
121
116
|
/**
|
|
122
117
|
* Replace templated variables with supplied data in a given URL.
|
|
123
118
|
*
|
|
@@ -188,7 +183,7 @@ declare class Oas {
|
|
|
188
183
|
* @see {Operation.getOperationId()}
|
|
189
184
|
* @param id The `operationId` to look up.
|
|
190
185
|
*/
|
|
191
|
-
getOperationById(id: string):
|
|
186
|
+
getOperationById(id: string): Operation | Webhook;
|
|
192
187
|
/**
|
|
193
188
|
* With an object of user information, retrieve the appropriate API auth keys from the current
|
|
194
189
|
* OAS definition.
|
|
@@ -197,9 +192,7 @@ declare class Oas {
|
|
|
197
192
|
* @param user User
|
|
198
193
|
* @param selectedApp The user app to retrieve an auth key for.
|
|
199
194
|
*/
|
|
200
|
-
getAuth(user: User, selectedApp?: number | string):
|
|
201
|
-
[x: string]: unknown;
|
|
202
|
-
};
|
|
195
|
+
getAuth(user: User, selectedApp?: number | string): AuthForHAR;
|
|
203
196
|
/**
|
|
204
197
|
* Returns the `paths` object that exists in this API definition but with every `method` mapped
|
|
205
198
|
* to an instance of the `Operation` class.
|
|
@@ -207,7 +200,7 @@ declare class Oas {
|
|
|
207
200
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#openapi-object}
|
|
208
201
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object}
|
|
209
202
|
*/
|
|
210
|
-
getPaths(): Record<string, Record<HttpMethods,
|
|
203
|
+
getPaths(): Record<string, Record<HttpMethods, Operation | Webhook>>;
|
|
211
204
|
/**
|
|
212
205
|
* Returns the `webhooks` object that exists in this API definition but with every `method`
|
|
213
206
|
* mapped to an instance of the `Webhook` class.
|
|
@@ -240,7 +233,7 @@ declare class Oas {
|
|
|
240
233
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions}
|
|
241
234
|
* @param extension Specification extension to lookup.
|
|
242
235
|
*/
|
|
243
|
-
getExtension(extension: string | keyof Extensions, operation?: Operation):
|
|
236
|
+
getExtension(extension: string | keyof Extensions, operation?: Operation): any;
|
|
244
237
|
/**
|
|
245
238
|
* Determine if a given OpenAPI custom extension is valid or not.
|
|
246
239
|
*
|
|
@@ -284,7 +277,7 @@ declare class Oas {
|
|
|
284
277
|
* Preserve component schema names within themselves as a `title`.
|
|
285
278
|
*/
|
|
286
279
|
preserveRefAsJSONSchemaTitle?: boolean;
|
|
287
|
-
}): Promise<
|
|
280
|
+
}): Promise<(typeof this.promises)[] | boolean>;
|
|
288
281
|
}
|
|
289
282
|
|
|
290
283
|
export = Oas;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { OASDocument, User, ServerVariable, HttpMethods, PathsObject } from './types.js';
|
|
1
|
+
import { O as Operation, W as Webhook, E as Extensions } from './extensions-Bv1ipECR.js';
|
|
2
|
+
import { OASDocument, User, ServerVariable, ServerVariablesObject, Servers, HttpMethods, AuthForHAR, PathsObject } from './types.js';
|
|
4
3
|
import { Match, ParamData } from 'path-to-regexp';
|
|
5
4
|
import 'json-schema';
|
|
5
|
+
import 'openapi-types';
|
|
6
6
|
|
|
7
7
|
interface PathMatch {
|
|
8
8
|
match?: Match<ParamData>;
|
|
@@ -69,9 +69,7 @@ declare class Oas {
|
|
|
69
69
|
*/
|
|
70
70
|
getDefinition(): OASDocument;
|
|
71
71
|
url(selected?: number, variables?: ServerVariable): string;
|
|
72
|
-
variables(selected?: number):
|
|
73
|
-
[variable: string]: openapi_types.OpenAPIV3.ServerVariableObject;
|
|
74
|
-
};
|
|
72
|
+
variables(selected?: number): ServerVariablesObject;
|
|
75
73
|
defaultVariables(selected?: number): ServerVariable;
|
|
76
74
|
splitUrl(selected?: number): ({
|
|
77
75
|
/**
|
|
@@ -114,10 +112,7 @@ declare class Oas {
|
|
|
114
112
|
*
|
|
115
113
|
* @param baseUrl A given URL to extract server variables out of.
|
|
116
114
|
*/
|
|
117
|
-
splitVariables(baseUrl: string):
|
|
118
|
-
selected: number;
|
|
119
|
-
variables: Record<string, string | number>;
|
|
120
|
-
};
|
|
115
|
+
splitVariables(baseUrl: string): Servers | false;
|
|
121
116
|
/**
|
|
122
117
|
* Replace templated variables with supplied data in a given URL.
|
|
123
118
|
*
|
|
@@ -188,7 +183,7 @@ declare class Oas {
|
|
|
188
183
|
* @see {Operation.getOperationId()}
|
|
189
184
|
* @param id The `operationId` to look up.
|
|
190
185
|
*/
|
|
191
|
-
getOperationById(id: string):
|
|
186
|
+
getOperationById(id: string): Operation | Webhook;
|
|
192
187
|
/**
|
|
193
188
|
* With an object of user information, retrieve the appropriate API auth keys from the current
|
|
194
189
|
* OAS definition.
|
|
@@ -197,9 +192,7 @@ declare class Oas {
|
|
|
197
192
|
* @param user User
|
|
198
193
|
* @param selectedApp The user app to retrieve an auth key for.
|
|
199
194
|
*/
|
|
200
|
-
getAuth(user: User, selectedApp?: number | string):
|
|
201
|
-
[x: string]: unknown;
|
|
202
|
-
};
|
|
195
|
+
getAuth(user: User, selectedApp?: number | string): AuthForHAR;
|
|
203
196
|
/**
|
|
204
197
|
* Returns the `paths` object that exists in this API definition but with every `method` mapped
|
|
205
198
|
* to an instance of the `Operation` class.
|
|
@@ -207,7 +200,7 @@ declare class Oas {
|
|
|
207
200
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#openapi-object}
|
|
208
201
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object}
|
|
209
202
|
*/
|
|
210
|
-
getPaths(): Record<string, Record<HttpMethods,
|
|
203
|
+
getPaths(): Record<string, Record<HttpMethods, Operation | Webhook>>;
|
|
211
204
|
/**
|
|
212
205
|
* Returns the `webhooks` object that exists in this API definition but with every `method`
|
|
213
206
|
* mapped to an instance of the `Webhook` class.
|
|
@@ -240,7 +233,7 @@ declare class Oas {
|
|
|
240
233
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions}
|
|
241
234
|
* @param extension Specification extension to lookup.
|
|
242
235
|
*/
|
|
243
|
-
getExtension(extension: string | keyof Extensions, operation?: Operation):
|
|
236
|
+
getExtension(extension: string | keyof Extensions, operation?: Operation): any;
|
|
244
237
|
/**
|
|
245
238
|
* Determine if a given OpenAPI custom extension is valid or not.
|
|
246
239
|
*
|
|
@@ -284,7 +277,7 @@ declare class Oas {
|
|
|
284
277
|
* Preserve component schema names within themselves as a `title`.
|
|
285
278
|
*/
|
|
286
279
|
preserveRefAsJSONSchemaTitle?: boolean;
|
|
287
|
-
}): Promise<
|
|
280
|
+
}): Promise<(typeof this.promises)[] | boolean>;
|
|
288
281
|
}
|
|
289
282
|
|
|
290
283
|
export { Oas as default };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Oas
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-SKTFIIOT.js";
|
|
4
|
+
import "./chunk-QVVE46I7.js";
|
|
5
|
+
import "./chunk-W2TD4LSC.js";
|
|
6
|
+
import "./chunk-VMOLPNIM.js";
|
|
7
|
+
import "./chunk-L2OVXZK3.js";
|
|
8
|
+
import "./chunk-DPTPURCR.js";
|
|
9
9
|
export {
|
|
10
10
|
Oas as default
|
|
11
11
|
};
|
package/dist/operation/index.cjs
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
5
|
+
var _chunk2A73SW7Acjs = require('../chunk-2A73SW7A.cjs');
|
|
6
|
+
require('../chunk-TDI4MZLI.cjs');
|
|
7
|
+
require('../chunk-QBBP72GC.cjs');
|
|
8
|
+
require('../chunk-XS7VDTTT.cjs');
|
|
9
|
+
require('../chunk-VSXG73AZ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.Callback =
|
|
14
|
+
exports.Callback = _chunk2A73SW7Acjs.Callback; exports.Operation = _chunk2A73SW7Acjs.Operation; exports.Webhook = _chunk2A73SW7Acjs.Webhook;
|
|
15
15
|
//# sourceMappingURL=index.cjs.map
|
package/dist/operation/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Callback,
|
|
3
3
|
Operation,
|
|
4
4
|
Webhook
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-QVVE46I7.js";
|
|
6
|
+
import "../chunk-W2TD4LSC.js";
|
|
7
|
+
import "../chunk-VMOLPNIM.js";
|
|
8
|
+
import "../chunk-L2OVXZK3.js";
|
|
9
|
+
import "../chunk-DPTPURCR.js";
|
|
10
10
|
export {
|
|
11
11
|
Callback,
|
|
12
12
|
Operation,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
4
|
+
var _chunkQBBP72GCcjs = require('../../chunk-QBBP72GC.cjs');
|
|
5
|
+
require('../../chunk-XS7VDTTT.cjs');
|
|
6
|
+
require('../../chunk-VSXG73AZ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.getParametersAsJSONSchema =
|
|
10
|
+
exports.getParametersAsJSONSchema = _chunkQBBP72GCcjs.getParametersAsJSONSchema; exports.types = _chunkQBBP72GCcjs.types;
|
|
11
11
|
//# sourceMappingURL=get-parameters-as-json-schema.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../types.cjs';
|
|
2
|
-
export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-
|
|
2
|
+
export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-DCqurkah.cjs';
|
|
3
3
|
import 'json-schema';
|
|
4
4
|
import 'openapi-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../types.js';
|
|
2
|
-
export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-
|
|
2
|
+
export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-Bv1ipECR.js';
|
|
3
3
|
import 'json-schema';
|
|
4
4
|
import 'openapi-types';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getParametersAsJSONSchema,
|
|
3
3
|
types
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-VMOLPNIM.js";
|
|
5
|
+
import "../../chunk-L2OVXZK3.js";
|
|
6
|
+
import "../../chunk-DPTPURCR.js";
|
|
7
7
|
export {
|
|
8
8
|
getParametersAsJSONSchema,
|
|
9
9
|
types
|