@scalar/api-client 2.0.11 → 2.0.13

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 (44) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/App.vue.js +38 -27
  4. package/dist/Modal/api-client-modal.d.ts +2 -1
  5. package/dist/Modal/api-client-modal.d.ts.map +1 -1
  6. package/dist/Modal/api-client-modal.js +49 -40
  7. package/dist/components/ActionModal/ActionModalFolder.vue.js +37 -35
  8. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  9. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  10. package/dist/components/AddressBar/AddressBar.vue2.js +42 -42
  11. package/dist/components/AddressBar/AddressBarServer.vue.d.ts +1 -14
  12. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  13. package/dist/components/AddressBar/AddressBarServer.vue.js +50 -55
  14. package/dist/components/Sidebar/Sidebar.vue.js +5 -5
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +8 -9
  18. package/dist/libs/index.d.ts +1 -0
  19. package/dist/libs/index.d.ts.map +1 -1
  20. package/dist/libs/index.js +10 -8
  21. package/dist/libs/local-storage.d.ts +9 -0
  22. package/dist/libs/local-storage.d.ts.map +1 -0
  23. package/dist/libs/local-storage.js +36 -0
  24. package/dist/router.d.ts +2 -2
  25. package/dist/router.d.ts.map +1 -1
  26. package/dist/router.js +13 -13
  27. package/dist/store/workspace.d.ts +511 -269
  28. package/dist/store/workspace.d.ts.map +1 -1
  29. package/dist/store/workspace.js +213 -157
  30. package/dist/style.css +1 -1
  31. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  32. package/dist/views/Request/Request.vue.js +2 -2
  33. package/dist/views/Request/Request.vue2.js +93 -91
  34. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  35. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  36. package/dist/views/Request/RequestSection/RequestTable.vue2.js +28 -28
  37. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  38. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  39. package/dist/views/Request/RequestSidebarItem.vue2.js +25 -25
  40. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  41. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  42. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +56 -56
  43. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +11 -11
  44. package/package.json +4 -4
@@ -1,16 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
- workspace: any;
3
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
4
- workspace: any;
5
- }>>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
6
2
  export default _default;
7
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
- type __VLS_TypePropsToOption<T> = {
9
- [K in keyof T]-?: {} extends Pick<T, K> ? {
10
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
- } : {
12
- type: import('vue').PropType<T[K]>;
13
- required: true;
14
- };
15
- };
16
3
  //# sourceMappingURL=AddressBarServer.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";eAgIa,GAAG;;eAAH,GAAG;;AA0RhB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA6YA,wBAKG"}
@@ -1,21 +1,18 @@
1
- import { defineComponent as D, computed as h, resolveComponent as U, openBlock as a, createBlock as S, unref as r, withCtx as i, createElementBlock as m, Fragment as g, renderList as R, createElementVNode as u, normalizeClass as A, createVNode as d, toDisplayString as f, createCommentVNode as L, withModifiers as N } from "vue";
2
- import { useWorkspace as O } from "../../store/workspace.js";
3
- import { ScalarDropdown as V, ScalarDropdownItem as y, ScalarIcon as C, ScalarDropdownDivider as j } from "@scalar/components";
4
- const E = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, I = { class: "flex items-center justify-center h-4 w-4" }, M = /* @__PURE__ */ u("span", null, "Add Server", -1), F = {
1
+ import { defineComponent as D, computed as h, resolveComponent as U, unref as s, openBlock as u, createBlock as k, withCtx as a, createElementBlock as S, Fragment as A, renderList as L, createElementVNode as d, normalizeClass as R, createVNode as i, toDisplayString as f, withModifiers as j } from "vue";
2
+ import { useWorkspace as E } from "../../store/workspace.js";
3
+ import { ScalarDropdown as I, ScalarDropdownItem as g, ScalarIcon as C, ScalarDropdownDivider as M } from "@scalar/components";
4
+ const N = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, O = { class: "flex items-center justify-center h-4 w-4" }, V = /* @__PURE__ */ d("span", null, "Add Server", -1), F = {
5
5
  key: 1,
6
6
  class: "flex whitespace-nowrap items-center font-code lg:text-sm text-xs"
7
7
  }, H = /* @__PURE__ */ D({
8
8
  __name: "AddressBarServer",
9
- props: {
10
- workspace: {}
11
- },
12
9
  setup(W) {
13
- const { activeCollection: l, servers: v, collectionMutators: b } = O(), p = h(
10
+ const { activeCollection: l, isReadOnly: y, servers: x, collectionMutators: b } = E(), p = h(
14
11
  () => {
15
12
  var e, t;
16
13
  return (t = (e = l.value) == null ? void 0 : e.spec.serverUids) == null ? void 0 : t.map((n) => ({
17
14
  id: n,
18
- label: v[n].url
15
+ label: x[n].url
19
16
  }));
20
17
  }
21
18
  ), z = (e) => {
@@ -27,82 +24,80 @@ const E = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, I = { cl
27
24
  }, B = (e) => {
28
25
  var t;
29
26
  return ((t = l.value) == null ? void 0 : t.selectedServerUid) === e;
30
- }, x = h(() => {
27
+ }, m = h(() => {
31
28
  var c;
32
- const e = v[((c = l.value) == null ? void 0 : c.selectedServerUid) ?? ""], t = e == null ? void 0 : e.url, n = /{\s*([\w.-]+)\s*}/g;
33
- return t == null ? void 0 : t.replace(n, (s, w) => {
34
- var k, _;
35
- const o = (k = e == null ? void 0 : e.variables) == null ? void 0 : k[w];
36
- return (o == null ? void 0 : o.value) || (o == null ? void 0 : o.default) || ((_ = o == null ? void 0 : o.enum) == null ? void 0 : _[0]) || s;
29
+ const e = x[((c = l.value) == null ? void 0 : c.selectedServerUid) ?? ""], t = e == null ? void 0 : e.url, n = /{\s*([\w.-]+)\s*}/g;
30
+ return t == null ? void 0 : t.replace(n, (r, v) => {
31
+ var _, w;
32
+ const o = (_ = e == null ? void 0 : e.variables) == null ? void 0 : _[v];
33
+ return (o == null ? void 0 : o.value) || (o == null ? void 0 : o.default) || ((w = o == null ? void 0 : o.enum) == null ? void 0 : w[0]) || r;
37
34
  });
38
35
  });
39
36
  return (e, t) => {
40
37
  var c;
41
38
  const n = U("RouterLink");
42
- return p.value && !e.workspace.isReadOnly ? (a(), S(r(V), {
39
+ return p.value && !s(y) ? (u(), k(s(I), {
43
40
  key: 0,
44
41
  options: p.value,
45
42
  resize: "",
46
43
  teleport: "#scalar-client",
47
- value: (c = r(l)) == null ? void 0 : c.selectedServerUid
44
+ value: (c = s(l)) == null ? void 0 : c.selectedServerUid
48
45
  }, {
49
- items: i(() => [
50
- (a(!0), m(g, null, R(p.value, (s) => (a(), S(r(y), {
51
- key: s.id,
46
+ items: a(() => [
47
+ (u(!0), S(A, null, L(p.value, (r) => (u(), k(s(g), {
48
+ key: r.id,
52
49
  class: "flex !gap-1.5 group font-code text-xxs whitespace-nowrap text-ellipsis overflow-hidden",
53
- value: s.id,
54
- onClick: (w) => z(s.id)
50
+ value: r.id,
51
+ onClick: (v) => z(r.id)
55
52
  }, {
56
- default: i(() => [
57
- u("div", {
58
- class: A([
53
+ default: a(() => [
54
+ d("div", {
55
+ class: R([
59
56
  "flex size-4 items-center justify-center rounded-full p-[3px] group-hover:shadow-border",
60
- B(s.id) ? "bg-blue text-b-1" : "text-transparent"
57
+ B(r.id) ? "bg-blue text-b-1" : "text-transparent"
61
58
  ])
62
59
  }, [
63
- d(r(C), {
60
+ i(s(C), {
64
61
  class: "relative top-[0.5px] size-2.5 stroke-[1.75]",
65
62
  icon: "Checkmark"
66
63
  })
67
64
  ], 2),
68
- u("span", E, f(s.label), 1)
65
+ d("span", N, f(r.label), 1)
69
66
  ]),
70
67
  _: 2
71
68
  }, 1032, ["value", "onClick"]))), 128)),
72
- e.workspace.isReadOnly ? L("", !0) : (a(), m(g, { key: 0 }, [
73
- d(r(j)),
74
- d(r(y), null, {
75
- default: i(() => [
76
- d(n, {
77
- class: "font-code text-xxs flex items-center gap-1.5",
78
- to: "/servers"
79
- }, {
80
- default: i(() => [
81
- u("div", I, [
82
- d(r(C), {
83
- class: "h-2.5",
84
- icon: "Add"
85
- })
86
- ]),
87
- M
69
+ i(s(M)),
70
+ i(s(g), null, {
71
+ default: a(() => [
72
+ i(n, {
73
+ class: "font-code text-xxs flex items-center gap-1.5",
74
+ to: "/servers"
75
+ }, {
76
+ default: a(() => [
77
+ d("div", O, [
78
+ i(s(C), {
79
+ class: "h-2.5",
80
+ icon: "Add"
81
+ })
88
82
  ]),
89
- _: 1
90
- })
91
- ]),
92
- _: 1
93
- })
94
- ], 64))
83
+ V
84
+ ]),
85
+ _: 1
86
+ })
87
+ ]),
88
+ _: 1
89
+ })
95
90
  ]),
96
- default: i(() => [
97
- u("button", {
91
+ default: a(() => [
92
+ d("button", {
98
93
  class: "font-code lg:text-sm text-xs whitespace-nowrap border border-b-3 border-solid rounded px-1.5 text-c-2 z-[1]",
99
94
  type: "button",
100
- onClick: t[0] || (t[0] = N(() => {
95
+ onClick: t[0] || (t[0] = j(() => {
101
96
  }, ["stop"]))
102
- }, f(x.value), 1)
97
+ }, f(m.value), 1)
103
98
  ]),
104
99
  _: 1
105
- }, 8, ["options", "value"])) : (a(), m("div", F, f(x.value), 1));
100
+ }, 8, ["options", "value"])) : (u(), S("div", F, f(m.value), 1));
106
101
  };
107
102
  }
108
103
  });
@@ -1,14 +1,14 @@
1
- import { defineComponent as c, openBlock as s, createElementBlock as o, unref as l, createElementVNode as r, renderSlot as t, createCommentVNode as a } from "vue";
2
- import { useWorkspace as i } from "../../store/workspace.js";
1
+ import { defineComponent as l, openBlock as s, createElementBlock as o, unref as c, createElementVNode as r, renderSlot as t, createCommentVNode as i } from "vue";
2
+ import { useWorkspace as a } from "../../store/workspace.js";
3
3
  const d = { class: "w-sidebar relative flex flex-col border-r bg-b-1" }, m = {
4
4
  key: 0,
5
5
  class: "xl:min-h-header py-2.5 flex items-center border-b px-4 text-sm"
6
- }, _ = { class: "font-medium m-0 text-sm" }, p = { class: "custom-scroll sidebar-height" }, x = /* @__PURE__ */ c({
6
+ }, _ = { class: "font-medium m-0 text-sm" }, p = { class: "custom-scroll sidebar-height" }, x = /* @__PURE__ */ l({
7
7
  __name: "Sidebar",
8
8
  setup(f) {
9
- const { workspace: n } = i();
9
+ const { isReadOnly: n } = a();
10
10
  return (e, h) => (s(), o("aside", d, [
11
- l(n).isReadOnly ? a("", !0) : (s(), o("div", m, [
11
+ c(n) ? i("", !0) : (s(), o("div", m, [
12
12
  r("h2", _, [
13
13
  t(e.$slots, "title")
14
14
  ])
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default as ScalarClient } from './App.vue.js';
2
2
  export * from './Modal/index.js';
3
3
  export { useWorkspace } from './store/workspace.js';
4
- export { clientRoutes, clientRouter } from './router.js';
4
+ export { modalRouter } from './router.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
package/dist/index.js CHANGED
@@ -1,14 +1,13 @@
1
- import { default as o } from "./App.vue.js";
1
+ import { default as t } from "./App.vue.js";
2
2
  /* empty css */
3
3
  import { useWorkspace as l } from "./store/workspace.js";
4
- import { clientRouter as i, clientRoutes as f } from "./router.js";
5
- import { default as m } from "./Modal/ApiClientModal.vue.js";
6
- import { createScalarApiClient as s } from "./Modal/api-client-modal.js";
4
+ import { modalRouter as f } from "./router.js";
5
+ import { default as i } from "./Modal/ApiClientModal.vue.js";
6
+ import { createScalarApiClient as c } from "./Modal/api-client-modal.js";
7
7
  export {
8
- m as ApiClientModal,
9
- o as ScalarClient,
10
- i as clientRouter,
11
- f as clientRoutes,
12
- s as createScalarApiClient,
8
+ i as ApiClientModal,
9
+ t as ScalarClient,
10
+ c as createScalarApiClient,
11
+ f as modalRouter,
13
12
  l as useWorkspace
14
13
  };
@@ -1,5 +1,6 @@
1
1
  export * from './formatters.js';
2
2
  export * from './eventBusses/index.js';
3
+ export * from './local-storage.js';
3
4
  export * from './pathParams.js';
4
5
  export { sendRequest } from './sendRequest.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
@@ -1,11 +1,13 @@
1
- import { formatBytes as o, formatMs as t } from "./formatters.js";
2
- import { syncPathParamsFromURL as s } from "./pathParams.js";
3
- import { sendRequest as a } from "./sendRequest.js";
4
- import { executeRequestBus as p } from "./eventBusses/executeRequestBus.js";
1
+ import { formatBytes as r, formatMs as t } from "./formatters.js";
2
+ import { loadAllResources as m } from "./local-storage.js";
3
+ import { syncPathParamsFromURL as a } from "./pathParams.js";
4
+ import { sendRequest as p } from "./sendRequest.js";
5
+ import { executeRequestBus as R } from "./eventBusses/executeRequestBus.js";
5
6
  export {
6
- p as executeRequestBus,
7
- o as formatBytes,
7
+ R as executeRequestBus,
8
+ r as formatBytes,
8
9
  t as formatMs,
9
- a as sendRequest,
10
- s as syncPathParamsFromURL
10
+ m as loadAllResources,
11
+ p as sendRequest,
12
+ a as syncPathParamsFromURL
11
13
  };
@@ -0,0 +1,9 @@
1
+ import type { useWorkspace } from '../store/workspace.js';
2
+ /**
3
+ * Loads all resources from localStorage into mutators on app start
4
+ * We use the raw mutator.add here instead of the custom ones because we do NOT want any side effects
5
+ *
6
+ * Currently not working for workspace
7
+ */
8
+ export declare const loadAllResources: (mutators: ReturnType<typeof useWorkspace>, workspaceUid?: string) => void;
9
+ //# sourceMappingURL=local-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../src/libs/local-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAcrD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aACjB,UAAU,CAAC,OAAO,YAAY,CAAC,gCAoE1C,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { LS_KEYS as e } from "@scalar/object-utils/mutator-record";
2
+ const h = (t, o = "default") => {
3
+ const {
4
+ collectionMutators: s,
5
+ cookieMutators: a,
6
+ environmentMutators: r,
7
+ folderMutators: c,
8
+ requestExampleMutators: l,
9
+ requestMutators: E,
10
+ serverMutators: u,
11
+ securitySchemeMutators: S,
12
+ workspaceMutators: O
13
+ } = t;
14
+ Object.values(
15
+ JSON.parse(localStorage.getItem(e.COLLECTION) || "{}")
16
+ ).forEach(s.rawAdd), Object.values(
17
+ JSON.parse(localStorage.getItem(e.COOKIE) || "{}")
18
+ ).forEach(a.add), Object.values(
19
+ JSON.parse(localStorage.getItem(e.ENVIRONMENT) || "{}")
20
+ ).forEach(r.add), Object.values(
21
+ JSON.parse(localStorage.getItem(e.FOLDER) || "{}")
22
+ ).forEach(c.rawAdd), Object.values(
23
+ JSON.parse(localStorage.getItem(e.REQUEST_EXAMPLE) || "{}")
24
+ ).forEach(l.rawAdd), Object.values(
25
+ JSON.parse(localStorage.getItem(e.REQUEST) || "{}")
26
+ ).forEach(E.rawAdd), Object.values(
27
+ JSON.parse(localStorage.getItem(e.SERVER) || "{}")
28
+ ).forEach(u.rawAdd), Object.values(
29
+ JSON.parse(localStorage.getItem(e.SECURITY_SCHEME) || "{}")
30
+ ).forEach(S.add), Object.values(
31
+ JSON.parse(localStorage.getItem(e.WORKSPACE + o) || "{}")
32
+ ).forEach(O.add);
33
+ };
34
+ export {
35
+ h as loadAllResources
36
+ };
package/dist/router.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare enum PathId {
8
8
  Server = "server"
9
9
  }
10
10
  /** Routes required by the client modal */
11
- export declare const clientRoutes: ({
11
+ export declare const modalRoutes: ({
12
12
  path: string;
13
13
  redirect: string;
14
14
  component?: undefined;
@@ -19,7 +19,7 @@ export declare const clientRoutes: ({
19
19
  })[];
20
20
  export declare const router: import("vue-router").Router;
21
21
  /** Creates the in memory client router */
22
- export declare const clientRouter: import("vue-router").Router;
22
+ export declare const modalRouter: import("vue-router").Router;
23
23
  export declare const activeRouterParams: import("vue").ComputedRef<{
24
24
  collection: string;
25
25
  environment: string;
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAGA,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,0CAA0C;AAC1C,eAAO,MAAM,YAAY;;;;;;;;IAcxB,CAAA;AAyDD,eAAO,MAAM,MAAM,6BAGjB,CAAA;AAEF,0CAA0C;AAC1C,eAAO,MAAM,YAAY,6BAGvB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;EAyB7B,CAAA;AAEF,gGAAgG;AAChG,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,QAmBtC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAGA,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,0CAA0C;AAC1C,eAAO,MAAM,WAAW;;;;;;;;IAcvB,CAAA;AAyDD,eAAO,MAAM,MAAM,6BAGjB,CAAA;AAEF,0CAA0C;AAC1C,eAAO,MAAM,WAAW,6BAGtB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;EAyB7B,CAAA;AAEF,gGAAgG;AAChG,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,QAmBtC"}
package/dist/router.js CHANGED
@@ -1,5 +1,5 @@
1
- import { computed as i } from "vue";
2
- import { createRouter as c, createWebHistory as l, createMemoryHistory as m } from "vue-router";
1
+ import { computed as m } from "vue";
2
+ import { createRouter as c, createWebHistory as l, createMemoryHistory as i } from "vue-router";
3
3
  var u = /* @__PURE__ */ ((e) => (e.Request = "request", e.Example = "example", e.Cookies = "cookies", e.Collection = "collection", e.Schema = "schema", e.Environment = "environment", e.Server = "server", e))(u || {});
4
4
  const s = [
5
5
  { path: "/", redirect: "/request/default" },
@@ -71,10 +71,10 @@ const s = [
71
71
  ], t = c({
72
72
  history: l(),
73
73
  routes: p
74
- }), a = c({
75
- history: m(),
74
+ }), n = c({
75
+ history: i(),
76
76
  routes: s
77
- }), f = i(() => {
77
+ }), d = m(() => {
78
78
  const e = {
79
79
  collection: "default",
80
80
  environment: "default",
@@ -83,15 +83,15 @@ const s = [
83
83
  schema: "default",
84
84
  cookies: "default",
85
85
  server: "default"
86
- }, o = a.currentRoute.value.matched.length ? a.currentRoute.value : t.currentRoute.value;
86
+ }, o = n.currentRoute.value.matched.length ? n.currentRoute.value : t.currentRoute.value;
87
87
  return o && Object.values(u).forEach((r) => {
88
88
  o.params[r] && (e[r] = o.params[r]);
89
89
  }), e;
90
90
  });
91
- function d(e, o) {
92
- var r, n;
91
+ function f(e, o) {
92
+ var r, a;
93
93
  t.currentRoute.value && // If the item is missing then we know the UID is no longer in use and redirect to the default
94
- !o && ((r = t.currentRoute.value) != null && r.params[e]) && ((n = t.currentRoute.value) == null ? void 0 : n.params[e]) !== "default" && // We only redirect if the key is missing for the matching route
94
+ !o && ((r = t.currentRoute.value) != null && r.params[e]) && ((a = t.currentRoute.value) == null ? void 0 : a.params[e]) !== "default" && // We only redirect if the key is missing for the matching route
95
95
  t.currentRoute.value.path.includes(e) && t.push({
96
96
  params: {
97
97
  ...t.currentRoute.value.params,
@@ -101,9 +101,9 @@ function d(e, o) {
101
101
  }
102
102
  export {
103
103
  u as PathId,
104
- f as activeRouterParams,
105
- a as clientRouter,
106
- s as clientRoutes,
107
- d as fallbackMissingParams,
104
+ d as activeRouterParams,
105
+ f as fallbackMissingParams,
106
+ n as modalRouter,
107
+ s as modalRoutes,
108
108
  t as router
109
109
  };