@scalar/oas-utils 0.2.0 → 0.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @scalar/oas-utils
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e0fc110: chore: patch bump all package
8
+ - f0acc89: chore: upgrade to new @scalar/openapi-parser version
9
+
3
10
  ## 0.2.0
4
11
 
5
12
  ### Minor Changes
@@ -62,6 +62,6 @@ export declare const importSpecToWorkspace: (spec: string | AnyObject) => Promis
62
62
  selectedServerUid: string;
63
63
  childUids: string[];
64
64
  };
65
- components: import("@scalar/openapi-parser").ResolvedOpenAPIV3.ComponentsObject | import("@scalar/openapi-parser").ResolvedOpenAPIV3_1.ComponentsObject | undefined;
65
+ components: any;
66
66
  }>;
67
67
  //# sourceMappingURL=import-spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/import-spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,2BAA2B,CAAA;AAKvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAWxC,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,SAAgB,MAAM,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgJnE,CAAA"}
1
+ {"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/import-spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,2BAA2B,CAAA;AAKvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAWxC,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,SAAgB,MAAM,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmJnE,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { tagObjectSchema } from '../entities/workspace/spec/spec.js';
2
2
  import { parseJsonOrYaml } from '../helpers/parse.js';
3
3
  import { schemaModel } from '../helpers/schema-model.js';
4
- import { openapi } from '@scalar/openapi-parser';
4
+ import { load, dereference } from '@scalar/openapi-parser';
5
5
  import { createRequest } from '../entities/workspace/spec/requests.js';
6
6
  import { createFolder } from '../entities/workspace/folder/folder.js';
7
7
  import { createServer } from '../entities/workspace/server/server.js';
@@ -18,7 +18,10 @@ const importSpecToWorkspace = async (spec) => {
18
18
  const importWarnings = [];
19
19
  const requests = [];
20
20
  const parsedSpec = parseJsonOrYaml(spec);
21
- const { schema, errors } = await openapi().load(parsedSpec).resolve();
21
+ // TODO: `parsedSpec` can have circular reference and will break.
22
+ // We always have to use the original document.
23
+ const { filesystem } = await load(parsedSpec);
24
+ const { schema, errors } = await dereference(filesystem);
22
25
  if (errors?.length || !schema) {
23
26
  console.warn('Please open an issue on https://github.com/scalar/scalar\n', 'Scalar OpenAPI Parser Warning:\n', errors);
24
27
  }
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "specification",
17
17
  "yaml"
18
18
  ],
19
- "version": "0.2.0",
19
+ "version": "0.2.1",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -87,11 +87,11 @@
87
87
  "module": "dist/index.js",
88
88
  "dependencies": {
89
89
  "nanoid": "^5.0.7",
90
- "yaml": "^2.4.1",
90
+ "yaml": "^2.4.5",
91
91
  "zod": "^3.22.4"
92
92
  },
93
93
  "devDependencies": {
94
- "@scalar/openapi-parser": "^0.3.2",
94
+ "@scalar/openapi-parser": "^0.7.1",
95
95
  "axios": "^1.6.8",
96
96
  "httpsnippet-lite": "^3.0.5",
97
97
  "openapi-types": "^12.1.3",
@@ -100,7 +100,7 @@
100
100
  "type-fest": "^4.20.0",
101
101
  "vite": "^5.2.10",
102
102
  "vitest": "^1.6.0",
103
- "@scalar/build-tooling": "0.1.5"
103
+ "@scalar/build-tooling": "0.1.6"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "axios": "^1.5"