@scalar/oas-utils 0.2.61 → 0.2.63

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 (33) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/entities/spec/collection.d.ts +20 -12
  3. package/dist/entities/spec/collection.d.ts.map +1 -1
  4. package/dist/entities/spec/collection.js +4 -2
  5. package/dist/entities/spec/request-examples.d.ts.map +1 -1
  6. package/dist/entities/spec/request-examples.js +7 -0
  7. package/dist/helpers/fetchSpecFromUrl.d.ts +1 -1
  8. package/dist/helpers/fetchSpecFromUrl.d.ts.map +1 -1
  9. package/dist/helpers/fetchSpecFromUrl.js +15 -14
  10. package/dist/helpers/fetchWithProxyFallback.d.ts +10 -0
  11. package/dist/helpers/fetchWithProxyFallback.d.ts.map +1 -0
  12. package/dist/helpers/fetchWithProxyFallback.js +46 -0
  13. package/dist/helpers/index.d.ts +5 -2
  14. package/dist/helpers/index.d.ts.map +1 -1
  15. package/dist/helpers/index.js +6 -3
  16. package/dist/helpers/isLocalUrl.d.ts +5 -0
  17. package/dist/helpers/isLocalUrl.d.ts.map +1 -0
  18. package/dist/helpers/isLocalUrl.js +10 -0
  19. package/dist/helpers/makeUrlAbsolute.d.ts +5 -0
  20. package/dist/helpers/makeUrlAbsolute.d.ts.map +1 -0
  21. package/dist/helpers/makeUrlAbsolute.js +20 -0
  22. package/dist/helpers/redirectToProxy.d.ts +0 -2
  23. package/dist/helpers/redirectToProxy.d.ts.map +1 -1
  24. package/dist/helpers/redirectToProxy.js +4 -8
  25. package/dist/migrations/v-2.1.0/migration.d.ts +2 -2
  26. package/dist/migrations/v-2.1.0/migration.d.ts.map +1 -1
  27. package/dist/migrations/v-2.1.0/migration.js +2 -2
  28. package/dist/transforms/export-spec.d.ts +3 -2
  29. package/dist/transforms/export-spec.d.ts.map +1 -1
  30. package/dist/transforms/import-spec.d.ts +2 -2
  31. package/dist/transforms/import-spec.d.ts.map +1 -1
  32. package/dist/transforms/import-spec.js +2 -2
  33. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @scalar/oas-utils
2
2
 
3
+ ## 0.2.63
4
+
5
+ ### Patch Changes
6
+
7
+ - ada8545: feat: add the sidebar button
8
+ - Updated dependencies [ad12c56]
9
+ - @scalar/themes@0.9.44
10
+
11
+ ## 0.2.62
12
+
13
+ ### Patch Changes
14
+
15
+ - 097ab40: fix: add mapping of header to headers for api client ingress
16
+ - Updated dependencies [197e3ae]
17
+ - @scalar/themes@0.9.43
18
+
3
19
  ## 0.2.61
4
20
 
5
21
  ### Patch Changes
@@ -107,13 +107,15 @@ export declare const extendedCollectionSchema: z.ZodObject<{
107
107
  *
108
108
  * @remarks Only effective when `documentUrl` is set
109
109
  */
110
- watchForChanges: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
110
+ watchMode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
111
+ /** Keeps track of which integration is associated with the specific collection */
112
+ integration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
113
  /**
112
114
  * Status of the watcher from above
113
115
  *
114
116
  * @defaults to idle for all collections, doesn't mean that it can watch for changes
115
117
  */
116
- watchForChangesStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<["IDLE", "WATCHING", "ERROR"]>>>;
118
+ watchModeStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<["IDLE", "WATCHING", "ERROR"]>>>;
117
119
  }, "strip", z.ZodTypeAny, {
118
120
  uid: string;
119
121
  children: string[];
@@ -150,9 +152,10 @@ export declare const extendedCollectionSchema: z.ZodObject<{
150
152
  token: string;
151
153
  clientSecret: string;
152
154
  }>;
153
- watchForChanges: boolean;
154
- watchForChangesStatus: "IDLE" | "WATCHING" | "ERROR";
155
+ watchMode: boolean;
156
+ watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
155
157
  documentUrl?: string | undefined;
158
+ integration?: string | null | undefined;
156
159
  }, {
157
160
  uid?: string | undefined;
158
161
  children?: (string | undefined)[] | undefined;
@@ -190,8 +193,9 @@ export declare const extendedCollectionSchema: z.ZodObject<{
190
193
  clientSecret?: string | undefined;
191
194
  }> | undefined;
192
195
  documentUrl?: string | undefined;
193
- watchForChanges?: boolean | undefined;
194
- watchForChangesStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
196
+ watchMode?: boolean | undefined;
197
+ integration?: string | null | undefined;
198
+ watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
195
199
  }>;
196
200
  export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
197
201
  type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"collection">>>;
@@ -394,13 +398,15 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
394
398
  *
395
399
  * @remarks Only effective when `documentUrl` is set
396
400
  */
397
- watchForChanges: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
401
+ watchMode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
402
+ /** Keeps track of which integration is associated with the specific collection */
403
+ integration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
398
404
  /**
399
405
  * Status of the watcher from above
400
406
  *
401
407
  * @defaults to idle for all collections, doesn't mean that it can watch for changes
402
408
  */
403
- watchForChangesStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<["IDLE", "WATCHING", "ERROR"]>>>;
409
+ watchModeStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<["IDLE", "WATCHING", "ERROR"]>>>;
404
410
  }>, "strip", z.ZodTypeAny, {
405
411
  type: "collection";
406
412
  uid: string;
@@ -441,8 +447,8 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
441
447
  token: string;
442
448
  clientSecret: string;
443
449
  }>;
444
- watchForChanges: boolean;
445
- watchForChangesStatus: "IDLE" | "WATCHING" | "ERROR";
450
+ watchMode: boolean;
451
+ watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
446
452
  externalDocs?: {
447
453
  url: string;
448
454
  description?: string | undefined;
@@ -468,6 +474,7 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
468
474
  components?: Record<string, unknown> | undefined;
469
475
  webhooks?: Record<string, unknown> | undefined;
470
476
  documentUrl?: string | undefined;
477
+ integration?: string | null | undefined;
471
478
  }, {
472
479
  type?: "collection" | undefined;
473
480
  uid?: string | undefined;
@@ -533,8 +540,9 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
533
540
  clientSecret?: string | undefined;
534
541
  }> | undefined;
535
542
  documentUrl?: string | undefined;
536
- watchForChanges?: boolean | undefined;
537
- watchForChangesStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
543
+ watchMode?: boolean | undefined;
544
+ integration?: string | null | undefined;
545
+ watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
538
546
  }>;
539
547
  export type Collection = z.infer<typeof collectionSchema>;
540
548
  export type CollectionPayload = z.input<typeof collectionSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAyCvB,eAAO,MAAM,wBAAwB;;IAEnC,qEAAqE;;IAErE,2FAA2F;;IAE3F,oCAAoC;;IAEpC,wDAAwD;;IAExD,gDAAgD;;IAEhD,8CAA8C;;IAE9C,gEAAgE;;IAEhE;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH,wGAAwG;;IAExG;;;;OAIG;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKH,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKH,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAnE3B;;;;;;OAMG;;;;;;;;;;;;IAGH,uBAAuB;;IAEvB,uBAAuB;;IAEvB,gDAAgD;;;;IAYhD,qEAAqE;;IAErE,2FAA2F;;IAE3F,oCAAoC;;IAEpC,wDAAwD;;IAExD,gDAAgD;;IAEhD,8CAA8C;;IAE9C,gEAAgE;;IAEhE;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH,wGAAwG;;IAExG;;;;OAIG;;IAEH,kFAAkF;;IAElF;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASJ,CAAA;AACD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
@@ -68,13 +68,15 @@ const extendedCollectionSchema = z.object({
68
68
  *
69
69
  * @remarks Only effective when `documentUrl` is set
70
70
  */
71
- watchForChanges: z.boolean().optional().default(false),
71
+ watchMode: z.boolean().optional().default(false),
72
+ /** Keeps track of which integration is associated with the specific collection */
73
+ integration: z.string().nullable().optional(),
72
74
  /**
73
75
  * Status of the watcher from above
74
76
  *
75
77
  * @defaults to idle for all collections, doesn't mean that it can watch for changes
76
78
  */
77
- watchForChangesStatus: z
79
+ watchModeStatus: z
78
80
  .enum(['IDLE', 'WATCHING', 'ERROR'])
79
81
  .optional()
80
82
  .default('IDLE'),
@@ -1 +1 @@
1
- {"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/request-examples.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,eAAO,MAAM,8BAA8B;;;;;;IAMzC,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUlF,CAAA;AAEF,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,8BAA8B,CACtC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,uEAQ7B,CAAA;AACV,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;YAjCnC,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDlF,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;gBAvD/B,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YAAlF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAlF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuElF,CAAA;AAEF,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAKxE,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB;;;;;;;;;;;;;;;EA8B1D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAiGhB"}
@@ -112,10 +112,17 @@ function createExampleFromRequest(request, name, server) {
112
112
  path: [],
113
113
  query: [],
114
114
  cookie: [],
115
+ // deprecated TODO: add zod transform to remove
115
116
  header: [],
117
+ headers: [],
116
118
  };
117
119
  // Populated the separated params
118
120
  request.parameters?.forEach((p) => parameters[p.in].push(createParamInstance(p)));
121
+ // TODO: add zod transform to remove header and only support headers
122
+ if (parameters.header.length > 0) {
123
+ parameters.headers = parameters.header;
124
+ parameters.header = [];
125
+ }
119
126
  // ---------------------------------------------------------------------------
120
127
  // Handle request body defaulting for various content type encodings
121
128
  const body = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Fetches an OpenAPI/Swagger specification from a given URL.
2
+ * Fetches an OpenAPI/Swagger document from a given URL.
3
3
  *
4
4
  * @throws an error if the fetch fails
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fetchSpecFromUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/fetchSpecFromUrl.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,EACd,QAAQ,UAAO,GACd,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
1
+ {"version":3,"file":"fetchSpecFromUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/fetchSpecFromUrl.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,EACd,QAAQ,UAAO,GACd,OAAO,CAAC,MAAM,CAAC,CAkCjB"}
@@ -1,4 +1,4 @@
1
- import { redirectToProxy } from './redirectToProxy.js';
1
+ import { fetchWithProxyFallback } from './fetchWithProxyFallback.js';
2
2
  import { formatJsonOrYamlString } from './parse.js';
3
3
 
4
4
  // Doesn’t work
@@ -6,7 +6,7 @@ const OLD_PROXY_URL = 'https://api.scalar.com/request-proxy';
6
6
  // Does work
7
7
  const NEW_PROXY_URL = 'https://proxy.scalar.com';
8
8
  /**
9
- * Fetches an OpenAPI/Swagger specification from a given URL.
9
+ * Fetches an OpenAPI/Swagger document from a given URL.
10
10
  *
11
11
  * @throws an error if the fetch fails
12
12
  */
@@ -16,21 +16,22 @@ async function fetchSpecFromUrl(url, proxy, beautify = true) {
16
16
  // eslint-disable-next-line no-param-reassign
17
17
  proxy = NEW_PROXY_URL;
18
18
  }
19
- // To use a proxy or not to use a proxy
20
- const response = await fetch(proxy ? redirectToProxy(proxy, url) : url);
21
- // Looks like the request failed
22
- if (response.status !== 200) {
23
- console.error(`[fetchSpecFromUrl] Failed to fetch the specification at ${url} (Status: ${response.status})`);
19
+ try {
20
+ const response = await fetchWithProxyFallback(url, proxy);
21
+ if (!response.ok) {
22
+ throw new Error(`Failed to fetch the OpenAPI document: ${url} (Status: ${response.status})`);
23
+ }
24
+ const text = await response.text();
25
+ // If it's JSON, make it pretty
26
+ return beautify ? formatJsonOrYamlString(text) : text;
27
+ }
28
+ catch (error) {
29
+ console.error(`[fetchSpecFromUrl] Failed to fetch the OpenAPI document at ${url}`, error);
24
30
  if (!proxy) {
25
- console.warn(`[fetchSpecFromUrl] Tried to fetch the specification (url: ${url}) without a proxy. Are the CORS headers configured to allow cross-domain requests? https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS`);
31
+ console.warn(`[fetchSpecFromUrl] Tried to fetch the OpenAPI document (${url}) without a proxy. Are the CORS headers configured to allow cross-domain requests? https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS`);
26
32
  }
27
- throw new Error(`Failed to fetch the specification (Status: ${response.status})`);
33
+ throw error;
28
34
  }
29
- // If it’s JSON, make it pretty
30
- if (beautify)
31
- return formatJsonOrYamlString(await response.text());
32
- else
33
- return await response.text();
34
35
  }
35
36
 
36
37
  export { fetchSpecFromUrl };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Fetches an OpenAPI document with a proxy fallback mechanism.
3
+ *
4
+ * If a proxy is provided and the URL requires it, it will first attempt to fetch using the proxy.
5
+ * If the proxy fetch fails or is not used, it will fall back to a direct fetch.
6
+ *
7
+ * Also handles cases where the input is a JSON object instead of a URL.
8
+ */
9
+ export declare function fetchWithProxyFallback(value: string, proxy?: string): Promise<Response>;
10
+ //# sourceMappingURL=fetchWithProxyFallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchWithProxyFallback.d.ts","sourceRoot":"","sources":["../../src/helpers/fetchWithProxyFallback.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,qBAsCzE"}
@@ -0,0 +1,46 @@
1
+ import { resolve } from '@scalar/import';
2
+ import { shouldUseProxy, redirectToProxy } from './redirectToProxy.js';
3
+
4
+ /**
5
+ * Fetches an OpenAPI document with a proxy fallback mechanism.
6
+ *
7
+ * If a proxy is provided and the URL requires it, it will first attempt to fetch using the proxy.
8
+ * If the proxy fetch fails or is not used, it will fall back to a direct fetch.
9
+ *
10
+ * Also handles cases where the input is a JSON object instead of a URL.
11
+ */
12
+ async function fetchWithProxyFallback(value, proxy) {
13
+ // Maybe it’s not an OpenAPI document URL, but we can still find the actual URL
14
+ const url = await resolve(value);
15
+ // If the value is an object, mock a fetch response with beautified JSON
16
+ if (typeof value === 'object' && value !== null) {
17
+ const json = JSON.stringify(value, null, 2);
18
+ return {
19
+ ok: true,
20
+ status: 200,
21
+ text: async () => json,
22
+ };
23
+ }
24
+ if (typeof url !== 'string') {
25
+ throw new Error(`[fetchWithProxyFallback] Can’t fetch URL: ${url}`);
26
+ }
27
+ const shouldTryProxy = shouldUseProxy(proxy, url);
28
+ const initialUrl = shouldTryProxy ? redirectToProxy(proxy, url) : url;
29
+ try {
30
+ const result = await fetch(initialUrl, { cache: 'no-cache' });
31
+ if (result.ok || !shouldTryProxy) {
32
+ return result;
33
+ }
34
+ // Retry without proxy if the initial request failed
35
+ return await fetch(url, { cache: 'no-cache' });
36
+ }
37
+ catch (error) {
38
+ if (shouldTryProxy) {
39
+ // If proxy failed, try without it
40
+ return await fetch(url, { cache: 'no-cache' });
41
+ }
42
+ throw error;
43
+ }
44
+ }
45
+
46
+ export { fetchWithProxyFallback };
@@ -1,21 +1,24 @@
1
1
  export * from './concatenateUrlAndPath.js';
2
2
  export * from './createHash.js';
3
3
  export * from './fetchSpecFromUrl.js';
4
+ export * from './fetchWithProxyFallback.js';
4
5
  export * from './findVariables.js';
5
6
  export * from './httpMethods.js';
6
7
  export * from './httpStatusCodes.js';
8
+ export * from './isLocalUrl.js';
9
+ export * from './isValidUrl.js';
7
10
  export * from './iterateTitle.js';
8
11
  export * from './local-storage.js';
12
+ export * from './makeUrlAbsolute.js';
9
13
  export * from './normalizeMimeType.js';
10
14
  export * from './normalizeMimeTypeObject.js';
11
15
  export * from './object.js';
12
16
  export * from './parse.js';
13
17
  export * from './prettyPrintJson.js';
14
18
  export * from './redirectToProxy.js';
19
+ export * from './regexHelpers.js';
15
20
  export * from './replaceVariables.js';
16
21
  export * from './schema-model.js';
17
22
  export * from './ssrState.js';
18
23
  export * from './string.js';
19
- export * from './isValidUrl.js';
20
- export * from './regexHelpers.js';
21
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
@@ -1,20 +1,23 @@
1
1
  export { concatenateUrlAndPath } from './concatenateUrlAndPath.js';
2
2
  export { createHash } from './createHash.js';
3
3
  export { fetchSpecFromUrl } from './fetchSpecFromUrl.js';
4
+ export { fetchWithProxyFallback } from './fetchWithProxyFallback.js';
4
5
  export { findVariables } from './findVariables.js';
5
6
  export { REQUEST_METHODS, canMethodHaveBody, getHttpMethodInfo } from './httpMethods.js';
6
7
  export { httpStatusCodes } from './httpStatusCodes.js';
8
+ export { isLocalUrl } from './isLocalUrl.js';
9
+ export { isValidUrl } from './isValidUrl.js';
7
10
  export { iterateTitle } from './iterateTitle.js';
8
11
  export { LS_KEYS } from './local-storage.js';
12
+ export { makeUrlAbsolute } from './makeUrlAbsolute.js';
9
13
  export { normalizeMimeType } from './normalizeMimeType.js';
10
14
  export { normalizeMimeTypeObject } from './normalizeMimeTypeObject.js';
11
15
  export { getObjectKeys, objectMerge } from './object.js';
12
16
  export { formatJsonOrYamlString, isJsonString, json, parseJsonOrYaml, transformToJson, yaml } from './parse.js';
13
17
  export { prettyPrintJson, replaceCircularDependencies } from './prettyPrintJson.js';
14
- export { isRelativePath, isRequestToLocalhost, redirectToProxy, shouldUseProxy } from './redirectToProxy.js';
18
+ export { isRelativePath, redirectToProxy, shouldUseProxy } from './redirectToProxy.js';
19
+ export { pathRegex, variableRegex } from './regexHelpers.js';
15
20
  export { replaceVariables } from './replaceVariables.js';
16
21
  export { schemaModel } from './schema-model.js';
17
22
  export { defaultStateFactory, ssrState } from './ssrState.js';
18
23
  export { camelToTitleWords, capitalize } from './string.js';
19
- export { isValidUrl } from './isValidUrl.js';
20
- export { pathRegex, variableRegex } from './regexHelpers.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Detect requests to localhost
3
+ */
4
+ export declare function isLocalUrl(url: string): boolean;
5
+ //# sourceMappingURL=isLocalUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isLocalUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/isLocalUrl.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,WAIrC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Detect requests to localhost
3
+ */
4
+ function isLocalUrl(url) {
5
+ const { hostname } = new URL(url);
6
+ const listOfLocalUrls = ['localhost', '127.0.0.1', '[::1]', '0.0.0.0'];
7
+ return listOfLocalUrls.includes(hostname);
8
+ }
9
+
10
+ export { isLocalUrl };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Pass an URL or a relative URL and get an absolute URL
3
+ */
4
+ export declare const makeUrlAbsolute: (url?: string) => string | undefined;
5
+ //# sourceMappingURL=makeUrlAbsolute.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Pass an URL or a relative URL and get an absolute URL
3
+ */
4
+ const makeUrlAbsolute = (url) => {
5
+ if (!url ||
6
+ url.startsWith('http://') ||
7
+ url.startsWith('https://') ||
8
+ typeof window === 'undefined')
9
+ return url;
10
+ const baseUrl = window.location.href;
11
+ // Remove any query parameters or hash from the base URL
12
+ const cleanBaseUrl = baseUrl.split('?')[0].split('#')[0];
13
+ // Ensure the base URL ends with a slash if it doesn’t already
14
+ const normalizedBaseUrl = cleanBaseUrl.endsWith('/')
15
+ ? cleanBaseUrl
16
+ : cleanBaseUrl + '/';
17
+ return new URL(url, normalizedBaseUrl).toString();
18
+ };
19
+
20
+ export { makeUrlAbsolute };
@@ -4,6 +4,4 @@ export declare function redirectToProxy(proxy?: string, url?: string): string;
4
4
  export declare const isRelativePath: (url: string) => boolean;
5
5
  /** Returns false for requests to localhost, relative URLs, if no proxy is defined … */
6
6
  export declare function shouldUseProxy(proxy?: string, url?: string): boolean;
7
- /** Detect requests to localhost */
8
- export declare function isRequestToLocalhost(url: string): boolean;
9
7
  //# sourceMappingURL=redirectToProxy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"redirectToProxy.d.ts","sourceRoot":"","sources":["../../src/helpers/redirectToProxy.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAepE;AAED,mEAAmE;AACnE,eAAO,MAAM,cAAc,QAAS,MAAM,YAA8B,CAAA;AAExE,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAWpE;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,WAI/C"}
1
+ {"version":3,"file":"redirectToProxy.d.ts","sourceRoot":"","sources":["../../src/helpers/redirectToProxy.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAepE;AAED,mEAAmE;AACnE,eAAO,MAAM,cAAc,QAAS,MAAM,YAA8B,CAAA;AAExE,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAWpE"}
@@ -1,3 +1,5 @@
1
+ import { isLocalUrl } from './isLocalUrl.js';
2
+
1
3
  /** Redirects the request to a proxy server with a given URL. */
2
4
  function redirectToProxy(proxy, url) {
3
5
  if (!shouldUseProxy(proxy, url)) {
@@ -22,15 +24,9 @@ function shouldUseProxy(proxy, url) {
22
24
  if (isRelativePath(url))
23
25
  return false;
24
26
  // Requests to localhost
25
- if (isRequestToLocalhost(url))
27
+ if (isLocalUrl(url))
26
28
  return false;
27
29
  return true;
28
30
  }
29
- /** Detect requests to localhost */
30
- function isRequestToLocalhost(url) {
31
- const { hostname } = new URL(url);
32
- const listOfLocalUrls = ['localhost', '127.0.0.1', '[::1]'];
33
- return listOfLocalUrls.includes(hostname);
34
- }
35
31
 
36
- export { isRelativePath, isRequestToLocalhost, redirectToProxy, shouldUseProxy };
32
+ export { isRelativePath, redirectToProxy, shouldUseProxy };
@@ -64,8 +64,8 @@ export declare const migrate_v_2_1_0: (data: Omit<v_0_0_0.Data, "folders">) => {
64
64
  }>;
65
65
  children: string[];
66
66
  'x-scalar-icon': string;
67
- watchForChanges: false;
68
- watchForChangesStatus: "IDLE";
67
+ watchMode: false;
68
+ watchModeStatus: "IDLE";
69
69
  }[];
70
70
  cookies: v_0_0_0.Cookie[];
71
71
  environments: {
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/migrations/v-2.1.0/migration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAInE,mCAAmC;AACnC,eAAO,MAAM,eAAe,SAA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;;;oBAOmB,CAAA;2BAAqC,CAAC;sBACnC,CAAC;wBACW,CAAC;oBACtB,CAAC;oBACR,CAAN;sBAAmC,CAAC;uBACf,CAAC;uBAChB,CAAA;uBAAoC,CAAC;wBAIvC,CADH;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAUU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA0Iyd,CAAC;;6BAA4E,CAAC;;;;;;;;;;CADljB,CAAA"}
@@ -118,8 +118,8 @@ const migrate_v_2_1_0 = (data) => {
118
118
  auth,
119
119
  'children': c.childUids || [],
120
120
  'x-scalar-icon': 'interface-content-folder',
121
- 'watchForChanges': false,
122
- 'watchForChangesStatus': 'IDLE',
121
+ 'watchMode': false,
122
+ 'watchModeStatus': 'IDLE',
123
123
  };
124
124
  });
125
125
  // Cookies
@@ -42,8 +42,8 @@ export declare function exportSpecFromWorkspace({ collection, requests, }: {
42
42
  token: string;
43
43
  clientSecret: string;
44
44
  }>;
45
- watchForChanges: boolean;
46
- watchForChangesStatus: "IDLE" | "WATCHING" | "ERROR";
45
+ watchMode: boolean;
46
+ watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
47
47
  externalDocs?: {
48
48
  url: string;
49
49
  description?: string | undefined;
@@ -69,5 +69,6 @@ export declare function exportSpecFromWorkspace({ collection, requests, }: {
69
69
  components?: Record<string, unknown> | undefined;
70
70
  webhooks?: Record<string, unknown> | undefined;
71
71
  documentUrl?: string | undefined;
72
+ integration?: string | null | undefined;
72
73
  };
73
74
  //# sourceMappingURL=export-spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"export-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/export-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,iBAAiB,CAAA;AAMxB,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA"}
1
+ {"version":3,"file":"export-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/export-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,iBAAiB,CAAA;AAMxB,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA"}
@@ -8,7 +8,7 @@ export declare const parseSchema: (spec: string | UnknownObject) => Promise<{
8
8
  schema: OpenAPIV3.Document | OpenAPIV3_1.Document;
9
9
  errors: import("@scalar/openapi-parser").ErrorObject[];
10
10
  }>;
11
- export type ImportSpecToWorkspaceArgs = Pick<CollectionPayload, 'documentUrl' | 'watchForChanges'> & Pick<ReferenceConfiguration, 'authentication'> & {
11
+ export type ImportSpecToWorkspaceArgs = Pick<CollectionPayload, 'documentUrl' | 'watchMode'> & Pick<ReferenceConfiguration, 'authentication'> & {
12
12
  /** Sets the preferred security scheme on the collection instead of the requests */
13
13
  setCollectionSecurity?: boolean;
14
14
  };
@@ -20,7 +20,7 @@ export type ImportSpecToWorkspaceArgs = Pick<CollectionPayload, 'documentUrl' |
20
20
  * created and used at various levels we will index via the uids to create
21
21
  * the relationships
22
22
  */
23
- export declare function importSpecToWorkspace(spec: string | UnknownObject, { authentication, documentUrl, setCollectionSecurity, watchForChanges, }?: ImportSpecToWorkspaceArgs): Promise<{
23
+ export declare function importSpecToWorkspace(spec: string | UnknownObject, { authentication, documentUrl, setCollectionSecurity, watchMode, }?: ImportSpecToWorkspaceArgs): Promise<{
24
24
  error: false;
25
25
  collection: Collection;
26
26
  requests: Request[];
@@ -1 +1 @@
1
- {"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/import-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,cAAc,EAGnB,KAAK,MAAM,EACX,KAAK,GAAG,EAOT,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,0BAA0B,CAAA;AAIjC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAkFxD,mFAAmF;AACnF,eAAO,MAAM,WAAW,SAAgB,MAAM,GAAG,aAAa;YAKjC,SAAS,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ;;EACrE,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,iBAAiB,EACjB,aAAa,GAAG,iBAAiB,CAClC,GACC,IAAI,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,GAAG;IAC/C,mFAAmF;IACnF,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAEH;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,GAAG,aAAa,EAC5B,EACE,cAAc,EACd,WAAW,EACX,qBAA6B,EAC7B,eAAuB,GACxB,GAAE,yBAA8B,GAChC,OAAO,CACN;IACE,KAAK,EAAE,KAAK,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,QAA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AAc,EACd,WAAW,EACX,qBAA6B,EAC7B,SAAiB,GAClB,GAAE,yBAA8B,GAChC,OAAO,CACN;IACE,KAAK,EAAE,KAAK,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,MAAM,EAAE,SAAS,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAA;IACjD,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,eAAe,EAAE,cAAc,EAAE,CAAA;CAClC,GACD;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAC5C,CA8QA"}
@@ -90,7 +90,7 @@ const parseSchema = async (spec) => {
90
90
  * created and used at various levels we will index via the uids to create
91
91
  * the relationships
92
92
  */
93
- async function importSpecToWorkspace(spec, { authentication, documentUrl, setCollectionSecurity = false, watchForChanges = false, } = {}) {
93
+ async function importSpecToWorkspace(spec, { authentication, documentUrl, setCollectionSecurity = false, watchMode = false, } = {}) {
94
94
  const { schema, errors } = await parseSchema(spec);
95
95
  const importWarnings = [...errors.map((e) => e.message)];
96
96
  if (!schema)
@@ -276,7 +276,7 @@ async function importSpecToWorkspace(spec, { authentication, documentUrl, setCol
276
276
  }
277
277
  const collection = collectionSchema.parse({
278
278
  ...schema,
279
- watchForChanges,
279
+ watchMode,
280
280
  documentUrl,
281
281
  auth,
282
282
  requests: requests.map((r) => r.uid),
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "specification",
17
17
  "yaml"
18
18
  ],
19
- "version": "0.2.61",
19
+ "version": "0.2.63",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -106,9 +106,10 @@
106
106
  "nanoid": "^5.0.7",
107
107
  "yaml": "^2.4.5",
108
108
  "zod": "^3.23.8",
109
+ "@scalar/import": "0.0.3",
109
110
  "@scalar/object-utils": "1.1.10",
111
+ "@scalar/themes": "0.9.44",
110
112
  "@scalar/types": "0.0.17",
111
- "@scalar/themes": "0.9.42",
112
113
  "@scalar/openapi-types": "0.1.4"
113
114
  },
114
115
  "devDependencies": {