@scalar/openapi-parser 0.10.4 → 0.10.6

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/index.d.ts +4 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/lib/Validator/Validator.d.ts +2 -2
  5. package/dist/lib/Validator/Validator.d.ts.map +1 -1
  6. package/dist/lib/Validator/Validator.js +1 -0
  7. package/dist/lib/Validator/index.d.ts +2 -2
  8. package/dist/lib/Validator/index.d.ts.map +1 -1
  9. package/dist/plugins/fetch-urls/fetchUrls.d.ts +1 -1
  10. package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +1 -1
  11. package/dist/plugins/fetch-urls/fetchUrls.js +1 -0
  12. package/dist/plugins/fetch-urls/index.d.ts +1 -1
  13. package/dist/plugins/fetch-urls/index.d.ts.map +1 -1
  14. package/dist/plugins/read-files/index.d.ts +1 -1
  15. package/dist/plugins/read-files/index.d.ts.map +1 -1
  16. package/dist/plugins/read-files/readFiles.d.ts +1 -1
  17. package/dist/plugins/read-files/readFiles.d.ts.map +1 -1
  18. package/dist/plugins/read-files/readFiles.js +1 -0
  19. package/dist/polyfills/index.d.ts +1 -1
  20. package/dist/polyfills/index.d.ts.map +1 -1
  21. package/dist/types/index.d.ts +1 -1
  22. package/dist/types/index.d.ts.map +1 -1
  23. package/dist/utils/betterAjvErrors/utils.d.ts +9 -0
  24. package/dist/utils/betterAjvErrors/utils.d.ts.map +1 -0
  25. package/dist/utils/betterAjvErrors/utils.js +5 -16
  26. package/dist/utils/dereference.d.ts +2 -2
  27. package/dist/utils/dereference.d.ts.map +1 -1
  28. package/dist/utils/details.d.ts +1 -1
  29. package/dist/utils/details.d.ts.map +1 -1
  30. package/dist/utils/filter.d.ts +1 -1
  31. package/dist/utils/filter.d.ts.map +1 -1
  32. package/dist/utils/getEntrypoint.d.ts +1 -1
  33. package/dist/utils/getEntrypoint.d.ts.map +1 -1
  34. package/dist/utils/getListOfReferences.d.ts +1 -1
  35. package/dist/utils/getListOfReferences.d.ts.map +1 -1
  36. package/dist/utils/index.d.ts +26 -26
  37. package/dist/utils/index.d.ts.map +1 -1
  38. package/dist/utils/load/index.d.ts +1 -1
  39. package/dist/utils/load/index.d.ts.map +1 -1
  40. package/dist/utils/load/load.d.ts +1 -1
  41. package/dist/utils/load/load.d.ts.map +1 -1
  42. package/dist/utils/makeFilesystem.d.ts +1 -1
  43. package/dist/utils/makeFilesystem.d.ts.map +1 -1
  44. package/dist/utils/normalize.d.ts +1 -1
  45. package/dist/utils/normalize.d.ts.map +1 -1
  46. package/dist/utils/openapi/actions/details.d.ts +2 -2
  47. package/dist/utils/openapi/actions/details.d.ts.map +1 -1
  48. package/dist/utils/openapi/actions/files.d.ts +1 -1
  49. package/dist/utils/openapi/actions/files.d.ts.map +1 -1
  50. package/dist/utils/openapi/actions/get.d.ts +1 -1
  51. package/dist/utils/openapi/actions/get.d.ts.map +1 -1
  52. package/dist/utils/openapi/actions/toJson.d.ts +1 -1
  53. package/dist/utils/openapi/actions/toJson.d.ts.map +1 -1
  54. package/dist/utils/openapi/actions/toYaml.d.ts +1 -1
  55. package/dist/utils/openapi/actions/toYaml.d.ts.map +1 -1
  56. package/dist/utils/openapi/commands/dereferenceCommand.d.ts +5 -5
  57. package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +1 -1
  58. package/dist/utils/openapi/commands/filterCommand.d.ts +9 -9
  59. package/dist/utils/openapi/commands/filterCommand.d.ts.map +1 -1
  60. package/dist/utils/openapi/commands/loadCommand.d.ts +994 -994
  61. package/dist/utils/openapi/commands/loadCommand.d.ts.map +1 -1
  62. package/dist/utils/openapi/commands/upgradeCommand.d.ts +311 -311
  63. package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +1 -1
  64. package/dist/utils/openapi/commands/validateCommand.d.ts +311 -311
  65. package/dist/utils/openapi/commands/validateCommand.d.ts.map +1 -1
  66. package/dist/utils/openapi/index.d.ts +1 -1
  67. package/dist/utils/openapi/index.d.ts.map +1 -1
  68. package/dist/utils/openapi/openapi.d.ts +700 -700
  69. package/dist/utils/openapi/openapi.d.ts.map +1 -1
  70. package/dist/utils/openapi/utils/queueTask.d.ts +1 -1
  71. package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -1
  72. package/dist/utils/openapi/utils/workThroughQueue.d.ts +1 -1
  73. package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +1 -1
  74. package/dist/utils/openapi/utils/workThroughQueue.js +1 -1
  75. package/dist/utils/resolveReferences.d.ts +1 -1
  76. package/dist/utils/resolveReferences.d.ts.map +1 -1
  77. package/dist/utils/resolveReferences.js +3 -2
  78. package/dist/utils/toJson.d.ts +1 -1
  79. package/dist/utils/toJson.d.ts.map +1 -1
  80. package/dist/utils/toYaml.d.ts +1 -1
  81. package/dist/utils/toYaml.d.ts.map +1 -1
  82. package/dist/utils/transform/index.d.ts +1 -1
  83. package/dist/utils/transform/index.d.ts.map +1 -1
  84. package/dist/utils/transform/sanitize.d.ts +3 -3
  85. package/dist/utils/transform/sanitize.d.ts.map +1 -1
  86. package/dist/utils/transform/utils/addInfoObject.d.ts +1 -1
  87. package/dist/utils/transform/utils/addInfoObject.d.ts.map +1 -1
  88. package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts +1 -1
  89. package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts.map +1 -1
  90. package/dist/utils/transform/utils/addMissingTags.d.ts +1 -1
  91. package/dist/utils/transform/utils/addMissingTags.d.ts.map +1 -1
  92. package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts +1 -1
  93. package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts.map +1 -1
  94. package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts +1 -1
  95. package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts.map +1 -1
  96. package/dist/utils/transformErrors.d.ts +1 -1
  97. package/dist/utils/transformErrors.d.ts.map +1 -1
  98. package/dist/utils/traverse.d.ts +1 -1
  99. package/dist/utils/traverse.d.ts.map +1 -1
  100. package/dist/utils/upgrade.d.ts +1 -1
  101. package/dist/utils/upgrade.d.ts.map +1 -1
  102. package/dist/utils/upgradeFromThreeToThreeOne.js +1 -1
  103. package/dist/utils/validate.d.ts +1 -1
  104. package/dist/utils/validate.d.ts.map +1 -1
  105. package/dist/utils/validate.js +1 -1
  106. package/package.json +3 -3
  107. package/dist/lib/index.d.ts +0 -2
  108. package/dist/lib/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/utils/openapi/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAS,MAAM,aAAa,CAAA;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;GAEG;AACH,wBAAgB,OAAO,CAAC,aAAa,CAAC,EAAE,cAAc;kBASpC,sBAAsB,YAAY,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9D"}
@@ -1,4 +1,4 @@
1
- import type { Queue, Task } from '../../../types';
1
+ import type { Queue, Task } from '../../../types/index.ts';
2
2
  /**
3
3
  * Add a new task to the existing queue
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"queueTask.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/utils/queueTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAEjD;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAI7D,KAAK,CAAC,CAAC,CAAC,CACd"}
1
+ {"version":3,"file":"queueTask.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/utils/queueTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE1D;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAI7D,KAAK,CAAC,CAAC,CAAC,CACd"}
@@ -1,4 +1,4 @@
1
- import type { CommandChain, Queue, Task } from '../../../types';
1
+ import type { CommandChain, Queue, Task } from '../../../types/index.ts';
2
2
  /**
3
3
  * Takes a queue of tasks and works through them
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"workThroughQueue.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/utils/workThroughQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAS,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAOtE;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,IAAI,EAAE,EACrD,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CA4E1B"}
1
+ {"version":3,"file":"workThroughQueue.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/utils/workThroughQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAS,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAO/E;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,IAAI,EAAE,EACrD,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CA4E1B"}
@@ -1,8 +1,8 @@
1
1
  import { dereference } from '../../dereference.js';
2
2
  import { filter } from '../../filter.js';
3
+ import { load } from '../../load/load.js';
3
4
  import { upgrade } from '../../upgrade.js';
4
5
  import { validate } from '../../validate.js';
5
- import { load } from '../../load/load.js';
6
6
 
7
7
  /**
8
8
  * Takes a queue of tasks and works through them
@@ -1,5 +1,5 @@
1
1
  import type { OpenAPI } from '@scalar/openapi-types';
2
- import type { AnyObject, ErrorObject, Filesystem, FilesystemEntry, ThrowOnErrorOption } from '../types';
2
+ import type { AnyObject, ErrorObject, Filesystem, FilesystemEntry, ThrowOnErrorOption } from '../types/index.ts';
3
3
  export type ResolveReferencesResult = {
4
4
  valid: boolean;
5
5
  errors: ErrorObject[];
@@ -1 +1 @@
1
- {"version":3,"file":"resolveReferences.d.ts","sourceRoot":"","sources":["../../src/utils/resolveReferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MA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IAAI,CAAA;CACnE,CAAA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAE/B,KAAK,EAAE,SAAS,GAAG,UAAU,EAE7B,OAAO,CAAC,EAAE,wBAAwB,EAElC,IAAI,CAAC,EAAE,eAAe,EAEtB,MAAM,GAAE,WAAW,EAAO,GACzB,uBAAuB,CAqCzB"}
@@ -97,7 +97,7 @@ resolve, errors) {
97
97
  code: 'INVALID_REFERENCE',
98
98
  message: ERRORS.INVALID_REFERENCE.replace('%s', uri),
99
99
  });
100
- return;
100
+ return undefined;
101
101
  }
102
102
  // Understand the URI
103
103
  const [prefix, path] = uri.split('#', 2);
@@ -116,7 +116,7 @@ resolve, errors) {
116
116
  code: 'EXTERNAL_REFERENCE_NOT_FOUND',
117
117
  message: ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix),
118
118
  });
119
- return;
119
+ return undefined;
120
120
  }
121
121
  // $ref: 'other-file.yaml'
122
122
  if (path === undefined) {
@@ -143,6 +143,7 @@ resolve, errors) {
143
143
  message: ERRORS.INVALID_REFERENCE.replace('%s', uri),
144
144
  });
145
145
  }
146
+ return undefined;
146
147
  }
147
148
 
148
149
  export { resolveReferences };
@@ -1,3 +1,3 @@
1
- import type { AnyObject } from '../types';
1
+ import type { AnyObject } from '../types/index.ts';
2
2
  export declare const toJson: (value: AnyObject) => string;
3
3
  //# sourceMappingURL=toJson.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../src/utils/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,MAAM,UAAW,SAAS,WAAmC,CAAA"}
1
+ {"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../src/utils/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,eAAO,MAAM,MAAM,UAAW,SAAS,WAAmC,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { AnyObject } from '../types';
1
+ import type { AnyObject } from '../types/index.ts';
2
2
  export declare const toYaml: (value: AnyObject) => string;
3
3
  //# sourceMappingURL=toYaml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../src/utils/toYaml.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,MAAM,UAAW,SAAS,WAAqB,CAAA"}
1
+ {"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../src/utils/toYaml.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,eAAO,MAAM,MAAM,UAAW,SAAS,WAAqB,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './sanitize.js';
1
+ export * from './sanitize.ts';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/transform/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/transform/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { OpenAPI } from '@scalar/openapi-types';
2
- import type { AnyObject } from '../../types';
3
- export { DEFAULT_OPENAPI_VERSION } from './utils/addLatestOpenApiVersion.js';
4
- export { DEFAULT_TITLE, DEFAULT_VERSION } from './utils/addInfoObject.js';
2
+ import type { AnyObject } from '../../types/index.ts';
3
+ export { DEFAULT_OPENAPI_VERSION } from './utils/addLatestOpenApiVersion.ts';
4
+ export { DEFAULT_TITLE, DEFAULT_VERSION } from './utils/addInfoObject.ts';
5
5
  /**
6
6
  * Make an OpenAPI document a valid and clean OpenAPI document
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/utils/transform/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAO5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEtE;;GAEG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,QAAQ,CAUhE"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/utils/transform/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAOrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAEzE;;GAEG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,QAAQ,CAUhE"}
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from '../../../types';
1
+ import type { AnyObject } from '../../../types/index.ts';
2
2
  export declare const DEFAULT_TITLE = "API";
3
3
  export declare const DEFAULT_VERSION = "1.0";
4
4
  export declare const addInfoObject: (definition: AnyObject) => {
@@ -1 +1 @@
1
- {"version":3,"file":"addInfoObject.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/addInfoObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,eAAO,MAAM,aAAa,QAAQ,CAAA;AAClC,eAAO,MAAM,eAAe,QAAQ,CAAA;AAEpC,eAAO,MAAM,aAAa,eAAgB,SAAS;;CAOjD,CAAA"}
1
+ {"version":3,"file":"addInfoObject.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/addInfoObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,eAAO,MAAM,aAAa,QAAQ,CAAA;AAClC,eAAO,MAAM,eAAe,QAAQ,CAAA;AAEpC,eAAO,MAAM,aAAa,eAAgB,SAAS;;CAOjD,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from '../../../types';
1
+ import type { AnyObject } from '../../../types/index.ts';
2
2
  export declare const DEFAULT_OPENAPI_VERSION = "3.1.1";
3
3
  export declare const addLatestOpenApiVersion: (definition: AnyObject) => {
4
4
  openapi: any;
@@ -1 +1 @@
1
- {"version":3,"file":"addLatestOpenApiVersion.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/addLatestOpenApiVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,eAAO,MAAM,uBAAuB,UAAU,CAAA;AAE9C,eAAO,MAAM,uBAAuB,eAAgB,SAAS;;CAG3D,CAAA"}
1
+ {"version":3,"file":"addLatestOpenApiVersion.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/addLatestOpenApiVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,eAAO,MAAM,uBAAuB,UAAU,CAAA;AAE9C,eAAO,MAAM,uBAAuB,eAAgB,SAAS;;CAG3D,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { AnyObject } from '../../../types';
1
+ import type { AnyObject } from '../../../types/index.ts';
2
2
  export declare const addMissingTags: (definition: AnyObject) => AnyObject;
3
3
  //# sourceMappingURL=addMissingTags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addMissingTags.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/addMissingTags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,eAAO,MAAM,cAAc,eAAgB,SAAS,cA8CnD,CAAA"}
1
+ {"version":3,"file":"addMissingTags.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/addMissingTags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,eAAO,MAAM,cAAc,eAAgB,SAAS,cA8CnD,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { AnyObject } from '../../../types';
1
+ import type { AnyObject } from '../../../types/index.ts';
2
2
  export declare const normalizeSecuritySchemes: (definition: AnyObject) => AnyObject;
3
3
  //# sourceMappingURL=normalizeSecuritySchemes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeSecuritySchemes.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/normalizeSecuritySchemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,eAAO,MAAM,wBAAwB,eAAgB,SAAS,cAsD7D,CAAA"}
1
+ {"version":3,"file":"normalizeSecuritySchemes.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/normalizeSecuritySchemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,eAAO,MAAM,wBAAwB,eAAgB,SAAS,cAsD7D,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { AnyObject } from '../../../types';
1
+ import type { AnyObject } from '../../../types/index.ts';
2
2
  export declare const rejectSwaggerDocuments: (defintion: AnyObject) => AnyObject;
3
3
  //# sourceMappingURL=rejectSwaggerDocuments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rejectSwaggerDocuments.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/rejectSwaggerDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,eAAO,MAAM,sBAAsB,cAAe,SAAS,cAQ1D,CAAA"}
1
+ {"version":3,"file":"rejectSwaggerDocuments.d.ts","sourceRoot":"","sources":["../../../../src/utils/transform/utils/rejectSwaggerDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,eAAO,MAAM,sBAAsB,cAAe,SAAS,cAQ1D,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from '../types';
1
+ import type { AnyObject } from '../types/index.ts';
2
2
  /**
3
3
  * Transforms ajv errors, finds the positions in the schema and returns an enriched format.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"transformErrors.d.ts","sourceRoot":"","sources":["../../src/utils/transformErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC;;GAEG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAkBpE"}
1
+ {"version":3,"file":"transformErrors.d.ts","sourceRoot":"","sources":["../../src/utils/transformErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGlD;;GAEG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAkBpE"}
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from '../types';
1
+ import type { AnyObject } from '../types/index.ts';
2
2
  /**
3
3
  * Recursively traverses the specification and applies the transform function to each node.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/utils/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;GAEG;AACH,wBAAgB,QAAQ,CACtB,aAAa,EAAE,SAAS,EACxB,SAAS,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,SAAS,EACnE,IAAI,GAAE,MAAM,EAAO,aA0BpB"}
1
+ {"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/utils/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD;;GAEG;AACH,wBAAgB,QAAQ,CACtB,aAAa,EAAE,SAAS,EACxB,SAAS,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,SAAS,EACnE,IAAI,GAAE,MAAM,EAAO,aA0BpB"}
@@ -1,5 +1,5 @@
1
1
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
- import type { AnyObject, Filesystem, UpgradeResult } from '../types';
2
+ import type { AnyObject, Filesystem, UpgradeResult } from '../types/index.ts';
3
3
  /**
4
4
  * Upgrade specification to OpenAPI 3.1.0
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/utils/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMpE;;GAEG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GACrC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAoBrC"}
1
+ {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/utils/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAM7E;;GAEG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GACrC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAoBrC"}
@@ -20,7 +20,7 @@ function upgradeFromThreeToThreeOne(originalSpecification) {
20
20
  // Nullable types
21
21
  specification = traverse(specification, (schema) => {
22
22
  if (schema.type !== 'undefined' && schema.nullable === true) {
23
- schema.type = ['null', schema.type];
23
+ schema.type = [schema.type, 'null'];
24
24
  delete schema.nullable;
25
25
  }
26
26
  return schema;
@@ -1,4 +1,4 @@
1
- import type { AnyObject, Filesystem, ThrowOnErrorOption, ValidateResult } from '../types';
1
+ import type { AnyObject, Filesystem, ThrowOnErrorOption, ValidateResult } from '../types/index.ts';
2
2
  export type ValidateOptions = ThrowOnErrorOption;
3
3
  /**
4
4
  * Validates an OpenAPI document
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/utils/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAA;AAEhD;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EACtC,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC,CAWzB"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/utils/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,mBAAmB,CAAA;AAG1B,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAA;AAEhD;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EACtC,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC,CAWzB"}
@@ -1,5 +1,5 @@
1
- import { makeFilesystem } from './makeFilesystem.js';
2
1
  import { Validator } from '../lib/Validator/Validator.js';
2
+ import { makeFilesystem } from './makeFilesystem.js';
3
3
 
4
4
  /**
5
5
  * Validates an OpenAPI document
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "parser",
18
18
  "typescript"
19
19
  ],
20
- "version": "0.10.4",
20
+ "version": "0.10.6",
21
21
  "engines": {
22
22
  "node": ">=18"
23
23
  },
@@ -65,8 +65,8 @@
65
65
  "just-diff": "^6.0.2",
66
66
  "tinybench": "^2.8.0",
67
67
  "@scalar/build-tooling": "0.1.12",
68
- "@scalar/openapi-types": "0.1.6",
69
- "@scalar/types": "0.0.26"
68
+ "@scalar/types": "0.0.32",
69
+ "@scalar/openapi-types": "0.1.7"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "scalar-build-rollup",
@@ -1,2 +0,0 @@
1
- export * from './Validator';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}