@scalar/api-client 2.13.0 → 2.14.1

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 (30) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/libs/string-template.d.ts +2 -0
  3. package/dist/libs/string-template.d.ts.map +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +33 -0
  6. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -0
  7. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +18 -0
  8. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -0
  9. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts +7 -0
  10. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts.map +1 -0
  11. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +8 -0
  12. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +1 -0
  13. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +4 -0
  14. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -0
  15. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  16. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  17. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +10 -9
  18. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
  19. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  20. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +90 -75
  21. package/dist/v2/features/operation/Operation.vue.js +1 -1
  22. package/dist/v2/helpers/drag-handle-factory.d.ts.map +1 -1
  23. package/dist/v2/helpers/drag-handle-factory.js +72 -71
  24. package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -1
  25. package/dist/v2/hooks/use-sidebar-state.js +23 -19
  26. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  27. package/dist/views/Request/libs/oauth2.d.ts +2 -2
  28. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  29. package/dist/views/Request/libs/oauth2.js +66 -53
  30. package/package.json +19 -19
@@ -0,0 +1,33 @@
1
+ import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
2
+ import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ /**
4
+ * Converts the parameters into a set of headers, cookies and url params while
5
+ * replacing environment variables and extracting example values. Also builds up a record of the path
6
+ * parameters which can then be used to replace variables in the path.
7
+ * Also handles both content based and schema based parameters.
8
+ *
9
+ * @param parameters - Unfiltered parameters
10
+ * @param env - Environment variables flattened into a key-value object
11
+ * @param exampleKey - The key of the current example
12
+ * @param contentType - Content type for content based parameters
13
+ * @returns A set of headers, cookies and url params
14
+ */
15
+ export declare const buildRequestParameters: (
16
+ /** All parameters */
17
+ parameters?: ParameterObject[],
18
+ /** Environment variables flattened into a key-value object */
19
+ env?: Record<string, string>,
20
+ /** The key of the current example */
21
+ exampleKey?: string,
22
+ /**
23
+ * Content type for content based parameters
24
+ *
25
+ * @see https://spec.openapis.org/oas/latest.html#fixed-fields-for-use-with-content
26
+ */
27
+ contentType?: string) => {
28
+ cookies: XScalarCookie[];
29
+ headers: Record<string, string>;
30
+ pathVariables: Record<string, string>;
31
+ urlParams: URLSearchParams;
32
+ };
33
+ //# sourceMappingURL=build-request-parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-request-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-parameters.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;AACjC,qBAAqB;AACrB,aAAY,eAAe,EAAO;AAClC,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,aAAY,MAAkB;AAC9B;;;;GAIG;AACH,cAAa,MAA2B,KACvC;IACD,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,SAAS,EAAE,eAAe,CAAA;CAkFzB,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
2
+ import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ /**
4
+ * Generates the headers, cookies and query params for selected security schemes
5
+ * In the future we can add customization for where the security is applied
6
+ */
7
+ export declare const buildRequestSecurity: (
8
+ /** Applicable security schemes */
9
+ securitySchemes?: SecuritySchemeObject[],
10
+ /** Environment variables flattened into a key-value object */
11
+ env?: Record<string, string>,
12
+ /** Include this parameter to set the placeholder for empty tokens */
13
+ emptyTokenPlaceholder?: string) => {
14
+ headers: Record<string, string>;
15
+ cookies: XScalarCookie[];
16
+ urlParams: URLSearchParams;
17
+ };
18
+ //# sourceMappingURL=build-request-security.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-request-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-security.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAE5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAGxG;;;GAGG;AACH,eAAO,MAAM,oBAAoB;AAC/B,kCAAkC;AAClC,kBAAiB,oBAAoB,EAAO;AAC5C,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qEAAqE;AACrE,8BAA0B,KACzB;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAmDzF,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Decode the buffer according to its content-type
3
+ *
4
+ * @returns The decoded string or Blob
5
+ */
6
+ export declare const decodeBuffer: (buffer: ArrayBuffer, contentType: string) => string | Blob;
7
+ //# sourceMappingURL=decode-buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode-buffer.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/decode-buffer.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,WAAW,EAAE,aAAa,MAAM,KAAG,MAAM,GAAG,IAWhF,CAAA"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Gets the delimiter for the given parameter style
3
+ *
4
+ * @param style - The style of the parameter
5
+ * @returns The delimiter for the given style
6
+ */
7
+ export declare const getDelimiter: (style: string) => string;
8
+ //# sourceMappingURL=get-delimiter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-delimiter.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-delimiter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAa5C,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ /** Grabs the example from both schema based and content based parameters */
3
+ export declare const getExample: (param: ParameterObject, exampleKey: string, contentType: string) => import("@scalar/workspace-store/schemas/v3.1/strict/example").ExampleObject | undefined;
4
+ //# sourceMappingURL=get-example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-example.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-example.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG,4EAA4E;AAC5E,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,EAAE,YAAY,MAAM,EAAE,aAAa,MAAM,4FAQzF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBody.vue"],"names":[],"mappings":"AAuVA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAgBrG,KAAK,WAAW,GAAG;IACjB,mBAAmB;IACnB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,2BAA2B;IAC3B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;eAI4C,MAAM;;;gBAI7B,MAAM,GAAG,IAAI;qBAAe,MAAM;;;cAM7C,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;qBACxC,MAAM;;;eAMZ,MAAM;cACP,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;SAAE,CAAC;qBAC9C,MAAM;;;eAGiB,MAAM;qBAAe,MAAM;;;;eAtBvB,MAAM;;;gBAI7B,MAAM,GAAG,IAAI;qBAAe,MAAM;;;cAM7C,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;qBACxC,MAAM;;;eAMZ,MAAM;cACP,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;SAAE,CAAC;qBAC9C,MAAM;;;eAGiB,MAAM;qBAAe,MAAM;;;AAyjBrE,wBAOG"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBody.vue"],"names":[],"mappings":"AAwVA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAgBrG,KAAK,WAAW,GAAG;IACjB,mBAAmB;IACnB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,2BAA2B;IAC3B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;eAI4C,MAAM;;;gBAI7B,MAAM,GAAG,IAAI;qBAAe,MAAM;;;cAM7C,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;qBACxC,MAAM;;;eAMZ,MAAM;cACP,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;SAAE,CAAC;qBAC9C,MAAM;;;eAGiB,MAAM;qBAAe,MAAM;;;;eAtBvB,MAAM;;;gBAI7B,MAAM,GAAG,IAAI;qBAAe,MAAM;;;cAM7C,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;qBACxC,MAAM;;;eAMZ,MAAM;cACP,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;SAAE,CAAC;qBAC9C,MAAM;;;eAGiB,MAAM;qBAAe,MAAM;;;AA6jBrE,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestBody.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0d3254bf"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1b70fdaa"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as D, computed as s, createBlock as v, openBlock as i, unref as n, withCtx as u, createVNode as d, createElementVNode as f, toDisplayString as c, createElementBlock as w, Fragment as q, createTextVNode as g } from "vue";
1
+ import { defineComponent as D, computed as m, createBlock as v, openBlock as i, unref as n, withCtx as u, createVNode as d, createElementVNode as f, toDisplayString as c, createElementBlock as w, Fragment as q, createTextVNode as g } from "vue";
2
2
  import { ScalarListbox as O, ScalarButton as x, ScalarIcon as k } from "@scalar/components";
3
3
  import { unpackProxyObject as B } from "@scalar/workspace-store/helpers/unpack-proxy";
4
4
  import F from "./RequestTable.vue.js";
@@ -25,7 +25,7 @@ const K = {
25
25
  environment: {}
26
26
  },
27
27
  emits: ["update:contentType", "update:value", "add:formRow", "update:formRow", "delete:fromRow"],
28
- setup(m, { emit: U }) {
28
+ setup(s, { emit: U }) {
29
29
  const a = U, V = {
30
30
  "application/json": "json",
31
31
  "application/xml": "xml",
@@ -40,10 +40,10 @@ const K = {
40
40
  "application/edn": "EDN",
41
41
  other: "Other",
42
42
  none: "None"
43
- }, o = s(() => m.requestBody?.["x-scalar-selected-content-type"]?.[m.exampleKey] ?? Object.keys(m.requestBody?.content ?? {})[0] ?? "other"), y = Object.entries(j).map(([l, e]) => ({
43
+ }, o = m(() => s.requestBody?.["x-scalar-selected-content-type"]?.[s.exampleKey] ?? Object.keys(s.requestBody?.content ?? {})[0] ?? "other"), y = Object.entries(j).map(([l, e]) => ({
44
44
  id: l,
45
45
  label: e
46
- })), b = s({
46
+ })), b = m({
47
47
  get: () => y.find(
48
48
  (e) => e.id === o.value
49
49
  ) ?? y.at(-1),
@@ -62,25 +62,26 @@ const K = {
62
62
  });
63
63
  e();
64
64
  }
65
- const p = s(
66
- () => m.requestBody && S(m.requestBody, o.value, m.exampleKey)
67
- ), C = s(() => {
65
+ const p = m(
66
+ () => s.requestBody && S(s.requestBody, o.value, s.exampleKey)
67
+ ), C = m(() => {
68
68
  if (!p.value)
69
69
  return "";
70
70
  const l = p.value.value;
71
71
  return typeof l == "string" ? l : JSON.stringify(l, null, 2);
72
- }), T = s(() => p.value ? Array.isArray(p.value.value) ? p.value.value : [] : []);
72
+ }), T = m(() => p.value ? Array.isArray(p.value.value) ? p.value.value : [] : []);
73
73
  return (l, e) => (i(), v(n(A), null, {
74
74
  title: u(() => [
75
75
  g(c(l.title), 1)
76
76
  ]),
77
77
  default: u(() => [
78
78
  d(n(E), {
79
+ class: "border-b",
79
80
  columns: [""],
80
81
  presentational: ""
81
82
  }, {
82
83
  default: u(() => [
83
- d(n(L), { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
84
+ d(n(L), { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between border-r-0 !p-0" }, {
84
85
  default: u(() => [
85
86
  d(n(O), {
86
87
  modelValue: b.value,
@@ -25,10 +25,10 @@ proxyUrl?: string) => Promise<ErrorResponse<string>>;
25
25
  * Makes the BE authorization call to grab the token server to server
26
26
  * Used for clientCredentials and authorizationCode
27
27
  */
28
- export declare const authorizeServers: (flows: NonImplicitFlow, type: keyof NonImplicitFlow, scopes: string, { code, pkce, proxyUrl, }?: {
28
+ export declare const authorizeServers: (flows: NonImplicitFlow, type: keyof NonImplicitFlow, scopes: string, { code, pkce, proxyUrl, }: {
29
29
  code?: string;
30
30
  pkce?: PKCEState | null;
31
31
  proxyUrl?: string | undefined;
32
- }) => Promise<ErrorResponse<string>>;
32
+ } | undefined, activeServer: ServerObject | undefined) => Promise<ErrorResponse<string>>;
33
33
  export {};
34
34
  //# sourceMappingURL=oauth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/oauth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGlH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,qDAAqD;AACrD,KAAK,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;AAEzD,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAgBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAU,UAAU,MAAM,EAAE,UAAU,SAAS,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAkB3G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,gBAAgB,EACvB,MAAM,MAAM,gBAAgB,EAC5B,gBAAgB,MAAM,EAAE;AACxB,wEAAwE;AACxE,cAAc,YAAY,GAAG,SAAS;AACtC,kCAAkC;AAClC,WAAW,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAkK/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,eAAe,EACtB,MAAM,MAAM,eAAe,EAC3B,QAAQ,MAAM,EACd,4BAIG;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB,KACL,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA8F/B,CAAA"}
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/oauth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGlH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,qDAAqD;AACrD,KAAK,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;AAEzD,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAgBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAU,UAAU,MAAM,EAAE,UAAU,SAAS,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAkB3G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,gBAAgB,EACvB,MAAM,MAAM,gBAAgB,EAC5B,gBAAgB,MAAM,EAAE;AACxB,wEAAwE;AACxE,cAAc,YAAY,GAAG,SAAS;AACtC,kCAAkC;AAClC,WAAW,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAmL/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,eAAe,EACtB,MAAM,MAAM,eAAe,EAC3B,QAAQ,MAAM,EACd,2BAIG;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,YAAK,EACN,cAAc,YAAY,GAAG,SAAS,KACrC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA+F/B,CAAA"}
@@ -1,113 +1,128 @@
1
- import { shouldUseProxy as U } from "@scalar/oas-utils/helpers";
2
- import { encode as A, fromUint8Array as S } from "js-base64";
3
- const C = () => {
4
- const a = new Uint8Array(32);
5
- return crypto.getRandomValues(a), S(a, !0);
6
- }, E = async (a, t) => {
1
+ import { makeUrlAbsolute as A } from "@scalar/helpers/url/make-url-absolute";
2
+ import { shouldUseProxy as b } from "@scalar/oas-utils/helpers";
3
+ import { encode as C, fromUint8Array as S } from "js-base64";
4
+ const E = () => {
5
+ const r = new Uint8Array(32);
6
+ return crypto.getRandomValues(r), S(r, !0);
7
+ }, z = async (r, t) => {
7
8
  if (t === "plain")
8
- return a;
9
+ return r;
9
10
  if (typeof crypto?.subtle?.digest != "function")
10
- return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."), a;
11
- const f = new TextEncoder().encode(a), h = await crypto.subtle.digest("SHA-256", f);
12
- return S(new Uint8Array(h), !0);
13
- }, z = async (a, t, m, f, h) => {
14
- const i = a[t];
11
+ return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."), r;
12
+ const l = new TextEncoder().encode(r), w = await crypto.subtle.digest("SHA-256", l);
13
+ return S(new Uint8Array(w), !0);
14
+ }, $ = async (r, t, p, l, w) => {
15
+ const d = r[t];
15
16
  try {
16
- if (!i)
17
+ if (!d)
17
18
  return [new Error("Flow not found"), null];
18
- const e = m.join(" ");
19
+ const f = p.join(" ");
19
20
  if (t === "clientCredentials" || t === "password")
20
- return k(a, t, e, {
21
- proxyUrl: h
22
- });
23
- const r = (Math.random() + 1).toString(36).substring(2, 10), c = new URL(a[t].authorizationUrl);
21
+ return U(
22
+ r,
23
+ t,
24
+ f,
25
+ {
26
+ proxyUrl: w
27
+ },
28
+ l
29
+ );
30
+ const e = (Math.random() + 1).toString(36).substring(2, 10), a = A(r[t].authorizationUrl, {
31
+ baseUrl: l?.url
32
+ }), n = new URL(a);
24
33
  let o = null;
25
34
  if (t === "implicit")
26
- c.searchParams.set("response_type", "token");
35
+ n.searchParams.set("response_type", "token");
27
36
  else if (t === "authorizationCode") {
28
- const s = a[t];
29
- if (c.searchParams.set("response_type", "code"), s["x-usePkce"] !== "no") {
30
- const n = C(), l = await E(n, s["x-usePkce"]);
37
+ const s = r[t];
38
+ if (n.searchParams.set("response_type", "code"), s["x-usePkce"] !== "no") {
39
+ const c = E(), i = await z(c, s["x-usePkce"]);
31
40
  o = {
32
- codeVerifier: n,
33
- codeChallenge: l,
41
+ codeVerifier: c,
42
+ codeChallenge: i,
34
43
  codeChallengeMethod: s["x-usePkce"] === "SHA-256" ? "S256" : "plain"
35
- }, c.searchParams.set("code_challenge", l), c.searchParams.set("code_challenge_method", o.codeChallengeMethod);
44
+ }, n.searchParams.set("code_challenge", i), n.searchParams.set("code_challenge_method", o.codeChallengeMethod);
36
45
  }
37
46
  }
38
- const w = a[t];
39
- if (w["x-scalar-secret-redirect-uri"].startsWith("/")) {
40
- const s = f?.url || window.location.origin + window.location.pathname, n = new URL(w["x-scalar-secret-redirect-uri"], s).toString();
41
- c.searchParams.set("redirect_uri", n);
47
+ const m = r[t];
48
+ if (m["x-scalar-secret-redirect-uri"].startsWith("/")) {
49
+ const s = l?.url || window.location.origin + window.location.pathname, c = new URL(m["x-scalar-secret-redirect-uri"], s).toString();
50
+ n.searchParams.set("redirect_uri", c);
42
51
  } else
43
- c.searchParams.set("redirect_uri", w["x-scalar-secret-redirect-uri"]);
44
- i["x-scalar-security-query"] && Object.keys(i["x-scalar-security-query"]).forEach((s) => {
45
- const n = i["x-scalar-security-query"]?.[s];
46
- n && c.searchParams.set(s, n);
47
- }), c.searchParams.set("client_id", i["x-scalar-secret-client-id"]), c.searchParams.set("state", r), e && c.searchParams.set("scope", e);
48
- const d = window.open(c, "openAuth2Window", "left=100,top=100,width=800,height=600");
49
- return d ? new Promise((s) => {
50
- const n = setInterval(() => {
51
- let l = null, g = null, x = null, p = null;
52
+ n.searchParams.set("redirect_uri", m["x-scalar-secret-redirect-uri"]);
53
+ d["x-scalar-security-query"] && Object.keys(d["x-scalar-security-query"]).forEach((s) => {
54
+ const c = d["x-scalar-security-query"]?.[s];
55
+ c && n.searchParams.set(s, c);
56
+ }), n.searchParams.set("client_id", d["x-scalar-secret-client-id"]), n.searchParams.set("state", e), f && n.searchParams.set("scope", f);
57
+ const u = window.open(n, "openAuth2Window", "left=100,top=100,width=800,height=600");
58
+ return u ? new Promise((s) => {
59
+ const c = setInterval(() => {
60
+ let i = null, g = null, x = null, P = null;
52
61
  try {
53
- const u = new URL(d.location.href).searchParams, y = i["x-tokenName"] || "access_token";
54
- l = u.get(y), g = u.get("code"), x = u.get("error"), p = u.get("error_description");
55
- const _ = new URLSearchParams(d.location.href.split("#")[1]);
56
- l ||= _.get(y), g ||= _.get("code"), x ||= _.get("error"), p ||= _.get("error_description");
62
+ const h = new URL(u.location.href).searchParams, k = d["x-tokenName"] || "access_token";
63
+ i = h.get(k), g = h.get("code"), x = h.get("error"), P = h.get("error_description");
64
+ const y = new URLSearchParams(u.location.href.split("#")[1]);
65
+ i ||= y.get(k), g ||= y.get("code"), x ||= y.get("error"), P ||= y.get("error_description");
57
66
  } catch {
58
67
  }
59
- if (d.closed || l || g || x)
60
- if (clearInterval(n), d.close(), x)
61
- s([new Error(`OAuth error: ${x}${p ? ` (${p})` : ""}`), null]);
62
- else if (l) {
63
- const u = d.location.href.match(/state=([^&]*)/)?.[1];
64
- s(u === r ? [null, l] : [new Error("State mismatch"), null]);
65
- } else g && t === "authorizationCode" ? new URL(d.location.href).searchParams.get("state") === r ? k(a, t, e, {
66
- code: g,
67
- pkce: o,
68
- proxyUrl: h
69
- }).then(s) : s([new Error("State mismatch"), null]) : (clearInterval(n), s([new Error("Window was closed without granting authorization"), null]));
68
+ if (u.closed || i || g || x)
69
+ if (clearInterval(c), u.close(), x)
70
+ s([new Error(`OAuth error: ${x}${P ? ` (${P})` : ""}`), null]);
71
+ else if (i) {
72
+ const h = u.location.href.match(/state=([^&]*)/)?.[1];
73
+ s(h === e ? [null, i] : [new Error("State mismatch"), null]);
74
+ } else g && t === "authorizationCode" ? new URL(u.location.href).searchParams.get("state") === e ? U(
75
+ r,
76
+ t,
77
+ f,
78
+ {
79
+ code: g,
80
+ pkce: o,
81
+ proxyUrl: w
82
+ },
83
+ l
84
+ ).then(s) : s([new Error("State mismatch"), null]) : (clearInterval(c), s([new Error("Window was closed without granting authorization"), null]));
70
85
  }, 200);
71
86
  }) : [new Error("Failed to open auth window"), null];
72
87
  } catch {
73
88
  return [new Error("Failed to authorize oauth2 flow"), null];
74
89
  }
75
- }, k = async (a, t, m, {
76
- code: f,
77
- pkce: h,
78
- proxyUrl: i
79
- } = {}) => {
80
- const e = a[t];
90
+ }, U = async (r, t, p, {
91
+ code: l,
92
+ pkce: w,
93
+ proxyUrl: d
94
+ } = {}, f) => {
95
+ const e = r[t];
81
96
  if (!e)
82
97
  return [new Error("OAuth2 flow was not defined"), null];
83
- const r = new URLSearchParams();
84
- if (r.set("client_id", e["x-scalar-secret-client-id"]), m && (t === "clientCredentials" || t === "password") && r.set("scope", m), e["x-scalar-secret-client-secret"] && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "body") && r.set("client_secret", e["x-scalar-secret-client-secret"]), "x-scalar-secret-redirect-uri" in e && e["x-scalar-secret-redirect-uri"] && r.set("redirect_uri", e["x-scalar-secret-redirect-uri"]), f)
85
- r.set("code", f), r.set("grant_type", "authorization_code"), h && r.set("code_verifier", h.codeVerifier);
98
+ const a = new URLSearchParams();
99
+ if (a.set("client_id", e["x-scalar-secret-client-id"]), p && (t === "clientCredentials" || t === "password") && a.set("scope", p), e["x-scalar-secret-client-secret"] && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "body") && a.set("client_secret", e["x-scalar-secret-client-secret"]), "x-scalar-secret-redirect-uri" in e && e["x-scalar-secret-redirect-uri"] && a.set("redirect_uri", e["x-scalar-secret-redirect-uri"]), l)
100
+ a.set("code", l), a.set("grant_type", "authorization_code"), w && a.set("code_verifier", w.codeVerifier);
86
101
  else if (t === "password") {
87
- const o = a[t];
88
- r.set("grant_type", "password"), r.set("username", o["x-scalar-secret-username"]), r.set("password", o["x-scalar-secret-password"]);
102
+ const o = r[t];
103
+ a.set("grant_type", "password"), a.set("username", o["x-scalar-secret-username"]), a.set("password", o["x-scalar-secret-password"]);
89
104
  } else
90
- r.set("grant_type", "client_credentials");
91
- e["x-scalar-security-body"] && Object.entries(e["x-scalar-security-body"]).forEach(([o, w]) => {
92
- w && r.set(o, w);
105
+ a.set("grant_type", "client_credentials");
106
+ e["x-scalar-security-body"] && Object.entries(e["x-scalar-security-body"]).forEach(([o, m]) => {
107
+ m && a.set(o, m);
93
108
  });
94
109
  try {
95
110
  const o = {
96
111
  "Content-Type": "application/x-www-form-urlencoded"
97
112
  };
98
- e["x-scalar-secret-client-secret"] && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "header") && (o.Authorization = `Basic ${A(`${e["x-scalar-secret-client-id"]}:${e["x-scalar-secret-client-secret"]}`)}`);
99
- const P = U(i, e.tokenUrl) ? `${i}?${new URLSearchParams([["scalar_url", e.tokenUrl]]).toString()}` : e.tokenUrl, s = await (await fetch(P, {
113
+ e["x-scalar-secret-client-secret"] && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "header") && (o.Authorization = `Basic ${C(`${e["x-scalar-secret-client-id"]}:${e["x-scalar-secret-client-secret"]}`)}`);
114
+ const _ = A(e.tokenUrl, { baseUrl: f?.url }), u = b(d, _) ? `${d}?${new URLSearchParams([["scalar_url", _]]).toString()}` : _, c = await (await fetch(u, {
100
115
  method: "POST",
101
116
  headers: o,
102
- body: r
103
- })).json(), n = e["x-tokenName"] || "access_token";
104
- return [null, s[n]];
117
+ body: a
118
+ })).json(), i = e["x-tokenName"] || "access_token";
119
+ return [null, c[i]];
105
120
  } catch {
106
121
  return [new Error("Failed to get an access token. Please check your credentials."), null];
107
122
  }
108
123
  };
109
124
  export {
110
- z as authorizeOauth2,
111
- k as authorizeServers,
112
- E as generateCodeChallenge
125
+ $ as authorizeOauth2,
126
+ U as authorizeServers,
127
+ z as generateCodeChallenge
113
128
  };
@@ -40,7 +40,7 @@ const g = {
40
40
  method: e.method ?? "get"
41
41
  } : {
42
42
  type: "document"
43
- }), i = "2.13.0", d = B();
43
+ }), i = "2.14.1", d = B();
44
44
  return (t, o) => t.path && t.method && t.exampleName && n.value ? (s(), h(u(R), {
45
45
  key: 0,
46
46
  appVersion: u(i),
@@ -1 +1 @@
1
- {"version":3,"file":"drag-handle-factory.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/drag-handle-factory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,4CAA4C,CAAA;AAGnD,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,KAAK,CAAA;AA+SpD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,KAAK,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAC3C;mCAKuC,YAAY,gBAAgB,WAAW,KAAG,OAAO;iCA2DnD,YAAY,gBAAgB,WAAW,KAAG,OAAO;CAwEtF,CAAA"}
1
+ {"version":3,"file":"drag-handle-factory.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/drag-handle-factory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,4CAA4C,CAAA;AAGnD,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,KAAK,CAAA;AAiTpD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,KAAK,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAC3C;mCAKuC,YAAY,gBAAgB,WAAW,KAAG,OAAO;iCA2DnD,YAAY,gBAAgB,WAAW,KAAG,OAAO;CAwEtF,CAAA"}
@@ -1,119 +1,120 @@
1
- import { dereference as B, escapeJsonPointer as k } from "@scalar/openapi-parser";
1
+ import { sortByOrder as B } from "@scalar/helpers/array/sort-by-order";
2
+ import { dereference as k, escapeJsonPointer as j } from "@scalar/openapi-parser";
2
3
  import { unpackProxyObject as x } from "@scalar/workspace-store/helpers/unpack-proxy";
3
- import { getParentEntry as p, getOpenapiObject as h } from "@scalar/workspace-store/navigation";
4
+ import { getParentEntry as d, getOpenapiObject as h } from "@scalar/workspace-store/navigation";
4
5
  import { toValue as b } from "vue";
5
- import { removeCircular as j } from "./remove-circular.js";
6
- const P = (r, t, n, c) => {
6
+ import { removeCircular as A } from "./remove-circular.js";
7
+ const P = (r, t, n, a) => {
7
8
  if (t === -1 || n === -1 || t === n)
8
9
  return null;
9
- const o = [...r], [s] = o.splice(t, 1);
10
- if (s === void 0)
10
+ const o = [...r], [e] = o.splice(t, 1);
11
+ if (e === void 0)
11
12
  return null;
12
- const u = A(t, n, c, o.length);
13
- return o.splice(u, 0, s), x(o, { depth: 1 });
14
- }, A = (r, t, n, c) => {
13
+ const u = R(t, n, a, o.length);
14
+ return o.splice(u, 0, e), x(o, { depth: 1 });
15
+ }, R = (r, t, n, a) => {
15
16
  const o = r < t;
16
- return n === "after" ? o ? t : t + 1 : n === "before" ? o ? t - 1 : t : n === "into" ? c : t;
17
- }, y = (r, t) => t.includes(r.type), i = (r) => r.offset === "before" || r.offset === "after", m = (r) => r.offset === "into", l = (r, t) => !r.parent || !t.parent ? !1 : r.parent.id === t.parent.id, E = ({ store: r, entry: t }) => {
18
- const n = p("document", t);
17
+ return n === "after" ? o ? t : t + 1 : n === "before" ? o ? t - 1 : t : n === "into" ? a : t;
18
+ }, y = (r, t) => t.includes(r.type), p = (r) => r.offset === "before" || r.offset === "after", m = (r) => r.offset === "into", l = (r, t) => !r.parent || !t.parent ? !1 : r.parent.id === t.parent.id, O = ({ store: r, entry: t }) => {
19
+ const n = d("document", t);
19
20
  n && r.buildSidebar(n.name);
20
- }, R = (r, t) => r["x-scalar-order"] ?? t.children?.map((c) => c.id) ?? [], w = (r, t, n, c) => {
21
+ }, M = (r, t) => r["x-scalar-order"] ?? t.children?.map((a) => a.id) ?? [], w = (r, t, n, a) => {
21
22
  const o = t.parent;
22
23
  if (!o || !y(o, ["tag", "document"]))
23
24
  return !1;
24
- const s = h({ store: r, entry: o });
25
- if (!s)
25
+ const e = h({ store: r, entry: o });
26
+ if (!e)
26
27
  return !1;
27
- const u = R(s, o), e = u.findIndex((d) => d === t.id), a = u.findIndex((d) => d === n.id), f = P(u, e, a, c);
28
- return f ? (s["x-scalar-order"] = f, E({ store: r, entry: o }), !0) : !1;
29
- }, M = (r, t, n) => {
30
- const c = new Set(r.tags ?? []);
31
- n && c.add(n.name), t && c.delete(t.name), r.tags = Array.from(c);
32
- }, T = (r, t, n, c) => {
33
- r.paths?.[n.path]?.[n.method] && delete r.paths[n.path][n.method], t.paths ? (t.paths[n.path] || (t.paths[n.path] = {}), t.paths[n.path][n.method] = c) : t.paths = {
28
+ const u = M(e, o), s = u.findIndex((f) => f === t.id), c = u.findIndex((f) => f === n.id), i = P(u, s, c, a);
29
+ return i ? (e["x-scalar-order"] = i, O({ store: r, entry: o }), !0) : !1;
30
+ }, T = (r, t, n) => {
31
+ const a = new Set(r.tags ?? []);
32
+ n && a.add(n.name), t && a.delete(t.name), r.tags = Array.from(a);
33
+ }, $ = (r, t, n, a) => {
34
+ r.paths?.[n.path]?.[n.method] && delete r.paths[n.path][n.method], t.paths ? (t.paths[n.path] || (t.paths[n.path] = {}), t.paths[n.path][n.method] = a) : t.paths = {
34
35
  [n.path]: {
35
- [n.method]: c
36
+ [n.method]: a
36
37
  }
37
38
  };
38
- }, $ = (r, t, n) => {
39
- const o = B(r).schema.paths?.[t]?.[n];
40
- return j(o, { prefix: `#/paths/${k(t)}/${n}` });
41
39
  }, C = (r, t, n) => {
42
- const c = p("document", t), o = p("document", n);
43
- if (!c || !o)
40
+ const o = k(r).schema.paths?.[t]?.[n];
41
+ return A(o, { prefix: `#/paths/${j(t)}/${n}` });
42
+ }, F = (r, t, n) => {
43
+ const a = d("document", t), o = d("document", n);
44
+ if (!a || !o)
44
45
  return !1;
45
- const s = h({ store: r, entry: c }), u = h({ store: r, entry: o });
46
- if (!s || !u)
46
+ const e = h({ store: r, entry: a }), u = h({ store: r, entry: o });
47
+ if (!e || !u)
47
48
  return !1;
48
- const e = $(
49
- x(s),
49
+ const s = C(
50
+ x(e),
50
51
  t.path,
51
52
  t.method
52
53
  );
53
- if (!e)
54
+ if (!s)
54
55
  return !1;
55
- const a = p("tag", t) ?? null, f = p("tag", n) ?? null;
56
- return M(e, a, f), T(s, u, t, e), E({ store: r, entry: t }), E({ store: r, entry: n }), !0;
57
- }, F = (r, t, n, c) => {
58
- const o = r.workspace["x-scalar-order"] ?? Object.keys(r.workspace.documents), s = o.findIndex((a) => a === t.id), u = o.findIndex((a) => a === n.id), e = P(o, s, u, c);
59
- return e ? (r.update("x-scalar-order", e), !0) : !1;
60
- }, q = ({
56
+ const c = d("tag", t) ?? null, i = d("tag", n) ?? null;
57
+ return T(s, c, i), $(e, u, t, s), O({ store: r, entry: t }), O({ store: r, entry: n }), !0;
58
+ }, H = (r, t, n, a) => {
59
+ const o = r.workspace["x-scalar-order"] ?? [], e = Object.keys(r.workspace.documents), u = B(e, o, (f) => f), s = u.findIndex((f) => f === t.id), c = u.findIndex((f) => f === n.id), i = P(u, s, c, a);
60
+ return i ? (r.update("x-scalar-order", i), !0) : !1;
61
+ }, G = ({
61
62
  store: r,
62
63
  sidebarState: t
63
64
  }) => ({
64
- handleDragEnd: (o, s) => {
65
+ handleDragEnd: (o, e) => {
65
66
  const u = b(r);
66
67
  if (!u)
67
68
  return !1;
68
- const e = t.getEntryById(o.id), a = t.getEntryById(s.id);
69
- if (!e || !a)
69
+ const s = t.getEntryById(o.id), c = t.getEntryById(e.id);
70
+ if (!s || !c)
70
71
  return !1;
71
- if (e.type === "document")
72
- return a.type !== "document" || !i(s) ? !1 : F(u, e, a, s.offset);
73
- if (e.type === "tag")
74
- return a.type !== "tag" || !i(s) || !l(e, a) ? !1 : w(
72
+ if (s.type === "document")
73
+ return c.type !== "document" || !p(e) ? !1 : H(u, s, c, e.offset);
74
+ if (s.type === "tag")
75
+ return c.type !== "tag" || !p(e) || !l(s, c) ? !1 : w(
75
76
  u,
76
- e,
77
- a,
78
- s.offset
77
+ s,
78
+ c,
79
+ e.offset
79
80
  );
80
- if (e.type === "operation") {
81
- if (i(s) && l(e, a))
81
+ if (s.type === "operation") {
82
+ if (p(e) && l(s, c))
82
83
  return w(
83
84
  u,
84
- e,
85
- a,
86
- s.offset
85
+ s,
86
+ c,
87
+ e.offset
87
88
  );
88
- if (y(a, ["tag", "document"]) && m(s))
89
- return C(u, e, a);
89
+ if (y(c, ["tag", "document"]) && m(e))
90
+ return F(u, s, c);
90
91
  }
91
92
  return !1;
92
93
  },
93
- isDroppable: (o, s) => {
94
+ isDroppable: (o, e) => {
94
95
  const u = b(r);
95
96
  if (!u)
96
97
  return !1;
97
- const e = t.getEntryById(o.id), a = t.getEntryById(s.id);
98
- if (!e || !a || e.type === "example")
98
+ const s = t.getEntryById(o.id), c = t.getEntryById(e.id);
99
+ if (!s || !c || s.type === "example")
99
100
  return !1;
100
- if (e.type === "document")
101
- return a.type === "document" && i(s);
102
- if (e.type === "tag")
103
- return i(s) && l(e, a);
104
- if (e.type === "operation") {
105
- const f = p("document", a), d = p("document", e);
106
- if (!f || !d)
101
+ if (s.type === "document")
102
+ return c.type === "document" && p(e);
103
+ if (s.type === "tag")
104
+ return p(e) && l(s, c);
105
+ if (s.type === "operation") {
106
+ const i = d("document", c), f = d("document", s);
107
+ if (!i || !f)
107
108
  return !1;
108
- const O = h({ store: u, entry: f });
109
- if (!O)
109
+ const E = h({ store: u, entry: i });
110
+ if (!E)
110
111
  return !1;
111
- const D = l(e, a);
112
- return i(s) && !D ? !1 : D ? i(s) || m(s) && y(a, ["tag", "document"]) : m(s) && y(a, ["tag", "document"]) && (d.id === f.id || O.paths?.[e.path]?.[e.method] === void 0);
112
+ const D = l(s, c);
113
+ return p(e) && !D ? !1 : D ? p(e) || m(e) && y(c, ["tag", "document"]) : m(e) && y(c, ["tag", "document"]) && (f.id === i.id || E.paths?.[s.path]?.[s.method] === void 0);
113
114
  }
114
115
  return !1;
115
116
  }
116
117
  });
117
118
  export {
118
- q as dragHandleFactory
119
+ G as dragHandleFactory
119
120
  };