@scalar/api-reference 1.25.63 → 1.25.65

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 (49) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/browser/standalone.js +19184 -19124
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  5. package/dist/components/Anchor/Anchor.vue.js +2 -2
  6. package/dist/components/Anchor/Anchor.vue2.js +4 -4
  7. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReference.vue.js +59 -61
  9. package/dist/components/Content/Operation/OperationAccordion.vue.js +2 -2
  10. package/dist/components/Content/Operation/OperationAccordion.vue2.js +18 -18
  11. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +7 -7
  12. package/dist/features/ApiClientModal/ApiClientModal.vue.js +17 -17
  13. package/dist/features/ApiClientModal/useApiClient.d.ts +634 -302
  14. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  15. package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -1
  16. package/dist/features/BaseUrl/ServerUrlSelect.vue.js +4 -4
  17. package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +4 -5
  18. package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +1 -1
  19. package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +4 -4
  20. package/dist/features/BaseUrl/ServerVariablesSelect.vue2.js +27 -23
  21. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  22. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  23. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +36 -35
  24. package/dist/features/ExampleResponses/ExampleResponses.vue.js +3 -3
  25. package/dist/features/ExampleResponses/ExampleResponses.vue2.js +14 -14
  26. package/dist/helpers/getApiClientRequest.js +19 -19
  27. package/dist/helpers/getExampleCode.d.ts.map +1 -1
  28. package/dist/helpers/getExampleCode.js +16 -14
  29. package/dist/hooks/index.d.ts +0 -2
  30. package/dist/hooks/index.d.ts.map +1 -1
  31. package/dist/hooks/useReactiveSpec.d.ts +7 -7
  32. package/dist/index.js +33 -37
  33. package/dist/legacy/components/SecurityScheme.vue.js +2 -2
  34. package/dist/legacy/components/SecurityScheme.vue2.js +8 -8
  35. package/dist/legacy/helpers/getUrlFromServerState.d.ts +4 -1
  36. package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -1
  37. package/dist/legacy/helpers/getUrlFromServerState.js +15 -6
  38. package/dist/legacy/helpers/prepareClientRequestConfig.d.ts +1 -1
  39. package/dist/legacy/stores/useOpenApiStore.d.ts +5 -5
  40. package/dist/legacy/stores/useServerStore.d.ts.map +1 -1
  41. package/dist/legacy/stores/useServerStore.js +47 -36
  42. package/dist/style.css +1 -1
  43. package/package.json +8 -7
  44. package/dist/hooks/useClipboard.d.ts +0 -4
  45. package/dist/hooks/useClipboard.d.ts.map +0 -1
  46. package/dist/hooks/useClipboard.js +0 -14
  47. package/dist/hooks/useDarkModeState.d.ts +0 -7
  48. package/dist/hooks/useDarkModeState.d.ts.map +0 -1
  49. package/dist/hooks/useDarkModeState.js +0 -31
@@ -1,41 +1,41 @@
1
- import { getRequestFromOperation as n, getParametersFromOperation as d } from "@scalar/oas-utils/spec-getters";
2
- import { getHarRequest as f } from "./getHarRequest.js";
1
+ import { getRequestFromOperation as a, getParametersFromOperation as p } from "@scalar/oas-utils/spec-getters";
2
+ import { getHarRequest as q } from "./getHarRequest.js";
3
3
  import { getRequestFromAuthentication as c } from "../legacy/helpers/getRequestFromAuthentication.js";
4
- import { getUrlFromServerState as s } from "../legacy/helpers/getUrlFromServerState.js";
4
+ import { getUrlFromServerState as n } from "../legacy/helpers/getUrlFromServerState.js";
5
5
  function O({
6
6
  serverState: t,
7
7
  authenticationState: o,
8
8
  operation: e,
9
- globalSecurity: l
9
+ globalSecurity: d
10
10
  }) {
11
- var u, a;
12
- const r = f(
11
+ var m, u;
12
+ const r = q(
13
13
  {
14
- url: s(t)
14
+ url: n(t).modifiedUrl
15
15
  },
16
- n(e, { requiredOnly: !1 }),
16
+ a(e, { requiredOnly: !1 }),
17
17
  // Only generate authentication parameters if an authentication state is passed.
18
18
  o ? c(
19
19
  o,
20
- ((u = e.information) == null ? void 0 : u.security) ?? l ?? []
20
+ ((m = e.information) == null ? void 0 : m.security) ?? d ?? []
21
21
  ) : {}
22
- ), p = n(e, {
22
+ ), l = a(e, {
23
23
  requiredOnly: !1
24
- }), q = d(e, "path", !1);
24
+ }), f = p(e, "path", !1);
25
25
  return {
26
26
  id: e.operationId,
27
27
  name: e.name,
28
28
  type: r.method,
29
- path: p.path ?? "",
30
- variables: q,
31
- cookies: i(r.cookies),
32
- query: r.queryString.map((m) => ({ ...m, enabled: m.required ?? !0 })),
33
- headers: i(r.headers),
34
- url: s(t) ?? "",
35
- body: (a = r.postData) == null ? void 0 : a.text
29
+ path: l.path ?? "",
30
+ variables: f,
31
+ cookies: s(r.cookies),
32
+ query: r.queryString.map((i) => ({ ...i, enabled: i.required ?? !0 })),
33
+ headers: s(r.headers),
34
+ url: n(t).modifiedUrl ?? "",
35
+ body: (u = r.postData) == null ? void 0 : u.text
36
36
  };
37
37
  }
38
- function i(t) {
38
+ function s(t) {
39
39
  return (t ?? []).map((o) => ({ ...o, enabled: !0 }));
40
40
  }
41
41
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,mBAoCjB"}
1
+ {"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,mBAyCjB"}
@@ -1,30 +1,32 @@
1
- import { snippetz as i } from "@scalar/snippetz";
1
+ import { snippetz as r } from "@scalar/snippetz";
2
2
  import { HTTPSnippet as s } from "httpsnippet-lite";
3
- async function m(n, e, t) {
4
- const r = e;
5
- if (i().hasPlugin(r, t))
6
- return i().print(
7
- e,
3
+ async function f(e, t, p) {
4
+ const o = t;
5
+ if (r().hasPlugin(o, p))
6
+ return r().print(
8
7
  t,
9
- n
8
+ p,
9
+ e
10
10
  );
11
+ if (e.url.startsWith("__"))
12
+ return e.url;
11
13
  try {
12
- const p = e == null ? void 0 : e.replace(
14
+ const n = t == null ? void 0 : t.replace(
13
15
  "js",
14
16
  "javascript"
15
- ), c = t, o = await new s(n).convert(
16
- p,
17
+ ), c = p, i = await new s(e).convert(
18
+ n,
17
19
  c
18
20
  );
19
- if (typeof o == "string") return o;
20
- } catch (p) {
21
+ if (typeof i == "string") return i;
22
+ } catch (n) {
21
23
  console.error(
22
24
  "[getExampleCode] Failed to generate example code with httpsnippet-lite:",
23
- p
25
+ n
24
26
  );
25
27
  }
26
28
  return "";
27
29
  }
28
30
  export {
29
- m as getExampleCode
31
+ f as getExampleCode
30
32
  };
@@ -1,6 +1,4 @@
1
- export * from './useClipboard.js';
2
1
  export * from './useClientStore.js';
3
- export * from './useDarkModeState.js';
4
2
  export * from './useDeprecationWarnings.js';
5
3
  export * from './useNavState.js';
6
4
  export * from './useOperation.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
@@ -38,11 +38,11 @@ export declare function useReactiveSpec({ specConfig, proxy, }: {
38
38
  default?: any;
39
39
  format?: string | undefined;
40
40
  description?: string | undefined;
41
- properties?: Record<string, import("@scalar/types/legacy").Schema> | undefined;
41
+ properties?: Record<string, import("@scalar/types").Schema> | undefined;
42
42
  } | undefined;
43
43
  example?: any;
44
44
  examples?: (Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>) | undefined;
45
- content?: import("@scalar/types/legacy").RequestBodyMimeTypes | undefined;
45
+ content?: import("@scalar/types").RequestBodyMimeTypes | undefined;
46
46
  headers?: {
47
47
  [key: string]: import("@scalar/openapi-types").OpenAPI.HeaderObject;
48
48
  } | undefined;
@@ -52,7 +52,7 @@ export declare function useReactiveSpec({ specConfig, proxy, }: {
52
52
  requestBody?: {
53
53
  description?: string | undefined;
54
54
  required?: boolean | undefined;
55
- content?: import("@scalar/types/legacy").RequestBodyMimeTypes | undefined;
55
+ content?: import("@scalar/types").RequestBodyMimeTypes | undefined;
56
56
  } | undefined;
57
57
  summary?: string | undefined;
58
58
  tags?: string[] | undefined;
@@ -90,11 +90,11 @@ export declare function useReactiveSpec({ specConfig, proxy, }: {
90
90
  default?: any;
91
91
  format?: string | undefined;
92
92
  description?: string | undefined;
93
- properties?: Record<string, import("@scalar/types/legacy").Schema> | undefined;
93
+ properties?: Record<string, import("@scalar/types").Schema> | undefined;
94
94
  } | undefined;
95
95
  example?: any;
96
96
  examples?: (Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>) | undefined;
97
- content?: import("@scalar/types/legacy").RequestBodyMimeTypes | undefined;
97
+ content?: import("@scalar/types").RequestBodyMimeTypes | undefined;
98
98
  headers?: {
99
99
  [key: string]: import("@scalar/openapi-types").OpenAPI.HeaderObject;
100
100
  } | undefined;
@@ -205,8 +205,8 @@ export declare function useReactiveSpec({ specConfig, proxy, }: {
205
205
  callbacks?: Record<string, import("@scalar/openapi-types").OpenAPIV3_1.ReferenceObject | import("@scalar/openapi-types").OpenAPIV3_1.CallbackObject> | undefined;
206
206
  pathItems?: Record<string, import("@scalar/openapi-types").OpenAPIV3_1.ReferenceObject | import("@scalar/openapi-types").OpenAPIV3_1.PathItemObject> | undefined;
207
207
  } | undefined;
208
- webhooks?: import("@scalar/types/legacy").Webhooks | undefined;
209
- definitions?: import("@scalar/types/legacy").Definitions | undefined;
208
+ webhooks?: import("@scalar/types").Webhooks | undefined;
209
+ definitions?: import("@scalar/types").Definitions | undefined;
210
210
  swagger?: import("@scalar/openapi-types").OpenAPIV2.Document["swagger"];
211
211
  openapi?: import("@scalar/openapi-types").OpenAPIV3.Document["openapi"] | import("@scalar/openapi-types").OpenAPIV3_1.Document["openapi"];
212
212
  'x-tagGroups'?: {