@scalar/api-client 2.5.29 → 2.5.31

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 (63) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/analytics.d.ts +1 -36
  3. package/dist/analytics.d.ts.map +1 -1
  4. package/dist/analytics.js +7 -23
  5. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  6. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  7. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  8. package/dist/hooks/useAnalytics.d.ts +35 -0
  9. package/dist/hooks/useAnalytics.d.ts.map +1 -0
  10. package/dist/hooks/useAnalytics.js +11 -0
  11. package/dist/index.js +8 -9
  12. package/dist/layouts/App/create-api-client-app.d.ts +45 -78
  13. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  14. package/dist/layouts/App/create-api-client-app.js +20 -20
  15. package/dist/layouts/App/index.js +3 -4
  16. package/dist/layouts/Modal/create-api-client-modal.d.ts +90 -90
  17. package/dist/layouts/Web/create-api-client-web.d.ts +45 -78
  18. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  19. package/dist/layouts/Web/create-api-client-web.js +20 -20
  20. package/dist/layouts/Web/index.js +3 -4
  21. package/dist/libs/create-client.d.ts +45 -45
  22. package/dist/libs/hot-keys.d.ts +1 -1
  23. package/dist/store/collections.d.ts +4 -4
  24. package/dist/store/cookies.d.ts +4 -4
  25. package/dist/store/environment.d.ts +4 -4
  26. package/dist/store/request-example.d.ts +4 -4
  27. package/dist/store/requests.d.ts +4 -4
  28. package/dist/store/security-schemes.d.ts +16 -16
  29. package/dist/store/store.d.ts +45 -45
  30. package/dist/store/tags.d.ts +4 -4
  31. package/dist/store/workspace.d.ts +4 -4
  32. package/dist/style.css +1 -1
  33. package/dist/views/Request/RequestRoot.vue.js +2 -2
  34. package/dist/views/Request/RequestRoot.vue2.js +4 -4
  35. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +14 -1
  36. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  37. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +49 -47
  38. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +202 -1
  39. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  40. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  41. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +111 -103
  42. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +200 -1
  43. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  44. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  45. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +64 -44
  46. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +1 -1
  47. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  48. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +14 -1
  49. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  50. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +104 -121
  51. package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts +9 -0
  52. package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts.map +1 -0
  53. package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.js +28 -0
  54. package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.test.d.ts +2 -0
  55. package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.test.d.ts.map +1 -0
  56. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +3 -1
  57. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  58. package/dist/views/Request/RequestSection/RequestAuth/index.js +6 -4
  59. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  60. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  61. package/dist/views/Request/RequestSection/RequestSection.vue2.js +25 -24
  62. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  63. package/package.json +12 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.5.31
4
+
5
+ ### Patch Changes
6
+
7
+ - f8fc81c: fix: only allow deleting auth if not reaonly
8
+ - Updated dependencies [019a22a]
9
+ - @scalar/workspace-store@0.15.4
10
+ - @scalar/oas-utils@0.4.27
11
+ - @scalar/components@0.14.32
12
+ - @scalar/postman-to-openapi@0.3.30
13
+ - @scalar/use-codemirror@0.12.33
14
+
15
+ ## 2.5.30
16
+
17
+ ### Patch Changes
18
+
19
+ - c173063: feat: add authorized event to oauth2
20
+ - c173063: feat: add oauth2 actions slot
21
+ - Updated dependencies [821717b]
22
+ - Updated dependencies [2249fe3]
23
+ - @scalar/workspace-store@0.15.3
24
+ - @scalar/oas-utils@0.4.26
25
+ - @scalar/helpers@0.0.10
26
+ - @scalar/components@0.14.31
27
+ - @scalar/postman-to-openapi@0.3.29
28
+ - @scalar/import@0.4.22
29
+ - @scalar/object-utils@1.2.6
30
+ - @scalar/use-codemirror@0.12.32
31
+ - @scalar/openapi-parser@0.20.4
32
+
3
33
  ## 2.5.29
4
34
 
5
35
  ### Patch Changes
@@ -1,5 +1,4 @@
1
- /** Centralized method to control creation of analytics clients. */
2
- export declare function createAnalyticsClient(): {
1
+ export declare const analytics: {
3
2
  capture: <E extends "client-send-request" | "page-view">(event: E, ...[data]: import("zod").input<{
4
3
  readonly 'page-view': import("zod").ZodObject<{
5
4
  to: import("zod").ZodString;
@@ -32,38 +31,4 @@ export declare function createAnalyticsClient(): {
32
31
  readonly 'client-send-request': import("zod").ZodUndefined;
33
32
  }[E]>]) => Promise<void>;
34
33
  };
35
- /** Gets the correct analytics client based on the layout. */
36
- export declare function useAnalytics(): {
37
- capture: <E extends "client-send-request" | "page-view">(event: E, ...[data]: import("zod").input<{
38
- readonly 'page-view': import("zod").ZodObject<{
39
- to: import("zod").ZodString;
40
- from: import("zod").ZodString;
41
- hostname: import("zod").ZodString;
42
- }, "strip", import("zod").ZodTypeAny, {
43
- to: string;
44
- from: string;
45
- hostname: string;
46
- }, {
47
- to: string;
48
- from: string;
49
- hostname: string;
50
- }>;
51
- readonly 'client-send-request': import("zod").ZodUndefined;
52
- }[E]> extends undefined ? [] : [import("zod").input<{
53
- readonly 'page-view': import("zod").ZodObject<{
54
- to: import("zod").ZodString;
55
- from: import("zod").ZodString;
56
- hostname: import("zod").ZodString;
57
- }, "strip", import("zod").ZodTypeAny, {
58
- to: string;
59
- from: string;
60
- hostname: string;
61
- }, {
62
- to: string;
63
- from: string;
64
- hostname: string;
65
- }>;
66
- readonly 'client-send-request': import("zod").ZodUndefined;
67
- }[E]>]) => Promise<void>;
68
- } | undefined;
69
34
  //# sourceMappingURL=analytics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAOA,oEAAoE;AACpE,wBAAgB,qBAAqB;uEAQpC,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAHJ;AAED,6DAA6D;AAC7D,wBAAgB,YAAY;uEAA3B,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiBJ"}
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;uEAIuX,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADhZ,CAAA"}
package/dist/analytics.js CHANGED
@@ -1,25 +1,9 @@
1
- import { analyticsFactory as n } from "@scalar/analytics-client";
2
- import { useClientConfig as o } from "./hooks/useClientConfig.js";
3
- import { analytics as i } from "./layouts/Web/create-api-client-web.js";
4
- import { analytics as a } from "./layouts/App/create-api-client-app.js";
5
- import { useLayout as r } from "./hooks/useLayout.js";
6
- function y() {
7
- return n(
8
- "https://api.scalar.com",
9
- () => null
10
- // There is no auth to return.
11
- );
12
- }
13
- function f() {
14
- const { layout: t } = r();
15
- return o().value.telemetry ? {
16
- desktop: a,
17
- web: i,
18
- modal: void 0
19
- // There are currently no analytics for the modal layout.
20
- }[t] : void 0;
21
- }
1
+ import { analyticsFactory as a } from "@scalar/analytics-client";
2
+ const c = a(
3
+ "https://api.scalar.com",
4
+ () => null
5
+ // There is no auth to return.
6
+ );
22
7
  export {
23
- y as createAnalyticsClient,
24
- f as useAnalytics
8
+ c as analytics
25
9
  };
@@ -40,8 +40,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
40
40
  onInputFocus?: (() => any) | undefined;
41
41
  onInputBlur?: (() => any) | undefined;
42
42
  }>, {
43
- readOnly: boolean;
44
43
  required: boolean;
44
+ readOnly: boolean;
45
45
  lineWrapping: boolean;
46
46
  canAddCustomEnumValue: boolean;
47
47
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInput.vue"],"names":[],"mappings":"AAsMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAK/C,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,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AAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAiC7C,QAAA,MAAM,eAAe;;;;;;;;;;;cA5VN,OAAO;cAIP,OAAO;kBAQH,OAAO;2BATE,OAAO;6EAiWjC,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -4,9 +4,9 @@ type __VLS_Props = {
4
4
  isEditable?: boolean;
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
- change: (value: "head" | "delete" | "get" | "options" | "connect" | "patch" | "post" | "put" | "trace") => any;
7
+ change: (value: "delete" | "get" | "options" | "connect" | "head" | "patch" | "post" | "put" | "trace") => any;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onChange?: ((value: "head" | "delete" | "get" | "options" | "connect" | "patch" | "post" | "put" | "trace") => any) | undefined;
9
+ onChange?: ((value: "delete" | "get" | "options" | "connect" | "head" | "patch" | "post" | "put" | "trace") => any) | undefined;
10
10
  }>, {
11
11
  isEditable: boolean;
12
12
  isSquare: boolean;
@@ -0,0 +1,35 @@
1
+ /** Gets the correct analytics client based on the layout. */
2
+ export declare function useAnalytics(): {
3
+ capture: <E extends "client-send-request" | "page-view">(event: E, ...[data]: import("zod").input<{
4
+ readonly 'page-view': import("zod").ZodObject<{
5
+ to: import("zod").ZodString;
6
+ from: import("zod").ZodString;
7
+ hostname: import("zod").ZodString;
8
+ }, "strip", import("zod").ZodTypeAny, {
9
+ to: string;
10
+ from: string;
11
+ hostname: string;
12
+ }, {
13
+ to: string;
14
+ from: string;
15
+ hostname: string;
16
+ }>;
17
+ readonly 'client-send-request': import("zod").ZodUndefined;
18
+ }[E]> extends undefined ? [] : [import("zod").input<{
19
+ readonly 'page-view': import("zod").ZodObject<{
20
+ to: import("zod").ZodString;
21
+ from: import("zod").ZodString;
22
+ hostname: import("zod").ZodString;
23
+ }, "strip", import("zod").ZodTypeAny, {
24
+ to: string;
25
+ from: string;
26
+ hostname: string;
27
+ }, {
28
+ to: string;
29
+ from: string;
30
+ hostname: string;
31
+ }>;
32
+ readonly 'client-send-request': import("zod").ZodUndefined;
33
+ }[E]>]) => Promise<void>;
34
+ } | undefined;
35
+ //# sourceMappingURL=useAnalytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnalytics.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnalytics.ts"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,wBAAgB,YAAY;uEAW0G,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cADzI"}
@@ -0,0 +1,11 @@
1
+ import { analytics as t } from "../analytics.js";
2
+ import { useClientConfig as n } from "./useClientConfig.js";
3
+ import { useLayout as r } from "./useLayout.js";
4
+ function m() {
5
+ const { layout: o } = r();
6
+ if (!(!n().value.telemetry || o === "modal"))
7
+ return t;
8
+ }
9
+ export {
10
+ m as useAnalytics
11
+ };
package/dist/index.js CHANGED
@@ -1,20 +1,19 @@
1
1
  import "./style.css.js";
2
- import { useWorkspace as a } from "./store/store.js";
2
+ import { useWorkspace as p } from "./store/store.js";
3
3
  import { createModalRouter as i, createWebHashRouter as l, createWebHistoryRouter as c } from "./router.js";
4
4
  import { default as m } from "./layouts/App/ApiClientApp.vue.js";
5
5
  import "./layouts/App/ApiClientApp.vue2.js";
6
- import { default as s } from "./layouts/Modal/ApiClientModal.vue.js";
7
- import { createApiClientModal as d, createApiClientModalSync as u } from "./layouts/Modal/create-api-client-modal.js";
8
- import { analytics as C, createApiClientApp as M } from "./layouts/App/create-api-client-app.js";
6
+ import { default as d } from "./layouts/Modal/ApiClientModal.vue.js";
7
+ import { createApiClientModal as s, createApiClientModalSync as u } from "./layouts/Modal/create-api-client-modal.js";
8
+ import { createApiClientApp as C } from "./layouts/App/create-api-client-app.js";
9
9
  export {
10
10
  m as ApiClientApp,
11
- s as ApiClientModal,
12
- C as analytics,
13
- M as createApiClientApp,
14
- d as createApiClientModal,
11
+ d as ApiClientModal,
12
+ C as createApiClientApp,
13
+ s as createApiClientModal,
15
14
  u as createApiClientModalSync,
16
15
  i as createModalRouter,
17
16
  l as createWebHashRouter,
18
17
  c as createWebHistoryRouter,
19
- a as useWorkspace
18
+ p as useWorkspace
20
19
  };