@scalar/blocks 0.11.0 → 0.11.2
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.
- package/CHANGELOG.md +23 -0
- package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
- package/dist/code-example/components/CodeExample.vue.js +1 -1
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +60 -66
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-parameters.js +126 -156
- package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
- package/dist/code-example/mount.d.ts +1 -1
- package/dist/code-example/mount.d.ts.map +1 -1
- package/dist/code-example/mount.js +49 -39
- package/dist/code-example/mount.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/schema/Schema.vue.d.ts.map +1 -1
- package/dist/schema/Schema.vue.js +1 -1
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js +40 -39
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/schema/SchemaProperty.vue.js +1 -1
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.d.ts +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/schema/components/CopyLinkButton.vue.d.ts +5 -0
- package/dist/schema/components/CopyLinkButton.vue.d.ts.map +1 -1
- package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/helpers/dynamic-scope.d.ts +3 -1
- package/dist/schema/helpers/dynamic-scope.d.ts.map +1 -1
- package/dist/schema/helpers/dynamic-scope.js +19 -4
- package/dist/schema/helpers/dynamic-scope.js.map +1 -1
- package/dist/schema/helpers/get-compositions-to-render.d.ts.map +1 -1
- package/dist/schema/helpers/get-compositions-to-render.js +24 -24
- package/dist/schema/helpers/get-compositions-to-render.js.map +1 -1
- package/dist/schema/helpers/index.d.ts +1 -0
- package/dist/schema/helpers/index.d.ts.map +1 -1
- package/dist/schema/helpers/index.js +14 -13
- package/dist/schema/helpers/partition-all-of-compositions.d.ts.map +1 -1
- package/dist/schema/helpers/partition-all-of-compositions.js +24 -14
- package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -1
- package/dist/schema/helpers/should-render-array-item-composition.d.ts +2 -0
- package/dist/schema/helpers/should-render-array-item-composition.d.ts.map +1 -1
- package/dist/schema/helpers/should-render-array-item-composition.js +2 -6
- package/dist/schema/helpers/should-render-array-item-composition.js.map +1 -1
- package/dist/schema/localization/index.d.ts +1 -1
- package/dist/shared/ExternalExampleStatus.vue.d.ts +12 -0
- package/dist/shared/ExternalExampleStatus.vue.d.ts.map +1 -0
- package/dist/shared/ExternalExampleStatus.vue.js +6 -0
- package/dist/shared/ExternalExampleStatus.vue.js.map +1 -0
- package/dist/shared/ExternalExampleStatus.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/shared/ExternalExampleStatus.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/shared/external-example-localization/index.d.ts +4 -0
- package/dist/shared/external-example-localization/index.d.ts.map +1 -0
- package/dist/shared/external-example-localization/index.js +17 -0
- package/dist/shared/external-example-localization/index.js.map +1 -0
- package/dist/shared/external-example-localization/locales/ar.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/ar.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/ar.js +9 -0
- package/dist/shared/external-example-localization/locales/ar.js.map +1 -0
- package/dist/shared/external-example-localization/locales/de.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/de.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/de.js +9 -0
- package/dist/shared/external-example-localization/locales/de.js.map +1 -0
- package/dist/shared/external-example-localization/locales/en.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/en.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/en.js +9 -0
- package/dist/shared/external-example-localization/locales/en.js.map +1 -0
- package/dist/shared/external-example-localization/locales/es.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/es.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/es.js +9 -0
- package/dist/shared/external-example-localization/locales/es.js.map +1 -0
- package/dist/shared/external-example-localization/locales/fr.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/fr.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/fr.js +9 -0
- package/dist/shared/external-example-localization/locales/fr.js.map +1 -0
- package/dist/shared/external-example-localization/locales/pt.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/pt.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/pt.js +9 -0
- package/dist/shared/external-example-localization/locales/pt.js.map +1 -0
- package/dist/shared/external-example-localization/locales/ru.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/ru.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/ru.js +9 -0
- package/dist/shared/external-example-localization/locales/ru.js.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-cn.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/zh-cn.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-cn.js +9 -0
- package/dist/shared/external-example-localization/locales/zh-cn.js.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-tw.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/zh-tw.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-tw.js +9 -0
- package/dist/shared/external-example-localization/locales/zh-tw.js.map +1 -0
- package/dist/shared/external-example-localization/translations.d.ts +67 -0
- package/dist/shared/external-example-localization/translations.d.ts.map +1 -0
- package/dist/shared/external-example-localization/translations.js +24 -0
- package/dist/shared/external-example-localization/translations.js.map +1 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +4 -2
- package/dist/style.css +3 -3
- package/dist/vue-styles.css +1 -1
- package/package.json +9 -9
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { deSerializeParameter as t, filterDisabledProperties as n, getExampleFromSchema as r, isParamDisabled as i, serializeContentValue as a, serializeCookieStyle as o, serializeDeepObjectStyle as s, serializeFormStyle as c, serializeFormStyleForCookies as l, serializePipeDelimitedStyle as u, serializeSimpleStyle as d, serializeSpaceDelimitedStyle as f } from "@scalar/workspace-store/request-example";
|
|
1
|
+
import { deSerializeParameter as e, encodeReservedQueryValue as t, filterDisabledProperties as n, getExampleFromSchema as r, isParamDisabled as i, serializeContentValue as a, serializeCookieStyle as o, serializeDeepObjectStyle as s, serializeFormStyle as c, serializeFormStyleForCookies as l, serializePipeDelimitedStyle as u, serializeSimpleStyle as d, serializeSpaceDelimitedStyle as f } from "@scalar/workspace-store/request-example";
|
|
3
2
|
import { getResolvedRef as p } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
3
|
import { getCookieSerializationError as m } from "@scalar/helpers/http/get-cookie-serialization-error";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { replacePathVariables as h } from "@scalar/helpers/regex/replace-variables";
|
|
5
|
+
import { assertReservedPathUrl as g, hasPathDotSegment as _, includesUndefinedPathPrefix as v, serializePathParameter as y, serializeReservedPathParameter as b } from "@scalar/workspace-store/helpers/encode-path-parameter";
|
|
6
|
+
import { getParameterExample as x } from "@scalar/workspace-store/helpers/get-parameter-example";
|
|
7
|
+
import { getQuerystringParameter as S, serializeQuerystringParameter as C } from "@scalar/workspace-store/helpers/querystring-parameter";
|
|
8
8
|
// src/code-example/helpers/operation-to-har/process-parameters.ts
|
|
9
|
-
var
|
|
9
|
+
var w = class extends Error {}, T = (e) => (e ?? []).map((e) => p(e)).filter((e) => e !== void 0), E = (e) => "allowReserved" in e && e.allowReserved !== void 0 ? e.allowReserved : "schema" in e && e.schema && typeof e.schema == "object" && "allowReserved" in e.schema ? e.schema.allowReserved === !0 : !1, D = (e) => {
|
|
10
10
|
if (e.in === "header") return {
|
|
11
11
|
style: "simple",
|
|
12
12
|
explode: "explode" in e && e.explode !== void 0 && e.explode
|
|
@@ -29,237 +29,207 @@ var b = class extends Error {}, x = (e) => (e ?? []).map((e) => p(e)).filter((e)
|
|
|
29
29
|
style: n,
|
|
30
30
|
explode: "explode" in e && e.explode !== void 0 ? e.explode : n === "form"
|
|
31
31
|
};
|
|
32
|
-
},
|
|
33
|
-
let l =
|
|
34
|
-
if (d) return n(
|
|
35
|
-
if (i(
|
|
36
|
-
if (l.value !== void 0) return
|
|
37
|
-
if (!("schema" in
|
|
32
|
+
}, O = (t, a, o, s, c) => {
|
|
33
|
+
let l = x(t, a), u = l.example, d = t.in === "query" && !l.serialized && !l.mediaSerialized ? u?.["x-scalar-disabled-properties"] : void 0;
|
|
34
|
+
if (d) return n(e(l.value, t), d, i(t, u, o));
|
|
35
|
+
if (i(t, u, o)) return;
|
|
36
|
+
if (l.value !== void 0) return e(l.value, t);
|
|
37
|
+
if (!("schema" in t) || !t.schema) return;
|
|
38
38
|
let f = {
|
|
39
39
|
openapiVersion: s,
|
|
40
40
|
jsonSchemaDialect: c,
|
|
41
|
-
...
|
|
42
|
-
emptyString: `{${
|
|
41
|
+
...t.in === "path" ? {
|
|
42
|
+
emptyString: `{${t.name}}`,
|
|
43
43
|
preserveStringFallback: !0
|
|
44
44
|
} : {}
|
|
45
|
-
}, m = p(
|
|
45
|
+
}, m = p(t.schema);
|
|
46
46
|
return m ? r(m, f) : void 0;
|
|
47
|
-
},
|
|
48
|
-
let
|
|
49
|
-
|
|
47
|
+
}, k = ({ harRequest: n, parameters: r, example: p, defaultDisabled: k, openapiVersion: A, jsonSchemaDialect: j }) => {
|
|
48
|
+
let M = [...n.headers], N = [...n.queryString], P = [...n.cookies], F = [], I = n.url, L = n.url, R = !1, z = !1, B = [], V = [], H = (e, t, n = !1) => {
|
|
49
|
+
I = h(I, { [e]: t }), L = h(L, { [e]: n ? `x${t}` : t }), R ||= n;
|
|
50
|
+
}, U = (e, n, r) => {
|
|
51
|
+
E(r) ? B.push(`${encodeURIComponent(e)}=${t(n)}`) : N.push({
|
|
50
52
|
name: e,
|
|
51
|
-
value:
|
|
53
|
+
value: n
|
|
52
54
|
});
|
|
53
|
-
},
|
|
54
|
-
for (let
|
|
55
|
-
if (!
|
|
56
|
-
if (
|
|
57
|
-
let
|
|
58
|
-
defaultDisabled:
|
|
59
|
-
openapiVersion:
|
|
60
|
-
jsonSchemaDialect:
|
|
55
|
+
}, W = T(r);
|
|
56
|
+
for (let t of W) {
|
|
57
|
+
if (!t.in || !t.name) continue;
|
|
58
|
+
if (t.in === "querystring") {
|
|
59
|
+
let e = S(t, p, {
|
|
60
|
+
defaultDisabled: k,
|
|
61
|
+
openapiVersion: A,
|
|
62
|
+
jsonSchemaDialect: j
|
|
61
63
|
});
|
|
62
|
-
if (
|
|
63
|
-
let
|
|
64
|
-
|
|
64
|
+
if (e) {
|
|
65
|
+
let t = I.indexOf("#"), n = t === -1 ? "" : I.slice(t), r = (t === -1 ? I : I.slice(0, t)).split("?")[0], i = C(e);
|
|
66
|
+
I = `${r}${i ? `?${i}` : ""}${n}`;
|
|
65
67
|
}
|
|
66
68
|
continue;
|
|
67
69
|
}
|
|
68
|
-
let
|
|
69
|
-
if (
|
|
70
|
-
let
|
|
71
|
-
switch (
|
|
70
|
+
let n = x(t, p);
|
|
71
|
+
if (n.serialized && !i(t, n.example, k)) {
|
|
72
|
+
let e = String(n.value);
|
|
73
|
+
switch (t.in) {
|
|
72
74
|
case "path":
|
|
73
|
-
|
|
75
|
+
H(t.name, e);
|
|
74
76
|
break;
|
|
75
77
|
case "query":
|
|
76
|
-
|
|
78
|
+
B.push(e);
|
|
77
79
|
break;
|
|
78
80
|
case "header":
|
|
79
|
-
|
|
80
|
-
name:
|
|
81
|
-
value:
|
|
81
|
+
M.push({
|
|
82
|
+
name: t.name,
|
|
83
|
+
value: e
|
|
82
84
|
});
|
|
83
85
|
break;
|
|
84
|
-
case "cookie":
|
|
86
|
+
case "cookie": V.push(e);
|
|
85
87
|
}
|
|
86
88
|
continue;
|
|
87
89
|
}
|
|
88
|
-
if (
|
|
89
|
-
let
|
|
90
|
-
switch (
|
|
90
|
+
if (n.mediaSerialized && !i(t, n.example, k)) {
|
|
91
|
+
let e = String(n.value);
|
|
92
|
+
switch (t.in) {
|
|
91
93
|
case "query":
|
|
92
|
-
|
|
94
|
+
U(t.name, e, t);
|
|
93
95
|
break;
|
|
94
96
|
case "header":
|
|
95
|
-
|
|
96
|
-
name:
|
|
97
|
-
value:
|
|
97
|
+
M.push({
|
|
98
|
+
name: t.name,
|
|
99
|
+
value: e
|
|
98
100
|
});
|
|
99
101
|
break;
|
|
100
102
|
case "path":
|
|
101
|
-
|
|
103
|
+
H(t.name, encodeURIComponent(e));
|
|
102
104
|
break;
|
|
103
|
-
case "cookie":
|
|
104
|
-
name:
|
|
105
|
-
value:
|
|
105
|
+
case "cookie": P.push({
|
|
106
|
+
name: t.name,
|
|
107
|
+
value: e
|
|
106
108
|
});
|
|
107
109
|
}
|
|
108
110
|
continue;
|
|
109
111
|
}
|
|
110
|
-
let h =
|
|
111
|
-
if (
|
|
112
|
-
let { style: x, explode: S } = C(e);
|
|
113
|
-
switch (e.in) {
|
|
112
|
+
let { style: r, explode: h } = D(t), g = t.in === "path" && (r === "matrix" || r === "label"), _ = g ? e(n.value, t) : O(t, p, k, A, j);
|
|
113
|
+
if (!(g ? !n.example || i(t, n.example, k) : _ === void 0)) switch (t.in) {
|
|
114
114
|
case "path": {
|
|
115
|
-
let
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
let e = A?.startsWith("3.2.") && "schema" in t && t.allowReserved === !0;
|
|
116
|
+
if (z ||= !!e, g) {
|
|
117
|
+
let n = y(t.name, {
|
|
118
|
+
value: _,
|
|
119
|
+
style: r,
|
|
120
|
+
explode: h,
|
|
121
|
+
includeUndefinedPrefix: v(A)
|
|
122
|
+
}, void 0, e), i = r === "matrix" ? ";" : ".";
|
|
123
|
+
H(I.includes(`{${t.name}}`) ? t.name : `${i}${t.name}`, n, r === "label" && !e);
|
|
124
|
+
} else if (e) H(t.name, b(t.name, {
|
|
125
|
+
value: _,
|
|
126
|
+
style: r,
|
|
127
|
+
explode: h
|
|
128
|
+
}));
|
|
129
|
+
else {
|
|
130
|
+
let e = r === "simple" ? d(_, h) : _;
|
|
131
|
+
H(t.name, String(e));
|
|
132
|
+
}
|
|
123
133
|
break;
|
|
124
134
|
}
|
|
125
135
|
case "query":
|
|
126
|
-
if ("content" in
|
|
127
|
-
let
|
|
128
|
-
|
|
136
|
+
if ("content" in t && t.content) {
|
|
137
|
+
let e = Object.keys(t.content)[0] ?? "application/json", n = a(_, e);
|
|
138
|
+
U(t.name, n, t);
|
|
129
139
|
break;
|
|
130
140
|
}
|
|
131
|
-
switch (
|
|
141
|
+
switch (r) {
|
|
132
142
|
case "form": {
|
|
133
|
-
let
|
|
134
|
-
if (Array.isArray(
|
|
135
|
-
else
|
|
143
|
+
let e = c(_, h);
|
|
144
|
+
if (Array.isArray(e)) for (let n of e) U(n.key || t.name, String(n.value), t);
|
|
145
|
+
else U(t.name, String(e), t);
|
|
136
146
|
break;
|
|
137
147
|
}
|
|
138
148
|
case "spaceDelimited": {
|
|
139
|
-
let
|
|
140
|
-
|
|
149
|
+
let e = f(_);
|
|
150
|
+
U(t.name, e, t);
|
|
141
151
|
break;
|
|
142
152
|
}
|
|
143
153
|
case "pipeDelimited": {
|
|
144
|
-
let
|
|
145
|
-
|
|
154
|
+
let e = u(_);
|
|
155
|
+
U(t.name, e, t);
|
|
146
156
|
break;
|
|
147
157
|
}
|
|
148
158
|
case "deepObject":
|
|
149
|
-
if (Array.isArray(
|
|
150
|
-
let
|
|
151
|
-
if (Array.isArray(
|
|
152
|
-
else
|
|
159
|
+
if (Array.isArray(_)) {
|
|
160
|
+
let e = c(_, !0);
|
|
161
|
+
if (Array.isArray(e)) for (let n of e) U(n.key || t.name, String(n.value), t);
|
|
162
|
+
else U(t.name, String(e), t);
|
|
153
163
|
} else {
|
|
154
|
-
let
|
|
155
|
-
for (let n of
|
|
164
|
+
let e = s(t.name, _);
|
|
165
|
+
for (let n of e) U(n.key, n.value, t);
|
|
156
166
|
}
|
|
157
167
|
break;
|
|
158
|
-
default:
|
|
168
|
+
default: U(t.name, String(_), t);
|
|
159
169
|
}
|
|
160
170
|
break;
|
|
161
171
|
case "header": {
|
|
162
|
-
let
|
|
163
|
-
|
|
164
|
-
name:
|
|
165
|
-
value: String(
|
|
172
|
+
let e = d(_, h);
|
|
173
|
+
M.push({
|
|
174
|
+
name: t.name,
|
|
175
|
+
value: String(e)
|
|
166
176
|
});
|
|
167
177
|
break;
|
|
168
178
|
}
|
|
169
179
|
case "cookie": {
|
|
170
|
-
let [
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
|
|
180
|
+
let [e, n] = (A ?? "").split("."), i = e === "3" && n === "2" && !("content" in t) ? m(t, _) : void 0;
|
|
181
|
+
if (i) throw new w(i);
|
|
182
|
+
if (r === "cookie") {
|
|
183
|
+
F.push(...o(t.name, _, h));
|
|
174
184
|
break;
|
|
175
185
|
}
|
|
176
|
-
let
|
|
177
|
-
if (Array.isArray(
|
|
178
|
-
let n =
|
|
179
|
-
|
|
186
|
+
let a = l(_, h);
|
|
187
|
+
if (Array.isArray(a)) for (let e of a) {
|
|
188
|
+
let n = e.key || t.name, r = e.value === null ? "null" : String(e.value);
|
|
189
|
+
P.push({
|
|
180
190
|
name: n,
|
|
181
191
|
value: r
|
|
182
192
|
});
|
|
183
193
|
}
|
|
184
194
|
else {
|
|
185
|
-
let
|
|
186
|
-
|
|
187
|
-
name:
|
|
188
|
-
value:
|
|
195
|
+
let e = a === null ? "null" : String(a);
|
|
196
|
+
P.push({
|
|
197
|
+
name: t.name,
|
|
198
|
+
value: e
|
|
189
199
|
});
|
|
190
200
|
}
|
|
191
201
|
break;
|
|
192
202
|
}
|
|
193
203
|
}
|
|
194
204
|
}
|
|
195
|
-
if (
|
|
205
|
+
if (F.length || V.length) {
|
|
196
206
|
let e = [
|
|
197
|
-
...
|
|
198
|
-
...
|
|
199
|
-
...
|
|
200
|
-
].join("; "), t =
|
|
201
|
-
t ?
|
|
207
|
+
...P.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`),
|
|
208
|
+
...F.map((e) => `${e.name}=${e.value}`),
|
|
209
|
+
...V
|
|
210
|
+
].join("; "), t = M.find((e) => e.name.toLowerCase() === "cookie");
|
|
211
|
+
t ? M.splice(M.indexOf(t), 1, {
|
|
202
212
|
...t,
|
|
203
213
|
value: t.value ? `${t.value}; ${e}` : e
|
|
204
|
-
}) :
|
|
214
|
+
}) : M.push({
|
|
205
215
|
name: "Cookie",
|
|
206
216
|
value: e
|
|
207
217
|
});
|
|
208
218
|
}
|
|
209
|
-
if (
|
|
210
|
-
let e =
|
|
211
|
-
|
|
219
|
+
if (B.length) {
|
|
220
|
+
let e = I.indexOf("#"), t = e < 0 ? "" : I.slice(e), n = e < 0 ? I : I.slice(0, e);
|
|
221
|
+
I = `${n}${n.includes("?") ? "&" : "?"}${B.join("&")}${t}`;
|
|
212
222
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
223
|
+
if (z && g(I), R && _(I, L)) throw URIError("A label-style path parameter produces a dot segment that browsers remove.");
|
|
224
|
+
return {
|
|
225
|
+
url: I,
|
|
226
|
+
headers: M,
|
|
227
|
+
queryString: N,
|
|
228
|
+
cookies: F.length || V.length ? [] : P,
|
|
229
|
+
hasCookieStyleEntries: F.length > 0 || V.length > 0,
|
|
230
|
+
...B.length ? { hasSerializedQuery: !0 } : {}
|
|
220
231
|
};
|
|
221
|
-
}, E = (t, n, r, i, a) => {
|
|
222
|
-
switch (i) {
|
|
223
|
-
case "matrix":
|
|
224
|
-
if (a) {
|
|
225
|
-
if (Array.isArray(r)) {
|
|
226
|
-
let e = r.map((e) => `${n.name}=${e}`).join(";");
|
|
227
|
-
return t.replace(`{;${n.name}}`, `;${e}`);
|
|
228
|
-
}
|
|
229
|
-
if (e(r)) {
|
|
230
|
-
let e = Object.entries(r).map(([e, t]) => `${e}=${t}`).join(";");
|
|
231
|
-
return t.replace(`{;${n.name}}`, `;${e}`);
|
|
232
|
-
}
|
|
233
|
-
return t.replace(`{;${n.name}}`, `;${n.name}=${r}`);
|
|
234
|
-
}
|
|
235
|
-
if (Array.isArray(r)) return t.replace(`{;${n.name}}`, `;${n.name}=${r.join(",")}`);
|
|
236
|
-
if (e(r)) {
|
|
237
|
-
let e = Object.entries(r).map(([e, t]) => `${e},${t}`).join(",");
|
|
238
|
-
return t.replace(`{;${n.name}}`, `;${n.name}=${e}`);
|
|
239
|
-
}
|
|
240
|
-
return t.replace(`{;${n.name}}`, `;${n.name}=${r}`);
|
|
241
|
-
case "label":
|
|
242
|
-
if (a) {
|
|
243
|
-
if (Array.isArray(r)) return t.replace(`{.${n.name}}`, `.${r.join(".")}`);
|
|
244
|
-
if (e(r)) {
|
|
245
|
-
let e = Object.entries(r).map(([e, t]) => `${e}=${t}`).join(".");
|
|
246
|
-
return t.replace(`{.${n.name}}`, `.${e}`);
|
|
247
|
-
}
|
|
248
|
-
return t.replace(`{.${n.name}}`, `.${r}`);
|
|
249
|
-
}
|
|
250
|
-
if (Array.isArray(r)) return t.replace(`{.${n.name}}`, `.${r.join(",")}`);
|
|
251
|
-
if (e(r)) {
|
|
252
|
-
let e = Object.entries(r).map(([e, t]) => `${e},${t}`).join(",");
|
|
253
|
-
return t.replace(`{.${n.name}}`, `.${e}`);
|
|
254
|
-
}
|
|
255
|
-
return t.replace(`{.${n.name}}`, `.${r}`);
|
|
256
|
-
case "simple": {
|
|
257
|
-
let e = d(r, a);
|
|
258
|
-
return t.replace(`{${n.name}}`, String(e));
|
|
259
|
-
}
|
|
260
|
-
default: return t.replace(`{${n.name}}`, String(r));
|
|
261
|
-
}
|
|
262
232
|
};
|
|
263
|
-
export {
|
|
233
|
+
export { w as CookieSerializationError, k as processParameters };
|
|
264
234
|
|
|
265
235
|
//# sourceMappingURL=process-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-parameters.js","names":["CookieSerializationError","deReferenceParams","params","getResolvedRef","param","isAllowReserved","getParameterStyleAndExplode","explode","defaultStyle","style","getParameterValue","selected","getParameterExample","example","exampleValue","propertyStates","filterDisabledProperties","deSerializeParameter","isParamDisabled","defaultDisabled","options","schema","getExampleFromSchema","processParameters","newHeaders","harRequest","newQueryString","newCookies","cookieStyleEntries","newUrl","hasReservedPathParameter","serializedQuery","serializedCookies","appendQueryParameter","name","value","deReferencedParams","parameters","querystring","getQuerystringParameter","hashIndex","hash","base","query","serializeQuerystringParameter","wireValue","text","paramValue","openapiVersion","jsonSchemaDialect","allowReserved","pathValue","serializeReservedPathParameter","processPathParameters","paramContentType","serializedValue","serializeContentValue","serialized","serializeFormStyle","entry","serializeSpaceDelimitedStyle","serializePipeDelimitedStyle","entries","serializeDeepObjectStyle","serializeSimpleStyle","major","minor","error","getCookieSerializationError","serializeCookieStyle","serializeFormStyleForCookies","key","cookieValue","cookie","existing","header","assertReservedPathUrl","values","v","url","isObjectLike","k"],"sources":["../../../../src/code-example/helpers/operation-to-har/process-parameters.ts"],"sourcesContent":["import { getCookieSerializationError } from '@scalar/helpers/http/get-cookie-serialization-error'\nimport { isObjectLike } from '@scalar/helpers/object/is-object'\nimport {\n assertReservedPathUrl,\n serializeReservedPathParameter,\n} from '@scalar/workspace-store/helpers/encode-path-parameter'\nimport { getParameterExample } from '@scalar/workspace-store/helpers/get-parameter-example'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n getQuerystringParameter,\n serializeQuerystringParameter,\n} from '@scalar/workspace-store/helpers/querystring-parameter'\nimport {\n deSerializeParameter,\n filterDisabledProperties,\n getExampleFromSchema,\n isParamDisabled,\n serializeContentValue,\n serializeCookieStyle,\n serializeDeepObjectStyle,\n serializeFormStyle,\n serializeFormStyleForCookies,\n serializePipeDelimitedStyle,\n serializeSimpleStyle,\n serializeSpaceDelimitedStyle,\n} from '@scalar/workspace-store/request-example'\nimport type { OperationObject, ParameterObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport type { Request as HarRequest } from 'har-format'\n\n/** An invalid cookie declaration that authors can repair before generating a sample. */\nexport class CookieSerializationError extends Error {}\n\ntype ProcessedParameters = {\n /** Named serialized examples already embedded in the URL. */\n hasSerializedQuery?: boolean\n url: string\n headers: HarRequest['headers']\n queryString: HarRequest['queryString']\n cookies: HarRequest['cookies']\n /** Whether serialized cookie-style values require a complete Cookie header. */\n hasCookieStyleEntries: boolean\n}\n\n/** Ensures we don't have any references in the parameters */\nconst deReferenceParams = (params: OperationObject['parameters']): ParameterObject[] =>\n (params ?? []).map((param) => getResolvedRef(param)).filter((param) => param !== undefined)\n\n/** Whether the parameter allows reserved characters (from param or schema). */\nconst isAllowReserved = (param: ParameterObject): boolean => {\n if ('allowReserved' in param && param.allowReserved !== undefined) {\n return param.allowReserved\n }\n if ('schema' in param && param.schema && typeof param.schema === 'object' && 'allowReserved' in param.schema) {\n return (param.schema as { allowReserved?: boolean }).allowReserved === true\n }\n return false\n}\n\n/**\n * Get the style and explode values for a parameter according to OpenAPI 3.1.1 specification.\n * Handles defaults and validation for parameter location restrictions.\n */\nconst getParameterStyleAndExplode = (param: ParameterObject): { style: string; explode: boolean } => {\n // Headers only support 'simple' style\n if (param.in === 'header') {\n const explode = 'explode' in param && param.explode !== undefined ? param.explode : false\n return { style: 'simple', explode }\n }\n\n // Cookies default to form for compatibility and also support cookie style.\n if (param.in === 'cookie') {\n const explode = 'explode' in param && param.explode !== undefined ? param.explode : true\n return { style: 'style' in param && param.style === 'cookie' ? 'cookie' : 'form', explode }\n }\n\n const defaultStyle = {\n path: 'simple',\n query: 'form',\n querystring: 'form',\n header: 'simple',\n cookie: 'form',\n }[param.in]\n\n // Use provided style or default based on location\n const style = 'style' in param && param.style ? param.style : defaultStyle\n\n // Determine explode value: use provided value or default based on style\n const explode = 'explode' in param && param.explode !== undefined ? param.explode : style === 'form'\n\n return { style, explode }\n}\n\n/**\n * Extract the value for a parameter from example data or schema.\n * Prioritizes example data over schema examples.\n * Returns null if the parameter is disabled so we can skip it.\n */\nconst getParameterValue = (\n param: ParameterObject,\n example: string | undefined,\n defaultDisabled: boolean,\n openapiVersion?: string,\n jsonSchemaDialect?: string,\n): unknown => {\n // Try to get value from example first\n const selected = getParameterExample(param, example)\n const exampleValue = selected.example\n\n const propertyStates =\n param.in === 'query' && !selected.serialized && !selected.mediaSerialized\n ? exampleValue?.['x-scalar-disabled-properties']\n : undefined\n if (propertyStates) {\n return filterDisabledProperties(\n deSerializeParameter(selected.value, param),\n propertyStates,\n isParamDisabled(param, exampleValue, defaultDisabled),\n )\n }\n\n // If the parameter is disabled, return undefined so we can skip it.\n if (isParamDisabled(param, exampleValue, defaultDisabled)) {\n return undefined\n }\n\n // If the example value is set, return it.\n if (selected.value !== undefined) {\n return deSerializeParameter(selected.value, param)\n }\n\n // Fall back to schema example if available\n if (!('schema' in param) || !param.schema) {\n return undefined\n }\n\n const options = {\n openapiVersion,\n jsonSchemaDialect,\n ...(param.in === 'path' ? { emptyString: `{${param.name}}`, preserveStringFallback: true } : {}),\n }\n const schema = getResolvedRef(param.schema)\n return schema ? getExampleFromSchema(schema, options) : undefined\n}\n\n/**\n * Process OpenAPI parameters and return the updated properties.\n * Handles path, query, and header parameters with various styles and explode options.\n *\n * @see https://spec.openapis.org/oas/latest.html#style-values\n */\nexport const processParameters = ({\n harRequest,\n parameters,\n example,\n defaultDisabled,\n openapiVersion,\n jsonSchemaDialect,\n}: {\n harRequest: HarRequest\n parameters: OperationObject['parameters']\n /** The name of the example to use */\n example?: string | undefined\n /** Whether to disable parameters by default. */\n defaultDisabled: boolean\n /** Originating API description version. */\n openapiVersion?: string\n jsonSchemaDialect?: string\n}): ProcessedParameters => {\n // Create copies of the arrays to avoid modifying the input\n const newHeaders = [...harRequest.headers]\n const newQueryString = [...harRequest.queryString]\n const newCookies = [...harRequest.cookies]\n const cookieStyleEntries: HarRequest['cookies'] = []\n let newUrl = harRequest.url\n let hasReservedPathParameter = false\n const serializedQuery: string[] = []\n const serializedCookies: string[] = []\n\n const appendQueryParameter = (name: string, value: string, param: ParameterObject): void => {\n if (isAllowReserved(param)) {\n // HTTP clients cannot infer reserved expansion from a HAR name/value pair.\n serializedQuery.push(`${encodeURIComponent(name)}=${value}`)\n } else {\n newQueryString.push({ name, value })\n }\n }\n\n // Filter out references\n const deReferencedParams = deReferenceParams(parameters)\n\n for (const param of deReferencedParams) {\n if (!param.in || !param.name) {\n continue\n }\n\n if (param.in === 'querystring') {\n const querystring = getQuerystringParameter(param, example, {\n defaultDisabled,\n openapiVersion,\n jsonSchemaDialect,\n })\n if (querystring) {\n const hashIndex = newUrl.indexOf('#')\n const hash = hashIndex === -1 ? '' : newUrl.slice(hashIndex)\n const base = (hashIndex === -1 ? newUrl : newUrl.slice(0, hashIndex)).split('?')[0]\n const query = serializeQuerystringParameter(querystring)\n newUrl = `${base}${query ? `?${query}` : ''}${hash}`\n }\n continue\n }\n\n const selected = getParameterExample(param, example)\n if (selected.serialized && !isParamDisabled(param, selected.example, defaultDisabled)) {\n const wireValue = String(selected.value)\n switch (param.in) {\n case 'path':\n newUrl = newUrl.replaceAll(`{${param.name}}`, () => wireValue)\n break\n case 'query':\n serializedQuery.push(wireValue)\n break\n case 'header':\n newHeaders.push({ name: param.name, value: wireValue })\n break\n case 'cookie':\n serializedCookies.push(wireValue)\n break\n }\n continue\n }\n if (selected.mediaSerialized && !isParamDisabled(param, selected.example, defaultDisabled)) {\n const text = String(selected.value)\n switch (param.in) {\n case 'query':\n appendQueryParameter(param.name, text, param)\n break\n case 'header':\n newHeaders.push({ name: param.name, value: text })\n break\n case 'path':\n newUrl = newUrl.replaceAll(`{${param.name}}`, () => encodeURIComponent(text))\n break\n case 'cookie':\n newCookies.push({ name: param.name, value: text })\n break\n }\n continue\n }\n const paramValue = getParameterValue(param, example, defaultDisabled, openapiVersion, jsonSchemaDialect)\n if (paramValue === undefined) {\n continue\n }\n\n const { style, explode } = getParameterStyleAndExplode(param)\n\n switch (param.in) {\n case 'path': {\n const allowReserved = openapiVersion?.startsWith('3.2.') && 'schema' in param && param.allowReserved === true\n hasReservedPathParameter ||= Boolean(allowReserved)\n const pathValue = allowReserved\n ? serializeReservedPathParameter(param.name, { value: paramValue, style, explode })\n : undefined\n newUrl =\n pathValue === undefined\n ? processPathParameters(newUrl, param, paramValue, style, explode)\n : newUrl.replaceAll(`{${param.name}}`, () => pathValue)\n break\n }\n\n case 'query': {\n // Content type parameters should be serialized according to the parameter's own content type\n if ('content' in param && param.content) {\n // We grab the first for now but eventually we should support selecting the content type per parameter\n const paramContentType = Object.keys(param.content)[0] ?? 'application/json'\n const serializedValue = serializeContentValue(paramValue, paramContentType)\n appendQueryParameter(param.name, serializedValue, param)\n break\n }\n\n // Handle query parameters\n switch (style) {\n case 'form': {\n const serialized = serializeFormStyle(paramValue, explode)\n\n // If serialized is an array of key-value pairs (exploded object or array)\n if (Array.isArray(serialized)) {\n for (const entry of serialized) {\n const key = entry.key || param.name\n appendQueryParameter(key, String(entry.value), param)\n }\n }\n // Otherwise, convert to string\n else {\n appendQueryParameter(param.name, String(serialized), param)\n }\n break\n }\n case 'spaceDelimited': {\n const serialized = serializeSpaceDelimitedStyle(paramValue)\n appendQueryParameter(param.name, serialized, param)\n break\n }\n case 'pipeDelimited': {\n const serialized = serializePipeDelimitedStyle(paramValue)\n appendQueryParameter(param.name, serialized, param)\n break\n }\n case 'deepObject': {\n // OAS marks deepObject-on-array and deepObject+explode:false as undefined.\n // Mirror process-body: fall back to form/explode:true for arrays and always\n // invoke the serializer for objects so authors get useful output instead of\n // a silently-dropped parameter.\n if (Array.isArray(paramValue)) {\n const serialized = serializeFormStyle(paramValue, true)\n if (Array.isArray(serialized)) {\n for (const entry of serialized) {\n const key = entry.key || param.name\n appendQueryParameter(key, String(entry.value), param)\n }\n } else {\n appendQueryParameter(param.name, String(serialized), param)\n }\n } else {\n const entries = serializeDeepObjectStyle(param.name, paramValue)\n for (const entry of entries) {\n appendQueryParameter(entry.key, entry.value, param)\n }\n }\n break\n }\n\n // Default to form style\n default:\n appendQueryParameter(param.name, String(paramValue), param)\n }\n break\n }\n\n // Headers only support 'simple' style according to OpenAPI 3.1.1\n // For arrays, simple style always produces comma-separated values regardless of explode\n // The explode parameter only affects object serialization\n case 'header': {\n const serialized = serializeSimpleStyle(paramValue, explode)\n newHeaders.push({ name: param.name, value: String(serialized) })\n break\n }\n\n // Keep cookie style separate so snippet generators cannot percent-encode it.\n case 'cookie': {\n const [major, minor] = (openapiVersion ?? '').split('.')\n const error =\n major === '3' && minor === '2' && !('content' in param)\n ? getCookieSerializationError(param, paramValue)\n : undefined\n if (error) {\n throw new CookieSerializationError(error)\n }\n if (style === 'cookie') {\n cookieStyleEntries.push(...serializeCookieStyle(param.name, paramValue, explode))\n break\n }\n const serialized = serializeFormStyleForCookies(paramValue, explode)\n\n // If serialized is an array of key-value pairs (exploded object or array)\n if (Array.isArray(serialized)) {\n for (const entry of serialized) {\n const key = entry.key || param.name\n const value = entry.value === null ? 'null' : String(entry.value)\n newCookies.push({ name: key, value })\n }\n }\n // Otherwise, convert to string\n else {\n const value = serialized === null ? 'null' : String(serialized)\n newCookies.push({ name: param.name, value })\n }\n break\n }\n }\n }\n\n // HAR cookie entries are encoded by snippet generators. Use a complete header\n // when cookie style is present, preserving legacy encoding for other cookies.\n if (cookieStyleEntries.length || serializedCookies.length) {\n const cookieValue = [\n ...newCookies.map((cookie) => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`),\n ...cookieStyleEntries.map((cookie) => `${cookie.name}=${cookie.value}`),\n ...serializedCookies,\n ].join('; ')\n const existing = newHeaders.find((header) => header.name.toLowerCase() === 'cookie')\n if (existing) {\n newHeaders.splice(newHeaders.indexOf(existing), 1, {\n ...existing,\n value: existing.value ? `${existing.value}; ${cookieValue}` : cookieValue,\n })\n } else {\n newHeaders.push({ name: 'Cookie', value: cookieValue })\n }\n }\n\n if (serializedQuery.length) {\n const hashIndex = newUrl.indexOf('#')\n const hash = hashIndex < 0 ? '' : newUrl.slice(hashIndex)\n const base = hashIndex < 0 ? newUrl : newUrl.slice(0, hashIndex)\n newUrl = `${base}${base.includes('?') ? '&' : '?'}${serializedQuery.join('&')}${hash}`\n }\n\n if (hasReservedPathParameter) {\n assertReservedPathUrl(newUrl)\n }\n\n return {\n url: newUrl,\n headers: newHeaders,\n queryString: newQueryString,\n cookies: cookieStyleEntries.length || serializedCookies.length ? [] : newCookies,\n hasCookieStyleEntries: cookieStyleEntries.length > 0 || serializedCookies.length > 0,\n ...(serializedQuery.length ? { hasSerializedQuery: true } : {}),\n }\n}\n\n/**\n * Process path parameters according to OpenAPI specification.\n * Handles matrix, label, and simple styles with explode options.\n *\n * @param url - The URL to process\n * @param param - The parameter object\n * @param paramValue - The value of the parameter\n * @param style - The style of the parameter (matrix, label, simple)\n * @param explode - Whether to explode the parameter\n * @returns The updated URL with processed path parameters\n */\nconst processPathParameters = (\n url: string,\n param: ParameterObject,\n paramValue: unknown,\n style: string,\n explode: boolean,\n): string => {\n switch (style) {\n case 'matrix': {\n if (explode) {\n // Matrix explode array: ;color=blue;color=black;color=brown\n if (Array.isArray(paramValue)) {\n const values = paramValue.map((v: unknown) => `${param.name}=${v}`).join(';')\n return url.replace(`{;${param.name}}`, `;${values}`)\n }\n\n // Matrix explode object: ;R=100;G=200;B=150\n if (isObjectLike(paramValue)) {\n const values = Object.entries(paramValue)\n .map(([k, v]) => `${k}=${v}`)\n .join(';')\n return url.replace(`{;${param.name}}`, `;${values}`)\n }\n\n // Matrix explode primitive: ;color=blue\n return url.replace(`{;${param.name}}`, `;${param.name}=${paramValue}`)\n }\n\n // Matrix no explode array: ;color=blue,black,brown\n if (Array.isArray(paramValue)) {\n return url.replace(`{;${param.name}}`, `;${param.name}=${paramValue.join(',')}`)\n }\n\n // Matrix no explode object: ;color=R,100,G,200,B,150\n if (isObjectLike(paramValue)) {\n const values = Object.entries(paramValue)\n .map(([k, v]) => `${k},${v}`)\n .join(',')\n return url.replace(`{;${param.name}}`, `;${param.name}=${values}`)\n }\n\n // Matrix no explode primitive: ;color=blue\n return url.replace(`{;${param.name}}`, `;${param.name}=${paramValue}`)\n }\n case 'label': {\n if (explode) {\n // Label explode array: .blue.black.brown\n if (Array.isArray(paramValue)) {\n return url.replace(`{.${param.name}}`, `.${paramValue.join('.')}`)\n }\n\n // Label explode object: .R=100.G=200.B=150\n if (isObjectLike(paramValue)) {\n const values = Object.entries(paramValue)\n .map(([k, v]) => `${k}=${v}`)\n .join('.')\n\n return url.replace(`{.${param.name}}`, `.${values}`)\n }\n\n // Label explode primitive: .blue\n return url.replace(`{.${param.name}}`, `.${paramValue}`)\n }\n\n // Label no explode array: .blue,black,brown\n if (Array.isArray(paramValue)) {\n return url.replace(`{.${param.name}}`, `.${paramValue.join(',')}`)\n }\n\n // Label no explode object: .R,100,G,200,B,150\n if (isObjectLike(paramValue)) {\n const values = Object.entries(paramValue)\n .map(([k, v]) => `${k},${v}`)\n .join(',')\n\n return url.replace(`{.${param.name}}`, `.${values}`)\n }\n\n // Label no explode primitive: .blue\n return url.replace(`{.${param.name}}`, `.${paramValue}`)\n }\n\n case 'simple': {\n const serialized = serializeSimpleStyle(paramValue, explode)\n return url.replace(`{${param.name}}`, String(serialized))\n }\n\n // Default to simple style\n default:\n return url.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AAM8B,IAAS,OAAO,QAAQ9B,CAAU,CAAC,CACtC,KAAK,CAACkC,GAAGH,OAAO,GAAGG,EAAE,GAAGH,GAAG,CAAC,CAC5B,KAAK,GAAG;KAEX,OAAOC,EAAI,QAAQ,KAAK3E,EAAM,KAAK,IAAI,IAAIyE,GAAQ;IACrD;IAGA,OAAOE,EAAI,QAAQ,KAAK3E,EAAM,KAAK,IAAI,IAAI2C,GAAY;GACzD;GAGA,IAAI,MAAM,QAAQA,CAAU,GAC1B,OAAOgC,EAAI,QAAQ,KAAK3E,EAAM,KAAK,IAAI,IAAI2C,EAAW,KAAK,GAAG,GAAG;GAInE,IAAIiC,EAAajC,CAAU,GAAG;IAC5B,IAAM8B,IAAS,OAAO,QAAQ9B,CAAU,CAAC,CACtC,KAAK,CAACkC,GAAGH,OAAO,GAAGG,EAAE,GAAGH,GAAG,CAAC,CAC5B,KAAK,GAAG;IAEX,OAAOC,EAAI,QAAQ,KAAK3E,EAAM,KAAK,IAAI,IAAIyE,GAAQ;GACrD;GAGA,OAAOE,EAAI,QAAQ,KAAK3E,EAAM,KAAK,IAAI,IAAI2C,GAAY;EAGzD,KAAK,UAAU;GACb,IAAMU,IAAaO,EAAqBjB,GAAYxC,CAAO;GAC3D,OAAOwE,EAAI,QAAQ,IAAI3E,EAAM,KAAK,IAAI,OAAOqD,CAAU,CAAC;EAC1D;EAGA,SACE,OAAOsB,EAAI,QAAQ,IAAI3E,EAAM,KAAK,IAAI,OAAO2C,CAAU,CAAC;CAC5D;AACF"}
|
|
1
|
+
{"version":3,"file":"process-parameters.js","names":["CookieSerializationError","deReferenceParams","params","getResolvedRef","param","isAllowReserved","getParameterStyleAndExplode","explode","defaultStyle","style","getParameterValue","selected","getParameterExample","example","exampleValue","propertyStates","filterDisabledProperties","deSerializeParameter","isParamDisabled","defaultDisabled","options","schema","getExampleFromSchema","processParameters","newHeaders","harRequest","newQueryString","newCookies","cookieStyleEntries","newUrl","markedPathUrl","hasStyledLabel","hasReservedPathParameter","serializedQuery","serializedCookies","substitutePathParameter","replacePathVariables","name","value","markLabel","appendQueryParameter","encodeReservedQueryValue","deReferencedParams","parameters","querystring","getQuerystringParameter","hashIndex","hash","base","query","serializeQuerystringParameter","wireValue","text","isStyledPath","paramValue","openapiVersion","jsonSchemaDialect","allowReserved","serializePathParameter","includesUndefinedPathPrefix","operator","serializeReservedPathParameter","serializeSimpleStyle","paramContentType","serializedValue","serializeContentValue","serialized","serializeFormStyle","entry","serializeSpaceDelimitedStyle","serializePipeDelimitedStyle","entries","serializeDeepObjectStyle","major","minor","error","getCookieSerializationError","serializeCookieStyle","serializeFormStyleForCookies","key","cookieValue","cookie","existing","header","assertReservedPathUrl","hasPathDotSegment"],"sources":["../../../../src/code-example/helpers/operation-to-har/process-parameters.ts"],"sourcesContent":["import { getCookieSerializationError } from '@scalar/helpers/http/get-cookie-serialization-error'\nimport { replacePathVariables } from '@scalar/helpers/regex/replace-variables'\nimport {\n assertReservedPathUrl,\n hasPathDotSegment,\n includesUndefinedPathPrefix,\n serializePathParameter,\n serializeReservedPathParameter,\n} from '@scalar/workspace-store/helpers/encode-path-parameter'\nimport { getParameterExample } from '@scalar/workspace-store/helpers/get-parameter-example'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n getQuerystringParameter,\n serializeQuerystringParameter,\n} from '@scalar/workspace-store/helpers/querystring-parameter'\nimport {\n deSerializeParameter,\n encodeReservedQueryValue,\n filterDisabledProperties,\n getExampleFromSchema,\n isParamDisabled,\n serializeContentValue,\n serializeCookieStyle,\n serializeDeepObjectStyle,\n serializeFormStyle,\n serializeFormStyleForCookies,\n serializePipeDelimitedStyle,\n serializeSimpleStyle,\n serializeSpaceDelimitedStyle,\n} from '@scalar/workspace-store/request-example'\nimport type { OperationObject, ParameterObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport type { Request as HarRequest } from 'har-format'\n\n/** An invalid cookie declaration that authors can repair before generating a sample. */\nexport class CookieSerializationError extends Error {}\n\ntype ProcessedParameters = {\n /** Named serialized examples already embedded in the URL. */\n hasSerializedQuery?: boolean\n url: string\n headers: HarRequest['headers']\n queryString: HarRequest['queryString']\n cookies: HarRequest['cookies']\n /** Whether serialized cookie-style values require a complete Cookie header. */\n hasCookieStyleEntries: boolean\n}\n\n/** Ensures we don't have any references in the parameters */\nconst deReferenceParams = (params: OperationObject['parameters']): ParameterObject[] =>\n (params ?? []).map((param) => getResolvedRef(param)).filter((param) => param !== undefined)\n\n/** Whether the parameter allows reserved characters (from param or schema). */\nconst isAllowReserved = (param: ParameterObject): boolean => {\n if ('allowReserved' in param && param.allowReserved !== undefined) {\n return param.allowReserved\n }\n if ('schema' in param && param.schema && typeof param.schema === 'object' && 'allowReserved' in param.schema) {\n return (param.schema as { allowReserved?: boolean }).allowReserved === true\n }\n return false\n}\n\n/**\n * Get the style and explode values for a parameter according to OpenAPI 3.1.1 specification.\n * Handles defaults and validation for parameter location restrictions.\n */\nconst getParameterStyleAndExplode = (param: ParameterObject): { style: string; explode: boolean } => {\n // Headers only support 'simple' style\n if (param.in === 'header') {\n const explode = 'explode' in param && param.explode !== undefined ? param.explode : false\n return { style: 'simple', explode }\n }\n\n // Cookies default to form for compatibility and also support cookie style.\n if (param.in === 'cookie') {\n const explode = 'explode' in param && param.explode !== undefined ? param.explode : true\n return { style: 'style' in param && param.style === 'cookie' ? 'cookie' : 'form', explode }\n }\n\n const defaultStyle = {\n path: 'simple',\n query: 'form',\n querystring: 'form',\n header: 'simple',\n cookie: 'form',\n }[param.in]\n\n // Use provided style or default based on location\n const style = 'style' in param && param.style ? param.style : defaultStyle\n\n // Determine explode value: use provided value or default based on style\n const explode = 'explode' in param && param.explode !== undefined ? param.explode : style === 'form'\n\n return { style, explode }\n}\n\n/**\n * Extract the value for a parameter from example data or schema.\n * Prioritizes example data over schema examples.\n * Returns null if the parameter is disabled so we can skip it.\n */\nconst getParameterValue = (\n param: ParameterObject,\n example: string | undefined,\n defaultDisabled: boolean,\n openapiVersion?: string,\n jsonSchemaDialect?: string,\n): unknown => {\n // Try to get value from example first\n const selected = getParameterExample(param, example)\n const exampleValue = selected.example\n\n const propertyStates =\n param.in === 'query' && !selected.serialized && !selected.mediaSerialized\n ? exampleValue?.['x-scalar-disabled-properties']\n : undefined\n if (propertyStates) {\n return filterDisabledProperties(\n deSerializeParameter(selected.value, param),\n propertyStates,\n isParamDisabled(param, exampleValue, defaultDisabled),\n )\n }\n\n // If the parameter is disabled, return undefined so we can skip it.\n if (isParamDisabled(param, exampleValue, defaultDisabled)) {\n return undefined\n }\n\n // If the example value is set, return it.\n if (selected.value !== undefined) {\n return deSerializeParameter(selected.value, param)\n }\n\n // Fall back to schema example if available\n if (!('schema' in param) || !param.schema) {\n return undefined\n }\n\n const options = {\n openapiVersion,\n jsonSchemaDialect,\n ...(param.in === 'path' ? { emptyString: `{${param.name}}`, preserveStringFallback: true } : {}),\n }\n const schema = getResolvedRef(param.schema)\n return schema ? getExampleFromSchema(schema, options) : undefined\n}\n\n/**\n * Process OpenAPI parameters and return the updated properties.\n * Handles path, query, and header parameters with various styles and explode options.\n *\n * @see https://spec.openapis.org/oas/latest.html#style-values\n */\nexport const processParameters = ({\n harRequest,\n parameters,\n example,\n defaultDisabled,\n openapiVersion,\n jsonSchemaDialect,\n}: {\n harRequest: HarRequest\n parameters: OperationObject['parameters']\n /** The name of the example to use */\n example?: string | undefined\n /** Whether to disable parameters by default. */\n defaultDisabled: boolean\n /** Originating API description version. */\n openapiVersion?: string\n jsonSchemaDialect?: string\n}): ProcessedParameters => {\n // Create copies of the arrays to avoid modifying the input\n const newHeaders = [...harRequest.headers]\n const newQueryString = [...harRequest.queryString]\n const newCookies = [...harRequest.cookies]\n const cookieStyleEntries: HarRequest['cookies'] = []\n let newUrl = harRequest.url\n let markedPathUrl = harRequest.url\n let hasStyledLabel = false\n let hasReservedPathParameter = false\n const serializedQuery: string[] = []\n const serializedCookies: string[] = []\n\n const substitutePathParameter = (name: string, value: string, markLabel = false): void => {\n newUrl = replacePathVariables(newUrl, { [name]: value })\n // Mark only label substitutions so literal dot segments keep their usual URL semantics.\n markedPathUrl = replacePathVariables(markedPathUrl, { [name]: markLabel ? `x${value}` : value })\n hasStyledLabel ||= markLabel\n }\n\n const appendQueryParameter = (name: string, value: string, param: ParameterObject): void => {\n if (isAllowReserved(param)) {\n // HTTP clients cannot infer reserved expansion from a HAR name/value pair.\n serializedQuery.push(`${encodeURIComponent(name)}=${encodeReservedQueryValue(value)}`)\n } else {\n newQueryString.push({ name, value })\n }\n }\n\n // Filter out references\n const deReferencedParams = deReferenceParams(parameters)\n\n for (const param of deReferencedParams) {\n if (!param.in || !param.name) {\n continue\n }\n\n if (param.in === 'querystring') {\n const querystring = getQuerystringParameter(param, example, {\n defaultDisabled,\n openapiVersion,\n jsonSchemaDialect,\n })\n if (querystring) {\n const hashIndex = newUrl.indexOf('#')\n const hash = hashIndex === -1 ? '' : newUrl.slice(hashIndex)\n const base = (hashIndex === -1 ? newUrl : newUrl.slice(0, hashIndex)).split('?')[0]\n const query = serializeQuerystringParameter(querystring)\n newUrl = `${base}${query ? `?${query}` : ''}${hash}`\n }\n continue\n }\n\n const selected = getParameterExample(param, example)\n if (selected.serialized && !isParamDisabled(param, selected.example, defaultDisabled)) {\n const wireValue = String(selected.value)\n switch (param.in) {\n case 'path':\n substitutePathParameter(param.name, wireValue)\n break\n case 'query':\n serializedQuery.push(wireValue)\n break\n case 'header':\n newHeaders.push({ name: param.name, value: wireValue })\n break\n case 'cookie':\n serializedCookies.push(wireValue)\n break\n }\n continue\n }\n if (selected.mediaSerialized && !isParamDisabled(param, selected.example, defaultDisabled)) {\n const text = String(selected.value)\n switch (param.in) {\n case 'query':\n appendQueryParameter(param.name, text, param)\n break\n case 'header':\n newHeaders.push({ name: param.name, value: text })\n break\n case 'path':\n substitutePathParameter(param.name, encodeURIComponent(text))\n break\n case 'cookie':\n newCookies.push({ name: param.name, value: text })\n break\n }\n continue\n }\n const { style, explode } = getParameterStyleAndExplode(param)\n const isStyledPath = param.in === 'path' && (style === 'matrix' || style === 'label')\n // Like Test Request, leave the template visible when no example supplies a styled path value.\n const paramValue = isStyledPath\n ? deSerializeParameter(selected.value, param)\n : getParameterValue(param, example, defaultDisabled, openapiVersion, jsonSchemaDialect)\n if (\n isStyledPath\n ? !selected.example || isParamDisabled(param, selected.example, defaultDisabled)\n : paramValue === undefined\n ) {\n continue\n }\n\n switch (param.in) {\n case 'path': {\n const allowReserved = openapiVersion?.startsWith('3.2.') && 'schema' in param && param.allowReserved === true\n hasReservedPathParameter ||= Boolean(allowReserved)\n\n if (isStyledPath) {\n const value = serializePathParameter(\n param.name,\n {\n value: paramValue,\n style,\n explode,\n includeUndefinedPrefix: includesUndefinedPathPrefix(openapiVersion),\n },\n undefined,\n allowReserved,\n )\n // Support older samples that include a URI template operator in the path.\n const operator = style === 'matrix' ? ';' : '.'\n const name = newUrl.includes(`{${param.name}}`) ? param.name : `${operator}${param.name}`\n substitutePathParameter(name, value, style === 'label' && !allowReserved)\n } else if (allowReserved) {\n substitutePathParameter(\n param.name,\n serializeReservedPathParameter(param.name, { value: paramValue, style, explode }),\n )\n } else {\n const value = style === 'simple' ? serializeSimpleStyle(paramValue, explode) : paramValue\n substitutePathParameter(param.name, String(value))\n }\n break\n }\n\n case 'query': {\n // Content type parameters should be serialized according to the parameter's own content type\n if ('content' in param && param.content) {\n // We grab the first for now but eventually we should support selecting the content type per parameter\n const paramContentType = Object.keys(param.content)[0] ?? 'application/json'\n const serializedValue = serializeContentValue(paramValue, paramContentType)\n appendQueryParameter(param.name, serializedValue, param)\n break\n }\n\n // Handle query parameters\n switch (style) {\n case 'form': {\n const serialized = serializeFormStyle(paramValue, explode)\n\n // If serialized is an array of key-value pairs (exploded object or array)\n if (Array.isArray(serialized)) {\n for (const entry of serialized) {\n const key = entry.key || param.name\n appendQueryParameter(key, String(entry.value), param)\n }\n }\n // Otherwise, convert to string\n else {\n appendQueryParameter(param.name, String(serialized), param)\n }\n break\n }\n case 'spaceDelimited': {\n const serialized = serializeSpaceDelimitedStyle(paramValue)\n appendQueryParameter(param.name, serialized, param)\n break\n }\n case 'pipeDelimited': {\n const serialized = serializePipeDelimitedStyle(paramValue)\n appendQueryParameter(param.name, serialized, param)\n break\n }\n case 'deepObject': {\n // OAS marks deepObject-on-array and deepObject+explode:false as undefined.\n // Mirror process-body: fall back to form/explode:true for arrays and always\n // invoke the serializer for objects so authors get useful output instead of\n // a silently-dropped parameter.\n if (Array.isArray(paramValue)) {\n const serialized = serializeFormStyle(paramValue, true)\n if (Array.isArray(serialized)) {\n for (const entry of serialized) {\n const key = entry.key || param.name\n appendQueryParameter(key, String(entry.value), param)\n }\n } else {\n appendQueryParameter(param.name, String(serialized), param)\n }\n } else {\n const entries = serializeDeepObjectStyle(param.name, paramValue)\n for (const entry of entries) {\n appendQueryParameter(entry.key, entry.value, param)\n }\n }\n break\n }\n\n // Default to form style\n default:\n appendQueryParameter(param.name, String(paramValue), param)\n }\n break\n }\n\n // Headers only support 'simple' style according to OpenAPI 3.1.1\n // For arrays, simple style always produces comma-separated values regardless of explode\n // The explode parameter only affects object serialization\n case 'header': {\n const serialized = serializeSimpleStyle(paramValue, explode)\n newHeaders.push({ name: param.name, value: String(serialized) })\n break\n }\n\n // Keep cookie style separate so snippet generators cannot percent-encode it.\n case 'cookie': {\n const [major, minor] = (openapiVersion ?? '').split('.')\n const error =\n major === '3' && minor === '2' && !('content' in param)\n ? getCookieSerializationError(param, paramValue)\n : undefined\n if (error) {\n throw new CookieSerializationError(error)\n }\n if (style === 'cookie') {\n cookieStyleEntries.push(...serializeCookieStyle(param.name, paramValue, explode))\n break\n }\n const serialized = serializeFormStyleForCookies(paramValue, explode)\n\n // If serialized is an array of key-value pairs (exploded object or array)\n if (Array.isArray(serialized)) {\n for (const entry of serialized) {\n const key = entry.key || param.name\n const value = entry.value === null ? 'null' : String(entry.value)\n newCookies.push({ name: key, value })\n }\n }\n // Otherwise, convert to string\n else {\n const value = serialized === null ? 'null' : String(serialized)\n newCookies.push({ name: param.name, value })\n }\n break\n }\n }\n }\n\n // HAR cookie entries are encoded by snippet generators. Use a complete header\n // when cookie style is present, preserving legacy encoding for other cookies.\n if (cookieStyleEntries.length || serializedCookies.length) {\n const cookieValue = [\n ...newCookies.map((cookie) => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`),\n ...cookieStyleEntries.map((cookie) => `${cookie.name}=${cookie.value}`),\n ...serializedCookies,\n ].join('; ')\n const existing = newHeaders.find((header) => header.name.toLowerCase() === 'cookie')\n if (existing) {\n newHeaders.splice(newHeaders.indexOf(existing), 1, {\n ...existing,\n value: existing.value ? `${existing.value}; ${cookieValue}` : cookieValue,\n })\n } else {\n newHeaders.push({ name: 'Cookie', value: cookieValue })\n }\n }\n\n if (serializedQuery.length) {\n const hashIndex = newUrl.indexOf('#')\n const hash = hashIndex < 0 ? '' : newUrl.slice(hashIndex)\n const base = hashIndex < 0 ? newUrl : newUrl.slice(0, hashIndex)\n newUrl = `${base}${base.includes('?') ? '&' : '?'}${serializedQuery.join('&')}${hash}`\n }\n\n if (hasReservedPathParameter) {\n assertReservedPathUrl(newUrl)\n }\n if (hasStyledLabel && hasPathDotSegment(newUrl, markedPathUrl)) {\n throw new URIError('A label-style path parameter produces a dot segment that browsers remove.')\n }\n\n return {\n url: newUrl,\n headers: newHeaders,\n queryString: newQueryString,\n cookies: cookieStyleEntries.length || serializedCookies.length ? [] : newCookies,\n hasCookieStyleEntries: cookieStyleEntries.length > 0 || serializedCookies.length > 0,\n ...(serializedQuery.length ? { hasSerializedQuery: true } : {}),\n }\n}\n"],"mappings":";;;;;;;;AAkCA,IAAaA,IAAb,cAA8C,MAAM,CAAC,GAc/CC,KAAqB,OACxBC,KAAU,CAAC,EAAA,CAAG,KAAK,MAAUC,EAAeC,CAAK,CAAC,CAAC,CAAC,QAAQ,MAAUA,MAAU,KAAA,CAAS,GAGtFC,KAAmB,MACnB,mBAAmBD,KAASA,EAAM,kBAAkB,KA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AAS,GAAGE,IAAOA,EAAK,SAAS,GAAG,IAAI,MAAM,MAAMf,EAAgB,KAAK,GAAG,IAAIc;CAClF;CAKA,IAHIf,KACFoD,EAAsBvD,CAAM,GAE1BE,KAAkBsD,EAAkBxD,GAAQC,CAAa,GAC3D,MAAU,SAAS,2EAA2E;CAGhG,OAAO;EACL,KAAKD;EACL,SAASL;EACT,aAAaE;EACb,SAASE,EAAmB,UAAUM,EAAkB,SAAS,CAAC,IAAIP;EACtE,uBAAuBC,EAAmB,SAAS,KAAKM,EAAkB,SAAS;EACnF,GAAID,EAAgB,SAAS,EAAE,oBAAoB,GAAK,IAAI,CAAC;CAC/D;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AvailableClients } from '@scalar/snippetz';
|
|
2
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
|
-
import type
|
|
3
|
+
import { type SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
|
|
4
4
|
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
5
5
|
import { type App } from 'vue';
|
|
6
6
|
import { type CreateAsyncApiCodeExampleOptions } from './mount-asyncapi';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/code-example/mount.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/code-example/mount.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AASpE,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,yCAAyC,CAAA;AAEhD,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACjH,OAAO,EAAE,KAAK,GAAG,EAA0B,MAAM,KAAK,CAAA;AAItD,OAAO,EAAE,KA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