apiuikit 0.3.0 → 1.0.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.
Files changed (149) hide show
  1. package/README.md +66 -7
  2. package/dist/LinkedInExtension-6xekO5bX.cjs +1 -0
  3. package/dist/LinkedInExtension-BL-4T9tt.js +21 -0
  4. package/dist/LogoExtension-BOYrY_RE.cjs +1 -0
  5. package/dist/LogoExtension-HOlSsQf-.js +27 -0
  6. package/dist/XExtension-GyRtdHLL.js +23 -0
  7. package/dist/XExtension-jAiATfg-.cjs +1 -0
  8. package/dist/apiuikit.cjs.js +1 -1
  9. package/dist/apiuikit.css +1 -1
  10. package/dist/apiuikit.es.js +24 -17
  11. package/dist/c-Bz1-FJiA.js +277 -0
  12. package/dist/c-C_Sx7N-F.cjs +1 -0
  13. package/dist/clojure-DWYEZwCD.cjs +1 -0
  14. package/dist/clojure-aY2138WD.js +135 -0
  15. package/dist/components/Authorization.d.ts +28 -17
  16. package/dist/components/ChannelAddress.d.ts +8 -2
  17. package/dist/components/CodeBlock.d.ts +4 -1
  18. package/dist/components/CodeSamples.d.ts +12 -0
  19. package/dist/components/CollapsiblePanel.d.ts +24 -0
  20. package/dist/components/CopyMarkdownButton.d.ts +15 -0
  21. package/dist/components/Examples.d.ts +4 -2
  22. package/dist/components/InfoMetadata.d.ts +21 -2
  23. package/dist/components/Markdown.d.ts +2 -0
  24. package/dist/components/MarkdownExportMenu.d.ts +13 -0
  25. package/dist/components/MethodBadge.d.ts +14 -0
  26. package/dist/components/Navigation/AsyncAPINavigation.d.ts +28 -0
  27. package/dist/components/Navigation/Navigation.d.ts +58 -0
  28. package/dist/components/Navigation/OpenAPINavigation.d.ts +22 -0
  29. package/dist/components/Navigation/SpecNavigation.d.ts +25 -0
  30. package/dist/components/Navigation/index.d.ts +4 -0
  31. package/dist/components/Navigation/sharedSections.d.ts +10 -0
  32. package/dist/components/RenderExtensions.d.ts +28 -0
  33. package/dist/components/Section.d.ts +3 -1
  34. package/dist/components/ServerAddressBanner.d.ts +16 -0
  35. package/dist/components/SidePanel.d.ts +2 -0
  36. package/dist/components/Tabs.d.ts +3 -1
  37. package/dist/components/schema/SchemaTab.d.ts +24 -3
  38. package/dist/components/tests/Authorization.test.d.ts +1 -0
  39. package/dist/components/tests/Bindings.test.d.ts +1 -0
  40. package/dist/components/tests/CodeBlock.test.d.ts +1 -0
  41. package/dist/components/tests/CodeSamples.test.d.ts +1 -0
  42. package/dist/components/tests/CopyMarkdownButton.test.d.ts +1 -0
  43. package/dist/components/tests/MarkdownExportMenu.test.d.ts +1 -0
  44. package/dist/components/tests/RenderExtensions.test.d.ts +1 -0
  45. package/dist/config/config.d.ts +10 -0
  46. package/dist/containers/AsyncAPI/AsyncAPI.d.ts +12 -6
  47. package/dist/containers/AsyncAPI/AsyncAPIRenderer.d.ts +9 -0
  48. package/dist/containers/Information/InformationSection.d.ts +22 -0
  49. package/dist/containers/Information/OpenAPIInformation.d.ts +9 -0
  50. package/dist/containers/OpenAPI/Layout.d.ts +7 -0
  51. package/dist/containers/OpenAPI/OpenAPI.d.ts +18 -0
  52. package/dist/containers/OpenAPI/OpenAPIDocumentProvider.d.ts +13 -0
  53. package/dist/containers/OpenAPI/OpenAPIRenderer.d.ts +17 -0
  54. package/dist/containers/OpenAPI/tests/OpenAPI.test.d.ts +1 -0
  55. package/dist/containers/OpenAPI/tests/OpenAPIRenderer.test.d.ts +1 -0
  56. package/dist/containers/Operation/Operations.d.ts +2 -1
  57. package/dist/containers/Path/OperationCallbacks.d.ts +37 -0
  58. package/dist/containers/Path/PathOperation.d.ts +21 -0
  59. package/dist/containers/Path/Paths.d.ts +16 -0
  60. package/dist/containers/Path/ResponseLinks.d.ts +21 -0
  61. package/dist/containers/Path/tests/PathOperation.test.d.ts +1 -0
  62. package/dist/containers/Server/OpenAPIServer.d.ts +4 -0
  63. package/dist/containers/Server/OpenAPIServers.d.ts +13 -0
  64. package/dist/contants.d.ts +7 -0
  65. package/dist/contexts/useSpec.d.ts +30 -6
  66. package/dist/crystal-BcGgviMR.cjs +1 -0
  67. package/dist/crystal-BtD5fR4q.js +283 -0
  68. package/dist/csharp-AnFv7wyC.js +382 -0
  69. package/dist/csharp-yuAGIuP4.cjs +1 -0
  70. package/dist/go-BpetKc7b.cjs +1 -0
  71. package/dist/go-CkZ9_bn0.js +151 -0
  72. package/dist/helpers/codeSamples.d.ts +92 -0
  73. package/dist/helpers/exampleSchema.d.ts +19 -0
  74. package/dist/helpers/hljsLanguages.d.ts +6 -0
  75. package/dist/helpers/openapiParser.d.ts +10 -0
  76. package/dist/helpers/openapiSearchIndex.d.ts +3 -0
  77. package/dist/helpers/resolveDocument.d.ts +8 -0
  78. package/dist/helpers/runtimeExpression.d.ts +15 -0
  79. package/dist/helpers/schemaExample.d.ts +9 -0
  80. package/dist/helpers/searchIndex.d.ts +5 -2
  81. package/dist/helpers/tests/codeSamples.test.d.ts +1 -0
  82. package/dist/helpers/tests/exampleSchema.test.d.ts +1 -0
  83. package/dist/helpers/tests/openapiSearchIndex.test.d.ts +1 -0
  84. package/dist/helpers/tests/toMarkdown.test.d.ts +1 -0
  85. package/dist/helpers/toMarkdown.d.ts +20 -0
  86. package/dist/hooks/useDocumentProviderValue.d.ts +27 -0
  87. package/dist/hooks/useFuseSearch.d.ts +14 -0
  88. package/dist/hooks/useOpenAPISearch.d.ts +9 -0
  89. package/dist/hooks/useSearchResultFocus.d.ts +18 -0
  90. package/dist/hooks/useSpecLayoutController.d.ts +51 -0
  91. package/dist/hooks/useSpecSearch.d.ts +2 -6
  92. package/dist/http--XH4hLDt.cjs +1 -0
  93. package/dist/http-DKeNlJKS.js +85 -0
  94. package/dist/icons/Copy.d.ts +6 -0
  95. package/dist/icons/Info.d.ts +5 -0
  96. package/dist/icons/Search.d.ts +3 -0
  97. package/dist/{index-D7GelPk0.cjs → index-ArzwV232.cjs} +6 -6
  98. package/dist/index-Bh4OKjMA.js +25412 -0
  99. package/dist/index-C278WDNb.cjs +139 -0
  100. package/dist/index-C4I0xC5G.js +17544 -0
  101. package/dist/index-DuW5iShy.cjs +177 -0
  102. package/dist/index-PtAFPDfk.js +18851 -0
  103. package/dist/index.d.ts +7 -0
  104. package/dist/java-BIk0G-rH.cjs +1 -0
  105. package/dist/java-BicX26Pg.js +240 -0
  106. package/dist/kotlin-BwB8b-YX.js +242 -0
  107. package/dist/kotlin-kGuORR5a.cjs +2 -0
  108. package/dist/objectivec-CnyrJ13Z.js +237 -0
  109. package/dist/objectivec-CoeV81Tz.cjs +1 -0
  110. package/dist/ocaml-0j7KDjso.cjs +1 -0
  111. package/dist/ocaml-T8IqWCjo.js +67 -0
  112. package/dist/php-BL35ZHWM.js +566 -0
  113. package/dist/php-DF4zG2hq.cjs +2 -0
  114. package/dist/powershell-CvydS3ek.cjs +1 -0
  115. package/dist/powershell-DuhUKWoO.js +236 -0
  116. package/dist/protoToJsonSchema-AciPTlBK.cjs +83 -0
  117. package/dist/protoToJsonSchema-D1lojrO3.js +6131 -0
  118. package/dist/{protobufSchemaParser-D_2rEsD4.cjs → protobufSchemaParser-7SgmMhQd.cjs} +1 -1
  119. package/dist/{protobufSchemaParser-Cj2WOp05.js → protobufSchemaParser-BohWo_pY.js} +2 -2
  120. package/dist/public/createSectionRoot.d.ts +30 -0
  121. package/dist/public/openapiSections.d.ts +26 -0
  122. package/dist/public/sections.d.ts +6 -3
  123. package/dist/r-B8fCBydS.js +207 -0
  124. package/dist/r-CYaZnHkA.cjs +1 -0
  125. package/dist/ruby-CvOid-1s.js +388 -0
  126. package/dist/ruby-nPcbuC2a.cjs +1 -0
  127. package/dist/rust-BocnJ3Ns.js +305 -0
  128. package/dist/rust-DKnYCg2f.cjs +1 -0
  129. package/dist/stories/AsyncAPI.stories.d.ts +6 -0
  130. package/dist/stories/AsyncAPIRenderer.stories.d.ts +6 -0
  131. package/dist/stories/Messages.stories.d.ts +1 -0
  132. package/dist/stories/Operations.stories.d.ts +6 -0
  133. package/dist/stories/SchemaTab.stories.d.ts +1 -0
  134. package/dist/stories/SchemaTree.stories.d.ts +1 -0
  135. package/dist/stories/Server.stories.d.ts +1 -0
  136. package/dist/stories/documentContextDecorator.d.ts +2 -2
  137. package/dist/stories/noCanvasDocsPage.d.ts +9 -0
  138. package/dist/swift-C35Eof-I.js +799 -0
  139. package/dist/swift-CAnH__EC.cjs +1 -0
  140. package/dist/types/openapi.d.ts +85 -0
  141. package/package.json +16 -3
  142. package/dist/components/Navigation.d.ts +0 -28
  143. package/dist/icons/SideBar.d.ts +0 -6
  144. package/dist/index-Bad1aEIj.js +0 -11352
  145. package/dist/index-CzcxQGxP.js +0 -25414
  146. package/dist/index-gn5KpvCL.cjs +0 -73
  147. package/dist/protoToJsonSchema-8Mm10CIx.cjs +0 -83
  148. package/dist/protoToJsonSchema-BJpwl2Am.js +0 -6174
  149. package/dist/vite.svg +0 -1
@@ -0,0 +1,382 @@
1
+ function C(e) {
2
+ const d = [
3
+ "bool",
4
+ "byte",
5
+ "char",
6
+ "decimal",
7
+ "delegate",
8
+ "double",
9
+ "dynamic",
10
+ "enum",
11
+ "float",
12
+ "int",
13
+ "long",
14
+ "nint",
15
+ "nuint",
16
+ "object",
17
+ "sbyte",
18
+ "short",
19
+ "string",
20
+ "ulong",
21
+ "uint",
22
+ "ushort"
23
+ ], l = [
24
+ "public",
25
+ "private",
26
+ "protected",
27
+ "static",
28
+ "internal",
29
+ "protected",
30
+ "abstract",
31
+ "async",
32
+ "extern",
33
+ "override",
34
+ "unsafe",
35
+ "virtual",
36
+ "new",
37
+ "sealed",
38
+ "partial"
39
+ ], g = [
40
+ "default",
41
+ "false",
42
+ "null",
43
+ "true"
44
+ ], O = [
45
+ "abstract",
46
+ "as",
47
+ "base",
48
+ "break",
49
+ "case",
50
+ "catch",
51
+ "class",
52
+ "const",
53
+ "continue",
54
+ "do",
55
+ "else",
56
+ "event",
57
+ "explicit",
58
+ "extern",
59
+ "finally",
60
+ "fixed",
61
+ "for",
62
+ "foreach",
63
+ "goto",
64
+ "if",
65
+ "implicit",
66
+ "in",
67
+ "interface",
68
+ "internal",
69
+ "is",
70
+ "lock",
71
+ "namespace",
72
+ "new",
73
+ "operator",
74
+ "out",
75
+ "override",
76
+ "params",
77
+ "private",
78
+ "protected",
79
+ "public",
80
+ "readonly",
81
+ "record",
82
+ "ref",
83
+ "return",
84
+ "scoped",
85
+ "sealed",
86
+ "sizeof",
87
+ "stackalloc",
88
+ "static",
89
+ "struct",
90
+ "switch",
91
+ "this",
92
+ "throw",
93
+ "try",
94
+ "typeof",
95
+ "unchecked",
96
+ "unsafe",
97
+ "using",
98
+ "virtual",
99
+ "void",
100
+ "volatile",
101
+ "while"
102
+ ], N = [
103
+ "add",
104
+ "alias",
105
+ "and",
106
+ "ascending",
107
+ "args",
108
+ "async",
109
+ "await",
110
+ "by",
111
+ "descending",
112
+ "dynamic",
113
+ "equals",
114
+ "file",
115
+ "from",
116
+ "get",
117
+ "global",
118
+ "group",
119
+ "init",
120
+ "into",
121
+ "join",
122
+ "let",
123
+ "nameof",
124
+ "not",
125
+ "notnull",
126
+ "on",
127
+ "or",
128
+ "orderby",
129
+ "partial",
130
+ "record",
131
+ "remove",
132
+ "required",
133
+ "scoped",
134
+ "select",
135
+ "set",
136
+ "unmanaged",
137
+ "value|0",
138
+ "var",
139
+ "when",
140
+ "where",
141
+ "with",
142
+ "yield"
143
+ ], n = {
144
+ keyword: O.concat(N),
145
+ built_in: d,
146
+ literal: g
147
+ }, a = e.inherit(e.TITLE_MODE, { begin: "[a-zA-Z](\\.?\\w)*" }), i = {
148
+ className: "number",
149
+ variants: [
150
+ { begin: "\\b(0b[01']+)" },
151
+ { begin: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)" },
152
+ { begin: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" }
153
+ ],
154
+ relevance: 0
155
+ }, T = {
156
+ className: "string",
157
+ begin: /"""("*)(?!")(.|\n)*?"""\1/,
158
+ relevance: 1
159
+ }, t = {
160
+ className: "string",
161
+ begin: '@"',
162
+ end: '"',
163
+ contains: [{ begin: '""' }]
164
+ }, b = e.inherit(t, { illegal: /\n/ }), r = {
165
+ className: "subst",
166
+ begin: /\{/,
167
+ end: /\}/,
168
+ keywords: n
169
+ }, c = e.inherit(r, { illegal: /\n/ }), s = {
170
+ className: "string",
171
+ begin: /\$"/,
172
+ end: '"',
173
+ illegal: /\n/,
174
+ contains: [
175
+ { begin: /\{\{/ },
176
+ { begin: /\}\}/ },
177
+ e.BACKSLASH_ESCAPE,
178
+ c
179
+ ]
180
+ }, o = {
181
+ className: "string",
182
+ begin: /\$@"/,
183
+ end: '"',
184
+ contains: [
185
+ { begin: /\{\{/ },
186
+ { begin: /\}\}/ },
187
+ { begin: '""' },
188
+ r
189
+ ]
190
+ }, M = e.inherit(o, {
191
+ illegal: /\n/,
192
+ contains: [
193
+ { begin: /\{\{/ },
194
+ { begin: /\}\}/ },
195
+ { begin: '""' },
196
+ c
197
+ ]
198
+ });
199
+ r.contains = [
200
+ o,
201
+ s,
202
+ t,
203
+ e.APOS_STRING_MODE,
204
+ e.QUOTE_STRING_MODE,
205
+ i,
206
+ e.C_BLOCK_COMMENT_MODE
207
+ ], c.contains = [
208
+ M,
209
+ s,
210
+ b,
211
+ e.APOS_STRING_MODE,
212
+ e.QUOTE_STRING_MODE,
213
+ i,
214
+ e.inherit(e.C_BLOCK_COMMENT_MODE, { illegal: /\n/ })
215
+ ];
216
+ const _ = { variants: [
217
+ T,
218
+ o,
219
+ s,
220
+ t,
221
+ e.APOS_STRING_MODE,
222
+ e.QUOTE_STRING_MODE
223
+ ] }, E = {
224
+ begin: "<",
225
+ end: ">",
226
+ contains: [
227
+ { beginKeywords: "in out" },
228
+ a
229
+ ]
230
+ }, u = e.IDENT_RE + "(<" + e.IDENT_RE + "(\\s*,\\s*" + e.IDENT_RE + ")*>)?(\\[\\])?", I = {
231
+ // prevents expressions like `@class` from incorrect flagging
232
+ // `class` as a keyword
233
+ begin: "@" + e.IDENT_RE,
234
+ relevance: 0
235
+ };
236
+ return {
237
+ name: "C#",
238
+ aliases: [
239
+ "cs",
240
+ "c#"
241
+ ],
242
+ keywords: n,
243
+ illegal: /::/,
244
+ contains: [
245
+ e.COMMENT(
246
+ "///",
247
+ "$",
248
+ {
249
+ returnBegin: !0,
250
+ contains: [
251
+ {
252
+ className: "doctag",
253
+ variants: [
254
+ {
255
+ begin: "///",
256
+ relevance: 0
257
+ },
258
+ { begin: "<!--|-->" },
259
+ {
260
+ begin: "</?",
261
+ end: ">"
262
+ }
263
+ ]
264
+ }
265
+ ]
266
+ }
267
+ ),
268
+ e.C_LINE_COMMENT_MODE,
269
+ e.C_BLOCK_COMMENT_MODE,
270
+ {
271
+ className: "meta",
272
+ begin: "#",
273
+ end: "$",
274
+ keywords: { keyword: "if else elif endif define undef warning error line region endregion pragma checksum" }
275
+ },
276
+ _,
277
+ i,
278
+ {
279
+ beginKeywords: "class interface",
280
+ relevance: 0,
281
+ end: /[{;=]/,
282
+ illegal: /[^\s:,]/,
283
+ contains: [
284
+ { beginKeywords: "where class" },
285
+ a,
286
+ E,
287
+ e.C_LINE_COMMENT_MODE,
288
+ e.C_BLOCK_COMMENT_MODE
289
+ ]
290
+ },
291
+ {
292
+ beginKeywords: "namespace",
293
+ relevance: 0,
294
+ end: /[{;=]/,
295
+ illegal: /[^\s:]/,
296
+ contains: [
297
+ a,
298
+ e.C_LINE_COMMENT_MODE,
299
+ e.C_BLOCK_COMMENT_MODE
300
+ ]
301
+ },
302
+ {
303
+ beginKeywords: "record",
304
+ relevance: 0,
305
+ end: /[{;=]/,
306
+ illegal: /[^\s:]/,
307
+ contains: [
308
+ a,
309
+ E,
310
+ e.C_LINE_COMMENT_MODE,
311
+ e.C_BLOCK_COMMENT_MODE
312
+ ]
313
+ },
314
+ {
315
+ // [Attributes("")]
316
+ className: "meta",
317
+ begin: "^\\s*\\[(?=[\\w])",
318
+ excludeBegin: !0,
319
+ end: "\\]",
320
+ excludeEnd: !0,
321
+ contains: [
322
+ {
323
+ className: "string",
324
+ begin: /"/,
325
+ end: /"/
326
+ }
327
+ ]
328
+ },
329
+ {
330
+ // Expression keywords prevent 'keyword Name(...)' from being
331
+ // recognized as a function definition
332
+ beginKeywords: "new return throw await else",
333
+ relevance: 0
334
+ },
335
+ {
336
+ className: "function",
337
+ begin: "(" + u + "\\s+)+" + e.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
338
+ returnBegin: !0,
339
+ end: /\s*[{;=]/,
340
+ excludeEnd: !0,
341
+ keywords: n,
342
+ contains: [
343
+ // prevents these from being highlighted `title`
344
+ {
345
+ beginKeywords: l.join(" "),
346
+ relevance: 0
347
+ },
348
+ {
349
+ begin: e.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
350
+ returnBegin: !0,
351
+ contains: [
352
+ e.TITLE_MODE,
353
+ E
354
+ ],
355
+ relevance: 0
356
+ },
357
+ { match: /\(\)/ },
358
+ {
359
+ className: "params",
360
+ begin: /\(/,
361
+ end: /\)/,
362
+ excludeBegin: !0,
363
+ excludeEnd: !0,
364
+ keywords: n,
365
+ relevance: 0,
366
+ contains: [
367
+ _,
368
+ i,
369
+ e.C_BLOCK_COMMENT_MODE
370
+ ]
371
+ },
372
+ e.C_LINE_COMMENT_MODE,
373
+ e.C_BLOCK_COMMENT_MODE
374
+ ]
375
+ },
376
+ I
377
+ ]
378
+ };
379
+ }
380
+ export {
381
+ C as default
382
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function C(e){const d=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],l=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],g=["default","false","null","true"],O=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],N=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],n={keyword:O.concat(N),built_in:d,literal:g},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},T={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},t={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=e.inherit(t,{illegal:/\n/}),r={className:"subst",begin:/\{/,end:/\}/,keywords:n},c=e.inherit(r,{illegal:/\n/}),s={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,c]},o={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},r]},u=e.inherit(o,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},c]});r.contains=[o,s,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],c.contains=[u,s,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[T,o,s,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},i]},M=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",I={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+M+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{beginKeywords:l.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0,contains:[_,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},I]}}exports.default=C;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(e){const n={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:n,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,illegal:/["']/}]}]}}exports.default=t;
@@ -0,0 +1,151 @@
1
+ function c(e) {
2
+ const n = {
3
+ keyword: [
4
+ "break",
5
+ "case",
6
+ "chan",
7
+ "const",
8
+ "continue",
9
+ "default",
10
+ "defer",
11
+ "else",
12
+ "fallthrough",
13
+ "for",
14
+ "func",
15
+ "go",
16
+ "goto",
17
+ "if",
18
+ "import",
19
+ "interface",
20
+ "map",
21
+ "package",
22
+ "range",
23
+ "return",
24
+ "select",
25
+ "struct",
26
+ "switch",
27
+ "type",
28
+ "var"
29
+ ],
30
+ type: [
31
+ "bool",
32
+ "byte",
33
+ "complex64",
34
+ "complex128",
35
+ "error",
36
+ "float32",
37
+ "float64",
38
+ "int8",
39
+ "int16",
40
+ "int32",
41
+ "int64",
42
+ "string",
43
+ "uint8",
44
+ "uint16",
45
+ "uint32",
46
+ "uint64",
47
+ "int",
48
+ "uint",
49
+ "uintptr",
50
+ "rune"
51
+ ],
52
+ literal: [
53
+ "true",
54
+ "false",
55
+ "iota",
56
+ "nil"
57
+ ],
58
+ built_in: [
59
+ "append",
60
+ "cap",
61
+ "close",
62
+ "complex",
63
+ "copy",
64
+ "imag",
65
+ "len",
66
+ "make",
67
+ "new",
68
+ "panic",
69
+ "print",
70
+ "println",
71
+ "real",
72
+ "recover",
73
+ "delete"
74
+ ]
75
+ };
76
+ return {
77
+ name: "Go",
78
+ aliases: ["golang"],
79
+ keywords: n,
80
+ illegal: "</",
81
+ contains: [
82
+ e.C_LINE_COMMENT_MODE,
83
+ e.C_BLOCK_COMMENT_MODE,
84
+ {
85
+ className: "string",
86
+ variants: [
87
+ e.QUOTE_STRING_MODE,
88
+ e.APOS_STRING_MODE,
89
+ {
90
+ begin: "`",
91
+ end: "`"
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ className: "number",
97
+ variants: [
98
+ {
99
+ match: /-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,
100
+ // hex without a present digit before . (making a digit afterwards required)
101
+ relevance: 0
102
+ },
103
+ {
104
+ match: /-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,
105
+ // hex with a present digit before . (making a digit afterwards optional)
106
+ relevance: 0
107
+ },
108
+ {
109
+ match: /-?\b0[oO](_?[0-7])*i?/,
110
+ // leading 0o octal
111
+ relevance: 0
112
+ },
113
+ {
114
+ match: /-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,
115
+ // decimal without a present digit before . (making a digit afterwards required)
116
+ relevance: 0
117
+ },
118
+ {
119
+ match: /-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,
120
+ // decimal with a present digit before . (making a digit afterwards optional)
121
+ relevance: 0
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ begin: /:=/
127
+ // relevance booster
128
+ },
129
+ {
130
+ className: "function",
131
+ beginKeywords: "func",
132
+ end: "\\s*(\\{|$)",
133
+ excludeEnd: !0,
134
+ contains: [
135
+ e.TITLE_MODE,
136
+ {
137
+ className: "params",
138
+ begin: /\(/,
139
+ end: /\)/,
140
+ endsParent: !0,
141
+ keywords: n,
142
+ illegal: /["']/
143
+ }
144
+ ]
145
+ }
146
+ ]
147
+ };
148
+ }
149
+ export {
150
+ c as default
151
+ };
@@ -0,0 +1,92 @@
1
+ import { availableTargets } from '@readme/httpsnippet';
2
+ import { HttpMethod, OpenAPIParameterData, OpenAPIRequestBodyData, OpenAPISecuritySchemeData, OpenAPIServerData } from '../types/openapi';
3
+ export declare const DEFAULT_CODE_SAMPLE_TARGET = "shell";
4
+ export declare const DEFAULT_CODE_SAMPLE_CLIENT = "curl";
5
+ export type AvailableCodeSampleTarget = ReturnType<typeof availableTargets>[number];
6
+ /** Every target/client @readme/httpsnippet knows how to generate (curl,
7
+ * fetch, axios, Python requests, Go, Rust, ...), grouped by target — this is
8
+ * the data source for the language/library dropdown. Pure passthrough kept
9
+ * here so `@readme/httpsnippet` stays imported in one place. */
10
+ export declare function getAvailableCodeSampleTargets(): AvailableCodeSampleTarget[];
11
+ interface HarNameValue {
12
+ name: string;
13
+ value: string;
14
+ }
15
+ /** Loosely-typed HAR request we build ourselves — @readme/httpsnippet's own
16
+ * `HarRequest` type (from @types/har-format) declares several fields as
17
+ * required that its `init()` step actually defaults for us at runtime
18
+ * (httpVersion, headers, cookies, queryString, postData.mimeType). We build
19
+ * only what we need and cast at the single call site in `generateSnippet`. */
20
+ export interface CodeSampleHarRequest {
21
+ method: string;
22
+ url: string;
23
+ httpVersion: string;
24
+ headers: HarNameValue[];
25
+ queryString: HarNameValue[];
26
+ cookies: HarNameValue[];
27
+ postData?: {
28
+ mimeType: string;
29
+ text: string;
30
+ };
31
+ }
32
+ interface ResolvedAuthPlaceholder {
33
+ location: "header" | "query" | "cookie";
34
+ name: string;
35
+ value: string;
36
+ }
37
+ interface ResolvedRequestBodyMedia {
38
+ contentType: string;
39
+ schema?: unknown;
40
+ authorExample?: unknown;
41
+ }
42
+ /** Substitutes each `{var}` in a server URL template with its declared
43
+ * default (or first enum value, or the literal token as a last resort).
44
+ * Falls back to a placeholder host when the operation has no server at all,
45
+ * since HTTPSnippet's clients require an absolute URL. */
46
+ export declare function resolveServerBaseUrl(servers?: OpenAPIServerData[]): string;
47
+ /** Precedence: `param.example` → first `param.examples[...].value` →
48
+ * `schema.example` → first `schema.enum` value → a literal `{name}` token as
49
+ * a last-resort placeholder, so an undocumented parameter still produces a
50
+ * valid, copyable (if not runnable as-is) sample. */
51
+ export declare function resolveParamExampleValue(param: OpenAPIParameterData): string;
52
+ /** Substitutes `{token}` path placeholders using the matching `in: "path"`
53
+ * parameter's example value. Falls back to the literal token when no
54
+ * matching parameter is supplied — this is what keeps the sample valid even
55
+ * for operations whose path parameter is only declared at the path-item
56
+ * level (not merged into `op.parameters` today). */
57
+ export declare function buildRequestUrl(baseUrl: string, path: string, parameters: OpenAPIParameterData[]): string;
58
+ /** Resolves the first `security`/`globalSecurity` OR-alternative against
59
+ * `components.securitySchemes` into placeholder auth values, routed by
60
+ * location (header/query/cookie) so the caller can feed them into the
61
+ * matching HAR array. First code in the library to actually resolve a
62
+ * security requirement against its scheme definition. */
63
+ export declare function resolveAuthPlaceholders(security: Array<Record<string, string[]>>, securitySchemes?: Record<string, OpenAPISecuritySchemeData>): ResolvedAuthPlaceholder[];
64
+ /** Picks the request body media type to sample: prefers `application/json`,
65
+ * else the first declared content type. Surfaces the author-supplied
66
+ * `example`/`examples` value (never read anywhere else in the codebase
67
+ * today) so the caller can prefer it over a schema-faker-generated one. */
68
+ export declare function pickRequestBodyMedia(requestBody?: OpenAPIRequestBodyData): ResolvedRequestBodyMedia | null;
69
+ interface BuildHarRequestInput {
70
+ method: HttpMethod;
71
+ path: string;
72
+ servers?: OpenAPIServerData[];
73
+ parameters: OpenAPIParameterData[];
74
+ security: Array<Record<string, string[]>>;
75
+ securitySchemes?: Record<string, OpenAPISecuritySchemeData>;
76
+ media: ResolvedRequestBodyMedia | null;
77
+ resolvedBodyValue: unknown;
78
+ }
79
+ /** Assembles a HAR request object from a resolved operation — the input to
80
+ * `generateSnippet`/`@readme/httpsnippet`. Query parameters are supplied only
81
+ * via the `queryString` array (not appended to `url`); HTTPSnippet's own
82
+ * `prepare()` step reconstructs and encodes the final URL from that array. */
83
+ export declare function buildHarRequest(input: BuildHarRequestInput): CodeSampleHarRequest;
84
+ /** Generates a single target/client code sample for a resolved HAR request
85
+ * via @readme/httpsnippet. Fails soft: an unsupported target/client pair or a
86
+ * malformed request resolves to an empty string rather than throwing, so one
87
+ * bad operation (or a stale dropdown selection) can't crash the panel.
88
+ * `target`/`client` come from `getAvailableCodeSampleTargets()`'s own keys, so
89
+ * they're always valid at the httpsnippet level — the cast below only works
90
+ * around TargetId/ClientId not being exported types we can name directly. */
91
+ export declare function generateSnippet(harRequest: CodeSampleHarRequest, target: string, client: string): string;
92
+ export {};
@@ -0,0 +1,19 @@
1
+ export type JsonSchema = Record<string, unknown>;
2
+ export declare function includesType(schema: JsonSchema, type: string): boolean;
3
+ /**
4
+ * Prepares a schema for json-schema-faker's `generate()` so the Example tab
5
+ * shows something plausible and consistent with the Schema tab:
6
+ *
7
+ * - Leftover `$ref` nodes (resolveDocument's cycle cut-points) are unrolled
8
+ * exactly one level via `deref`, so a recursive schema's example shows one
9
+ * real nested occurrence. The second occurrence of the same ref on a path
10
+ * is cut to `{ type: "null" }` when the target allows null, else `{}`.
11
+ * Without this, generate() would throw on the unresolvable pointer and the
12
+ * tab would silently render nothing.
13
+ * - `oneOf`/`anyOf` collapse to their first branch, matching the case
14
+ * SchemaTree shows by default, instead of letting generate() pick an
15
+ * unrelated-looking one.
16
+ * - Plain string fields get placeholder examples (and `*id` fields a uuid
17
+ * format) instead of random character noise.
18
+ */
19
+ export declare function extendExampleSchema(schema: JsonSchema, deref?: (ref: string) => unknown, active?: Set<object>, refStack?: ReadonlySet<string>): JsonSchema;
@@ -0,0 +1,6 @@
1
+ export declare function hljsLanguageForTarget(target: string): string;
2
+ export declare function isHljsLanguageReady(hljsName: string): boolean;
3
+ /** Registers a highlight.js grammar on first use. No-op if already
4
+ * registered, if it's "plaintext" (needs no registration), or if there's no
5
+ * loader for it (CodeBlock falls back to unhighlighted text in that case). */
6
+ export declare function ensureHljsLanguage(hljsName: string): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import { OpenAPIDocumentData } from '../types/openapi';
2
+ import { ConfigInterface } from '../config/config';
3
+ export declare function parseDocument(raw: string): Promise<{
4
+ diagnostics: unknown[];
5
+ document: OpenAPIDocumentData | null;
6
+ }>;
7
+ export declare function parseAndRender(raw: string, config?: ConfigInterface): Promise<{
8
+ diagnostics: unknown[];
9
+ view: import("react").JSX.Element | null;
10
+ }>;
@@ -0,0 +1,3 @@
1
+ import { OpenAPIDocumentData } from '../types/openapi';
2
+ import { SearchEntry } from './searchIndex';
3
+ export declare function buildOpenAPISearchIndex(openapi: OpenAPIDocumentData): SearchEntry[];