oas 28.7.0 → 28.8.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/dist/analyzer/index.cjs +6 -6
- package/dist/analyzer/index.js +4 -4
- package/dist/{chunk-C3GC3WSK.js → chunk-3H2HA2EU.js} +2 -2
- package/dist/{chunk-WN7KLBGW.cjs → chunk-HKO2KXMC.cjs} +20 -20
- package/dist/{chunk-WN7KLBGW.cjs.map → chunk-HKO2KXMC.cjs.map} +1 -1
- package/dist/{chunk-AFEHY5RG.js → chunk-IIVCS7YE.js} +3 -3
- package/dist/{chunk-6JSHPV2O.cjs → chunk-KDRD2YJG.cjs} +5 -2
- package/dist/chunk-KDRD2YJG.cjs.map +1 -0
- package/dist/{chunk-CCR5GBJV.js → chunk-ON35XUBH.js} +4 -4
- package/dist/{chunk-OSHPUFYW.cjs → chunk-QU42TES7.cjs} +20 -20
- package/dist/{chunk-OSHPUFYW.cjs.map → chunk-QU42TES7.cjs.map} +1 -1
- package/dist/{chunk-NBQXNFZT.js → chunk-TTCGKV5E.js} +4 -1
- package/dist/chunk-TTCGKV5E.js.map +1 -0
- package/dist/{chunk-3IRCRFDX.cjs → chunk-WMPVSTGO.cjs} +3 -3
- package/dist/{chunk-3IRCRFDX.cjs.map → chunk-WMPVSTGO.cjs.map} +1 -1
- package/dist/{extensions-CCNmmxL8.d.cts → extensions-D_XcbwoY.d.cts} +20 -1
- package/dist/{extensions-BiYaChnB.d.ts → extensions-DoxE-Jq4.d.ts} +20 -1
- package/dist/extensions.cjs +4 -2
- package/dist/extensions.cjs.map +1 -1
- package/dist/extensions.d.cts +1 -1
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +3 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/operation/index.cjs +4 -4
- package/dist/operation/index.d.cts +1 -1
- package/dist/operation/index.d.ts +1 -1
- package/dist/operation/index.js +3 -3
- package/dist/operation/lib/get-parameters-as-json-schema.cjs +3 -3
- 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 +2 -2
- package/dist/utils.cjs +3 -3
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-6JSHPV2O.cjs.map +0 -1
- package/dist/chunk-NBQXNFZT.js.map +0 -1
- /package/dist/{chunk-C3GC3WSK.js.map → chunk-3H2HA2EU.js.map} +0 -0
- /package/dist/{chunk-AFEHY5RG.js.map → chunk-IIVCS7YE.js.map} +0 -0
- /package/dist/{chunk-CCR5GBJV.js.map → chunk-ON35XUBH.js.map} +0 -0
package/dist/analyzer/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkQU42TES7cjs = require('../chunk-QU42TES7.cjs');
|
|
4
|
+
require('../chunk-HKO2KXMC.cjs');
|
|
5
5
|
require('../chunk-LNQ2I4RW.cjs');
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-WMPVSTGO.cjs');
|
|
7
|
+
require('../chunk-KDRD2YJG.cjs');
|
|
8
8
|
require('../chunk-WK3UQMKM.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ function callbacks(definition) {
|
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
async function circularRefs(definition) {
|
|
24
|
-
const oas = new (0,
|
|
24
|
+
const oas = new (0, _chunkQU42TES7cjs.Oas)(JSON.parse(JSON.stringify(definition)));
|
|
25
25
|
await oas.dereference();
|
|
26
26
|
const results = oas.getCircularReferences();
|
|
27
27
|
results.sort();
|
|
@@ -34,7 +34,7 @@ function discriminators(definition) {
|
|
|
34
34
|
return _chunkW6GBV2JTcjs.query.call(void 0, ["$..discriminator"], definition).map((res) => _chunkW6GBV2JTcjs.refizePointer.call(void 0, res.pointer));
|
|
35
35
|
}
|
|
36
36
|
async function fileSize(definition) {
|
|
37
|
-
const oas = new (0,
|
|
37
|
+
const oas = new (0, _chunkQU42TES7cjs.Oas)(structuredClone(definition));
|
|
38
38
|
const originalSizeInBytes = Buffer.from(JSON.stringify(oas.api)).length;
|
|
39
39
|
const raw = Number((originalSizeInBytes / (1024 * 1024)).toFixed(2));
|
|
40
40
|
await oas.dereference();
|
package/dist/analyzer/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Oas
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-ON35XUBH.js";
|
|
4
|
+
import "../chunk-IIVCS7YE.js";
|
|
5
5
|
import "../chunk-LV26LN7C.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-3H2HA2EU.js";
|
|
7
|
+
import "../chunk-TTCGKV5E.js";
|
|
8
8
|
import "../chunk-L3V5TF63.js";
|
|
9
9
|
import {
|
|
10
10
|
query,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PARAMETER_ORDERING,
|
|
3
3
|
getExtension
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TTCGKV5E.js";
|
|
5
5
|
import {
|
|
6
6
|
isOpenAPI30,
|
|
7
7
|
isRef,
|
|
@@ -838,4 +838,4 @@ export {
|
|
|
838
838
|
types,
|
|
839
839
|
getParametersAsJSONSchema
|
|
840
840
|
};
|
|
841
|
-
//# sourceMappingURL=chunk-
|
|
841
|
+
//# sourceMappingURL=chunk-3H2HA2EU.js.map
|
|
@@ -10,10 +10,10 @@ var _chunkLNQ2I4RWcjs = require('./chunk-LNQ2I4RW.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkWMPVSTGOcjs = require('./chunk-WMPVSTGO.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkKDRD2YJGcjs = require('./chunk-KDRD2YJG.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkWK3UQMKMcjs = require('./chunk-WK3UQMKM.cjs');
|
|
@@ -48,7 +48,7 @@ function usesPolymorphism(schema) {
|
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
50
|
function objectify(thing) {
|
|
51
|
-
if (!
|
|
51
|
+
if (!_chunkWMPVSTGOcjs.isObject.call(void 0, thing)) {
|
|
52
52
|
return {};
|
|
53
53
|
}
|
|
54
54
|
return thing;
|
|
@@ -257,7 +257,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, opts = {}) {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
if (mediaTypeObject.schema) {
|
|
260
|
-
if (!
|
|
260
|
+
if (!_chunkWMPVSTGOcjs.matches_mimetype_default.xml(mediaType)) {
|
|
261
261
|
return [
|
|
262
262
|
{
|
|
263
263
|
value: samples_default(JSON.parse(JSON.stringify(mediaTypeObject.schema)), opts)
|
|
@@ -354,7 +354,7 @@ function getDefaultName(sample, count) {
|
|
|
354
354
|
function getExampleGroups(operation) {
|
|
355
355
|
const namelessCodeSampleCounts = {};
|
|
356
356
|
const groups = {};
|
|
357
|
-
const codeSamples =
|
|
357
|
+
const codeSamples = _chunkKDRD2YJGcjs.getExtension.call(void 0, "code-samples", operation.api, operation);
|
|
358
358
|
_optionalChain([codeSamples, 'optionalAccess', _11 => _11.forEach, 'call', _12 => _12((sample, i) => {
|
|
359
359
|
if (namelessCodeSampleCounts[sample.language]) {
|
|
360
360
|
namelessCodeSampleCounts[sample.language] += 1;
|
|
@@ -446,7 +446,7 @@ function getRequestBodyExamples(operation) {
|
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
// src/operation/lib/get-response-as-json-schema.ts
|
|
449
|
-
var isJSON =
|
|
449
|
+
var isJSON = _chunkWMPVSTGOcjs.matches_mimetype_default.json;
|
|
450
450
|
function buildHeadersSchema(response, opts) {
|
|
451
451
|
const headers = response.headers;
|
|
452
452
|
const headersSchema = {
|
|
@@ -456,7 +456,7 @@ function buildHeadersSchema(response, opts) {
|
|
|
456
456
|
Object.keys(headers).forEach((key) => {
|
|
457
457
|
if (headers[key] && headers[key].schema) {
|
|
458
458
|
const header = headers[key];
|
|
459
|
-
headersSchema.properties[key] =
|
|
459
|
+
headersSchema.properties[key] = _chunkWMPVSTGOcjs.toJSONSchema.call(void 0, header.schema, {
|
|
460
460
|
addEnumsToDescriptions: true,
|
|
461
461
|
transformer: opts.transformer
|
|
462
462
|
});
|
|
@@ -500,7 +500,7 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
500
500
|
}
|
|
501
501
|
for (let i = 0; i < contentTypes.length; i++) {
|
|
502
502
|
if (isJSON(contentTypes[i])) {
|
|
503
|
-
return
|
|
503
|
+
return _chunkWMPVSTGOcjs.toJSONSchema.call(void 0, _chunkWMPVSTGOcjs.cloneObject.call(void 0, content[contentTypes[i]].schema), {
|
|
504
504
|
addEnumsToDescriptions: true,
|
|
505
505
|
refLogger,
|
|
506
506
|
transformer: opts.transformer
|
|
@@ -508,7 +508,7 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
const contentType = contentTypes.shift();
|
|
511
|
-
return
|
|
511
|
+
return _chunkWMPVSTGOcjs.toJSONSchema.call(void 0, _chunkWMPVSTGOcjs.cloneObject.call(void 0, content[contentType].schema), {
|
|
512
512
|
addEnumsToDescriptions: true,
|
|
513
513
|
refLogger,
|
|
514
514
|
transformer: opts.transformer
|
|
@@ -516,15 +516,15 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
516
516
|
}
|
|
517
517
|
const foundSchema = getPreferredSchema(response.content);
|
|
518
518
|
if (foundSchema) {
|
|
519
|
-
const schema =
|
|
519
|
+
const schema = _chunkWMPVSTGOcjs.cloneObject.call(void 0, foundSchema);
|
|
520
520
|
const schemaWrapper = {
|
|
521
521
|
// If there's no `type` then the root schema is a circular `$ref` that we likely won't be
|
|
522
522
|
// able to render so instead of generating a JSON Schema with an `undefined` type we should
|
|
523
523
|
// default to `string` so there's at least *something* the end-user can interact with.
|
|
524
524
|
type: foundSchema.type || "string",
|
|
525
|
-
schema:
|
|
525
|
+
schema: _chunkWMPVSTGOcjs.isPrimitive.call(void 0, schema) ? schema : {
|
|
526
526
|
...schema,
|
|
527
|
-
$schema:
|
|
527
|
+
$schema: _chunkWMPVSTGOcjs.getSchemaVersionString.call(void 0, schema, api)
|
|
528
528
|
},
|
|
529
529
|
label: "Response body"
|
|
530
530
|
};
|
|
@@ -678,23 +678,23 @@ var Operation = class {
|
|
|
678
678
|
this.contentType = types[0];
|
|
679
679
|
}
|
|
680
680
|
types.forEach((t) => {
|
|
681
|
-
if (
|
|
681
|
+
if (_chunkWMPVSTGOcjs.matches_mimetype_default.json(t)) {
|
|
682
682
|
this.contentType = t;
|
|
683
683
|
}
|
|
684
684
|
});
|
|
685
685
|
return this.contentType;
|
|
686
686
|
}
|
|
687
687
|
isFormUrlEncoded() {
|
|
688
|
-
return
|
|
688
|
+
return _chunkWMPVSTGOcjs.matches_mimetype_default.formUrlEncoded(this.getContentType());
|
|
689
689
|
}
|
|
690
690
|
isMultipart() {
|
|
691
|
-
return
|
|
691
|
+
return _chunkWMPVSTGOcjs.matches_mimetype_default.multipart(this.getContentType());
|
|
692
692
|
}
|
|
693
693
|
isJson() {
|
|
694
|
-
return
|
|
694
|
+
return _chunkWMPVSTGOcjs.matches_mimetype_default.json(this.getContentType());
|
|
695
695
|
}
|
|
696
696
|
isXml() {
|
|
697
|
-
return
|
|
697
|
+
return _chunkWMPVSTGOcjs.matches_mimetype_default.xml(this.getContentType());
|
|
698
698
|
}
|
|
699
699
|
/**
|
|
700
700
|
* Checks if the current operation is a webhook or not.
|
|
@@ -939,7 +939,7 @@ var Operation = class {
|
|
|
939
939
|
*
|
|
940
940
|
*/
|
|
941
941
|
getParametersAsJSONSchema(opts = {}) {
|
|
942
|
-
return
|
|
942
|
+
return _chunkWMPVSTGOcjs.getParametersAsJSONSchema.call(void 0, this, this.api, {
|
|
943
943
|
includeDiscriminatorMappingRefs: true,
|
|
944
944
|
transformer: (s) => s,
|
|
945
945
|
...opts
|
|
@@ -1033,7 +1033,7 @@ var Operation = class {
|
|
|
1033
1033
|
let availableMediaType;
|
|
1034
1034
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
1035
1035
|
mediaTypes.forEach((mt) => {
|
|
1036
|
-
if (!availableMediaType &&
|
|
1036
|
+
if (!availableMediaType && _chunkWMPVSTGOcjs.matches_mimetype_default.json(mt)) {
|
|
1037
1037
|
availableMediaType = mt;
|
|
1038
1038
|
}
|
|
1039
1039
|
});
|
|
@@ -1274,4 +1274,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1274
1274
|
* @license Apache-2.0
|
|
1275
1275
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1276
1276
|
*/
|
|
1277
|
-
//# sourceMappingURL=chunk-
|
|
1277
|
+
//# sourceMappingURL=chunk-HKO2KXMC.cjs.map
|