fumadocs-openapi 10.6.4 → 10.6.6
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/css/generated/shared.css +34 -7
- package/dist/_openapi/types.d.ts +1 -2
- package/dist/generate-file.d.ts +1 -2
- package/dist/generate-file.js +3 -4
- package/dist/i18n.d.ts +2 -2
- package/dist/i18n.js +1 -2
- package/dist/playground/auth.js +92 -0
- package/dist/playground/client.d.ts +5 -10
- package/dist/playground/client.js +280 -199
- package/dist/playground/components/inputs.js +0 -2
- package/dist/playground/components/oauth-dialog.js +125 -164
- package/dist/playground/components/server-select.js +0 -2
- package/dist/playground/components/spinner.js +14 -0
- package/dist/playground/fetcher.d.ts +1 -2
- package/dist/playground/fetcher.js +0 -2
- package/dist/playground/schema.d.ts +1 -2
- package/dist/playground/schema.js +24 -15
- package/dist/playground/status-info.js +0 -2
- package/dist/requests/generators/all.d.ts +1 -2
- package/dist/requests/generators/all.js +0 -2
- package/dist/requests/generators/csharp.d.ts +1 -2
- package/dist/requests/generators/csharp.js +2 -3
- package/dist/requests/generators/curl.d.ts +1 -2
- package/dist/requests/generators/curl.js +5 -7
- package/dist/requests/generators/go.d.ts +1 -2
- package/dist/requests/generators/go.js +5 -7
- package/dist/requests/generators/index.d.ts +1 -2
- package/dist/requests/generators/index.js +0 -2
- package/dist/requests/generators/java.d.ts +1 -2
- package/dist/requests/generators/java.js +4 -6
- package/dist/requests/generators/javascript.d.ts +1 -2
- package/dist/requests/generators/javascript.js +3 -5
- package/dist/requests/generators/python.d.ts +1 -2
- package/dist/requests/generators/python.js +5 -6
- package/dist/requests/media/adapter.d.ts +1 -2
- package/dist/requests/media/adapter.js +7 -9
- package/dist/requests/media/encode.d.ts +1 -2
- package/dist/requests/media/encode.js +0 -2
- package/dist/requests/media/resolve-adapter.js +0 -2
- package/dist/requests/string-utils.js +25 -6
- package/dist/requests/types.d.ts +4 -4
- package/dist/scalar/client.js +0 -2
- package/dist/scalar/index.d.ts +1 -2
- package/dist/scalar/index.js +0 -2
- package/dist/server/create.d.ts +2 -3
- package/dist/server/create.js +0 -2
- package/dist/server/proxy.d.ts +1 -2
- package/dist/server/proxy.js +0 -2
- package/dist/server/source-api.d.ts +1 -2
- package/dist/server/source-api.js +0 -2
- package/dist/types.d.ts +1 -2
- package/dist/ui/api-page.d.ts +1 -2
- package/dist/ui/api-page.js +3 -3
- package/dist/ui/base.d.ts +9 -6
- package/dist/ui/base.js +8 -5
- package/dist/ui/client/boundary.d.ts +1 -2
- package/dist/ui/client/boundary.js +0 -2
- package/dist/ui/client/boundary.lazy.js +2 -3
- package/dist/ui/client/full.js +0 -2
- package/dist/ui/client/i18n.js +0 -2
- package/dist/ui/client/index.d.ts +1 -2
- package/dist/ui/client/index.js +0 -2
- package/dist/ui/client/storage-key.js +1 -3
- package/dist/ui/components/accordion.js +0 -2
- package/dist/ui/components/codeblock.d.ts +1 -2
- package/dist/ui/components/codeblock.js +0 -2
- package/dist/ui/components/dialog.js +0 -2
- package/dist/ui/components/input.js +0 -2
- package/dist/ui/components/method-label.js +0 -2
- package/dist/ui/components/select-tab.js +0 -2
- package/dist/ui/components/select.js +0 -2
- package/dist/ui/contexts/api.d.ts +7 -5
- package/dist/ui/contexts/api.js +7 -4
- package/dist/ui/create-client.d.ts +1 -2
- package/dist/ui/create-client.js +6 -3
- package/dist/ui/index.d.ts +1 -2
- package/dist/ui/index.js +0 -2
- package/dist/ui/operation/client.js +0 -2
- package/dist/ui/operation/get-example-requests.d.ts +1 -2
- package/dist/ui/operation/get-example-requests.js +0 -2
- package/dist/ui/operation/index.js +0 -2
- package/dist/ui/operation/request-tabs.d.ts +10 -0
- package/dist/ui/operation/request-tabs.js +43 -39
- package/dist/ui/operation/response-tabs.d.ts +1 -2
- package/dist/ui/operation/response-tabs.js +0 -2
- package/dist/ui/operation/usage-tabs/client.d.ts +1 -2
- package/dist/ui/operation/usage-tabs/client.js +0 -2
- package/dist/ui/operation/usage-tabs/index.js +0 -2
- package/dist/ui/schema/client.d.ts +1 -2
- package/dist/ui/schema/client.js +0 -2
- package/dist/ui/schema/index.d.ts +3 -4
- package/dist/ui/schema/index.js +1 -3
- package/dist/utils/deep-equal.js +0 -2
- package/dist/utils/document/dereference.d.ts +1 -2
- package/dist/utils/document/dereference.js +0 -2
- package/dist/utils/document/process.d.ts +1 -2
- package/dist/utils/document/process.js +0 -2
- package/dist/utils/id-to-title.js +0 -2
- package/dist/utils/is-plain-object.js +0 -2
- package/dist/utils/pages/builder.d.ts +1 -2
- package/dist/utils/pages/builder.js +0 -2
- package/dist/utils/pages/preset-auto.d.ts +1 -2
- package/dist/utils/pages/preset-auto.js +0 -2
- package/dist/utils/pages/to-static-data.js +0 -2
- package/dist/utils/pages/to-text.d.ts +1 -2
- package/dist/utils/pages/to-text.js +5 -6
- package/dist/utils/remove-undefined.js +0 -2
- package/dist/utils/schema/dereference.js +22 -14
- package/dist/utils/schema/index.d.ts +4 -10
- package/dist/utils/schema/index.js +4 -11
- package/dist/utils/{merge-schema.js → schema/merge.js} +2 -4
- package/dist/utils/schema/pick.js +0 -2
- package/dist/utils/schema/ref.js +0 -2
- package/dist/utils/schema/resolve-ref.js +0 -2
- package/dist/utils/schema/to-string.js +4 -7
- package/dist/utils/url.js +0 -2
- package/dist/utils/use-query.js +2 -3
- package/package.json +2 -2
- package/dist/_openapi/types.d.ts.map +0 -1
- package/dist/generate-file.d.ts.map +0 -1
- package/dist/generate-file.js.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/playground/client.d.ts.map +0 -1
- package/dist/playground/client.js.map +0 -1
- package/dist/playground/components/inputs.js.map +0 -1
- package/dist/playground/components/oauth-dialog.js.map +0 -1
- package/dist/playground/components/server-select.js.map +0 -1
- package/dist/playground/fetcher.d.ts.map +0 -1
- package/dist/playground/fetcher.js.map +0 -1
- package/dist/playground/schema.d.ts.map +0 -1
- package/dist/playground/schema.js.map +0 -1
- package/dist/playground/status-info.js.map +0 -1
- package/dist/requests/generators/all.d.ts.map +0 -1
- package/dist/requests/generators/all.js.map +0 -1
- package/dist/requests/generators/csharp.d.ts.map +0 -1
- package/dist/requests/generators/csharp.js.map +0 -1
- package/dist/requests/generators/curl.d.ts.map +0 -1
- package/dist/requests/generators/curl.js.map +0 -1
- package/dist/requests/generators/go.d.ts.map +0 -1
- package/dist/requests/generators/go.js.map +0 -1
- package/dist/requests/generators/index.d.ts.map +0 -1
- package/dist/requests/generators/index.js.map +0 -1
- package/dist/requests/generators/java.d.ts.map +0 -1
- package/dist/requests/generators/java.js.map +0 -1
- package/dist/requests/generators/javascript.d.ts.map +0 -1
- package/dist/requests/generators/javascript.js.map +0 -1
- package/dist/requests/generators/python.d.ts.map +0 -1
- package/dist/requests/generators/python.js.map +0 -1
- package/dist/requests/media/adapter.d.ts.map +0 -1
- package/dist/requests/media/adapter.js.map +0 -1
- package/dist/requests/media/encode.d.ts.map +0 -1
- package/dist/requests/media/encode.js.map +0 -1
- package/dist/requests/media/resolve-adapter.js.map +0 -1
- package/dist/requests/string-utils.js.map +0 -1
- package/dist/requests/types.d.ts.map +0 -1
- package/dist/scalar/client.js.map +0 -1
- package/dist/scalar/index.d.ts.map +0 -1
- package/dist/scalar/index.js.map +0 -1
- package/dist/server/create.d.ts.map +0 -1
- package/dist/server/create.js.map +0 -1
- package/dist/server/proxy.d.ts.map +0 -1
- package/dist/server/proxy.js.map +0 -1
- package/dist/server/source-api.d.ts.map +0 -1
- package/dist/server/source-api.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/ui/api-page.d.ts.map +0 -1
- package/dist/ui/api-page.js.map +0 -1
- package/dist/ui/base.d.ts.map +0 -1
- package/dist/ui/base.js.map +0 -1
- package/dist/ui/client/boundary.d.ts.map +0 -1
- package/dist/ui/client/boundary.js.map +0 -1
- package/dist/ui/client/boundary.lazy.js.map +0 -1
- package/dist/ui/client/full.js.map +0 -1
- package/dist/ui/client/i18n.js.map +0 -1
- package/dist/ui/client/index.d.ts.map +0 -1
- package/dist/ui/client/index.js.map +0 -1
- package/dist/ui/client/storage-key.js.map +0 -1
- package/dist/ui/components/accordion.js.map +0 -1
- package/dist/ui/components/codeblock.d.ts.map +0 -1
- package/dist/ui/components/codeblock.js.map +0 -1
- package/dist/ui/components/dialog.js.map +0 -1
- package/dist/ui/components/input.js.map +0 -1
- package/dist/ui/components/method-label.js.map +0 -1
- package/dist/ui/components/select-tab.js.map +0 -1
- package/dist/ui/components/select.js.map +0 -1
- package/dist/ui/contexts/api.d.ts.map +0 -1
- package/dist/ui/contexts/api.js.map +0 -1
- package/dist/ui/create-client.d.ts.map +0 -1
- package/dist/ui/create-client.js.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/operation/client.js.map +0 -1
- package/dist/ui/operation/get-example-requests.d.ts.map +0 -1
- package/dist/ui/operation/get-example-requests.js.map +0 -1
- package/dist/ui/operation/index.js.map +0 -1
- package/dist/ui/operation/request-tabs.js.map +0 -1
- package/dist/ui/operation/response-tabs.d.ts.map +0 -1
- package/dist/ui/operation/response-tabs.js.map +0 -1
- package/dist/ui/operation/usage-tabs/client.d.ts.map +0 -1
- package/dist/ui/operation/usage-tabs/client.js.map +0 -1
- package/dist/ui/operation/usage-tabs/index.js.map +0 -1
- package/dist/ui/schema/client.d.ts.map +0 -1
- package/dist/ui/schema/client.js.map +0 -1
- package/dist/ui/schema/index.d.ts.map +0 -1
- package/dist/ui/schema/index.js.map +0 -1
- package/dist/utils/deep-equal.js.map +0 -1
- package/dist/utils/document/dereference.d.ts.map +0 -1
- package/dist/utils/document/dereference.js.map +0 -1
- package/dist/utils/document/process.d.ts.map +0 -1
- package/dist/utils/document/process.js.map +0 -1
- package/dist/utils/id-to-title.js.map +0 -1
- package/dist/utils/is-plain-object.js.map +0 -1
- package/dist/utils/merge-schema.js.map +0 -1
- package/dist/utils/pages/builder.d.ts.map +0 -1
- package/dist/utils/pages/builder.js.map +0 -1
- package/dist/utils/pages/preset-auto.d.ts.map +0 -1
- package/dist/utils/pages/preset-auto.js.map +0 -1
- package/dist/utils/pages/to-static-data.js.map +0 -1
- package/dist/utils/pages/to-text.d.ts.map +0 -1
- package/dist/utils/pages/to-text.js.map +0 -1
- package/dist/utils/remove-undefined.js.map +0 -1
- package/dist/utils/schema/dereference.js.map +0 -1
- package/dist/utils/schema/index.d.ts.map +0 -1
- package/dist/utils/schema/index.js.map +0 -1
- package/dist/utils/schema/pick.js.map +0 -1
- package/dist/utils/schema/ref.js.map +0 -1
- package/dist/utils/schema/resolve-ref.js.map +0 -1
- package/dist/utils/schema/to-string.js.map +0 -1
- package/dist/utils/url.js.map +0 -1
- package/dist/utils/use-query.js.map +0 -1
package/css/generated/shared.css
CHANGED
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
@source inline("auth-specific");
|
|
66
66
|
@source inline("authBasicTokenExample");
|
|
67
67
|
@source inline("authBearerTokenExample");
|
|
68
|
-
@source inline("
|
|
68
|
+
@source inline("authCodeQuery");
|
|
69
|
+
@source inline("authCtx");
|
|
69
70
|
@source inline("authNode");
|
|
70
71
|
@source inline("authSchemes");
|
|
71
72
|
@source inline("authScope");
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
@source inline("border-b");
|
|
106
107
|
@source inline("border-current");
|
|
107
108
|
@source inline("border-fd-primary/20");
|
|
109
|
+
@source inline("border-s");
|
|
108
110
|
@source inline("border-t");
|
|
109
111
|
@source inline("border-x");
|
|
110
112
|
@source inline("border-y");
|
|
@@ -211,6 +213,7 @@
|
|
|
211
213
|
@source inline("defaultExampleId");
|
|
212
214
|
@source inline("defaultItem");
|
|
213
215
|
@source inline("defaultMdxComponents");
|
|
216
|
+
@source inline("defaultOpen");
|
|
214
217
|
@source inline("defaultShikiFactory");
|
|
215
218
|
@source inline("defaultValue");
|
|
216
219
|
@source inline("defaultValues");
|
|
@@ -218,7 +221,9 @@
|
|
|
218
221
|
@source inline("definitions");
|
|
219
222
|
@source inline("deprecated");
|
|
220
223
|
@source inline("depth");
|
|
224
|
+
@source inline("dereference");
|
|
221
225
|
@source inline("dereferenceDocument");
|
|
226
|
+
@source inline("dereferenceSwallow");
|
|
222
227
|
@source inline("dereferenced");
|
|
223
228
|
@source inline("description");
|
|
224
229
|
@source inline("descriptionNode");
|
|
@@ -263,7 +268,6 @@
|
|
|
263
268
|
@source inline("error");
|
|
264
269
|
@source inline("eslint-disable");
|
|
265
270
|
@source inline("eslint-disable-next-line");
|
|
266
|
-
@source inline("eslint-plugin-react-hooks/rules-of-hooks");
|
|
267
271
|
@source inline("example");
|
|
268
272
|
@source inline("exampleId");
|
|
269
273
|
@source inline("exampleRequests");
|
|
@@ -279,7 +283,6 @@
|
|
|
279
283
|
@source inline("fetch");
|
|
280
284
|
@source inline("fetchOptions");
|
|
281
285
|
@source inline("fetcher");
|
|
282
|
-
@source inline("fetchingToken");
|
|
283
286
|
@source inline("field");
|
|
284
287
|
@source inline("fieldData");
|
|
285
288
|
@source inline("fieldLabelVariants");
|
|
@@ -302,6 +305,7 @@
|
|
|
302
305
|
@source inline("flex-col-reverse");
|
|
303
306
|
@source inline("flex-row");
|
|
304
307
|
@source inline("flex-wrap");
|
|
308
|
+
@source inline("flow");
|
|
305
309
|
@source inline("flows");
|
|
306
310
|
@source inline("focus-visible:outline-none");
|
|
307
311
|
@source inline("focus-visible:ring-1");
|
|
@@ -381,7 +385,9 @@
|
|
|
381
385
|
@source inline("h-[240px]");
|
|
382
386
|
@source inline("h-px");
|
|
383
387
|
@source inline("h1");
|
|
388
|
+
@source inline("handling");
|
|
384
389
|
@source inline("hasHead");
|
|
390
|
+
@source inline("hash");
|
|
385
391
|
@source inline("hast");
|
|
386
392
|
@source inline("hast-util-to-jsx-runtime");
|
|
387
393
|
@source inline("headNode");
|
|
@@ -417,7 +423,7 @@
|
|
|
417
423
|
@source inline("infer");
|
|
418
424
|
@source inline("info");
|
|
419
425
|
@source inline("infoTags");
|
|
420
|
-
@source inline("
|
|
426
|
+
@source inline("initAuthInputs");
|
|
421
427
|
@source inline("initial");
|
|
422
428
|
@source inline("initialPath");
|
|
423
429
|
@source inline("inline-flex");
|
|
@@ -481,7 +487,6 @@
|
|
|
481
487
|
@source inline("localStorage");
|
|
482
488
|
@source inline("lucide-react");
|
|
483
489
|
@source inline("map");
|
|
484
|
-
@source inline("mapInputs");
|
|
485
490
|
@source inline("max");
|
|
486
491
|
@source inline("max-age");
|
|
487
492
|
@source inline("max-h-[460px]");
|
|
@@ -489,6 +494,7 @@
|
|
|
489
494
|
@source inline("max-w-full");
|
|
490
495
|
@source inline("max-w-lg");
|
|
491
496
|
@source inline("may");
|
|
497
|
+
@source inline("mb-1");
|
|
492
498
|
@source inline("mb-2");
|
|
493
499
|
@source inline("mb-4");
|
|
494
500
|
@source inline("md");
|
|
@@ -573,6 +579,7 @@
|
|
|
573
579
|
@source inline("openapi");
|
|
574
580
|
@source inline("openapi-sampler");
|
|
575
581
|
@source inline("openapi-types");
|
|
582
|
+
@source inline("openid");
|
|
576
583
|
@source inline("operation");
|
|
577
584
|
@source inline("operationId");
|
|
578
585
|
@source inline("operations");
|
|
@@ -581,7 +588,6 @@
|
|
|
581
588
|
@source inline("orange");
|
|
582
589
|
@source inline("order-last");
|
|
583
590
|
@source inline("origin");
|
|
584
|
-
@source inline("original");
|
|
585
591
|
@source inline("other");
|
|
586
592
|
@source inline("out");
|
|
587
593
|
@source inline("outline");
|
|
@@ -590,7 +596,6 @@
|
|
|
590
596
|
@source inline("overflow-hidden");
|
|
591
597
|
@source inline("overrides");
|
|
592
598
|
@source inline("overview");
|
|
593
|
-
@source inline("oxlint-disable-next-line");
|
|
594
599
|
@source inline("p-1");
|
|
595
600
|
@source inline("p-1.5");
|
|
596
601
|
@source inline("p-2");
|
|
@@ -598,6 +603,7 @@
|
|
|
598
603
|
@source inline("p-4");
|
|
599
604
|
@source inline("packages");
|
|
600
605
|
@source inline("page");
|
|
606
|
+
@source inline("page-level");
|
|
601
607
|
@source inline("pageData");
|
|
602
608
|
@source inline("pages");
|
|
603
609
|
@source inline("param");
|
|
@@ -629,6 +635,7 @@
|
|
|
629
635
|
@source inline("peer-disabled:opacity-70");
|
|
630
636
|
@source inline("perhaps");
|
|
631
637
|
@source inline("persist");
|
|
638
|
+
@source inline("persisted");
|
|
632
639
|
@source inline("persistent");
|
|
633
640
|
@source inline("pickExample");
|
|
634
641
|
@source inline("pickSchema");
|
|
@@ -657,6 +664,7 @@
|
|
|
657
664
|
@source inline("property");
|
|
658
665
|
@source inline("props");
|
|
659
666
|
@source inline("prose-no-margin");
|
|
667
|
+
@source inline("provider");
|
|
660
668
|
@source inline("proxy");
|
|
661
669
|
@source inline("proxyForwardCookie");
|
|
662
670
|
@source inline("proxyUrl");
|
|
@@ -736,6 +744,9 @@
|
|
|
736
744
|
@source inline("requestUrl");
|
|
737
745
|
@source inline("requests");
|
|
738
746
|
@source inline("required");
|
|
747
|
+
@source inline("requirement");
|
|
748
|
+
@source inline("requirementId");
|
|
749
|
+
@source inline("requirements");
|
|
739
750
|
@source inline("res");
|
|
740
751
|
@source inline("reset");
|
|
741
752
|
@source inline("resize-none");
|
|
@@ -756,6 +767,7 @@
|
|
|
756
767
|
@source inline("result");
|
|
757
768
|
@source inline("return");
|
|
758
769
|
@source inline("returned");
|
|
770
|
+
@source inline("role");
|
|
759
771
|
@source inline("root");
|
|
760
772
|
@source inline("rotate-90");
|
|
761
773
|
@source inline("rounded-lg");
|
|
@@ -773,6 +785,7 @@
|
|
|
773
785
|
@source inline("schemaExample");
|
|
774
786
|
@source inline("schemaFormat");
|
|
775
787
|
@source inline("schemaHideArray");
|
|
788
|
+
@source inline("schemaId");
|
|
776
789
|
@source inline("schemaItems");
|
|
777
790
|
@source inline("schemaLength");
|
|
778
791
|
@source inline("schemaMatch");
|
|
@@ -785,6 +798,8 @@
|
|
|
785
798
|
@source inline("schemaValueIn");
|
|
786
799
|
@source inline("schemas");
|
|
787
800
|
@source inline("scheme");
|
|
801
|
+
@source inline("schemeId");
|
|
802
|
+
@source inline("schemes");
|
|
788
803
|
@source inline("scope");
|
|
789
804
|
@source inline("scopes");
|
|
790
805
|
@source inline("scroll");
|
|
@@ -824,11 +839,13 @@
|
|
|
824
839
|
@source inline("setNextName");
|
|
825
840
|
@source inline("setOpen");
|
|
826
841
|
@source inline("setPath");
|
|
842
|
+
@source inline("setRequirementId");
|
|
827
843
|
@source inline("setSearch");
|
|
828
844
|
@source inline("setSecurityId");
|
|
829
845
|
@source inline("setServer");
|
|
830
846
|
@source inline("setServerVariables");
|
|
831
847
|
@source inline("setShow");
|
|
848
|
+
@source inline("setStore");
|
|
832
849
|
@source inline("setToken");
|
|
833
850
|
@source inline("setTruncated");
|
|
834
851
|
@source inline("setType");
|
|
@@ -866,6 +883,7 @@
|
|
|
866
883
|
@source inline("sm:justify-end");
|
|
867
884
|
@source inline("sm:text-start");
|
|
868
885
|
@source inline("so");
|
|
886
|
+
@source inline("source");
|
|
869
887
|
@source inline("spec");
|
|
870
888
|
@source inline("specify");
|
|
871
889
|
@source inline("state");
|
|
@@ -881,6 +899,7 @@
|
|
|
881
899
|
@source inline("statuses");
|
|
882
900
|
@source inline("step");
|
|
883
901
|
@source inline("stf");
|
|
902
|
+
@source inline("stfSync");
|
|
884
903
|
@source inline("sticky");
|
|
885
904
|
@source inline("storageKey");
|
|
886
905
|
@source inline("storageKeyPrefix");
|
|
@@ -897,6 +916,7 @@
|
|
|
897
916
|
@source inline("summary");
|
|
898
917
|
@source inline("support");
|
|
899
918
|
@source inline("supported");
|
|
919
|
+
@source inline("svg");
|
|
900
920
|
@source inline("switch");
|
|
901
921
|
@source inline("t");
|
|
902
922
|
@source inline("tab");
|
|
@@ -950,6 +970,7 @@
|
|
|
950
970
|
@source inline("toStaticData");
|
|
951
971
|
@source inline("toc");
|
|
952
972
|
@source inline("token");
|
|
973
|
+
@source inline("tokenInfo");
|
|
953
974
|
@source inline("token_type");
|
|
954
975
|
@source inline("toolbar");
|
|
955
976
|
@source inline("top-0");
|
|
@@ -958,6 +979,7 @@
|
|
|
958
979
|
@source inline("top-2");
|
|
959
980
|
@source inline("tracking-tight");
|
|
960
981
|
@source inline("transform");
|
|
982
|
+
@source inline("transformAuthInputs");
|
|
961
983
|
@source inline("transformPageTree");
|
|
962
984
|
@source inline("transition-colors");
|
|
963
985
|
@source inline("transition-transform");
|
|
@@ -979,11 +1001,14 @@
|
|
|
979
1001
|
@source inline("undefined");
|
|
980
1002
|
@source inline("under");
|
|
981
1003
|
@source inline("underline");
|
|
1004
|
+
@source inline("unexpected");
|
|
982
1005
|
@source inline("union");
|
|
983
1006
|
@source inline("unionField");
|
|
984
1007
|
@source inline("unknown");
|
|
1008
|
+
@source inline("update");
|
|
985
1009
|
@source inline("updateInfo");
|
|
986
1010
|
@source inline("updated");
|
|
1011
|
+
@source inline("updatedSchemeId");
|
|
987
1012
|
@source inline("updating");
|
|
988
1013
|
@source inline("url");
|
|
989
1014
|
@source inline("usage");
|
|
@@ -992,6 +1017,7 @@
|
|
|
992
1017
|
@source inline("use");
|
|
993
1018
|
@source inline("useApiClientModal");
|
|
994
1019
|
@source inline("useApiContext");
|
|
1020
|
+
@source inline("useAuth");
|
|
995
1021
|
@source inline("useCopyButton");
|
|
996
1022
|
@source inline("useFieldValue");
|
|
997
1023
|
@source inline("useForm");
|
|
@@ -999,6 +1025,7 @@
|
|
|
999
1025
|
@source inline("useMemo");
|
|
1000
1026
|
@source inline("useNamespace");
|
|
1001
1027
|
@source inline("useObject");
|
|
1028
|
+
@source inline("useOnChange");
|
|
1002
1029
|
@source inline("useOperationContext");
|
|
1003
1030
|
@source inline("useQuery");
|
|
1004
1031
|
@source inline("useRef");
|
package/dist/_openapi/types.d.ts
CHANGED
package/dist/generate-file.d.ts
CHANGED
|
@@ -78,5 +78,4 @@ interface BeforeWriteContext {
|
|
|
78
78
|
declare function generateFiles(options: Config): Promise<void>;
|
|
79
79
|
declare function generateFilesOnly(options: DistributiveOmit<Config, 'output'>): Promise<OutputFile[]>;
|
|
80
80
|
//#endregion
|
|
81
|
-
export { Config, OutputFile, generateFiles, generateFilesOnly };
|
|
82
|
-
//# sourceMappingURL=generate-file.d.ts.map
|
|
81
|
+
export { Config, OutputFile, generateFiles, generateFilesOnly };
|
package/dist/generate-file.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { doubleQuote } from "./requests/string-utils.js";
|
|
1
2
|
import { generateDocument, toText } from "./utils/pages/to-text.js";
|
|
2
3
|
import { createAutoPreset } from "./utils/pages/preset-auto.js";
|
|
3
4
|
import { fromSchema } from "./utils/pages/builder.js";
|
|
@@ -115,8 +116,8 @@ function writeIndexFiles(context, options) {
|
|
|
115
116
|
}
|
|
116
117
|
for (const entry of outputEntries) {
|
|
117
118
|
if (entry.type === "group") continue;
|
|
118
|
-
const descriptionAttr = entry.info.description ? `description=${
|
|
119
|
-
content.push(`<Card href="${urlFn(entry.path)}" title=${
|
|
119
|
+
const descriptionAttr = entry.info.description ? `description=${doubleQuote(entry.info.description)} ` : "";
|
|
120
|
+
content.push(`<Card href="${urlFn(entry.path)}" title=${doubleQuote(entry.info.title)} ${descriptionAttr}/>`);
|
|
120
121
|
}
|
|
121
122
|
content.push("</Cards>");
|
|
122
123
|
return generateDocument({
|
|
@@ -133,5 +134,3 @@ function writeIndexFiles(context, options) {
|
|
|
133
134
|
}
|
|
134
135
|
//#endregion
|
|
135
136
|
export { generateFiles, generateFilesOnly };
|
|
136
|
-
|
|
137
|
-
//# sourceMappingURL=generate-file.js.map
|
package/dist/i18n.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ declare const defaultTranslations: {
|
|
|
76
76
|
usernameField: string;
|
|
77
77
|
passwordField: string;
|
|
78
78
|
fetchingToken: string;
|
|
79
|
+
fetchTokenError: string;
|
|
79
80
|
serverUrl: string;
|
|
80
81
|
serverUrlDescription: string;
|
|
81
82
|
serverUrlFieldPlaceholder: string;
|
|
@@ -96,5 +97,4 @@ declare const defaultTranslations: {
|
|
|
96
97
|
type Translations = typeof defaultTranslations;
|
|
97
98
|
declare function defineI18nOpenAPI<Languages extends string>(config: I18nUIConfig<Languages>, translations: Partial<Record<NoInfer<Languages>, Partial<Translations>>>): I18nUIConfig<Languages>;
|
|
98
99
|
//#endregion
|
|
99
|
-
export { Translations, defaultTranslations, defineI18nOpenAPI };
|
|
100
|
-
//# sourceMappingURL=i18n.d.ts.map
|
|
100
|
+
export { Translations, defaultTranslations, defineI18nOpenAPI };
|
package/dist/i18n.js
CHANGED
|
@@ -75,6 +75,7 @@ const defaultTranslations = {
|
|
|
75
75
|
usernameField: "Username",
|
|
76
76
|
passwordField: "Password",
|
|
77
77
|
fetchingToken: "Fetching token...",
|
|
78
|
+
fetchTokenError: "Failed to fetch token",
|
|
78
79
|
serverUrl: "Server URL",
|
|
79
80
|
serverUrlDescription: "The base URL of your API endpoint.",
|
|
80
81
|
serverUrlFieldPlaceholder: "Enter Value",
|
|
@@ -109,5 +110,3 @@ function defineI18nOpenAPI(config, translations) {
|
|
|
109
110
|
}
|
|
110
111
|
//#endregion
|
|
111
112
|
export { defaultTranslations, defineI18nOpenAPI };
|
|
112
|
-
|
|
113
|
-
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useApiContext } from "../ui/contexts/api.js";
|
|
3
|
+
import { useQuery } from "../utils/use-query.js";
|
|
4
|
+
import { createContext, use, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/playground/auth.tsx
|
|
7
|
+
const AuthContext = createContext(null);
|
|
8
|
+
function useAuth() {
|
|
9
|
+
const ctx = use(AuthContext);
|
|
10
|
+
if (!ctx) throw new Error("must use this component under <AuthProvider />");
|
|
11
|
+
return ctx;
|
|
12
|
+
}
|
|
13
|
+
function AuthProvider({ children }) {
|
|
14
|
+
const { schemes } = useApiContext();
|
|
15
|
+
const [store, setStore] = useState({});
|
|
16
|
+
const authCodeQuery = useQuery(async (code, state) => {
|
|
17
|
+
const scheme = schemes[state.scheme];
|
|
18
|
+
if (!scheme || scheme.type !== "oauth2") return;
|
|
19
|
+
const value = scheme.flows?.authorizationCode;
|
|
20
|
+
if (!value) return;
|
|
21
|
+
const res = await fetch(value.tokenUrl, {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
24
|
+
body: new URLSearchParams({
|
|
25
|
+
grant_type: "authorization_code",
|
|
26
|
+
code,
|
|
27
|
+
redirect_uri: state.redirect_uri,
|
|
28
|
+
client_id: state.client_id,
|
|
29
|
+
client_secret: state.client_secret
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
if (!res.ok) throw new Error(await res.text());
|
|
33
|
+
const { access_token, token_type = "Bearer" } = await res.json();
|
|
34
|
+
const info = {
|
|
35
|
+
type: "authorization_code",
|
|
36
|
+
...state,
|
|
37
|
+
token: `${token_type} ${access_token}`
|
|
38
|
+
};
|
|
39
|
+
setStore((s) => ({
|
|
40
|
+
...s,
|
|
41
|
+
[state.scheme]: info
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
function onQuery() {
|
|
46
|
+
const query = new URLSearchParams(window.location.search);
|
|
47
|
+
const state = query.get("state");
|
|
48
|
+
const code = query.get("code");
|
|
49
|
+
if (!state || !code) return;
|
|
50
|
+
const parsedState = JSON.parse(state);
|
|
51
|
+
authCodeQuery.start(code, parsedState);
|
|
52
|
+
window.history.replaceState(null, "", window.location.pathname);
|
|
53
|
+
}
|
|
54
|
+
function onHash() {
|
|
55
|
+
const hash = new URLSearchParams(window.location.hash.slice(1));
|
|
56
|
+
const state = hash.get("state");
|
|
57
|
+
const token = hash.get("access_token");
|
|
58
|
+
const type = hash.get("token_type") ?? "Bearer";
|
|
59
|
+
if (!state || !token) return;
|
|
60
|
+
const parsedState = JSON.parse(state);
|
|
61
|
+
const scheme = schemes[parsedState.scheme];
|
|
62
|
+
if (!scheme || scheme.type !== "oauth2" || !scheme.flows?.implicit) return;
|
|
63
|
+
const info = {
|
|
64
|
+
type: "implicit",
|
|
65
|
+
client_id: parsedState.client_id,
|
|
66
|
+
token: `${type} ${token}`
|
|
67
|
+
};
|
|
68
|
+
setStore((s) => ({
|
|
69
|
+
...s,
|
|
70
|
+
[parsedState.scheme]: info
|
|
71
|
+
}));
|
|
72
|
+
window.history.replaceState(null, "", window.location.pathname);
|
|
73
|
+
}
|
|
74
|
+
if (window.location.search.length > 0) onQuery();
|
|
75
|
+
if (window.location.hash.length > 1) onHash();
|
|
76
|
+
}, []);
|
|
77
|
+
return /* @__PURE__ */ jsx(AuthContext, {
|
|
78
|
+
value: useMemo(() => ({
|
|
79
|
+
store,
|
|
80
|
+
updatedSchemeId: Object.keys(store)[0] ?? null,
|
|
81
|
+
isLoading: authCodeQuery.isLoading,
|
|
82
|
+
error: authCodeQuery.error
|
|
83
|
+
}), [
|
|
84
|
+
store,
|
|
85
|
+
authCodeQuery.isLoading,
|
|
86
|
+
authCodeQuery.error
|
|
87
|
+
]),
|
|
88
|
+
children
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { AuthProvider, useAuth };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BrowserFetcherOptions, FetchResult } from "./fetcher.js";
|
|
2
2
|
import { SchemaScope } from "./schema.js";
|
|
3
|
-
import { ProcessedDocument } from "../utils/document/process.js";
|
|
4
3
|
import { Document, HttpMethods, ParameterObject } from "../types.js";
|
|
5
4
|
import { ParsedSchema, SecurityEntry } from "../utils/schema/index.js";
|
|
6
5
|
import { ComponentProps, FC, ReactNode } from "react";
|
|
@@ -20,12 +19,8 @@ interface PlaygroundClientProps extends ComponentProps<'form'>, SchemaScope {
|
|
|
20
19
|
route: string;
|
|
21
20
|
method: HttpMethods;
|
|
22
21
|
securities: SecurityEntry[][];
|
|
23
|
-
/** the OpenAPI document */
|
|
24
|
-
doc:
|
|
25
|
-
bundled: Document;
|
|
26
|
-
} | {
|
|
27
|
-
processed: ProcessedDocument;
|
|
28
|
-
};
|
|
22
|
+
/** the OpenAPI document (not dereferenced) */
|
|
23
|
+
doc: Document;
|
|
29
24
|
proxyUrl?: string;
|
|
30
25
|
}
|
|
31
26
|
interface ResultDisplayProps extends ComponentProps<'div'> {
|
|
@@ -85,8 +80,9 @@ declare const ParamTypes: readonly ["path", "header", "cookie", "query"];
|
|
|
85
80
|
type ParamType = (typeof ParamTypes)[number];
|
|
86
81
|
interface AuthField {
|
|
87
82
|
fieldName: FieldKey;
|
|
83
|
+
schemeId: string;
|
|
84
|
+
storageKey: string;
|
|
88
85
|
defaultValue: unknown;
|
|
89
|
-
original?: SecurityEntry;
|
|
90
86
|
children: ReactNode;
|
|
91
87
|
mapOutput?: (values: unknown) => unknown;
|
|
92
88
|
}
|
|
@@ -109,5 +105,4 @@ declare const Custom: {
|
|
|
109
105
|
};
|
|
110
106
|
};
|
|
111
107
|
//#endregion
|
|
112
|
-
export { AuthField, CollapsiblePanelProps, Custom, DefaultCollapsiblePanel, DefaultResultDisplay, FormValues, PlaygroundClientOptions, PlaygroundClientProps, ResultDisplayProps, PlaygroundClient as default };
|
|
113
|
-
//# sourceMappingURL=client.d.ts.map
|
|
108
|
+
export { AuthField, CollapsiblePanelProps, Custom, DefaultCollapsiblePanel, DefaultResultDisplay, FormValues, PlaygroundClientOptions, PlaygroundClientProps, ResultDisplayProps, PlaygroundClient as default };
|