Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@scalar/oas-utils

Package Overview
Dependencies
Maintainers
0
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/oas-utils - npm Package Compare versions

Comparing version 0.2.24 to 0.2.25

6

CHANGELOG.md
# @scalar/oas-utils
## 0.2.25
### Patch Changes
- 9cc6311: fix: add overload to servers as prop for create client app
## 0.2.24

@@ -4,0 +10,0 @@

4

dist/transforms/import-spec.d.ts
import { type Request } from '../entities/workspace/spec/index.js';
import type { AnyObject } from '../types';
import type { AnyObject, Spec } from '../types';
/** Import an OpenAPI spec file and convert it to workspace entities */
export declare const importSpecToWorkspace: (spec: string | AnyObject) => Promise<{
export declare const importSpecToWorkspace: (spec: string | AnyObject, overloadServers?: Spec["servers"]) => Promise<{
tags: {

@@ -6,0 +6,0 @@ name: string;

@@ -16,3 +16,3 @@ import { tagObjectSchema } from '../entities/workspace/spec/spec.js';

/** Import an OpenAPI spec file and convert it to workspace entities */
const importSpecToWorkspace = async (spec) => {
const importSpecToWorkspace = async (spec, overloadServers) => {
const importWarnings = [];

@@ -112,12 +112,13 @@ const requests = [];

// Toss in a default server if there aren't any
const unparsedServers = schema?.servers?.length
? schema.servers
: [
{
url: typeof window !== 'undefined'
? window.location.origin
: 'http://localhost',
description: 'Replace with your API server',
},
];
const unparsedServers = overloadServers ??
(schema?.servers?.length
? schema.servers
: [
{
url: typeof window !== 'undefined'
? window.location.origin
: 'http://localhost',
description: 'Replace with your API server',
},
]);
const servers = unparsedServers.map((server) => createServer(server));

@@ -124,0 +125,0 @@ const collection = createCollection({

@@ -19,3 +19,3 @@ {

],
"version": "0.2.24",
"version": "0.2.25",
"engines": {

@@ -22,0 +22,0 @@ "node": ">=18"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc