@scalar/blocks 0.8.0 → 0.9.0

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.
@@ -1,21 +1,21 @@
1
1
  import { snapshotSchema as e } from "@scalar/workspace-store/helpers/snapshot-schema";
2
- import { buildRequestBody as t, coerceLeafValueToSchemaType as n, getExample as r, getExampleFromBody as i, getExampleFromSchema as a, needsMultipartEncoding as o, resolveLeafSchema as s, serializeFormPropertyWithEncoding as c, serializeMultipartArray as l, serializeMultipartBody as u } from "@scalar/workspace-store/request-example";
3
- import { isXmlMediaType as d } from "@scalar/helpers/http/is-xml-media-type";
4
- import { getExampleValue as f, getExplicitExampleText as p } from "@scalar/workspace-store/helpers/get-example-value";
5
- import { getResolvedRef as m, mergeSiblingReferences as h } from "@scalar/workspace-store/helpers/get-resolved-ref";
6
- import { getStreamFormat as g } from "@scalar/helpers/http/is-streaming-content-type";
7
- import { isFileSchema as _ } from "@scalar/workspace-store/helpers/is-file-schema";
8
- import { serializeStreamExample as v } from "@scalar/workspace-store/helpers/serialize-stream-example";
9
- import { unpackProxyObject as y } from "@scalar/workspace-store/helpers/unpack-proxy";
10
- import { resolve as b } from "@scalar/workspace-store/resolve";
11
- import { isArraySchema as x, isObjectSchema as S } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
2
+ import { buildRequestBody as t, coerceLeafValueToSchemaType as n, getExample as r, getExampleFromBody as i, getExampleFromSchema as a, needsMultipartEncoding as o, resolveLeafSchema as s, serializeFormPropertyWithEncoding as c, serializeMultipartArray as l, serializeMultipartBody as u, usesAspNetFormNaming as d } from "@scalar/workspace-store/request-example";
3
+ import { isXmlMediaType as f } from "@scalar/helpers/http/is-xml-media-type";
4
+ import { getExampleValue as p, getExplicitExampleText as m } from "@scalar/workspace-store/helpers/get-example-value";
5
+ import { getResolvedRef as h, mergeSiblingReferences as g } from "@scalar/workspace-store/helpers/get-resolved-ref";
6
+ import { getStreamFormat as _ } from "@scalar/helpers/http/is-streaming-content-type";
7
+ import { isFileSchema as v } from "@scalar/workspace-store/helpers/is-file-schema";
8
+ import { serializeStreamExample as y } from "@scalar/workspace-store/helpers/serialize-stream-example";
9
+ import { unpackProxyObject as b } from "@scalar/workspace-store/helpers/unpack-proxy";
10
+ import { resolve as x } from "@scalar/workspace-store/resolve";
11
+ import { isArraySchema as S, isObjectSchema as C } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
12
12
  // src/code-example/helpers/operation-to-har/process-body.ts
13
- var C = (e, t, n) => ({
13
+ var w = (e, t, n) => ({
14
14
  name: e,
15
15
  value: `@${t}`,
16
16
  fileName: t,
17
17
  ...n ? { contentType: n } : {}
18
- }), w = (e) => !!e && "type" in e && e.type === "string" && "format" in e && e.format === "binary", T = (e, t) => typeof e == "string" && e.startsWith("@") && w(t) ? e.slice(1) : void 0, E = (e, t, r, i = !1, a) => {
18
+ }), T = (e) => !!e && "type" in e && e.type === "string" && "format" in e && e.format === "binary", E = (e, t) => typeof e == "string" && e.startsWith("@") && T(t) ? e.slice(1) : void 0, D = (e, t, r, i = !1, a) => {
19
19
  let o = [], u = Array.isArray(e) ? e.filter((e) => !e.isDisabled).map((e) => [String(e.name), e.value]) : Object.entries(e);
20
20
  for (let [d, f] of u) {
21
21
  if (f == null) continue;
@@ -23,7 +23,7 @@ var C = (e, t, n) => ({
23
23
  if (i && !r) {
24
24
  let t = Array.isArray(e) ? n(f, s(a, [d])) : f, r = l(d, Array.isArray(t) ? t : f, u);
25
25
  if (r) {
26
- for (let e of r) e.value instanceof File ? o.push(C(e.key, e.value.name, e.contentType ?? e.value.type)) : o.push({
26
+ for (let e of r) e.value instanceof File ? o.push(w(e.key, e.value.name, e.contentType ?? e.value.type)) : o.push({
27
27
  name: e.key,
28
28
  value: e.value,
29
29
  ...e.contentType ? { contentType: e.contentType } : {}
@@ -31,34 +31,34 @@ var C = (e, t, n) => ({
31
31
  continue;
32
32
  }
33
33
  }
34
- let p = u && (u.style !== void 0 || u.explode !== void 0 || u.allowReserved !== void 0), m = p || !i ? void 0 : u?.contentType, h = i && !r ? T(f, s(a, [d])) : void 0, g = r ? null : c(d, f, u);
34
+ let p = u && (u.style !== void 0 || u.explode !== void 0 || u.allowReserved !== void 0), m = p || !i ? void 0 : u?.contentType, h = i && !r ? E(f, s(a, [d])) : void 0, g = r ? null : c(d, f, u);
35
35
  if (g) for (let e of g) o.push({
36
36
  name: e.key,
37
37
  value: e.value
38
38
  });
39
39
  else if (f instanceof File) {
40
- let e = y(f);
41
- o.push(C(d, e.name, m ?? (i ? e.type : void 0)));
42
- } else if (h !== void 0) o.push(C(d, h, m));
40
+ let e = b(f);
41
+ o.push(w(d, e.name, m ?? (i ? e.type : void 0)));
42
+ } else if (h !== void 0) o.push(w(d, h, m));
43
43
  else if (m && typeof f == "object") o.push({
44
44
  name: d,
45
- value: JSON.stringify(y(f)),
45
+ value: JSON.stringify(b(f)),
46
46
  contentType: m
47
47
  });
48
48
  else if (i && !r && !p && typeof f == "object" && !Array.isArray(f)) o.push({
49
49
  name: d,
50
- value: JSON.stringify(y(f)),
50
+ value: JSON.stringify(b(f)),
51
51
  contentType: "application/json"
52
52
  });
53
53
  else if (Array.isArray(f)) for (let e of f) if (e instanceof File) {
54
- let t = y(e);
55
- o.push(C(d, t.name, i ? t.type : void 0));
54
+ let t = b(e);
55
+ o.push(w(d, t.name, i ? t.type : void 0));
56
56
  } else o.push({
57
57
  name: d,
58
58
  value: String(e)
59
59
  });
60
60
  else if (typeof f == "object") {
61
- let e = E(f, void 0, d);
61
+ let e = D(f, void 0, d);
62
62
  for (let t of e) o.push({
63
63
  name: `${d}.${t.name}`,
64
64
  value: t.value
@@ -70,89 +70,107 @@ var C = (e, t, n) => ({
70
70
  });
71
71
  }
72
72
  return o;
73
- }, D = ({ requestBody: n, contentType: s, example: c, openapiVersion: l, jsonSchemaDialect: C, requestBodyCompositionSelection: w }) => {
74
- let T = s || Object.keys(n.content)[0] || "", D = T === "other" ? "" : T, O = (e) => `@${y(e).name || "filename"}`, k = n.content[T]?.encoding, A = n.content[T];
75
- if (A && o(T, A)) {
76
- let e = c ?? Object.keys(A.examples ?? {})[0] ?? "default", r = t({
73
+ }, O = ({ requestBody: n, contentType: s, example: c, openapiVersion: l, jsonSchemaDialect: T, requestBodyCompositionSelection: E, multipartNaming: O }) => {
74
+ let k = s || Object.keys(n.content)[0] || "", A = k === "other" ? "" : k, j = (e) => `@${b(e).name || "filename"}`, M = n.content[k]?.encoding, N = n.content[k], P = d(k, N, O);
75
+ if (N && (P || o(k, N))) {
76
+ let e = c ?? Object.keys(N.examples ?? {})[0] ?? "default", r = t({
77
77
  ...n,
78
- "x-scalar-selected-content-type": { [e]: T }
79
- }, e, w, l, C);
78
+ "x-scalar-selected-content-type": { [e]: k }
79
+ }, e, E, l, T, {
80
+ multipartNaming: O,
81
+ aspNetFilePlaceholders: P && k === "multipart/form-data"
82
+ });
83
+ if (P && r?.mode === "urlencoded") return {
84
+ mimeType: A,
85
+ params: r.value.map(({ key: e, value: t }) => ({
86
+ name: e,
87
+ value: t
88
+ }))
89
+ };
90
+ if (P && r?.mode === "formdata") return {
91
+ mimeType: A,
92
+ params: r.value.flatMap((e) => e.type === "file" ? [w(e.key, e.value.name, e.contentType ?? e.value.type)] : e.type === "text" ? [{
93
+ name: e.key,
94
+ value: e.value,
95
+ ...e.contentType ? { contentType: e.contentType } : {}
96
+ }] : [])
97
+ };
80
98
  if (r?.mode === "multipart") {
81
99
  let e = u(r.value, r.contentType);
82
100
  return {
83
101
  mimeType: e.contentType,
84
- text: e.chunks.map((e) => e instanceof File ? O(e) : e instanceof Blob ? "BINARY" : String(e)).join("")
102
+ text: e.chunks.map((e) => e instanceof File ? j(e) : e instanceof Blob ? "BINARY" : String(e)).join("")
85
103
  };
86
104
  }
87
105
  }
88
- let j = T === "multipart/form-data" || T === "application/x-www-form-urlencoded";
89
- if (d(T)) {
90
- let e = i(n, T, c ?? "", w, l, C);
106
+ let F = k === "multipart/form-data" || k === "application/x-www-form-urlencoded";
107
+ if (f(k)) {
108
+ let e = i(n, k, c ?? "", E, l, T);
91
109
  return e ? {
92
- mimeType: D,
110
+ mimeType: A,
93
111
  text: e.value
94
112
  } : void 0;
95
113
  }
96
- let M = f(r(n, c, s)), N = p(M, T);
97
- if (N !== void 0) return {
98
- mimeType: D,
99
- text: N
114
+ let I = p(r(n, c, s)), L = m(I, k);
115
+ if (L !== void 0) return {
116
+ mimeType: A,
117
+ text: L
100
118
  };
101
- let P = M?.value;
102
- if (P !== void 0) {
103
- let e = typeof P == "object" && P ? y(P) : P;
104
- return j && typeof e == "object" && e ? {
105
- mimeType: D,
106
- params: E(e, k, void 0, T === "multipart/form-data", m(n.content[T]?.schema, h))
119
+ let R = I?.value;
120
+ if (R !== void 0) {
121
+ let e = typeof R == "object" && R ? b(R) : R;
122
+ return F && typeof e == "object" && e ? {
123
+ mimeType: A,
124
+ params: D(e, M, void 0, k === "multipart/form-data", h(n.content[k]?.schema, g))
107
125
  } : e instanceof File ? {
108
- mimeType: D,
109
- text: O(e)
126
+ mimeType: A,
127
+ text: j(e)
110
128
  } : {
111
- mimeType: D,
112
- text: typeof e == "string" ? e : v(e, T, !1) ?? JSON.stringify(e)
129
+ mimeType: A,
130
+ text: typeof e == "string" ? e : y(e, k, !1) ?? JSON.stringify(e)
113
131
  };
114
132
  }
115
- let F = n.content[T], I = m(F?.schema ?? F?.itemSchema);
116
- if (I !== void 0) {
117
- let t = e(I);
118
- if (T === "multipart/form-data" && S(t)) for (let [e, n] of Object.entries(t.properties ?? {})) {
119
- let r = b.schema(n), i = r && x(r) ? b.schema(r.items) : r;
120
- if (i && !("type" in i) && !("properties" in i) && !i.allOf && !i.oneOf && !i.anyOf && !i.contentSchema && _(i, !1)) {
133
+ let z = n.content[k], B = h(z?.schema ?? z?.itemSchema);
134
+ if (B !== void 0) {
135
+ let t = e(B);
136
+ if (k === "multipart/form-data" && C(t)) for (let [e, n] of Object.entries(t.properties ?? {})) {
137
+ let r = x.schema(n), i = r && S(r) ? x.schema(r.items) : r;
138
+ if (i && !("type" in i) && !("properties" in i) && !i.allOf && !i.oneOf && !i.anyOf && !i.contentSchema && v(i, !1)) {
121
139
  let n = {
122
140
  ...i,
123
141
  type: "string",
124
142
  format: "binary"
125
143
  };
126
- t.properties[e] = r && x(r) ? {
144
+ t.properties[e] = r && S(r) ? {
127
145
  ...r,
128
146
  items: n
129
147
  } : n;
130
148
  }
131
149
  }
132
- if (!j && F?.schema !== void 0 && Object.keys(t).every((e) => [
150
+ if (!F && z?.schema !== void 0 && Object.keys(t).every((e) => [
133
151
  "__scalar_",
134
152
  "title",
135
153
  "description"
136
- ].includes(e)) && !g(T) && _(t, !1, T)) return {
137
- mimeType: D,
154
+ ].includes(e)) && !_(k) && v(t, !1, k)) return {
155
+ mimeType: A,
138
156
  text: "@filename"
139
157
  };
140
158
  let n = a(t, {
141
- compositionSelection: w,
159
+ compositionSelection: E,
142
160
  mode: "write",
143
161
  openapiVersion: l,
144
- jsonSchemaDialect: C,
145
- binaryAsFile: T === "multipart/form-data"
162
+ jsonSchemaDialect: T,
163
+ binaryAsFile: k === "multipart/form-data"
146
164
  }, { schemaPath: ["requestBody"] });
147
- if (n !== void 0) return j && typeof n == "object" && n ? {
148
- mimeType: D,
149
- params: E(n, k, void 0, T === "multipart/form-data", I)
165
+ if (n !== void 0) return F && typeof n == "object" && n ? {
166
+ mimeType: A,
167
+ params: D(n, M, void 0, k === "multipart/form-data", B)
150
168
  } : {
151
- mimeType: D,
152
- text: v(n, T, F?.schema === void 0) ?? (typeof n == "string" ? n : JSON.stringify(n))
169
+ mimeType: A,
170
+ text: y(n, k, z?.schema === void 0) ?? (typeof n == "string" ? n : JSON.stringify(n))
153
171
  };
154
172
  }
155
173
  };
156
- export { D as processBody };
174
+ export { O as processBody };
157
175
 
158
176
  //# sourceMappingURL=process-body.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"process-body.js","names":["buildFileParam","fileName","contentType","isBinarySchema","schema","getBinaryPlaceholderFileName","value","objectToFormParams","params","entries","obj","item","key","partEncoding","parentKey","encoding","isMultipart","restored","coerceLeafValueToSchemaType","resolveLeafSchema","arrayParts","serializeMultipartArray","part","hasFormStyle","explicitContentType","binaryPlaceholderFileName","styleParams","serializeFormPropertyWithEncoding","param","file","unpackProxyObject","nestedParams","processBody","_contentType","requestBody","harMimeType","formatBinaryFile","media","needsMultipartEncoding","exampleName","example","body","buildRequestBody","requestBodyCompositionSelection","openapiVersion","jsonSchemaDialect","encoded","serializeMultipartBody","chunk","isFormData","isXmlMediaType","xmlExample","getExampleFromBody","selected","getExampleValue","getExample","explicitText","getExplicitExampleText","_example","exampleValue","getResolvedRef","mergeSiblingReferences","serializeStreamExample","mediaType","contentSchema","exampleSchema","snapshotSchema","isObjectSchema","name","property","resolved","resolve","isArraySchema","isFileSchema","binary","getStreamFormat","extractedExample","getExampleFromSchema"],"sources":["../../../../src/code-example/helpers/operation-to-har/process-body.ts"],"sourcesContent":["import { getStreamFormat } from '@scalar/helpers/http/is-streaming-content-type'\nimport { isXmlMediaType } from '@scalar/helpers/http/is-xml-media-type'\nimport { getExampleValue, getExplicitExampleText } from '@scalar/workspace-store/helpers/get-example-value'\nimport { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { serializeStreamExample } from '@scalar/workspace-store/helpers/serialize-stream-example'\nimport { snapshotSchema } from '@scalar/workspace-store/helpers/snapshot-schema'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport {\n buildRequestBody,\n coerceLeafValueToSchemaType,\n getExample,\n getExampleFromBody,\n getExampleFromSchema,\n needsMultipartEncoding,\n resolveLeafSchema,\n serializeFormPropertyWithEncoding,\n serializeMultipartArray,\n serializeMultipartBody,\n} from '@scalar/workspace-store/request-example'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n MediaTypeObject,\n RequestBodyObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema, isObjectSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport type { Param, PostData } from 'har-format'\n\nimport type { OperationToHarProps } from './operation-to-har'\n\ntype ProcessBodyProps = Pick<\n OperationToHarProps,\n 'contentType' | 'example' | 'requestBodyCompositionSelection' | 'openapiVersion' | 'jsonSchemaDialect'\n> & {\n requestBody: RequestBodyObject\n}\n\ntype MultipartEncodingMap = MediaTypeObject['encoding']\n\n/**\n * Builds a HAR param for an uploaded file. `fileName` is what snippet generators read to emit real\n * file handling (for example `files=` in Python or `new Blob` in fetch). `value` keeps the\n * `@filename` placeholder for consumers that only read the text value.\n */\nconst buildFileParam = (name: string, fileName: string, contentType?: string): Param => ({\n name,\n value: `@${fileName}`,\n fileName,\n ...(contentType ? { contentType } : {}),\n})\n\n/** True when the schema describes a binary file (`type: string, format: binary`). */\nconst isBinarySchema = (schema: SchemaObject | undefined): boolean =>\n !!schema && 'type' in schema && schema.type === 'string' && 'format' in schema && schema.format === 'binary'\n\n/**\n * Example generation turns a binary property into the `@filename` placeholder string.\n * Use the schema to tell that apart from a normal text field that happens to start with `@`.\n */\nconst getBinaryPlaceholderFileName = (value: unknown, schema: SchemaObject | undefined): string | undefined =>\n typeof value === 'string' && value.startsWith('@') && isBinarySchema(schema) ? value.slice(1) : undefined\n\n/**\n * Converts a form-data body into HAR `Param[]` entries for `multipart/form-data`\n * and `application/x-www-form-urlencoded` requests.\n *\n * Per OpenAPI 3.1.x Encoding Object, each property's serialization is governed\n * by an optional Encoding entry. When `style` / `explode` / `allowReserved` is\n * set, the value is serialized RFC6570-style and `contentType` is ignored.\n * Multipart arrays apply the encoding to each item and repeat the property name.\n * Object items default to JSON, and uploaded files retain their filename references.\n *\n * @param obj - The form-data payload, either an object keyed by property name\n * or a HAR-style `{ name, value, isDisabled }[]` array.\n * @param encoding - The `encoding` map from the Media Type Object, if any.\n * Used only at the top level (`parentKey` undefined).\n * @param parentKey - When set, we are flattening a nested object inside another\n * property; encoding is ignored and keys are joined with `.` (legacy default).\n * @param isMultipart - True for `multipart/form-data`. Gates the spec defaults\n * for object properties and array items. Urlencoded bodies retain their existing\n * serialization and flattening behavior.\n */\nconst objectToFormParams = (\n obj: object | { name: string; value: unknown; isDisabled: boolean }[],\n encoding?: MultipartEncodingMap,\n parentKey?: string,\n isMultipart = false,\n schema?: SchemaObject,\n): Param[] => {\n const params: Param[] = []\n\n /** Ensure we do not include disabled items */\n const entries: [string, unknown][] = Array.isArray(obj)\n ? obj.filter((item) => !item.isDisabled).map((item) => [String(item.name), item.value])\n : Object.entries(obj)\n\n for (const [key, value] of entries) {\n if (value === undefined || value === null) {\n continue\n }\n\n const partEncoding = parentKey ? undefined : encoding?.[key]\n\n if (isMultipart && !parentKey) {\n const restored = Array.isArray(obj) ? coerceLeafValueToSchemaType(value, resolveLeafSchema(schema, [key])) : value\n const arrayParts = serializeMultipartArray(key, Array.isArray(restored) ? restored : value, partEncoding)\n if (arrayParts) {\n for (const part of arrayParts) {\n if (part.value instanceof File) {\n params.push(buildFileParam(part.key, part.value.name, part.contentType ?? part.value.type))\n continue\n }\n params.push({\n name: part.key,\n value: part.value,\n ...(part.contentType ? { contentType: part.contentType } : {}),\n })\n }\n continue\n }\n }\n /**\n * Per OpenAPI 3.1.1: when style, explode, or allowReserved is explicitly set on the\n * encoding entry, contentType (implicit or explicit) is ignored and the value is\n * serialized as if it were a query-style parameter.\n */\n const hasFormStyle =\n partEncoding &&\n (partEncoding.style !== undefined ||\n partEncoding.explode !== undefined ||\n partEncoding.allowReserved !== undefined)\n /**\n * Per OAS 3.1.x Encoding Object: `contentType` SHALL be ignored if the request body\n * media type is not a multipart. For `application/x-www-form-urlencoded` we still\n * honor `style`/`explode`/`allowReserved` (handled above), but a `contentType`-only\n * entry has no effect — values fall through to the dotted-key flattening default.\n */\n const explicitContentType = hasFormStyle || !isMultipart ? undefined : partEncoding?.contentType\n\n /**\n * When the encoding sets style/explode/allowReserved, serialize the value RFC6570-style\n * (bracket/exploded notation) and ignore contentType. See `serializeFormPropertyWithEncoding`\n * for the per-style rules; it returns null for primitives, Files, and arrays of Files, which\n * then fall through to the dedicated branches below. HAR represents multipart and urlencoded\n * the same way via `PostData.params`, so the resulting parts work for both.\n */\n const binaryPlaceholderFileName =\n isMultipart && !parentKey ? getBinaryPlaceholderFileName(value, resolveLeafSchema(schema, [key])) : undefined\n const styleParams = parentKey ? null : serializeFormPropertyWithEncoding(key, value, partEncoding)\n if (styleParams) {\n for (const param of styleParams) {\n params.push({ name: param.key, value: param.value })\n }\n } else if (value instanceof File) {\n /**\n * File values render as `@filename` references, the conventional cURL syntax for an\n * attached file. Picked up by snippet renderers downstream (e.g. `--form 'x=@file.png'`).\n */\n const file = unpackProxyObject(value)\n params.push(buildFileParam(key, file.name, explicitContentType ?? (isMultipart ? file.type : undefined)))\n } else if (binaryPlaceholderFileName !== undefined) {\n /** A binary property filled in by example generation, so it is a file and not a text field. */\n params.push(buildFileParam(key, binaryPlaceholderFileName, explicitContentType))\n } else if (explicitContentType && typeof value === 'object') {\n /**\n * Per OAS 3.1.x Encoding Object: an explicit `encoding[key].contentType` on a\n * complex value overrides the default and emits a single part containing the value\n * JSON-stringified into that media type. Only reachable when style/explode/allowReserved\n * are unset (otherwise contentType is ignored — see the style branch above).\n */\n params.push({\n name: key,\n value: JSON.stringify(unpackProxyObject(value)),\n contentType: explicitContentType,\n })\n } else if (isMultipart && !parentKey && !hasFormStyle && typeof value === 'object' && !Array.isArray(value)) {\n /**\n * Per OpenAPI 3.x: a top-level multipart property whose value is an object (and not a File)\n * defaults to a single part encoded as application/json, rather than being flattened\n * into multiple parts with dotted keys.\n */\n params.push({\n name: key,\n value: JSON.stringify(unpackProxyObject(value)),\n contentType: 'application/json',\n })\n } else if (Array.isArray(value)) {\n for (const item of value) {\n if (item instanceof File) {\n const file = unpackProxyObject(item)\n params.push(buildFileParam(key, file.name, isMultipart ? file.type : undefined))\n } else {\n params.push({ name: key, value: String(item) })\n }\n }\n } else if (typeof value === 'object') {\n /**\n * Legacy fallback: flatten nested objects into dotted-key parts. Reached when the\n * multipart JSON-default branches above don't apply — i.e. either inside a recursive\n * call (`parentKey` set) or on `application/x-www-form-urlencoded` bodies without an\n * explicit encoding entry. Strict OAS 3.1.x would use `style: form, explode: true` as\n * the urlencoded default (inner keys become top-level params); we keep dotted keys for\n * backwards compatibility with consumers that already parse this shape.\n */\n const nestedParams = objectToFormParams(value, undefined, key)\n\n for (const param of nestedParams) {\n params.push({ name: `${key}.${param.name}`, value: param.value })\n }\n } else {\n params.push({\n name: key,\n value: String(value),\n ...(explicitContentType ? { contentType: explicitContentType } : {}),\n })\n }\n }\n\n return params\n}\n\n/**\n * Processes the request body and returns the processed data\n * Returns undefined if no example is found\n */\nexport const processBody = ({\n requestBody,\n contentType,\n example,\n openapiVersion,\n jsonSchemaDialect,\n requestBodyCompositionSelection,\n}: ProcessBodyProps): PostData | undefined => {\n const _contentType = contentType || Object.keys(requestBody.content)[0] || ''\n /** Empty when \"Other\" is selected so snippets do not inject `Content-Type: other`. */\n const harMimeType = _contentType === 'other' ? '' : _contentType\n const formatBinaryFile = (file: File) => {\n const unwrappedFile = unpackProxyObject(file)\n return `@${unwrappedFile.name || 'filename'}`\n }\n const encoding = requestBody.content[_contentType]?.encoding\n\n const media = requestBody.content[_contentType]\n if (media && needsMultipartEncoding(_contentType, media)) {\n const exampleName = example ?? Object.keys(media.examples ?? {})[0] ?? 'default'\n const body = buildRequestBody(\n { ...requestBody, 'x-scalar-selected-content-type': { [exampleName]: _contentType } },\n exampleName,\n requestBodyCompositionSelection,\n openapiVersion,\n jsonSchemaDialect,\n )\n if (body?.mode === 'multipart') {\n const encoded = serializeMultipartBody(body.value, body.contentType)\n return {\n mimeType: encoded.contentType,\n // HAR text cannot embed file bytes synchronously. Keep visible file placeholders.\n text: encoded.chunks\n .map((chunk) => {\n if (chunk instanceof File) {\n return formatBinaryFile(chunk)\n }\n return chunk instanceof Blob ? 'BINARY' : String(chunk)\n })\n .join(''),\n }\n }\n }\n\n // Check if this is a form data content type\n const isFormData = _contentType === 'multipart/form-data' || _contentType === 'application/x-www-form-urlencoded'\n\n // Check if this is an XML content type\n if (isXmlMediaType(_contentType)) {\n const xmlExample = getExampleFromBody(\n requestBody,\n _contentType,\n example ?? '',\n requestBodyCompositionSelection,\n openapiVersion,\n jsonSchemaDialect,\n )\n return xmlExample ? { mimeType: harMimeType, text: xmlExample.value as string } : undefined\n }\n\n // Get the example value\n const selected = getExampleValue(getExample(requestBody, example, contentType))\n const explicitText = getExplicitExampleText(selected, _contentType)\n if (explicitText !== undefined) {\n return { mimeType: harMimeType, text: explicitText }\n }\n const _example = selected?.value\n\n // Return the provided top level example\n if (typeof _example !== 'undefined') {\n const exampleValue = _example !== null && typeof _example === 'object' ? unpackProxyObject(_example) : _example\n\n if (isFormData && typeof exampleValue === 'object' && exampleValue !== null) {\n return {\n mimeType: harMimeType,\n params: objectToFormParams(\n exampleValue,\n encoding,\n undefined,\n _contentType === 'multipart/form-data',\n getResolvedRef(requestBody.content[_contentType]?.schema, mergeSiblingReferences),\n ),\n }\n }\n\n if (exampleValue instanceof File) {\n return {\n mimeType: harMimeType,\n text: formatBinaryFile(exampleValue),\n }\n }\n\n return {\n mimeType: harMimeType,\n text:\n typeof exampleValue === 'string'\n ? exampleValue\n : (serializeStreamExample(exampleValue, _contentType, false) ?? JSON.stringify(exampleValue)),\n }\n }\n\n // Try to extract examples from the schema\n const mediaType = requestBody.content[_contentType]\n const contentSchema = getResolvedRef(mediaType?.schema ?? mediaType?.itemSchema)\n if (typeof contentSchema !== 'undefined') {\n const exampleSchema = snapshotSchema(contentSchema)\n if (_contentType === 'multipart/form-data' && isObjectSchema(exampleSchema)) {\n // Adapt upgraded upload fields only on the code example's private snapshot.\n // The generator already supports the legacy binary shape, including file arrays.\n for (const [name, property] of Object.entries(exampleSchema.properties ?? {})) {\n const resolved = resolve.schema(property)\n const file = resolved && isArraySchema(resolved) ? resolve.schema(resolved.items) : resolved\n if (\n file &&\n !('type' in file) &&\n !('properties' in file) &&\n !file.allOf &&\n !file.oneOf &&\n !file.anyOf &&\n !file.contentSchema &&\n isFileSchema(file, false)\n ) {\n const binary: SchemaObject = { ...file, type: 'string', format: 'binary' }\n exampleSchema.properties![name] =\n resolved && isArraySchema(resolved) ? { ...resolved, items: binary } : binary\n }\n }\n }\n // A migrated whole-body binary schema is empty. Do not infer files from\n // declared values, constraints, compositions, or schemas for individual stream items.\n const isEmptyBinaryBody =\n !isFormData &&\n mediaType?.schema !== undefined &&\n Object.keys(exampleSchema).every((key) => ['__scalar_', 'title', 'description'].includes(key)) &&\n !getStreamFormat(_contentType) &&\n isFileSchema(exampleSchema, false, _contentType)\n if (isEmptyBinaryBody) {\n return { mimeType: harMimeType, text: '@filename' }\n }\n const extractedExample = getExampleFromSchema(\n exampleSchema,\n {\n compositionSelection: requestBodyCompositionSelection,\n mode: 'write',\n openapiVersion,\n jsonSchemaDialect,\n binaryAsFile: _contentType === 'multipart/form-data',\n },\n {\n schemaPath: ['requestBody'],\n },\n )\n\n if (extractedExample !== undefined) {\n if (isFormData && typeof extractedExample === 'object' && extractedExample !== null) {\n return {\n mimeType: harMimeType,\n params: objectToFormParams(\n extractedExample,\n encoding,\n undefined,\n _contentType === 'multipart/form-data',\n contentSchema,\n ),\n }\n }\n\n return {\n mimeType: harMimeType,\n text:\n serializeStreamExample(extractedExample, _contentType, mediaType?.schema === undefined) ??\n (typeof extractedExample === 'string' ? extractedExample : JSON.stringify(extractedExample)),\n }\n }\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,IAAMA,KAAkB,GAAc,GAAkB,OAAiC;CACvF;CACA,OAAO,IAAIC;CACX;CACA,GAAIC,IAAc,EAAE,eAAY,IAAI,CAAC;AACvC,IAGMC,KAAkB,MACtB,CAAC,CAACC,KAAU,UAAUA,KAAUA,EAAO,SAAS,YAAY,YAAYA,KAAUA,EAAO,WAAW,U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K,GACxB;IACA,IAAM6C,IAAuB;KAAE,GAAG7C;KAAM,MAAM;KAAU,QAAQ;IAAS;IACzE,EAAc,WAAYuC,KACxBE,KAAYE,EAAcF,CAAQ,IAAI;KAAE,GAAGA;KAAU,OAAOI;IAAO,IAAIA;GAC3E;EACF;EAUF,IALE,CAACzB,KACDc,GAAW,WAAW,KAAA,KACtB,OAAO,KAAKE,CAAa,CAAC,CAAC,OAAO,MAAQ;GAAC;GAAa;GAAS;EAAa,CAAC,CAAC,SAASrD,CAAG,CAAC,KAC7F,CAAC+D,EAAgB1C,CAAY,KAC7BwC,EAAaR,GAAe,IAAOhC,CAAY,GAE/C,OAAO;GAAE,UAAUE;GAAa,MAAM;EAAY;EAEpD,IAAMyC,IAAmBC,EACvBZ,GACA;GACE,sBAAsBtB;GACtB,MAAM;GACN;GACA;GACA,cAAcV,MAAiB;EACjC,GACA,EACE,YAAY,CAAC,aAAa,EAC5B,CACF;EAEA,IAAI2C,MAAqB,KAAA,GAcvB,OAbI3B,KAAc,OAAO2B,KAAqB,YAAYA,IACjD;GACL,UAAUzC;GACV,QAAQ5B,EACNqE,GACA7D,GACA,KAAA,GACAkB,MAAiB,uBACjB+B,CACF;EACF,IAGK;GACL,UAAU7B;GACV,MACE2B,EAAuBc,GAAkB3C,GAAc8B,GAAW,WAAW,KAAA,CAAS,MACrF,OAAOa,KAAqB,WAAWA,IAAmB,KAAK,UAAUA,CAAgB;EAC9F;CAEJ;AAGF"}
1
+ {"version":3,"file":"process-body.js","names":["buildFileParam","fileName","contentType","isBinarySchema","schema","getBinaryPlaceholderFileName","value","objectToFormParams","params","entries","obj","item","key","partEncoding","parentKey","encoding","isMultipart","restored","coerceLeafValueToSchemaType","resolveLeafSchema","arrayParts","serializeMultipartArray","part","hasFormStyle","explicitContentType","binaryPlaceholderFileName","styleParams","serializeFormPropertyWithEncoding","param","file","unpackProxyObject","nestedParams","processBody","_contentType","requestBody","harMimeType","formatBinaryFile","media","aspNetNaming","usesAspNetFormNaming","multipartNaming","needsMultipartEncoding","exampleName","example","body","buildRequestBody","requestBodyCompositionSelection","openapiVersion","jsonSchemaDialect","encoded","serializeMultipartBody","chunk","isFormData","isXmlMediaType","xmlExample","getExampleFromBody","selected","getExampleValue","getExample","explicitText","getExplicitExampleText","_example","exampleValue","getResolvedRef","mergeSiblingReferences","serializeStreamExample","mediaType","contentSchema","exampleSchema","snapshotSchema","isObjectSchema","name","property","resolved","resolve","isArraySchema","isFileSchema","binary","getStreamFormat","extractedExample","getExampleFromSchema"],"sources":["../../../../src/code-example/helpers/operation-to-har/process-body.ts"],"sourcesContent":["import { getStreamFormat } from '@scalar/helpers/http/is-streaming-content-type'\nimport { isXmlMediaType } from '@scalar/helpers/http/is-xml-media-type'\nimport { getExampleValue, getExplicitExampleText } from '@scalar/workspace-store/helpers/get-example-value'\nimport { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { serializeStreamExample } from '@scalar/workspace-store/helpers/serialize-stream-example'\nimport { snapshotSchema } from '@scalar/workspace-store/helpers/snapshot-schema'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport {\n buildRequestBody,\n coerceLeafValueToSchemaType,\n getExample,\n getExampleFromBody,\n getExampleFromSchema,\n needsMultipartEncoding,\n resolveLeafSchema,\n serializeFormPropertyWithEncoding,\n serializeMultipartArray,\n serializeMultipartBody,\n usesAspNetFormNaming,\n} from '@scalar/workspace-store/request-example'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n MediaTypeObject,\n RequestBodyObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema, isObjectSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport type { Param, PostData } from 'har-format'\n\nimport type { OperationToHarProps } from './operation-to-har'\n\ntype ProcessBodyProps = Pick<\n OperationToHarProps,\n | 'multipartNaming'\n | 'contentType'\n | 'example'\n | 'requestBodyCompositionSelection'\n | 'openapiVersion'\n | 'jsonSchemaDialect'\n> & {\n requestBody: RequestBodyObject\n}\n\ntype MultipartEncodingMap = MediaTypeObject['encoding']\n\n/**\n * Builds a HAR param for an uploaded file. `fileName` is what snippet generators read to emit real\n * file handling (for example `files=` in Python or `new Blob` in fetch). `value` keeps the\n * `@filename` placeholder for consumers that only read the text value.\n */\nconst buildFileParam = (name: string, fileName: string, contentType?: string): Param => ({\n name,\n value: `@${fileName}`,\n fileName,\n ...(contentType ? { contentType } : {}),\n})\n\n/** True when the schema describes a binary file (`type: string, format: binary`). */\nconst isBinarySchema = (schema: SchemaObject | undefined): boolean =>\n !!schema && 'type' in schema && schema.type === 'string' && 'format' in schema && schema.format === 'binary'\n\n/**\n * Example generation turns a binary property into the `@filename` placeholder string.\n * Use the schema to tell that apart from a normal text field that happens to start with `@`.\n */\nconst getBinaryPlaceholderFileName = (value: unknown, schema: SchemaObject | undefined): string | undefined =>\n typeof value === 'string' && value.startsWith('@') && isBinarySchema(schema) ? value.slice(1) : undefined\n\n/**\n * Converts a form-data body into HAR `Param[]` entries for `multipart/form-data`\n * and `application/x-www-form-urlencoded` requests.\n *\n * Per OpenAPI 3.1.x Encoding Object, each property's serialization is governed\n * by an optional Encoding entry. When `style` / `explode` / `allowReserved` is\n * set, the value is serialized RFC6570-style and `contentType` is ignored.\n * Multipart arrays apply the encoding to each item and repeat the property name.\n * Object items default to JSON, and uploaded files retain their filename references.\n *\n * @param obj - The form-data payload, either an object keyed by property name\n * or a HAR-style `{ name, value, isDisabled }[]` array.\n * @param encoding - The `encoding` map from the Media Type Object, if any.\n * Used only at the top level (`parentKey` undefined).\n * @param parentKey - When set, we are flattening a nested object inside another\n * property; encoding is ignored and keys are joined with `.` (legacy default).\n * @param isMultipart - True for `multipart/form-data`. Gates the spec defaults\n * for object properties and array items. Urlencoded bodies retain their existing\n * serialization and flattening behavior.\n */\nconst objectToFormParams = (\n obj: object | { name: string; value: unknown; isDisabled: boolean }[],\n encoding?: MultipartEncodingMap,\n parentKey?: string,\n isMultipart = false,\n schema?: SchemaObject,\n): Param[] => {\n const params: Param[] = []\n\n /** Ensure we do not include disabled items */\n const entries: [string, unknown][] = Array.isArray(obj)\n ? obj.filter((item) => !item.isDisabled).map((item) => [String(item.name), item.value])\n : Object.entries(obj)\n\n for (const [key, value] of entries) {\n if (value === undefined || value === null) {\n continue\n }\n\n const partEncoding = parentKey ? undefined : encoding?.[key]\n\n if (isMultipart && !parentKey) {\n const restored = Array.isArray(obj) ? coerceLeafValueToSchemaType(value, resolveLeafSchema(schema, [key])) : value\n const arrayParts = serializeMultipartArray(key, Array.isArray(restored) ? restored : value, partEncoding)\n if (arrayParts) {\n for (const part of arrayParts) {\n if (part.value instanceof File) {\n params.push(buildFileParam(part.key, part.value.name, part.contentType ?? part.value.type))\n continue\n }\n params.push({\n name: part.key,\n value: part.value,\n ...(part.contentType ? { contentType: part.contentType } : {}),\n })\n }\n continue\n }\n }\n /**\n * Per OpenAPI 3.1.1: when style, explode, or allowReserved is explicitly set on the\n * encoding entry, contentType (implicit or explicit) is ignored and the value is\n * serialized as if it were a query-style parameter.\n */\n const hasFormStyle =\n partEncoding &&\n (partEncoding.style !== undefined ||\n partEncoding.explode !== undefined ||\n partEncoding.allowReserved !== undefined)\n /**\n * Per OAS 3.1.x Encoding Object: `contentType` SHALL be ignored if the request body\n * media type is not a multipart. For `application/x-www-form-urlencoded` we still\n * honor `style`/`explode`/`allowReserved` (handled above), but a `contentType`-only\n * entry has no effect — values fall through to the dotted-key flattening default.\n */\n const explicitContentType = hasFormStyle || !isMultipart ? undefined : partEncoding?.contentType\n\n /**\n * When the encoding sets style/explode/allowReserved, serialize the value RFC6570-style\n * (bracket/exploded notation) and ignore contentType. See `serializeFormPropertyWithEncoding`\n * for the per-style rules; it returns null for primitives, Files, and arrays of Files, which\n * then fall through to the dedicated branches below. HAR represents multipart and urlencoded\n * the same way via `PostData.params`, so the resulting parts work for both.\n */\n const binaryPlaceholderFileName =\n isMultipart && !parentKey ? getBinaryPlaceholderFileName(value, resolveLeafSchema(schema, [key])) : undefined\n const styleParams = parentKey ? null : serializeFormPropertyWithEncoding(key, value, partEncoding)\n if (styleParams) {\n for (const param of styleParams) {\n params.push({ name: param.key, value: param.value })\n }\n } else if (value instanceof File) {\n /**\n * File values render as `@filename` references, the conventional cURL syntax for an\n * attached file. Picked up by snippet renderers downstream (e.g. `--form 'x=@file.png'`).\n */\n const file = unpackProxyObject(value)\n params.push(buildFileParam(key, file.name, explicitContentType ?? (isMultipart ? file.type : undefined)))\n } else if (binaryPlaceholderFileName !== undefined) {\n /** A binary property filled in by example generation, so it is a file and not a text field. */\n params.push(buildFileParam(key, binaryPlaceholderFileName, explicitContentType))\n } else if (explicitContentType && typeof value === 'object') {\n /**\n * Per OAS 3.1.x Encoding Object: an explicit `encoding[key].contentType` on a\n * complex value overrides the default and emits a single part containing the value\n * JSON-stringified into that media type. Only reachable when style/explode/allowReserved\n * are unset (otherwise contentType is ignored — see the style branch above).\n */\n params.push({\n name: key,\n value: JSON.stringify(unpackProxyObject(value)),\n contentType: explicitContentType,\n })\n } else if (isMultipart && !parentKey && !hasFormStyle && typeof value === 'object' && !Array.isArray(value)) {\n /**\n * Per OpenAPI 3.x: a top-level multipart property whose value is an object (and not a File)\n * defaults to a single part encoded as application/json, rather than being flattened\n * into multiple parts with dotted keys.\n */\n params.push({\n name: key,\n value: JSON.stringify(unpackProxyObject(value)),\n contentType: 'application/json',\n })\n } else if (Array.isArray(value)) {\n for (const item of value) {\n if (item instanceof File) {\n const file = unpackProxyObject(item)\n params.push(buildFileParam(key, file.name, isMultipart ? file.type : undefined))\n } else {\n params.push({ name: key, value: String(item) })\n }\n }\n } else if (typeof value === 'object') {\n /**\n * Legacy fallback: flatten nested objects into dotted-key parts. Reached when the\n * multipart JSON-default branches above don't apply — i.e. either inside a recursive\n * call (`parentKey` set) or on `application/x-www-form-urlencoded` bodies without an\n * explicit encoding entry. Strict OAS 3.1.x would use `style: form, explode: true` as\n * the urlencoded default (inner keys become top-level params); we keep dotted keys for\n * backwards compatibility with consumers that already parse this shape.\n */\n const nestedParams = objectToFormParams(value, undefined, key)\n\n for (const param of nestedParams) {\n params.push({ name: `${key}.${param.name}`, value: param.value })\n }\n } else {\n params.push({\n name: key,\n value: String(value),\n ...(explicitContentType ? { contentType: explicitContentType } : {}),\n })\n }\n }\n\n return params\n}\n\n/**\n * Processes the request body and returns the processed data\n * Returns undefined if no example is found\n */\nexport const processBody = ({\n requestBody,\n contentType,\n example,\n openapiVersion,\n jsonSchemaDialect,\n requestBodyCompositionSelection,\n multipartNaming,\n}: ProcessBodyProps): PostData | undefined => {\n const _contentType = contentType || Object.keys(requestBody.content)[0] || ''\n /** Empty when \"Other\" is selected so snippets do not inject `Content-Type: other`. */\n const harMimeType = _contentType === 'other' ? '' : _contentType\n const formatBinaryFile = (file: File) => {\n const unwrappedFile = unpackProxyObject(file)\n return `@${unwrappedFile.name || 'filename'}`\n }\n const encoding = requestBody.content[_contentType]?.encoding\n\n const media = requestBody.content[_contentType]\n const aspNetNaming = usesAspNetFormNaming(_contentType, media, multipartNaming)\n if (media && (aspNetNaming || needsMultipartEncoding(_contentType, media))) {\n const exampleName = example ?? Object.keys(media.examples ?? {})[0] ?? 'default'\n const body = buildRequestBody(\n { ...requestBody, 'x-scalar-selected-content-type': { [exampleName]: _contentType } },\n exampleName,\n requestBodyCompositionSelection,\n openapiVersion,\n jsonSchemaDialect,\n { multipartNaming, aspNetFilePlaceholders: aspNetNaming && _contentType === 'multipart/form-data' },\n )\n if (aspNetNaming && body?.mode === 'urlencoded') {\n return { mimeType: harMimeType, params: body.value.map(({ key, value }) => ({ name: key, value })) }\n }\n if (aspNetNaming && body?.mode === 'formdata') {\n return {\n mimeType: harMimeType,\n params: body.value.flatMap((part): Param[] => {\n if (part.type === 'file') {\n return [buildFileParam(part.key, part.value.name, part.contentType ?? part.value.type)]\n }\n if (part.type !== 'text') {\n return []\n }\n return [{ name: part.key, value: part.value, ...(part.contentType ? { contentType: part.contentType } : {}) }]\n }),\n }\n }\n if (body?.mode === 'multipart') {\n const encoded = serializeMultipartBody(body.value, body.contentType)\n return {\n mimeType: encoded.contentType,\n // HAR text cannot embed file bytes synchronously. Keep visible file placeholders.\n text: encoded.chunks\n .map((chunk) => {\n if (chunk instanceof File) {\n return formatBinaryFile(chunk)\n }\n return chunk instanceof Blob ? 'BINARY' : String(chunk)\n })\n .join(''),\n }\n }\n }\n\n // Check if this is a form data content type\n const isFormData = _contentType === 'multipart/form-data' || _contentType === 'application/x-www-form-urlencoded'\n\n // Check if this is an XML content type\n if (isXmlMediaType(_contentType)) {\n const xmlExample = getExampleFromBody(\n requestBody,\n _contentType,\n example ?? '',\n requestBodyCompositionSelection,\n openapiVersion,\n jsonSchemaDialect,\n )\n return xmlExample ? { mimeType: harMimeType, text: xmlExample.value as string } : undefined\n }\n\n // Get the example value\n const selected = getExampleValue(getExample(requestBody, example, contentType))\n const explicitText = getExplicitExampleText(selected, _contentType)\n if (explicitText !== undefined) {\n return { mimeType: harMimeType, text: explicitText }\n }\n const _example = selected?.value\n\n // Return the provided top level example\n if (typeof _example !== 'undefined') {\n const exampleValue = _example !== null && typeof _example === 'object' ? unpackProxyObject(_example) : _example\n\n if (isFormData && typeof exampleValue === 'object' && exampleValue !== null) {\n return {\n mimeType: harMimeType,\n params: objectToFormParams(\n exampleValue,\n encoding,\n undefined,\n _contentType === 'multipart/form-data',\n getResolvedRef(requestBody.content[_contentType]?.schema, mergeSiblingReferences),\n ),\n }\n }\n\n if (exampleValue instanceof File) {\n return {\n mimeType: harMimeType,\n text: formatBinaryFile(exampleValue),\n }\n }\n\n return {\n mimeType: harMimeType,\n text:\n typeof exampleValue === 'string'\n ? exampleValue\n : (serializeStreamExample(exampleValue, _contentType, false) ?? JSON.stringify(exampleValue)),\n }\n }\n\n // Try to extract examples from the schema\n const mediaType = requestBody.content[_contentType]\n const contentSchema = getResolvedRef(mediaType?.schema ?? mediaType?.itemSchema)\n if (typeof contentSchema !== 'undefined') {\n const exampleSchema = snapshotSchema(contentSchema)\n if (_contentType === 'multipart/form-data' && isObjectSchema(exampleSchema)) {\n // Adapt upgraded upload fields only on the code example's private snapshot.\n // The generator already supports the legacy binary shape, including file arrays.\n for (const [name, property] of Object.entries(exampleSchema.properties ?? {})) {\n const resolved = resolve.schema(property)\n const file = resolved && isArraySchema(resolved) ? resolve.schema(resolved.items) : resolved\n if (\n file &&\n !('type' in file) &&\n !('properties' in file) &&\n !file.allOf &&\n !file.oneOf &&\n !file.anyOf &&\n !file.contentSchema &&\n isFileSchema(file, false)\n ) {\n const binary: SchemaObject = { ...file, type: 'string', format: 'binary' }\n exampleSchema.properties![name] =\n resolved && isArraySchema(resolved) ? { ...resolved, items: binary } : binary\n }\n }\n }\n // A migrated whole-body binary schema is empty. Do not infer files from\n // declared values, constraints, compositions, or schemas for individual stream items.\n const isEmptyBinaryBody =\n !isFormData &&\n mediaType?.schema !== undefined &&\n Object.keys(exampleSchema).every((key) => ['__scalar_', 'title', 'description'].includes(key)) &&\n !getStreamFormat(_contentType) &&\n isFileSchema(exampleSchema, false, _contentType)\n if (isEmptyBinaryBody) {\n return { mimeType: harMimeType, text: '@filename' }\n }\n const extractedExample = getExampleFromSchema(\n exampleSchema,\n {\n compositionSelection: requestBodyCompositionSelection,\n mode: 'write',\n openapiVersion,\n jsonSchemaDialect,\n binaryAsFile: _contentType === 'multipart/form-data',\n },\n {\n schemaPath: ['requestBody'],\n },\n )\n\n if (extractedExample !== undefined) {\n if (isFormData && typeof extractedExample === 'object' && extractedExample !== null) {\n return {\n mimeType: harMimeType,\n params: objectToFormParams(\n extractedExample,\n encoding,\n undefined,\n _contentType === 'multipart/form-data',\n contentSchema,\n ),\n }\n }\n\n return {\n mimeType: harMimeType,\n text:\n serializeStreamExample(extractedExample, _contentType, mediaType?.schema === undefined) ??\n (typeof extractedExample === 'string' ? extractedExample : JSON.stringify(extractedExample)),\n }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,CAACkE,EAAgB7C,CAAY,KAC7B2C,EAAaR,GAAe,IAAOnC,CAAY,GAE/C,OAAO;GAAE,UAAUE;GAAa,MAAM;EAAY;EAEpD,IAAM4C,IAAmBC,EACvBZ,GACA;GACE,sBAAsBtB;GACtB,MAAM;GACN;GACA;GACA,cAAcb,MAAiB;EACjC,GACA,EACE,YAAY,CAAC,aAAa,EAC5B,CACF;EAEA,IAAI8C,MAAqB,KAAA,GAcvB,OAbI3B,KAAc,OAAO2B,KAAqB,YAAYA,IACjD;GACL,UAAU5C;GACV,QAAQ5B,EACNwE,GACAhE,GACA,KAAA,GACAkB,MAAiB,uBACjBkC,CACF;EACF,IAGK;GACL,UAAUhC;GACV,MACE8B,EAAuBc,GAAkB9C,GAAciC,GAAW,WAAW,KAAA,CAAS,MACrF,OAAOa,KAAqB,WAAWA,IAAmB,KAAK,UAAUA,CAAgB;EAC9F;CAEJ;AAGF"}
package/dist/constants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/constants.ts
2
- var e = typeof OVERRIDE_PACKAGE_VERSION < "u" ? OVERRIDE_PACKAGE_VERSION : "0.8.0";
2
+ var e = typeof OVERRIDE_PACKAGE_VERSION < "u" ? OVERRIDE_PACKAGE_VERSION : "0.9.0";
3
3
  export { e as APP_VERSION };
4
4
 
5
5
  //# sourceMappingURL=constants.js.map