@scalar/oas-utils 0.2.66 → 0.2.68

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,18 @@
1
1
  # @scalar/oas-utils
2
2
 
3
+ ## 0.2.68
4
+
5
+ ### Patch Changes
6
+
7
+ - dab543e: fix: remove url validation from collection info
8
+
9
+ ## 0.2.67
10
+
11
+ ### Patch Changes
12
+
13
+ - 823c14d: fix: add tests for oauth2 flows, ensure we reject on state mismatch
14
+ - 997cd35: fix: relative URLs are created wrong
15
+
3
16
  ## 0.2.66
4
17
 
5
18
  ### Patch Changes
@@ -15,7 +15,7 @@ const oasLicenseSchema = z.object({
15
15
  * A URL to the license used for the API. This MUST be in the form of a URL. The url field
16
16
  * is mutually exclusive of the identifier field.
17
17
  */
18
- url: z.string().url().optional(),
18
+ url: z.string().optional(),
19
19
  });
20
20
  /**
21
21
  * Contact
@@ -27,7 +27,7 @@ const oasContactSchema = z.object({
27
27
  /** The identifying name of the contact person/organization. */
28
28
  name: z.string().optional(),
29
29
  /** The URL pointing to the contact information. This MUST be in the form of a URL. */
30
- url: z.string().url().optional(),
30
+ url: z.string().optional(),
31
31
  /** The email address of the contact person/organization. This MUST be in the form of an email address. */
32
32
  email: z.string().email().optional(),
33
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"makeUrlAbsolute.d.ts","sourceRoot":"","sources":["../../src/helpers/makeUrlAbsolute.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,MAAM,uBAoB3C,CAAA"}
1
+ {"version":3,"file":"makeUrlAbsolute.d.ts","sourceRoot":"","sources":["../../src/helpers/makeUrlAbsolute.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,MAAM,uBAqB3C,CAAA"}
@@ -10,10 +10,11 @@ const makeUrlAbsolute = (url) => {
10
10
  const baseUrl = window.location.href;
11
11
  // Remove any query parameters or hash from the base URL
12
12
  const cleanBaseUrl = baseUrl.split('?')[0].split('#')[0];
13
- // Ensure the base URL ends with a slash if it doesn’t already
13
+ // For base URLs with a path component, we want to remove the last path segment
14
+ // if it doesn't end with a slash
14
15
  const normalizedBaseUrl = cleanBaseUrl.endsWith('/')
15
16
  ? cleanBaseUrl
16
- : cleanBaseUrl + '/';
17
+ : cleanBaseUrl.substring(0, cleanBaseUrl.lastIndexOf('/') + 1);
17
18
  return new URL(url, normalizedBaseUrl).toString();
18
19
  };
19
20
 
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "specification",
17
17
  "yaml"
18
18
  ],
19
- "version": "0.2.66",
19
+ "version": "0.2.68",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -106,9 +106,9 @@
106
106
  "nanoid": "^5.0.7",
107
107
  "yaml": "^2.4.5",
108
108
  "zod": "^3.23.8",
109
- "@scalar/openapi-types": "0.1.4",
110
109
  "@scalar/object-utils": "1.1.11",
111
110
  "@scalar/themes": "0.9.45",
111
+ "@scalar/openapi-types": "0.1.4",
112
112
  "@scalar/types": "0.0.18"
113
113
  },
114
114
  "devDependencies": {
@@ -117,8 +117,8 @@
117
117
  "vitest": "^1.6.0",
118
118
  "zod-to-ts": "^1.2.0",
119
119
  "@scalar/build-tooling": "0.1.11",
120
- "@scalar/openapi-parser": "0.8.8",
121
- "@scalar/openapi-types": "0.1.4"
120
+ "@scalar/openapi-types": "0.1.4",
121
+ "@scalar/openapi-parser": "0.8.8"
122
122
  },
123
123
  "scripts": {
124
124
  "build": "scalar-build-rollup",