uigraph 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -51
- package/dist/bin.mjs +1608 -59037
- package/dist/viewer/assets/abnfDiagram-VCTEODGH-D7zWJuPJ.js +1 -0
- package/dist/viewer/assets/actor-avatar-Bu-mKKXB.js +1 -0
- package/dist/viewer/assets/{api-adapters-CnQpLiWI.js → api-adapters-tfr51BsS.js} +1 -1
- package/dist/viewer/assets/{api-endpoints-DCA5GNpC.js → api-endpoints-D-Whnnwd.js} +9 -9
- package/dist/viewer/assets/{api-group-endpoints-page-Di42W69y.js → api-group-endpoints-page-B9R1EI4i.js} +9 -9
- package/dist/viewer/assets/{arc-Cn8owoDw.js → arc-DauzQXFu.js} +1 -1
- package/dist/viewer/assets/architectureDiagram-5GKGNRK7-CXzgHd-c.js +36 -0
- package/dist/viewer/assets/{arrow-left-DWcMgM2U.js → arrow-left-DpQqmf17.js} +1 -1
- package/dist/viewer/assets/avatar-DAFUyk1i.js +43 -0
- package/dist/viewer/assets/badge-hR3QvPWv.js +1 -0
- package/dist/viewer/assets/better-delete-confirmation-modal-CGEQ5O4X.js +1 -0
- package/dist/viewer/assets/better-dialog-DcIxFWwk.js +1 -0
- package/dist/viewer/assets/{blockDiagram-I7D4REHJ-CbYzOsL_.js → blockDiagram-I7D4REHJ-CFHWUw4z.js} +2 -2
- package/dist/viewer/assets/{brands-Bd4RklRx.js → brands-DtmA1AhP.js} +1 -1
- package/dist/viewer/assets/button-DZj74qS7.js +1 -0
- package/dist/viewer/assets/{c4Diagram-7LVT6UL2-CLkVbphC.js → c4Diagram-7LVT6UL2-BHSggPKI.js} +6 -6
- package/dist/viewer/assets/{calendar-C0xdI_ag.js → calendar-Bolgc8E5.js} +1 -1
- package/dist/viewer/assets/channel-CNRSofFP.js +1 -0
- package/dist/viewer/assets/{check-XjanpAFg.js → check-BpmCQNbj.js} +1 -1
- package/dist/viewer/assets/checkbox-CFJfXL6R.js +1 -0
- package/dist/viewer/assets/{chevron-down-R7pQzyLD.js → chevron-down-DDsUE_xz.js} +1 -1
- package/dist/viewer/assets/{chevron-up-CRPypfOs.js → chevron-up-DVznKMGv.js} +1 -1
- package/dist/viewer/assets/{chunk-2Q5K7J3B-CcvtugCu.js → chunk-2Q5K7J3B-CNfz5YDQ.js} +1 -1
- package/dist/viewer/assets/{chunk-5VM5RSS4-CpZHHr12.js → chunk-5VM5RSS4-CwIhjvMe.js} +1 -1
- package/dist/viewer/assets/{chunk-F27PBJKO-DeAl4iOc.js → chunk-F27PBJKO-YFexFJof.js} +1 -1
- package/dist/viewer/assets/{chunk-IMKFNOWR-BfrPe7pS.js → chunk-IMKFNOWR-GY2yrvuo.js} +1 -1
- package/dist/viewer/assets/{chunk-JWPE2WC7-DDjyvUmZ.js → chunk-JWPE2WC7-xd0JGvne.js} +1 -1
- package/dist/viewer/assets/chunk-OB3PAWPO-DJIP1M4r.js +12 -0
- package/dist/viewer/assets/{chunk-POPQ4Y6H-DkDb0mzz.js → chunk-POPQ4Y6H-Bh6rizEy.js} +1 -1
- package/dist/viewer/assets/{chunk-SVP7TREG-D-K2XIGs.js → chunk-SVP7TREG-DtNrjvpq.js} +1 -1
- package/dist/viewer/assets/{chunk-TICWLB2K-DWMQQx6z.js → chunk-TICWLB2K-DrERwtw8.js} +1 -1
- package/dist/viewer/assets/{chunk-XXDRQBXY-DfkljAyM.js → chunk-XXDRQBXY-fYo04iwY.js} +1 -1
- package/dist/viewer/assets/{circle-alert-pm13M-Ef.js → circle-alert-Bl7DXYD_.js} +1 -1
- package/dist/viewer/assets/classDiagram-ZZMXUADV-D7PO-ME9.js +1 -0
- package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-D7PO-ME9.js +1 -0
- package/dist/viewer/assets/color-input-ClkkG_kZ.js +11 -0
- package/dist/viewer/assets/{common-Y7ySZBdh.js → common-DLCsGQ-t.js} +1 -1
- package/dist/viewer/assets/{component-icons-D1BDAuEt.js → component-icons-MJ61E9nt.js} +2 -2
- package/dist/viewer/assets/{copy-CN4K2f_R.js → copy-DMJJonQF.js} +1 -1
- package/dist/viewer/assets/cose-bilkent-JH36ORCC-Dplz8nVT.js +1 -0
- package/dist/viewer/assets/cross-button-D5qst1tj.js +1 -0
- package/dist/viewer/assets/{cynefin-OW5HDTMX-yz-uw9Kz.js → cynefin-OW5HDTMX-DiBs4CI8.js} +1 -1
- package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-COXS8-dI.js +62 -0
- package/dist/viewer/assets/{dagre-GXQ25YYZ-zjZDwXOe.js → dagre-GXQ25YYZ-K8qvfG8D.js} +2 -2
- package/dist/viewer/assets/dashboard-diagrams-page-Cb0xNr4W.js +2 -0
- package/dist/viewer/assets/dashboard-diagrams-page-inner-CD--zr5q.js +1 -0
- package/dist/viewer/assets/dashboard-docs-page-BfWR9Ai9.js +2 -0
- package/dist/viewer/assets/dashboard-docs-page-inner-BLbX-YwF.js +67 -0
- package/dist/viewer/assets/dashboard-layout-sTeeHNsZ.js +1 -0
- package/dist/viewer/assets/dashboard-lens-layout-D-tu_4kn.js +1 -0
- package/dist/viewer/assets/dashboard-map-frame-page-7pDmbTSe.js +1 -0
- package/dist/viewer/assets/dashboard-plans-page-CfwOZ34A.js +1 -0
- package/dist/viewer/assets/dashboard-service-apis-k93fjW51.js +1 -0
- package/dist/viewer/assets/{dashboard-service-diagrams-CIjk95Jk.js → dashboard-service-diagrams-BIWUxX-Y.js} +3 -3
- package/dist/viewer/assets/dashboard-service-docs-CnniTD6Q.js +1 -0
- package/dist/viewer/assets/{dashboard-service-overview-CzePVPjl.js → dashboard-service-overview-CGBu4omY.js} +5 -5
- package/dist/viewer/assets/dashboard-services-DEscIO2O.js +1 -0
- package/dist/viewer/assets/{db-type-badge-DOgu1Pyc.js → db-type-badge-UbPgpwQf.js} +2 -2
- package/dist/viewer/assets/debounce-Cp8eREM4-D7o-Pzb-.js +2 -0
- package/dist/viewer/assets/{dependencies-CYdEztHw.js → dependencies-DK2GDlhQ.js} +1 -1
- package/dist/viewer/assets/{dependency-graph-DbyfN-rC.js → dependency-graph-xBEnCS0J.js} +3 -3
- package/dist/viewer/assets/{diagram-S7CK7UJ4-q-NHkUCx.js → diagram-S7CK7UJ4-D-liadVe.js} +2 -2
- package/dist/viewer/assets/diagram-UQ7AKVKN-CnA8mgXp.js +41 -0
- package/dist/viewer/assets/{diagram-VSXAHHWV-DZc1kHGx.js → diagram-VSXAHHWV-Ck7dgRFR.js} +2 -2
- package/dist/viewer/assets/diagram-VX7I27RA-Cm1LHbu3.js +24 -0
- package/dist/viewer/assets/diagram-Z3DM3KII-DV3yBUCB.js +24 -0
- package/dist/viewer/assets/diagram-live-preview-DzJ7Nxp1.js +2 -0
- package/dist/viewer/assets/{diagram-portal-page-CWxuok9E.js → diagram-portal-page-gguGLULH.js} +24 -24
- package/dist/viewer/assets/{diagrams-C1xkRPqT.js → diagrams-BqBSv2eb.js} +4 -4
- package/dist/viewer/assets/dialog-D7wzTt0L.js +6 -0
- package/dist/viewer/assets/{doc-file-content-B06roi8L.js → doc-file-content-Be0au9Vo.js} +4 -4
- package/dist/viewer/assets/{download-CLdCXVsO.js → download-DhyZ3g4F.js} +1 -1
- package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BXbHVQvG.js +1 -0
- package/dist/viewer/assets/{editor-vqK4qAnB.js → editor-F9o4zoeB.js} +2 -2
- package/dist/viewer/assets/{erDiagram-RLTQ6QDP-BWuA-aqV.js → erDiagram-RLTQ6QDP-DMfiWput.js} +2 -2
- package/dist/viewer/assets/{file-text-BvszilVL.js → file-text-BFqJQ67P.js} +1 -1
- package/dist/viewer/assets/flow-diagram-preview-B83UU1n_.js +1 -0
- package/dist/viewer/assets/{flowDiagram-HODETNUW-Db0QtNj4.js → flowDiagram-HODETNUW-BNFS2Mkr.js} +1 -1
- package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-DFDsYJNp.js +292 -0
- package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-BVHabPDp.js +106 -0
- package/dist/viewer/assets/global-loader-XJO9_e0l.js +1 -0
- package/dist/viewer/assets/{globe-Jl6eIZmG.js → globe-CJ35KsQW.js} +1 -1
- package/dist/viewer/assets/gql-FFIj8zdp.js +1 -0
- package/dist/viewer/assets/{grid-scroll-body-CPqSxU6-.js → grid-scroll-body-DC5pYDPJ.js} +2 -2
- package/dist/viewer/assets/iconBase-DtqdW2XR.js +1 -0
- package/dist/viewer/assets/index-B6MxYIzs.js +1 -0
- package/dist/viewer/assets/index-BC5xdBQU.js +48 -0
- package/dist/viewer/assets/index-BIrx3oY4.js +1 -0
- package/dist/viewer/assets/{index-jm22RWpY.js → index-BZGsDmUx.js} +5 -5
- package/dist/viewer/assets/{index-Poftp9f1.js → index-BZXhpoWr.js} +4 -4
- package/dist/viewer/assets/index-Bn2bqqMd.js +1 -0
- package/dist/viewer/assets/{index-HU5pz3kj.js → index-BpCVYTvP.js} +36 -36
- package/dist/viewer/assets/{index-Bt2YHgxl.js → index-CBOYhBKJ.js} +1 -1
- package/dist/viewer/assets/index-CH7cEAxj.js +17 -0
- package/dist/viewer/assets/index-CIf0GId3.js +74 -0
- package/dist/viewer/assets/{index-D7MEHpJf.js → index-Ck66Ic_p.js} +4 -4
- package/dist/viewer/assets/index-Cp9mIQ8F.js +1 -0
- package/dist/viewer/assets/{index-c6Bxcoqm.js → index-DDmBuMKI.js} +1 -1
- package/dist/viewer/assets/{index-BSyJbFDG.js → index-DY3BFyb6.js} +1 -1
- package/dist/viewer/assets/{index-BS94XVnd.js → index-DkzZ-ZvR.js} +1 -1
- package/dist/viewer/assets/{index-C_43VC19.js → index-PglMbhys.js} +1 -1
- package/dist/viewer/assets/infoDiagram-27XIBGKW-CG-wwxBf.js +2 -0
- package/dist/viewer/assets/input--C59pq6j.js +1 -0
- package/dist/viewer/assets/{ishikawaDiagram-5VMMS53U-C4PzFnZ4.js → ishikawaDiagram-5VMMS53U-BlgV7ceJ.js} +2 -2
- package/dist/viewer/assets/{journeyDiagram-3NMN7TZE-Dpn3bBNo.js → journeyDiagram-3NMN7TZE-Cn03_Xl6.js} +2 -2
- package/dist/viewer/assets/{kanban-definition-UXKFOSKX-CJ99H4G6.js → kanban-definition-UXKFOSKX-CJogvDPY.js} +6 -6
- package/dist/viewer/assets/{layout-Bfvxt_D5.js → layout-B26eC4yQ.js} +1 -1
- package/dist/viewer/assets/{lens-run-page-DZneics-.js → lens-run-page-Ba1ppzJt.js} +3 -3
- package/dist/viewer/assets/lens-runs-page-BnUS57LM.js +1 -0
- package/dist/viewer/assets/{link-2-C75goIOt.js → link-2-D1e0xznG.js} +1 -1
- package/dist/viewer/assets/linked-project-dot-BY1gEES9.js +543 -0
- package/dist/viewer/assets/{loader-circle-C5jZoM7X.js → loader-circle-CiqyoJF7.js} +1 -1
- package/dist/viewer/assets/{merge-Cy7YkrN7.js → merge-BhOMvhW1.js} +1 -1
- package/dist/viewer/assets/mermaid.core-BDgZg3kW.js +312 -0
- package/dist/viewer/assets/method-badge-DErZP7y5.js +1 -0
- package/dist/viewer/assets/{mindmap-definition-YA3MSWOX-yQCKA-K4.js → mindmap-definition-YA3MSWOX-DFkLu0ac.js} +2 -2
- package/dist/viewer/assets/nav-links-DZWMpwMR.js +61 -0
- package/dist/viewer/assets/{network-COWNXGMM.js → network-B1apzT1s.js} +1 -1
- package/dist/viewer/assets/{nosql-editor-modal-DTiWkc_r.js → nosql-editor-modal-CvH0SWAi.js} +5 -5
- package/dist/viewer/assets/not-found-page-C-fn8QeM.js +1 -0
- package/dist/viewer/assets/organization-dependency-graph-page-BryP-iJL.js +1 -0
- package/dist/viewer/assets/pegDiagram-XKGWAZYB-g1cM14-L.js +1 -0
- package/dist/viewer/assets/{pieDiagram-E7YTZNPT-DqnkpCX4.js → pieDiagram-E7YTZNPT-WEnDsMY3.js} +2 -2
- package/dist/viewer/assets/{plus-DQakmTjA.js → plus-DbyuOgKB.js} +1 -1
- package/dist/viewer/assets/popover-476u3TN0.js +1 -0
- package/dist/viewer/assets/preload-helper-BlTxHScW.js +1 -0
- package/dist/viewer/assets/{quadrantDiagram-AXDQQJYC-iQjJfars.js → quadrantDiagram-AXDQQJYC-NdfQCpzF.js} +2 -2
- package/dist/viewer/assets/query-D9oj6LGx.js +50 -0
- package/dist/viewer/assets/{quill-rCHj4fCw.js → quill-Cde5JMRD.js} +1 -1
- package/dist/viewer/assets/railroadDiagram-O6MQD6OU-BYhlXlMY.js +1 -0
- package/dist/viewer/assets/{react-BNzYaZuG.js → react-Bx48XWN4.js} +1 -1
- package/dist/viewer/assets/react-flow-wrapper-BcbvHgxz.js +277 -0
- package/dist/viewer/assets/{requirementDiagram-BXWQKSXE-Bv-Vh1dW.js → requirementDiagram-BXWQKSXE-C25Bcm2L.js} +2 -2
- package/dist/viewer/assets/{sankeyDiagram-P5KCCOFB-C__uD07f.js → sankeyDiagram-P5KCCOFB-h8LiCsgk.js} +2 -2
- package/dist/viewer/assets/scroll-area-RagrStGj.js +6 -0
- package/dist/viewer/assets/{search-DW-qhXLk.js → search-vw7ucoOs.js} +1 -1
- package/dist/viewer/assets/section-loader-C4hOfhQS.js +1 -0
- package/dist/viewer/assets/section-not-found-BnrXiPog.js +1 -0
- package/dist/viewer/assets/select-D9fbrr7O.js +1 -0
- package/dist/viewer/assets/{sequenceDiagram-WJ2MYXX4-1RbvcHwO.js → sequenceDiagram-WJ2MYXX4-CDRVvD30.js} +2 -2
- package/dist/viewer/assets/{service-context-C17u_Fw9.js → service-context-D5nBtU18.js} +1 -1
- package/dist/viewer/assets/{service-database-list-page-cYuDHIls.js → service-database-list-page-DBjaDLVy.js} +2 -2
- package/dist/viewer/assets/service-database-page-CenNCgwf.js +2 -0
- package/dist/viewer/assets/service-database-page-inner-gS51TQTZ.js +85 -0
- package/dist/viewer/assets/{service-doc-Dir8g83J.js → service-doc-C-jHqT1U.js} +4 -4
- package/dist/viewer/assets/{service-doc-preview-modal-bJ6tJ5YR.js → service-doc-preview-modal-5sX6FOu1.js} +2 -2
- package/dist/viewer/assets/service-layout-Bf0vZBCH.js +1 -0
- package/dist/viewer/assets/service-pages-CFikvX4t.js +1 -0
- package/dist/viewer/assets/{services-Crqkffr5.js → services-Ivav34WC.js} +4 -4
- package/dist/viewer/assets/{share-2-BmYmqN4k.js → share-2-CQEaWbfH.js} +1 -1
- package/dist/viewer/assets/sizeCapture-INFHLROL-BJ6ndnPM.js +1 -0
- package/dist/viewer/assets/stateDiagram-D77RDMKH-B_tNCX3o.js +1 -0
- package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-Dl9wqdli.js +1 -0
- package/dist/viewer/assets/{style-DgSU0bQl.js → style-BPesJvJr.js} +8 -8
- package/dist/viewer/assets/super-circle-loader-DSkos6uP.js +1 -0
- package/dist/viewer/assets/super-logo-loader-Cxlbn6MB.js +1 -0
- package/dist/viewer/assets/swimlanes-42K2YHIH-CzURzYwf.js +1 -0
- package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-DrIlwFtk.js +8 -0
- package/dist/viewer/assets/table-B4pFND-o.js +1 -0
- package/dist/viewer/assets/textarea-Clgdv3Oi.js +1 -0
- package/dist/viewer/assets/{timeline-definition-24CTP7MA-C4yuLwUH.js → timeline-definition-24CTP7MA-D0YXQE1U.js} +2 -2
- package/dist/viewer/assets/ui-graph-logo-gHowu5gP.js +1 -0
- package/dist/viewer/assets/{upload-CRsS43j9.js → upload-CYb3nN_5.js} +1 -1
- package/dist/viewer/assets/{uploads-BOQHX9l4.js → uploads-CX2kdXbM.js} +8 -8
- package/dist/viewer/assets/{use-debounced-value-Ba-kkCUY.js → use-debounced-value-BpNFJd3C.js} +1 -1
- package/dist/viewer/assets/{use-localstorage-DIisTx-J.js → use-localstorage-D233xVb0.js} +1 -1
- package/dist/viewer/assets/use-permissions-BvmxJJ5r.js +1 -0
- package/dist/viewer/assets/{use-scoped-storage-C4RzED-E.js → use-scoped-storage-DL1XVp1j.js} +1 -1
- package/dist/viewer/assets/useMutation-D5ZHwHsx.js +1 -0
- package/dist/viewer/assets/useQuery-Dhe6uxrL.js +1 -0
- package/dist/viewer/assets/{vennDiagram-4TSXK5OY-BCtqXZqe.js → vennDiagram-4TSXK5OY-SSjHlqCQ.js} +2 -2
- package/dist/viewer/assets/{wardleyDiagram-VM6X3IG4-D3OtZJoT.js → wardleyDiagram-VM6X3IG4-CZWNdQxH.js} +2 -2
- package/dist/viewer/assets/{xychartDiagram-S5SC5T6Z-DxLL2CHH.js → xychartDiagram-S5SC5T6Z-B2qAGeb0.js} +2 -2
- package/dist/viewer/assets/zod-BMU4UTQt.js +1 -0
- package/dist/viewer/index.html +10 -1
- package/package.json +57 -57
- package/dist/abort-signals-B4fc3ahg.mjs +0 -34
- package/dist/agents.md +0 -28
- package/dist/anthropic-messages-KPxCHqBN.mjs +0 -14327
- package/dist/auth-storage-BvNH97p9.mjs +0 -2180
- package/dist/azure-openai-config-BbeCSg4y.mjs +0 -55
- package/dist/azure-openai-responses-BRzy8RfL.mjs +0 -182
- package/dist/classifier-shared-DBUHiTGw.mjs +0 -105
- package/dist/cli-2R6QQFp1.mjs +0 -451
- package/dist/cloudflare-workers-ai-system-one-BfqwmRQf.mjs +0 -44
- package/dist/config-D8DMGzIq.mjs +0 -647
- package/dist/cross-spawn-B2jIQPlu.mjs +0 -404
- package/dist/diagnostics-xdSgQR8t.mjs +0 -131
- package/dist/dist-BRyghrKX.mjs +0 -404
- package/dist/dist-D0EzrblG.mjs +0 -12161
- package/dist/dist-EKhnHWHG.mjs +0 -140221
- package/dist/dist-pQtuusFv.mjs +0 -1243
- package/dist/easter-egg-3d-C9_btlWn.mjs +0 -1225
- package/dist/env-api-keys-uytNub6O.mjs +0 -122
- package/dist/error-body-FhmCtR7m.mjs +0 -101
- package/dist/esm-D5isprgl.mjs +0 -1533
- package/dist/esm-DnqE4pfM.mjs +0 -104876
- package/dist/execute-BoTKl80U.mjs +0 -1715
- package/dist/github-copilot-headers-DWcTgoXr.mjs +0 -22
- package/dist/google-generative-ai-Brs5YpJo.mjs +0 -332
- package/dist/google-shared-2CyYa4VE.mjs +0 -33438
- package/dist/google-vertex-DZDUQPKa.mjs +0 -378
- package/dist/hash-DN7ukSfd.mjs +0 -16
- package/dist/headers-GhQHLk-3.mjs +0 -17
- package/dist/jiti-9kWALm4Y.mjs +0 -5439
- package/dist/jiti-loader-f21DrY1K.mjs +0 -27
- package/dist/jiti-static-loader-BI_w28l7.mjs +0 -41704
- package/dist/json-parse-B2mHg7o7.mjs +0 -381
- package/dist/keybinding-hints-D0nLU3ZH.mjs +0 -17899
- package/dist/lib-Dj1gKQJc.mjs +0 -24379
- package/dist/llama-cpp-classify-C73BoMYd.mjs +0 -344
- package/dist/mistral-conversations-DXVR7znL.mjs +0 -698
- package/dist/models-DBdii9gQ.mjs +0 -1255
- package/dist/multipart-parser-DLw9Z0uJ.mjs +0 -298
- package/dist/node-B0NU8X55.mjs +0 -2479
- package/dist/node-B8gaKm9g.mjs +0 -23
- package/dist/openai-I3_AqKDX.mjs +0 -17357
- package/dist/openai-codex-responses-PcZHDuBD.mjs +0 -1198
- package/dist/openai-completions-a_mH01ii.mjs +0 -994
- package/dist/openai-decisions-Du8y4mQG.mjs +0 -142
- package/dist/openai-prompt-cache-Bc6qNWt0.mjs +0 -8
- package/dist/openai-responses-a9lV_U7O.mjs +0 -270
- package/dist/openai-responses-shared-CDs_PBiH.mjs +0 -598
- package/dist/openrouter-images-D0Zc8Cjs.mjs +0 -125
- package/dist/photon_rs-DCvMOMu0.mjs +0 -4252
- package/dist/pi-messages-B5ietIBq.mjs +0 -306
- package/dist/plan-prompt.md +0 -56
- package/dist/prompt.md +0 -44
- package/dist/provider-env-BJhgA66g.mjs +0 -37
- package/dist/provider-retry-DXYM7rVE.mjs +0 -79
- package/dist/runtime-DTkBxiaM.mjs +0 -2822
- package/dist/sanitize-unicode-CqChtoM6.mjs +0 -26
- package/dist/shell-836_JFnI.mjs +0 -162
- package/dist/source-CKPndhKl.mjs +0 -478
- package/dist/src-DNm2QRm3.mjs +0 -5028
- package/dist/system-one-shared-DUAFtNa8.mjs +0 -75
- package/dist/token-DEUkymby.mjs +0 -56
- package/dist/token-util-Cx5S4eKt.mjs +0 -3
- package/dist/tool-DHDYqsyG.mjs +0 -6673
- package/dist/transform-messages-BClk99Vn.mjs +0 -477
- package/dist/typesafe-system-one-D2d8j8hZ.mjs +0 -24
- package/dist/typescript-Br-vsRJV.mjs +0 -6737
- package/dist/uuid-CNCZqNBb.mjs +0 -49
- package/dist/v2-1z8ijsD3.mjs +0 -6120
- package/dist/viewer/assets/abnfDiagram-VCTEODGH-j5YaKnl9.js +0 -1
- package/dist/viewer/assets/actor-avatar-DqmoY8Xc.js +0 -1
- package/dist/viewer/assets/architectureDiagram-5GKGNRK7-D80cJKz_.js +0 -36
- package/dist/viewer/assets/avatar-BI7D-Aia.js +0 -43
- package/dist/viewer/assets/badge-870-A4Y6.js +0 -1
- package/dist/viewer/assets/better-delete-confirmation-modal-Dib31LVb.js +0 -1
- package/dist/viewer/assets/better-dialog-D3AAiahr.js +0 -1
- package/dist/viewer/assets/button-DadqadpO.js +0 -1
- package/dist/viewer/assets/channel-DRkt3LIn.js +0 -1
- package/dist/viewer/assets/checkbox-BXpR079x.js +0 -1
- package/dist/viewer/assets/classDiagram-ZZMXUADV-G5CebNaC.js +0 -1
- package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-G5CebNaC.js +0 -1
- package/dist/viewer/assets/color-input-Efm-lxDy.js +0 -11
- package/dist/viewer/assets/cose-bilkent-JH36ORCC-CrSHFmnp.js +0 -1
- package/dist/viewer/assets/cross-button-5Sr5rWVP.js +0 -1
- package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-Bdl_eBdu.js +0 -62
- package/dist/viewer/assets/dashboard-diagrams-page-DMupOe1m.js +0 -2
- package/dist/viewer/assets/dashboard-diagrams-page-inner-Dh0yKh2A.js +0 -1
- package/dist/viewer/assets/dashboard-docs-page-DWJ1qOQz.js +0 -2
- package/dist/viewer/assets/dashboard-docs-page-inner-Fs6G3oGo.js +0 -67
- package/dist/viewer/assets/dashboard-layout-D36InAaB.js +0 -1
- package/dist/viewer/assets/dashboard-lens-layout-Cv1Xx3hY.js +0 -1
- package/dist/viewer/assets/dashboard-map-frame-page-CTn61NUO.js +0 -1
- package/dist/viewer/assets/dashboard-plans-page-DxFJkrgK.js +0 -1
- package/dist/viewer/assets/dashboard-service-apis-BHtD9s5z.js +0 -1
- package/dist/viewer/assets/dashboard-service-docs-Uv_1uxxO.js +0 -1
- package/dist/viewer/assets/dashboard-services-CUP-L4Jg.js +0 -1
- package/dist/viewer/assets/diagram-UQ7AKVKN-DhFcurW6.js +0 -41
- package/dist/viewer/assets/diagram-VX7I27RA-DE1nREE8.js +0 -24
- package/dist/viewer/assets/diagram-Z3DM3KII-CSrYcCbc.js +0 -24
- package/dist/viewer/assets/diagram-live-preview-i5doxXLH.js +0 -2
- package/dist/viewer/assets/dialog-D_HtNS17.js +0 -6
- package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BfL8m_sf.js +0 -1
- package/dist/viewer/assets/flow-diagram-preview-T0Z4iMVU.js +0 -1
- package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-CsITpniw.js +0 -292
- package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-B4eCBGoe.js +0 -106
- package/dist/viewer/assets/iconBase-BoDZfJgC.js +0 -1
- package/dist/viewer/assets/index-5E1tJ7yK.js +0 -125
- package/dist/viewer/assets/index-7XpV2DRw.js +0 -1
- package/dist/viewer/assets/index-C0Rs3s9Z.js +0 -1
- package/dist/viewer/assets/index-CzHjJWeV.js +0 -1
- package/dist/viewer/assets/index-DcEA6SIV.js +0 -74
- package/dist/viewer/assets/infoDiagram-27XIBGKW-lTebN5Ix.js +0 -2
- package/dist/viewer/assets/input-YvHTVS0E.js +0 -1
- package/dist/viewer/assets/lens-runs-page-DoAOObxx.js +0 -1
- package/dist/viewer/assets/linked-project-dot-Ds2uEmJ9.js +0 -543
- package/dist/viewer/assets/mermaid.core-BCRBv8Us.js +0 -312
- package/dist/viewer/assets/method-badge-DMYDKdDZ.js +0 -1
- package/dist/viewer/assets/nav-links-8vT2ixiI.js +0 -61
- package/dist/viewer/assets/not-found-page-CnfLlhS4.js +0 -1
- package/dist/viewer/assets/organization-dependency-graph-page-3xqIxjNx.js +0 -1
- package/dist/viewer/assets/pegDiagram-XKGWAZYB-CMXqeAum.js +0 -1
- package/dist/viewer/assets/popover-CN9ni1N3.js +0 -1
- package/dist/viewer/assets/railroadDiagram-O6MQD6OU-CfqToX3W.js +0 -1
- package/dist/viewer/assets/react-flow-wrapper-BPlRstyO.js +0 -276
- package/dist/viewer/assets/scroll-area-BodE-n7W.js +0 -6
- package/dist/viewer/assets/section-loader-BzpYM_Nx.js +0 -1
- package/dist/viewer/assets/select-DDtnmSET.js +0 -1
- package/dist/viewer/assets/service-database-page-CMi1wF4h.js +0 -2
- package/dist/viewer/assets/service-database-page-inner-CoqAj93L.js +0 -85
- package/dist/viewer/assets/service-layout-0NMm_bKG.js +0 -1
- package/dist/viewer/assets/service-pages-dfnc91SU.js +0 -1
- package/dist/viewer/assets/sizeCapture-INFHLROL-BRJi3gCg.js +0 -1
- package/dist/viewer/assets/stateDiagram-D77RDMKH-DdLsfxgy.js +0 -1
- package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-DFwg8Qki.js +0 -1
- package/dist/viewer/assets/super-circle-loader-D8MElOMh.js +0 -1
- package/dist/viewer/assets/super-logo-loader-DJYiRbCS.js +0 -1
- package/dist/viewer/assets/swimlanes-42K2YHIH-AuYjrPqh.js +0 -1
- package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-0nIGA8_4.js +0 -8
- package/dist/viewer/assets/table-Bi4Auk9Z.js +0 -1
- package/dist/viewer/assets/textarea-MgxZ5x6-.js +0 -1
- package/dist/viewer/assets/ui-graph-logo-D4jRhd4z.js +0 -1
- package/dist/viewer/assets/use-permissions-6JVET753.js +0 -1
- package/dist/viewer/assets/useMutation-CmVaR9zz.js +0 -1
- package/dist/viewer/assets/useQuery-B8yYhO0c.js +0 -1
- package/dist/viewer/assets/zod-Dc4H6VVJ.js +0 -1
- package/dist/virtual-modules-DnCx0Gdx.mjs +0 -340
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-SVP7TREG-DtNrjvpq.js";import{p as f}from"./chunk-JWPE2WC7-xd0JGvne.js";import{_ as n,l as o}from"./mermaid.core-BDgZg3kW.js";import"./transform-BqqRT-Iy.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-DiBs4CI8.js";import"./preload-helper-BlTxHScW.js";import"./index-CH7cEAxj.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},I={parser:R,db:a,renderer:u,styles:p};export{I as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as t}from"./index-CH7cEAxj.js";import{A as R,a as A,b as D}from"./avatar-DAFUyk1i.js";import{a as M,h as y,g as z,i as B,k as G,d as W,f as v,b as k,l as $,o as K,D as V,r as q,C as O}from"./nav-links-DZWMpwMR.js";import{u as J}from"./iconBase-DtqdW2XR.js";import{c as F}from"./chunk-OB3PAWPO-DJIP1M4r.js";import{c as Q}from"./git-BilAlIQ8.js";var X=Object.defineProperty,m=(r,e)=>X(r,"name",{value:e,configurable:!0}),N,H="HoverCard",[L,he]=M(H,[y]),T=y(),[Y,j]=L(H),Z=m(r=>{const{__scopeHoverCard:e,children:n,open:o,defaultOpen:d,onOpenChange:l,openDelay:i=700,closeDelay:u=300}=r,h=T(e),c=s.useRef(0),p=s.useRef(0),x=s.useRef(!1),b=s.useRef(!1),[S,f]=z({prop:o,defaultProp:d??!1,onChange:l,caller:H}),C=s.useCallback(()=>{clearTimeout(p.current),c.current=window.setTimeout(()=>f(!0),i)},[i,f]),P=s.useCallback(()=>{clearTimeout(c.current),!x.current&&!b.current&&(p.current=window.setTimeout(()=>f(!1),u))},[u,f]),a=s.useCallback(()=>f(!1),[f]);return s.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(p.current)},[]),t.jsx(Y,{scope:e,open:S,onOpenChange:f,onOpen:C,onClose:P,onDismiss:a,hasSelectionRef:x,isPointerDownOnContentRef:b,children:t.jsx(B,{...h,children:n})})},"HoverCard"),ee="HoverCardTrigger",te=s.forwardRef(m(function(e,n){const{__scopeHoverCard:o,...d}=e,l=j(ee,o),i=T(o);return t.jsx(G,{asChild:!0,...i,children:t.jsx(W.a,{"data-state":l.open?"open":"closed",...d,ref:n,onPointerEnter:v(e.onPointerEnter,g(l.onOpen)),onPointerLeave:v(e.onPointerLeave,g(l.onClose)),onFocus:v(e.onFocus,l.onOpen),onBlur:v(e.onBlur,l.onClose),onTouchStart:v(e.onTouchStart,u=>u.preventDefault())})})},"HoverCardTrigger")),U="HoverCardPortal",[re,oe]=L(U,{forceMount:void 0}),ne=m(r=>{const{__scopeHoverCard:e,forceMount:n,children:o,container:d}=r,l=j(U,e);return t.jsx(re,{scope:e,forceMount:n,children:t.jsx(k,{present:n||l.open,children:t.jsx($,{asChild:!0,container:d,children:o})})})},"HoverCardPortal"),E="HoverCardContent",ae=s.forwardRef(m(function(e,n){const o=oe(E,e.__scopeHoverCard),{forceMount:d=o.forceMount,...l}=e,i=j(E,e.__scopeHoverCard);return t.jsx(k,{present:d||i.open,children:t.jsx(se,{"data-state":i.open?"open":"closed",...l,onPointerEnter:v(e.onPointerEnter,g(i.onOpen)),onPointerLeave:v(e.onPointerLeave,g(i.onClose)),ref:n})})},"HoverCardContent")),se=s.forwardRef(m(function(e,n){const{__scopeHoverCard:o,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:i,onInteractOutside:u,...h}=e,c=j(E,o),p=T(o),x=s.useRef(null),[b,S]=s.useState(null),f=J(n,x,S);K(b);const[C,P]=s.useState(!1);return s.useEffect(()=>{if(C){const a=document.body;return N=a.style.userSelect||a.style.webkitUserSelect,a.style.userSelect="none",a.style.webkitUserSelect="none",()=>{a.style.userSelect=N,a.style.webkitUserSelect=N}}},[C]),s.useEffect(()=>{if(x.current){const a=m(()=>{P(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})},"handlePointerUp");return document.addEventListener("pointerup",a),()=>{document.removeEventListener("pointerup",a),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),s.useEffect(()=>{x.current&&I(x.current).forEach(w=>w.setAttribute("tabindex","-1"))}),t.jsx(V,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:u,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:v(i,a=>{a.preventDefault()}),onDismiss:c.onDismiss,children:t.jsx(q,{...p,...h,onPointerDown:v(h.onPointerDown,a=>{a.currentTarget.contains(a.target)&&P(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:f,style:{...h.style,userSelect:C?"text":void 0,WebkitUserSelect:C?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})},"HoverCardContentImpl"));function g(r){return e=>e.pointerType==="touch"?void 0:r()}m(g,"excludeTouch");function I(r){const e=[],n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:m(o=>o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}m(I,"getTabbableNodes");function ie({...r}){return t.jsx(Z,{"data-slot":"hover-card",...r})}function ce({...r}){return t.jsx(te,{"data-slot":"hover-card-trigger",...r})}function le({className:r,align:e="center",sideOffset:n=4,...o}){return t.jsx(ne,{"data-slot":"hover-card-portal",children:t.jsx(ae,{"data-slot":"hover-card-content",align:e,sideOffset:n,className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",r),...o})})}function _(r){const e=(r??"").trim().split(/\s+/).filter(Boolean);return e.length===0?"":e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function xe({actor:r,className:e,title:n,commitHash:o,repoUrl:d}){if(!r)return null;const i=r.type==="service_account"&&!!o,u=t.jsxs(R,{onClick:i?p=>p.stopPropagation():void 0,title:n===!1||i?void 0:r.name??void 0,className:F("size-7 bg-[#1E2533] ring-1 ring-[#2A3242]",i?"cursor-pointer":"pointer-events-none",e),children:[t.jsx(A,{src:r.avatarUrl??void 0,alt:r.name??"",className:"object-cover"}),t.jsx(D,{className:"bg-[#1E2533] text-[9px] font-medium text-[#828DA3]",children:_(r.name)})]});if(!i)return u;const h=Q(d,o),c=o.slice(0,7);return t.jsxs(ie,{openDelay:100,closeDelay:100,children:[t.jsx(ce,{asChild:!0,children:u}),t.jsxs(le,{align:"end",className:"w-64 border-[#2A3242] bg-[#141925] p-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(R,{className:"pointer-events-none size-8 bg-[#1E2533] ring-1 ring-[#2A3242]",children:[t.jsx(A,{src:r.avatarUrl??void 0,alt:r.name??"",className:"object-cover"}),t.jsx(D,{className:"bg-[#1E2533] text-[10px] font-medium text-[#828DA3]",children:_(r.name)})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate text-sm font-semibold text-[#F4F7FC]",children:r.name}),t.jsx("div",{className:"text-[11px] text-[#586378]",children:"Service account"})]})]}),t.jsx("div",{className:"mt-3 border-t border-[#2A3242] pt-2",children:h?t.jsxs("a",{href:h,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),className:"flex items-center gap-1.5 text-[#828DA3] transition-colors hover:text-[#3B6BFF]",children:[t.jsx(O,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"font-mono text-xs",children:c})]}):t.jsxs("div",{className:"flex items-center gap-1.5 text-[#828DA3]",children:[t.jsx(O,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"font-mono text-xs",children:c})]})})]})]})}export{xe as A};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as a}from"./index-
|
|
1
|
+
import{C as a}from"./index-BpCVYTvP.js";function g(e){return p(e)}function p(e,r=0){if(!e?.trim()||e.trim()==="null"||r>5)return null;try{const t=JSON.parse(e);return typeof t=="string"?p(t,r+1)??t:t}catch{return null}}function S(e){const r=e.trim();if(!r)return null;const t=p(r);return t!==null?t:r}function q(e){if(e==null)return;const t=(Array.isArray(e)?e:[e]).map(S).filter(s=>s!=null);if(t.length!==0)return JSON.stringify(t)}function A(e){const r=p(e);return r===null?e.trim():JSON.stringify(r)}function h(e){return/^\d{3}$/.test(e)||e==="default"}function f(e){if(!e.trim())return e;const r=p(e);return r===null?e.replace(/\\n/g,`
|
|
2
2
|
`).replace(/\\t/g," "):JSON.stringify(r,null,2).replace(/\\n/g,`
|
|
3
3
|
`).replace(/\\t/g," ")}function l(e,r=0){if(!e||r>6)return null;if(e.example!==void 0)return e.example;if(e.enum)return e.enum[0]??null;for(const o of["allOf","anyOf","oneOf"]){const i=e[o];if(Array.isArray(i)&&i.length>0){if(o==="allOf"){const u={};for(const c of i)Object.assign(u,c);return l(u,r+1)}return l(i[0],r+1)}}const t=e.type;if(t==="object"||e.properties){const o=e.properties??{},i={};for(const[u,c]of Object.entries(o))i[u]=l(c,r+1);return i}if(t==="array"||e.items){const o=e.items??{};return[l(o,r+1)]}const s=e.format;switch(t){case"string":return s==="email"?"user@example.com":s==="date-time"?"2024-01-01T00:00:00Z":s==="date"?"2024-01-01":s==="password"?"********":s==="uuid"?"00000000-0000-0000-0000-000000000000":s==="uri"?"https://example.com":"string";case"integer":return 0;case"number":return 0;case"boolean":return!0;default:return null}}function C(e){const r=g(e);if(!r||typeof r!="object"||Array.isArray(r))return null;const t=Object.entries(r);if(!t.length||!t.every(([o])=>h(o)))return null;const s={};for(const[o,i]of t){if(!i||typeof i!="object"||Array.isArray(i))continue;const u=i;let c=u.example;c==null&&u.schema&&typeof u.schema=="object"&&(c=l(u.schema)),c!=null&&(s[o]=c)}return Object.keys(s).length===0?null:Object.keys(s).length===1?JSON.stringify(Object.values(s)[0],null,2):JSON.stringify(s,null,2)}function m(e,r,t){if(!e.trim()||e.trim()==="null")return e;if(r.toLowerCase()!=="rest")return f(e);const s=g(e);if(!s||typeof s!="object"||Array.isArray(s))return f(e);if(t==="request"){const o=l(s);if(o!==null)return JSON.stringify(o,null,2)}if(t==="response"){const o=C(e);if(o)return o}return f(e)}function E(e,r,t){const s=e.toLowerCase().trim();if(t.toLowerCase()==="rest"){if(s==="request schema")return m(r,t,"request");if(s==="response schema")return m(r,t,"response")}return f(r)}function d(e,r){const t=y(e);return t&&t.length>0?t:y(r)}function y(e){if(!e||e==="[]")return null;const r=p(e);return r===null?[e]:Array.isArray(r)?r.length===0?null:r.map(t=>typeof t=="string"?A(t):JSON.stringify(t)):typeof r=="object"?[JSON.stringify(r)]:[e]}function n(e,r,t,s=a.TextInput){const o=`api-${e.toLowerCase().replace(/\s+/g,"-")}`,i=r??"";return{componentFieldId:o,label:e,type:s,order:t,data:i?[{value:i}]:[]}}function T(e){const r=(e.protocol??"REST").toLowerCase(),t=e.specKey??void 0;return{serviceApiGroupId:e.id,serviceId:e.serviceId,name:e.name,version:e.version,protocol:e.protocol,openApiSpecFileId:r==="rest"?t:void 0,swaggerSpecFileId:void 0,graphqlSpecFileIds:r==="graphql"&&t?[t]:void 0,grpcSpecFileIds:r==="grpc"&&t?[t]:void 0,createdBy:e.createdBy,createdAt:e.createdAt,updatedAt:e.updatedAt}}function F(e){return{versionId:e.id,apiGroupId:e.apiGroupId,versionNumber:e.versionNumber,label:e.label,createdBy:e.createdBy,createdAt:e.createdAt,isAutoVersion:e.isAutoVersion}}function I(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function O(e){return[n("Name",e.operationId,0),n("GraphQL Operation Type",e.method,1),n("Signature",e.path,2),n("Description",e.description,3),n("Parameters",e.parameters,4,a.CodeEditor),n("Request Schema",e.requestBody,5,a.CodeEditor),n("Response Schema",e.responses,6,a.CodeEditor)]}function R(e){const r=I(e.parameters);return[n("gRPC Method Name",e.operationId,0),n("gRPC Service Name",r.serviceName,1),n("Package Name",r.packageName,2),n("gRPC RPC Type",e.method,3),n("Request Type",r.requestType,4),n("Response Type",r.responseType,5),n("Proto Snippet",e.summary,6,a.CodeEditor),n("Description",e.description,7),n("Request Schema",e.requestBody,8,a.CodeEditor),n("Response Schema",e.responses,9,a.CodeEditor)]}function b(e){return[n("Method",e.method,0),n("URL",e.path,1),n("Summary",e.summary,2),n("Description",e.description,3),n("Request Schema",e.requestBody,4,a.CodeEditor),n("Response Schema",e.responses,5,a.CodeEditor),n("Parameters",e.parameters,6,a.CodeEditor)]}function x(e,r,t="rest"){const s=t.toLowerCase(),o=s==="graphql"?O(e):s==="grpc"?R(e):b(e);return{apiEndpoint:{apiEndpointId:e.id,serviceApiGroupId:e.apiGroupId,componentMetaId:e.id,exampleRequests:d(e.exampleRequests,e.requestBody),exampleResponses:d(e.exampleResponses,e.responses),order:e.order,createdAt:e.createdAt,updatedAt:e.updatedAt,sla:e.sla},componentMeta:{componentMetaId:e.id,organizationId:r,componentModalFields:o}}}function J(e,r,t="rest"){return e.map(s=>x(s,r,t))}export{T as a,F as b,x as c,m as d,J as e,E as f,q as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as e}from"./
|
|
1
|
+
import"./query-D9oj6LGx.js";import{g as e}from"./gql-FFIj8zdp.js";const I=e(`
|
|
2
2
|
query APIGroups($orgId: ID!, $serviceId: ID!) {
|
|
3
3
|
apiGroups(orgId: $orgId, serviceId: $serviceId) {
|
|
4
4
|
id
|
|
@@ -16,7 +16,7 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
16
16
|
updatedAt
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
`),
|
|
19
|
+
`),o=e(`
|
|
20
20
|
query APIGroup($orgId: ID!, $serviceId: ID!, $id: ID!) {
|
|
21
21
|
apiGroup(orgId: $orgId, serviceId: $serviceId, id: $id) {
|
|
22
22
|
id
|
|
@@ -34,7 +34,7 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
34
34
|
updatedAt
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
`),
|
|
37
|
+
`),i=e(`
|
|
38
38
|
query APIEndpoints(
|
|
39
39
|
$orgId: ID!
|
|
40
40
|
$serviceId: ID!
|
|
@@ -77,7 +77,7 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
77
77
|
updatedAt
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
`),
|
|
80
|
+
`),p=e(`
|
|
81
81
|
mutation SyncAPIGroup(
|
|
82
82
|
$orgId: ID!
|
|
83
83
|
$serviceId: ID!
|
|
@@ -88,7 +88,7 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
88
88
|
versionCreated
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
`),
|
|
91
|
+
`),s=e(`
|
|
92
92
|
mutation RestoreAPIGroupVersion(
|
|
93
93
|
$orgId: ID!
|
|
94
94
|
$serviceId: ID!
|
|
@@ -105,7 +105,7 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
105
105
|
version
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
`),
|
|
108
|
+
`),t=e(`
|
|
109
109
|
mutation CreateAPIEndpoint(
|
|
110
110
|
$orgId: ID!
|
|
111
111
|
$serviceId: ID!
|
|
@@ -129,7 +129,7 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
`),
|
|
132
|
+
`),a=e(`
|
|
133
133
|
mutation UpdateAPIEndpoint(
|
|
134
134
|
$orgId: ID!
|
|
135
135
|
$serviceId: ID!
|
|
@@ -155,7 +155,7 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
`),
|
|
158
|
+
`),n=e(`
|
|
159
159
|
mutation DeleteAPIEndpoint(
|
|
160
160
|
$orgId: ID!
|
|
161
161
|
$serviceId: ID!
|
|
@@ -169,4 +169,4 @@ import{g as e}from"./index-5E1tJ7yK.js";const I=e(`
|
|
|
169
169
|
id: $id
|
|
170
170
|
)
|
|
171
171
|
}
|
|
172
|
-
`);export{I as A,
|
|
172
|
+
`);export{I as A,t as C,n as D,s as R,p as S,a as U,i as a,o as b};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{r as f,
|
|
1
|
+
import{r as f,j as t}from"./index-CH7cEAxj.js";import{S as ot}from"./section-loader-C4hOfhQS.js";import{B as oe}from"./button-DZj74qS7.js";import{u as Ge,B as at}from"./query-D9oj6LGx.js";import{c as it}from"./nav-links-DZWMpwMR.js";import{DashboardSectionHeader as lt,DashboardSectionContent as ct}from"./index-Bn2bqqMd.js";import{S as At}from"./section-not-found-BnrXiPog.js";import{a as Je,b as Ct,e as Et,s as Ot}from"./api-adapters-tfr51BsS.js";import{a as se}from"./index-Dj_05fqk.js";import{c as Mt}from"./react-Bx48XWN4.js";import{u as Lt,a as Dt,d as We,b as Ft,c as Rt,g as we,e as Oe,f as he,i as kt,h as Pt,j as Tt,k as qt,w as He,l as Gt}from"./debounce-Cp8eREM4-D7o-Pzb-.js";import{a as Ye,C as $t,U as Vt,D as Bt,S as _t,R as Ut}from"./api-endpoints-D-Whnnwd.js";import{g as dt}from"./gql-FFIj8zdp.js";import{u as pt,c as z,a as Qt}from"./chunk-OB3PAWPO-DJIP1M4r.js";import{A as ut}from"./arrow-left-DpQqmf17.js";import{u as Ze}from"./useQuery-Dhe6uxrL.js";import{u as ye}from"./useMutation-D5ZHwHsx.js";import{u as zt}from"./service-context-D5nBtU18.js";import{_ as Kt}from"./preload-helper-BlTxHScW.js";import{t as be}from"./index-B6MxYIzs.js";import{D as Jt}from"./download-DhyZ3g4F.js";import{M as Wt}from"./method-badge-DErZP7y5.js";import{C as $e}from"./cross-button-D5qst1tj.js";import{S as Ht}from"./super-circle-loader-DSkos6uP.js";import{B as fe}from"./badge-hR3QvPWv.js";import{C as Yt,D as Zt,a as Xt,b as es,c as Se}from"./scroll-area-RagrStGj.js";import{I as Me}from"./input--C59pq6j.js";import{S as Ve,a as Be,b as _e,c as Ue,d as ge}from"./select-D9fbrr7O.js";import{u as Ie,E as ts}from"./use-scoped-storage-DL1XVp1j.js";import{f as pe}from"./index-BpCVYTvP.js";import{C as Ae}from"./copy-DMJJonQF.js";import{C as mt}from"./chevron-down-DDsUE_xz.js";import{S as Le}from"./search-vw7ucoOs.js";import"./super-logo-loader-Cxlbn6MB.js";import"./iconBase-DtqdW2XR.js";import"./dashboard-layout-sTeeHNsZ.js";import"./grid-scroll-body-DC5pYDPJ.js";import"./popover-476u3TN0.js";import"./services-Ivav34WC.js";import"./ui-graph-logo-gHowu5gP.js";import"./check-BpmCQNbj.js";import"./chevron-up-DVznKMGv.js";import"./use-localstorage-D233xVb0.js";import"./index-CIf0GId3.js";import"./mermaid.core-BDgZg3kW.js";import"./transform-BqqRT-Iy.js";import"./last-DXTTfs9a.js";import"./index-BIrx3oY4.js";import"./value-wA6veExk.js";/**
|
|
2
2
|
* @license lucide-react v0.514.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ss=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],ns=
|
|
6
|
+
*/const ss=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],ns=it("lock-open",ss);/**
|
|
7
7
|
* @license lucide-react v0.514.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const rs=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],os=
|
|
11
|
+
*/const rs=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],os=it("lock",rs);function ve(e,s){return Object.hasOwn(e,s)?e[s]:void 0}function as(e,s){return ve(e,s)??s}function ft(e,s,n){try{return e(s)}catch(r){return n?He(25,s,r,n):He(24,s,r),null}}function ae(e){function s(n){if(typeof n>"u")return null;const r=Array.isArray(n);return r&&n[0]===void 0?null:(n=r?n[0]:typeof n=="string"?n:"",ft(e.parse,n))}return{type:"single",eq:(n,r)=>n===r,...e,parseServerSide:s,withDefault(n){return{...this,defaultValue:n,parseServerSide(r){return s(r)??n}}},withOptions(n){return{...this,...n}}}}const xt=ae({parse:e=>e,serialize:String});ae({parse:e=>{const s=parseInt(e);return s==s?s:null},serialize:e=>""+Math.round(e)});ae({parse:e=>{const s=parseInt(e);return s==s?s-1:null},serialize:e=>""+Math.round(e+1)});ae({parse:e=>{const s=parseInt(e,16);return s==s?s:null},serialize:e=>{const s=Math.round(e).toString(16);return s<"0"||!(s.length&1)?s:"0"+s}});ae({parse:e=>{const s=parseFloat(e);return s==s?s:null},serialize:String});ae({parse:e=>e.toLowerCase()==="true",serialize:String});function Qe(e,s){return e.valueOf()===s.valueOf()}ae({parse:e=>{const s=new Date(parseInt(e));return+s==+s?s:null},serialize:e=>""+e.valueOf(),eq:Qe});ae({parse:e=>{const s=new Date(e);return+s==+s&&ht.parse(e)?s:null},serialize:e=>e.toISOString(),eq:Qe});const ht=ae({parse:e=>{const s=new Date(e.slice(0,10));return+s==+s&&ht.serialize(s)===e.slice(0,10)?s:null},serialize:e=>e.toISOString().slice(0,10),eq:Qe}),De=qt("sync-emitter",()=>Gt()),is={},Xe=(e,s)=>e==="defaultValue"?void 0:s;function ls(e,s={}){const n=f.useId(),r=Lt(),o=Dt(),{history:a=r?.history??"replace",scroll:i=r?.scroll??!1,shallow:u=r?.shallow??!0,throttleMs:l=We.timeMs,limitUrlUpdates:p=r?.limitUrlUpdates,clearOnDefault:c=r?.clearOnDefault??!0,startTransition:d,urlKeys:x=is}=s,g=Object.keys(e).join(","),b=f.useRef(e),y=b.current,N=JSON.stringify(Object.entries(y),Xe)===JSON.stringify(Object.entries(e),Xe)&&Object.entries(e).every(([S,I])=>{if(y[S]?.startTransition!==I.startTransition)return!1;const G=y[S]?.defaultValue,Y=I.defaultValue;return Object.is(G,Y)?!0:G!==void 0&&Y!==void 0&&I.eq?.(G,Y)===!0})?y:e;b.current=N;const E=f.useMemo(()=>Object.fromEntries(Object.keys(e).map(S=>[S,as(x,S)])),[g,JSON.stringify(x)]),v=Object.values(E),A=Ft(v),M=A.searchParams,w=f.useRef(null),q=f.useRef(null),F=Rt(v),[Q]=f.useState(()=>{const S={},[,I]=et(e,E,M,F,S);return[I,S]}),O=f.useRef(Q[1]),[K,J]=f.useState(Q[0]),V=f.useRef(K),R=f.useRef(K),D=S=>JSON.stringify([v.map(I=>[I,S.getAll(I)]),F]),ie=D(M),le=()=>{const[S,I]=et(e,E,M,F,O.current,V.current);return S&&(he(1,n,g,I),V.current=I,R.current=I,J(I)),S},xe=Object.keys(O.current).join("&")!==v.join("&"),C=q.current===null||q.current===(A.pathname??location.pathname);if(xe)w.current=ie,le(),O.current=Object.fromEntries(Object.entries(E).map(([S,I])=>[I,e[S]?.type==="multi"?M.getAll(I):M.get(I)]));else{let S=!1;C&&w.current!==ie&&(w.current=ie,S=le()),!S&&K!==V.current&&V.current===R.current&&(C||A.pathname===void 0&&w.current===D(new URLSearchParams(location.search)))&&J(V.current)}f.useEffect(()=>{q.current=A.pathname??location.pathname,we.acknowledge(M,A.getSearchParamsSnapshot).forEach(S=>Oe.queuedQuerySync.emit(S)),le()},[ie,A.pathname]),f.useEffect(()=>{const S=[];for(const[I,G]of Object.entries(E)){const Y=({state:ee,query:te})=>{const B=V.current,W=B===R.current;O.current[G]=te;const Z=Object.is(B[I]??null,ee)?B:{...B,[I]:ee};V.current=Z,J(k=>{if(Object.is(k[I]??null,ee)&&(k===B||!W))return he(2,n,g,G,ee,e[I]?.defaultValue,k),k;const m=k===B?Z:{...k,...W&&B,[I]:ee};return he(3,n,g,G,ee,e[I]?.defaultValue,m),m})};he(4,n,G,g),De.on(G,Y),S.push([G,Y])}return()=>{for(const[I,G]of S)he(5,n,I,g),De.off(I,G)}},[g,E]);const L=f.useCallback((S,I={})=>{const G=(typeof S=="function"?S(tt(V.current,N)):S)??Object.fromEntries(Object.keys(N).map(W=>[W,null]));he(6,n,g,G);let Y,ee=0;const te=[];for(let[W,Z]of Object.entries(G)){const k=ve(N,W),m=E[W];if(!k||m===void 0||Z===void 0)continue;(I.clearOnDefault??k.clearOnDefault??c)&&Z!==null&&k.defaultValue!==void 0&&(k.eq??kt)(Z,k.defaultValue)&&(Z=null);const h=Z===null?null:(k.serialize??String)(Z);De.emit(m,{state:Z,query:h});const j={key:m,query:h,options:{history:I.history??k.history??a,shallow:I.shallow??k.shallow??u,scroll:I.scroll??k.scroll??i,startTransition:I.startTransition??k.startTransition??d}},P=I.limitUrlUpdates??k.limitUrlUpdates??p;if(P?.method==="debounce"){const T=P.timeMs??We.timeMs,_=Oe.push(j,T,A,o);ee<T&&(Y=_,ee=T)}else{const T=P?.timeMs??I.throttleMs??k.throttleMs??l;te.push(Oe.abort(m)),we.push(j,T)}}let B=te.length?we.flush(A,o):we.getPendingPromise(A);for(const W of te)B=W(B);return Y??B},[g,a,u,i,l,p?.method,p?.timeMs,d,c,N,E,A.updateUrl,A.getSearchParamsSnapshot,A.rateLimitFactor,o]);return[f.useMemo(()=>tt(K,N),[K,N]),L]}function et(e,s,n,r,o={},a={}){let i=!1;const u=Object.entries(e).reduce((l,[p,c])=>{const d=s[p],x=ve(r,d),g=c.type==="multi"?[]:null,b=x===void 0?c.type==="multi"?n.getAll(d):n.get(d):x,y=ve(a,p);return y!==void 0&&Pt(ve(o,d)??g,b)?(l[p]=y,l):(i=!0,l[p]=(Tt(b)?null:ft(c.parse,b,d))??null,o[d]=b,l)},{});return i||=Object.keys(u).length!==Object.keys(a).length,[i,u]}function tt(e,s){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??s[n]?.defaultValue??null]))}function gt(e,s={}){const{parse:n=d=>d,type:r,serialize:o,eq:a,defaultValue:i,...u}=s,l={parse:n,type:r,serialize:o,eq:a,defaultValue:i},[{[e]:p},c]=ls({[e]:l},u);return[p,f.useCallback((d,x={})=>c(g=>({[e]:typeof d=="function"?d(g[e]):d}),x),[e,c])]}const Fe=dt(`
|
|
12
12
|
query APIGroupAndVersions($orgId: ID!, $serviceId: ID!, $apiGroupId: ID!) {
|
|
13
13
|
apiGroups(orgId: $orgId, serviceId: $serviceId) {
|
|
14
14
|
id
|
|
@@ -41,7 +41,7 @@ import{r as f,a0 as At,a1 as Ct,a2 as Ke,a3 as Et,a4 as Ot,a5 as he,a6 as Mt,a7
|
|
|
41
41
|
createdAt
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`);function cs(e){const s=new Map(e.map(n=>[(n.label??"").toLowerCase(),n.data??""]));return{method:s.get("method")||void 0,path:s.get("url")||s.get("path")||void 0,summary:s.get("summary")||void 0,description:s.get("description")||void 0,requestBody:s.get("request schema")||void 0,responses:s.get("response schema")||void 0,parameters:s.get("parameters")||void 0}}const[ds,bt]=
|
|
44
|
+
`);function cs(e){const s=new Map(e.map(n=>[(n.label??"").toLowerCase(),n.data??""]));return{method:s.get("method")||void 0,path:s.get("url")||s.get("path")||void 0,summary:s.get("summary")||void 0,description:s.get("description")||void 0,requestBody:s.get("request schema")||void 0,responses:s.get("response schema")||void 0,parameters:s.get("parameters")||void 0}}const[ds,bt]=Mt(({serviceId:e,serviceApiGroupId:s})=>{const n=Ge().id,r=s,{selectedVersionId:o,setSelectedVersionId:a}=ps(),i={orgId:n,serviceId:e,apiGroupId:r},u=Ze(Fe,{fetchPolicy:"cache-first",skip:!n,variables:i}),l=f.useMemo(()=>u.data?.apiGroups?.find(C=>C.id===r),[u.data?.apiGroups,r]),p=f.useMemo(()=>{if(l)return Je(l)},[l]),c=f.useMemo(()=>se(u.data?.apiGroups).map(Je),[u.data?.apiGroups]),d=f.useMemo(()=>se(u.data?.apiGroupVersions).map(Ct),[u.data?.apiGroupVersions]),x=f.useMemo(()=>o?d.find(C=>C.versionId===o)??null:null,[d,o]),g={...i,versionId:o??null},b=Ze(Ye,{fetchPolicy:"cache-first",skip:!n,variables:g}),y=f.useCallback(()=>b.refetch(),[b]),N=f.useCallback(()=>u.refetch(),[u]),E={query:Ye,variables:{...i,versionId:null}},[v]=ye($t,{awaitRefetchQueries:!0,refetchQueries:[E]}),[A]=ye(Vt,{awaitRefetchQueries:!0,refetchQueries:[E]}),[M]=ye(Bt,{awaitRefetchQueries:!0,refetchQueries:[E]}),[w]=ye(_t,{awaitRefetchQueries:!0,refetchQueries:[E,{query:Fe,variables:i}]}),[q]=ye(Ut,{awaitRefetchQueries:!0,refetchQueries:[E,{query:Fe,variables:i}]}),F=f.useCallback(C=>{const{input:L}=C.variables;return v({variables:{orgId:n,serviceId:e,apiGroupId:r,input:{method:L.method??"GET",path:L.path??"/",summary:L.summary,description:L.description,order:L.order}}})},[v,n,e,r]),Q=f.useCallback(C=>{const{apiEndpointId:L,input:S}=C.variables;function I(G){return Ot(G)}return A({variables:{orgId:n,serviceId:e,apiGroupId:r,id:L,input:{exampleRequests:I(S.exampleRequests),exampleResponses:I(S.exampleResponses),order:S.order??void 0,sla:S.sla??void 0}}})},[A,n,e,r]),O=f.useCallback(C=>M({variables:{orgId:n,serviceId:e,apiGroupId:r,id:C.variables.apiEndpointId}}),[M,n,e,r]),K=f.useCallback(C=>{const L=C.variables.input.componentModalFields??[];return A({variables:{orgId:n,serviceId:e,apiGroupId:r,id:C.variables.componentMetaId,input:cs(L)}})},[A,n,e,r]),J=f.useCallback(async C=>{const{input:L}=C.variables;if(!L.specAssetId)throw new Error("Spec file is required to publish a version");return w({variables:{orgId:n,serviceId:e,input:{apiGroupId:r,name:p?.name??L.label??"API Group",version:L.label||void 0,protocol:p?.protocol??L.protocol??"REST",specAssetId:L.specAssetId}}})},[w,n,e,r,p]),V=f.useCallback(async C=>{const L=d.find(S=>S.versionNumber===C.variables.versionNumber);if(!L)throw new Error("Version not found");return q({variables:{orgId:n,serviceId:e,apiGroupId:r,versionId:L.versionId}})},[q,n,e,r,d]),R=f.useMemo(()=>p?.protocol?p.protocol.toLowerCase():p?.graphqlSpecFileIds&&p.graphqlSpecFileIds.length>0?"graphql":p?.grpcSpecFileIds&&p.grpcSpecFileIds.length>0?"grpc":(p?.openApiSpecFileId||p?.swaggerSpecFileId,"rest"),[p]),D=f.useMemo(()=>{const C=se(b.data?.apiEndpoints).slice();return C.sort((L,S)=>(L.order??0)-(S.order??0)),Et(C,n,R)},[b.data?.apiEndpoints,n,R]),ie=f.useMemo(()=>R==="rest"?D:[],[D,R]),le=f.useMemo(()=>R==="graphql"?D.filter(C=>C.apiEndpoint&&C.componentMeta):[],[D,R]),xe=f.useMemo(()=>R==="grpc"?D.filter(C=>C.apiEndpoint&&C.componentMeta):[],[D,R]);return{orgId:n,serviceId:e,serviceApiGroupId:r,apiGroup:p,apiGroups:c,apiGroupVersions:d,isLoading:u.loading&&(!u.data?.apiGroups||!u.data?.apiGroupVersions),apiEndpoints:ie,isApiEndpointsLoading:b.loading&&!b.data?.apiEndpoints,protocol:R,grpcMethods:xe,graphQLOperations:le,isGrpcLoading:b.loading&&R==="grpc",isGraphQLLoading:b.loading&&R==="graphql",createServiceApiEndpoint:F,updateServiceApiEndpoint:Q,deleteServiceApiEndpoint:O,updateServiceApiEndpointMeta:K,createServiceApiGroupVersion:J,restoreServiceApiGroupVersion:V,refetchEndpoints:y,refetchGroups:N,selectedVersionId:o,setSelectedVersionId:a,selectedReleaseId:o,setSelectedReleaseId:a,selectedRelease:x}},{useChildrenProvider(e,s){const n=pt(),r=s.isLoading,o=!r&&!s.apiGroup;return r||o?t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsx(lt,{title:"API Group",description:"Manage API endpoints, business logic, request/response samples, and test cases.",children:t.jsxs(oe,{preset:"outline",onClick:()=>n(`/services/${s.serviceId}/apis`),children:[t.jsx(ut,{className:"h-4 w-4"}),"Back to APIs"]})}),t.jsxs(ct,{noPadding:!0,children:[r&&t.jsx(ot,{label:"Loading API version..."}),o&&t.jsx(At,{plain:!0,label:"API version not found"})]})]}):e}});function ps(){const[e,s]=gt("releaseId",xt);return{selectedVersionId:!e||e==="working-copy"?null:e,setSelectedVersionId:n=>{s(n)}}}const yt=dt(`
|
|
45
45
|
query ApiGroupSpec(
|
|
46
46
|
$orgId: ID!
|
|
47
47
|
$serviceId: ID!
|
|
@@ -59,7 +59,7 @@ import{r as f,a0 as At,a1 as Ct,a2 as Ke,a3 as Et,a4 as Ot,a5 as he,a6 as Mt,a7
|
|
|
59
59
|
content
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
`);async function us(e,s,n,r){const{data:o}=await it.query({query:yt,variables:{orgId:e,serviceId:s,apiGroupId:n,versionId:r},fetchPolicy:"network-only"}),a=o?.apiGroupSpec;if(!a)throw new Error("Could not load spec content");return{content:a.content,fileName:a.fileName??null}}function ms(e,s,n){const r=new Blob([e],{type:n}),o=URL.createObjectURL(r),a=document.createElement("a");a.href=o,a.download=s,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}function fs(e){const s=e.trimStart();return s.startsWith("openapi:")||s.startsWith("swagger:")||s.startsWith("---")||!s.startsWith("{")&&!s.startsWith("[")}function xs({serviceId:e,apiGroupId:s,versionId:n}){const r=qe()?.id,[o,a]=f.useState(!1);async function i(u){try{a(!0);const{content:l,fileName:p}=await us(r,e,s,n);if(u==="original"){const c=fs(l)?"yaml":"json",d=c==="yaml"?"text/yaml":"application/json";ms(l,p??`api-spec.${c}`,d);return}}catch(l){console.error("Download failed:",l),be.error("Failed to download spec file")}finally{a(!1)}}return t.jsxs(ne,{preset:"outline",disabled:o,onClick:()=>void i("original"),children:[t.jsx(Jt,{className:"h-4 w-4"}),o?"Downloading...":"Download"]})}function vt({bottomOffset:e=0,topOffset:s=0,className:n,children:r,...o}){const a=f.useRef(null),[i,u]=f.useState(null),[l,p]=f.useState(0);return f.useLayoutEffect(()=>{const c=a.current;if(!c)return;function d(){u(c.getBoundingClientRect())}function x(){p(window.innerHeight)}window.addEventListener("resize",x),document.addEventListener("scroll",d,!0),c.addEventListener("scroll",d);const g=new ResizeObserver(d);return g.observe(c),x(),d(),()=>{window.removeEventListener("resize",x),document.removeEventListener("scroll",d,!0),c.removeEventListener("scroll",d),g.unobserve(c)}},[]),t.jsx("div",{ref:a,...o,className:B("better-scrollbar",n),style:{height:i&&l?l-Math.max(0,s,i.y)-e:void 0},children:r})}function hs(e,s){const n=e.trim();if(!n)return"/";const r=n.replace(/^https?:\/\/[^/]+/i,"");let o=r.startsWith("/")?r:`/${r}`;if(o=o.replace(/\/{2,}/g,"/"),s){const a=s.startsWith("/")?s:`/${s}`;o.startsWith(a)&&(o=o.slice(a.length)||"/")}return o}function gs(e){const s=Array.isArray(e?.servers)?e.servers:[],n=s[0]??null,r=vs(s),o=r[0]??null,a=e?.components?.securitySchemes??{},i=Object.keys(a).length>0,u=e?.security,l=Is(e,a,u),p=Es(e),c=As(e),d=Cs(e),x=js(e),g=Ns(e),b=ws(e),j=Ss(e,a,u),S=Nt(u,a),E=ys(n?.url);return{servers:s,defaultServer:n,envOptions:r,defaultEnv:o,securitySchemes:a,hasSecuritySchemes:i,basePath:E,resolveBaseUrl(w,A){return st(n,w,A)},resolveServerUrl(w,A,M){return st(w??n,A,M)},operationAuth(w){return i?w?l.get(w)??S:S:"none"},operationResponses(w){return w?p.get(w.trim())??{}:{}},operationRequestBody(w){return w?c.get(w.trim())??null:null},operationParameters(w){return w?d.get(w.trim())??[]:[]},operationRequestBodyByPath(w,A){return x.get(le(w,A))??null},operationParametersByPath(w,A){return g.get(le(w,A))??[]},operationResponsesByPath(w,A){return b.get(le(w,A))??{}},operationAuthByPath(w,A){return i?j.get(le(w,A))??S:"none"},resolveRef(w){return bs(e,w)}}}function bs(e,s){if(!e||!s.startsWith("#/"))return null;const n=s.slice(2).split("/");let r=e;for(const o of n){if(r==null||typeof r!="object")return null;r=r[o]}return r==null||typeof r!="object"?null:r}function le(e,s){return`${e.toUpperCase()}:${s}`}function ys(e){if(!e)return null;try{const n=new URL(e.replace(/\{[^}]+\}/g,"placeholder")).pathname;return n&&n!=="/"?n:null}catch{const s=e.match(/https?:\/\/[^/]+(\/[^?]*)/i);return s&&s[1]&&s[1]!=="/"?s[1]:null}}function vs(e){for(const s of e){const n=s.variables??{},r=Object.entries(n),o=r.find(([u])=>/env|stage|environment/i.test(u))??r.find(([,u])=>Array.isArray(u.enum)&&u.enum.length>0);if(!o)continue;const a=o[1].enum??[],i=Array.from(new Set(a.map(u=>u.trim()).filter(Boolean)));if(i.length>0)return i}return[]}function st(e,s,n){const r=e?.url?.trim();if(!r)return(n||"").trim();const o=s.trim().toLowerCase(),a=e?.variables??{},i={};for(const[l,p]of Object.entries(a)){const c=p,d=c.enum??[],x=d.find(g=>g.toLowerCase()===o)??d.find(g=>g.toLowerCase().includes(o))??c.default??d[0]??"";i[l]=x}return r.replace(/\{([^}]+)\}/g,(l,p)=>i[p]??"").trim()||(n||"").trim()}const Ae=new Set(["get","post","put","patch","delete","head","options","trace"]);function js(e){const s=new Map,n=e?.paths??{};for(const[r,o]of Object.entries(n))for(const[a,i]of Object.entries(o??{})){if(!Ae.has(a.toLowerCase()))continue;const u=i;if(!u?.requestBody)continue;const l=u.requestBody;let p=null,c="application/json";if(l.content){const d=l.content["application/json"];if(d?.schema)p=d.schema;else{const x=Object.entries(l.content)[0];x&&(c=x[0],p=x[1]?.schema??null)}}s.set(le(a,r),{schema:p,contentType:c,required:l.required??!1})}return s}function Ns(e){const s=new Map,n=e?.paths??{};for(const[r,o]of Object.entries(n)){const a=o.parameters??[];for(const[i,u]of Object.entries(o??{})){if(!Ae.has(i.toLowerCase()))continue;const l=u,c=[...a,...l?.parameters??[]].filter(d=>d?.name).map(d=>({name:d.name??"",in:d.in??"query",required:d.required??!1,description:d.description??"",schema:d.schema??null}));c.length>0&&s.set(le(i,r),c)}}return s}function ws(e){const s=new Map,n=e?.paths??{};for(const[r,o]of Object.entries(n))for(const[a,i]of Object.entries(o??{})){if(!Ae.has(a.toLowerCase()))continue;const u=i;if(!u?.responses)continue;const l={};for(const[p,c]of Object.entries(u.responses)){if(!c)continue;let d=null,x=null;const g=c.description??null,b=c.content?.["application/json"];if(b){if(b.schema&&(d=b.schema),b.example!==void 0)try{x=JSON.stringify(b.example,null,2)}catch{}else if(b.examples){const j=Object.values(b.examples)[0]?.value;if(j!==void 0)try{x=JSON.stringify(j,null,2)}catch{}}}if(!d&&c.schema&&(d=c.schema),!x&&c.examples?.["application/json"]!==void 0)try{x=JSON.stringify(c.examples["application/json"],null,2)}catch{}l[p]={schema:d,example:x,description:g}}Object.keys(l).length>0&&s.set(le(a,r),l)}return s}function Ss(e,s,n){const r=new Map,o=e?.paths??{};for(const[a,i]of Object.entries(o))for(const[u,l]of Object.entries(i??{})){if(!Ae.has(u.toLowerCase()))continue;const p=l;r.set(le(u,a),jt(p?.security,n,s))}return r}function Is(e,s,n){const r=new Map,o=e?.paths??{};for(const a of Object.values(o))for(const[i,u]of Object.entries(a??{})){if(i==="parameters")continue;const l=u,p=l?.operationId?.trim();p&&r.set(p,jt(l?.security,n,s))}return r}function jt(e,s,n){return Nt(e!==void 0?e:s,n)}function As(e){const s=new Map,n=e?.paths??{};for(const r of Object.values(n))for(const[o,a]of Object.entries(r??{})){if(o==="parameters")continue;const i=a;if(!i?.requestBody)continue;const u=i.operationId?.trim();if(!u)continue;const l=i.requestBody;let p=null,c="application/json";if(l.content){const d=l.content["application/json"];if(d?.schema)p=d.schema;else{const x=Object.entries(l.content)[0];x&&(c=x[0],p=x[1]?.schema??null)}}s.set(u,{schema:p,contentType:c,required:l.required??!1})}return s}function Cs(e){const s=new Map,n=e?.paths??{};for(const r of Object.values(n)){const o=r.parameters??[];for(const[a,i]of Object.entries(r??{})){if(a==="parameters")continue;const u=i,l=u?.operationId?.trim();if(!l)continue;const c=[...o,...u.parameters??[]].filter(d=>d?.name).map(d=>({name:d.name??"",in:d.in??"query",required:d.required??!1,description:d.description??"",schema:d.schema??null}));c.length>0&&s.set(l,c)}}return s}function Es(e){const s=new Map,n=e?.paths??{};for(const r of Object.values(n))if(r)for(const[o,a]of Object.entries(r)){if(o==="parameters")continue;const i=a;if(!i)continue;const u=i.operationId?.trim();if(!u||!i.responses)continue;const l={};for(const[p,c]of Object.entries(i.responses)){if(!c)continue;let d=null,x=null;const g=c.content?.["application/json"];if(g){if(g.schema&&(d=g.schema),g.example!==void 0)try{x=JSON.stringify(g.example,null,2)}catch{}else if(g.examples){const b=Object.values(g.examples)[0]?.value;if(b!==void 0)try{x=JSON.stringify(b,null,2)}catch{}}}if(!d&&c.schema&&(d=c.schema),!x&&c.examples?.["application/json"]!==void 0)try{x=JSON.stringify(c.examples["application/json"],null,2)}catch{}l[p]={schema:d,example:x,description:c.description??null}}Object.keys(l).length>0&&s.set(u,l)}return s}function Nt(e,s){if(!e||e.length===0)return"none";const n=e.flatMap(r=>Object.keys(r));if(n.length===0)return"none";for(const r of n){const o=s[r];if(!o)continue;const a=(o.type||"").toLowerCase(),i=(o.scheme||"").toLowerCase();return a==="oauth2"?"oauth2":a==="apikey"?"api-key":a==="http"&&i==="bearer"?"bearer":"other"}return"other"}function Os({apiGroupVersions:e=[],selectedVersionId:s=null,onSelectedVersionIdChange:n,showServerControls:r=!1,openApiRuntime:o,baseUrl:a="",selectedEnv:i="production",fallbackBaseUrl:u="",selectedServerIndex:l="0",onServerIndexChange:p}){const c=f.useMemo(()=>e.map((g,b)=>{const j=g.versionNumber,S=j!=null?`v${j}`:g.label?.trim()||"Latest";return{value:g.versionId,label:S,isLatest:b===0}}),[e]),d=c.find(g=>g.isLatest)?.value,x=s??d??"";return c.length===0?r&&o?t.jsx("div",{className:"flex w-full flex-wrap items-center gap-2 border-b bg-[#141925] px-4 py-2",children:t.jsx(nt,{openApiRuntime:o,baseUrl:a,selectedEnv:i,fallbackBaseUrl:u,selectedServerIndex:l,onServerIndexChange:p})}):null:t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 border-b bg-[#141925] px-4 py-2",children:[t.jsx(Ms,{label:"Versions",value:x,options:c,onValueChange:g=>n?.(g)}),r&&o?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hidden h-5 w-px bg-[#2A3242] sm:block"}),t.jsx(nt,{openApiRuntime:o,baseUrl:a,selectedEnv:i,fallbackBaseUrl:u,selectedServerIndex:l,onServerIndexChange:p})]}):null]})})}function Ms({label:e,value:s,options:n,onValueChange:r}){return t.jsxs($e,{value:s,onValueChange:r,children:[t.jsxs(Ve,{className:"border-stock h-8 min-w-[9rem] gap-2 rounded-full bg-[#141925] px-3 text-xs shadow-none",children:[t.jsx("span",{className:"text-[#828DA3]",children:e}),t.jsx("span",{className:"max-w-[8rem] truncate font-medium",children:t.jsx(Be,{placeholder:`Select ${e}`})})]}),t.jsx(_e,{children:n.map(o=>t.jsx(ge,{value:o.value,children:t.jsxs("span",{className:"flex items-center gap-2",children:[o.label,o.isLatest?t.jsx(fe,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"Latest"}):null]})},o.value))})]})}function nt({openApiRuntime:e,baseUrl:s,selectedEnv:n,fallbackBaseUrl:r,selectedServerIndex:o,onServerIndexChange:a}){const i=f.useMemo(()=>{const l=e.servers;return l.length?l.map((p,c)=>{const d=e.resolveServerUrl(p,n,r),x=p.description?.trim()||null;return{value:String(c),url:d,description:x}}):[{value:"0",url:s||r||"No server configured",description:null}]},[s,r,e,n]),u=i.find(l=>l.value===o)??i[0];return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsxs($e,{value:o,onValueChange:a,children:[t.jsxs(Ve,{className:"border-stock h-8 max-w-[28rem] min-w-[18rem] gap-2 rounded-full bg-[#141925] px-3 text-xs shadow-none [&_[data-slot=select-value]]:hidden",children:[t.jsx("span",{className:"shrink-0 text-[#828DA3]",children:"Servers"}),t.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:u?.url??"Select server"}),t.jsx(Be,{})]}),t.jsx(_e,{className:"max-w-[32rem]",children:i.map(l=>t.jsx(ge,{value:l.value,textValue:l.url,title:l.description?`${l.url} — ${l.description}`:l.url,children:t.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[t.jsx("span",{className:"truncate font-medium",children:l.url}),l.description?t.jsx("span",{className:"truncate text-[11px] text-[#828DA3]",children:l.description}):null]})},l.value))})]}),t.jsxs(ne,{variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5 px-2.5 text-xs",onClick:()=>void Ls(s),disabled:!s,children:[t.jsx(Ie,{className:"h-3.5 w-3.5"}),"Copy"]}),t.jsxs("span",{className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full border border-[#2A3242] px-3 text-xs text-[#828DA3]",children:[e.hasSecuritySchemes?t.jsx(os,{className:"h-3.5 w-3.5"}):t.jsx(ns,{className:"h-3.5 w-3.5"}),e.hasSecuritySchemes?"Auth required":"No auth"]})]})})}async function Ls(e){if(e)try{await navigator.clipboard.writeText(e),be.success("Server URL copied")}catch{be.error("Failed to copy")}}function wt(e){switch(e){case"string":return"text-emerald-400";case"integer":case"number":return"text-sky-400";case"boolean":return"text-amber-400";case"array":return"text-purple-400";case"object":return"text-orange-400";default:return"text-muted-foreground"}}function ae({name:e,schema:s,isRequired:n,depth:r=0,showRequired:o=!0}){const[a,i]=f.useState(r<2),u=s.properties||s.items||s.allOf||s.oneOf||s.anyOf,l=s.type?s.type+(s.format?` (${s.format})`:""):s.$ref?s.$ref.split("/").pop()??"$ref":"unknown";return t.jsxs("div",{className:B(r>0&&"ml-4 border-l border-[#2A3242] pl-1"),children:[t.jsxs("div",{className:B("flex items-center gap-2 rounded-md px-3 py-1.5",u&&"cursor-pointer hover:bg-[#1E2533]"),onClick:()=>u&&i(!a),children:[u?a?t.jsx(mt,{className:"h-3.5 w-3.5 shrink-0 text-[#586378]"}):t.jsx(Yt,{className:"h-3.5 w-3.5 shrink-0 text-[#586378]"}):null,t.jsx("span",{className:"text-sm font-medium text-[#F4F7FC]",children:e}),t.jsx("span",{className:B("font-mono text-xs",wt(s.type)),children:l}),o&&n&&t.jsx("span",{className:"rounded bg-red-500/15 px-1.5 py-px text-[10px] leading-4 font-medium text-red-400 ring-1 ring-red-500/30",children:"required"}),s.example!==void 0&&t.jsxs("span",{className:"text-muted-foreground ml-auto text-xs",children:["e.g."," ",t.jsx("code",{className:"rounded bg-[#1E2533] px-1 py-0.5 text-[10px]",children:typeof s.example=="string"?s.example:JSON.stringify(s.example)})]})]}),a&&u&&t.jsxs("div",{className:"pl-1",children:[s.properties&&Object.entries(s.properties).map(([p,c])=>t.jsx(ae,{name:p,schema:c,isRequired:s.required?.includes(p)??!1,depth:r+1,showRequired:o},p)),s.items&&t.jsx(ae,{name:"[items]",schema:s.items,isRequired:!1,depth:r+1,showRequired:o}),s.allOf?.map((p,c)=>t.jsx(ae,{name:`allOf[${c}]`,schema:p,isRequired:!1,depth:r+1,showRequired:o},`allOf-${c}`)),s.oneOf?.map((p,c)=>t.jsx(ae,{name:`oneOf[${c}]`,schema:p,isRequired:!1,depth:r+1,showRequired:o},`oneOf-${c}`)),s.anyOf?.map((p,c)=>t.jsx(ae,{name:`anyOf[${c}]`,schema:p,isRequired:!1,depth:r+1,showRequired:o},`anyOf-${c}`))]})]})}function Re({schema:e,showRequired:s=!0}){return!e.properties&&!e.items&&!e.allOf?t.jsxs("div",{className:"text-muted-foreground py-2 text-xs",children:["Type:"," ",t.jsx("span",{className:wt(e.type),children:e.type||"unknown"}),e.format&&t.jsxs("span",{children:[" (",e.format,")"]})]}):t.jsxs("div",{className:"rounded-lg border border-[#2A3242] bg-[#141925] p-2",children:[e.properties&&Object.entries(e.properties).map(([n,r])=>t.jsx(ae,{name:n,schema:r,isRequired:e.required?.includes(n)??!1,depth:0,showRequired:s},n)),e.items&&t.jsx(ae,{name:"[items]",schema:e.items,isRequired:!1,depth:0,showRequired:s}),e.allOf?.map((n,r)=>t.jsx(ae,{name:`allOf[${r}]`,schema:n,isRequired:!1,depth:0,showRequired:s},`allOf-${r}`))]})}function Ds(){const{apiEndpoints:e,protocol:s,graphQLOperations:n,isGraphQLLoading:r,grpcMethods:o,isGrpcLoading:a,selectedVersionId:i,setSelectedVersionId:u,apiGroupVersions:l,deleteServiceApiEndpoint:p,serviceId:c,apiGroup:d}=bt(),x=qe()?.id,g=d?.serviceApiGroupId??"",[b,j]=gt("endpointId",xt),[S,E]=f.useState(""),[w,A]=Se(`${c}:apis-auth`,"all"),[M,I]=Se(`${c}:apis-method`,"all"),[P]=Se(`${c}:apis-groupby`,"tags"),[F,V]=Se(`${c}:apis-optype`,"all"),[O,J]=f.useState(null),[_,T]=f.useState("0"),R=f.useRef(void 0);f.useEffect(()=>{if(T("0"),R.current===void 0){R.current=i;return}R.current!==i&&(R.current=i,j(null))},[i,j]);const[L,ce]=f.useState(S);f.useEffect(()=>{const m=setTimeout(()=>ce(S),250);return()=>clearTimeout(m)},[S]),f.useEffect(()=>{const m=(s||"").toLowerCase();if(!(m==="rest"||m==="openapi"||m==="swagger")||!g||!x){J(null);return}let N=!1;async function D(){try{const{data:G}=await it.query({query:yt,variables:{orgId:x,serviceId:c,apiGroupId:g,versionId:i},fetchPolicy:"cache-first"}),z=G?.apiGroupSpec?.content;if(z==null)return;let $=null;try{$=JSON.parse(z)}catch{$=(await Pt(()=>import("./js-yaml-3VEnDAEN.js"),[])).load(z)}!N&&$&&typeof $=="object"&&J($)}catch{N||J(null)}}return D(),()=>{N=!0}},[s,x,c,g,i]);const xe=s==="graphql",de=s==="grpc",C=f.useMemo(()=>gs(O),[O]),y=C.defaultEnv??"production",v=f.useMemo(()=>e.map(m=>{const h=ee(m.componentMeta?.componentModalFields),N=ie(h,h),D=q(N,h,["url"])??"",G=hs(D,C.basePath),z=(q(N,h,["method"])??"GET").toUpperCase(),$=q(N,h,["summary","label"])??"",X=q(N,h,["operation id","operationid"])??m.apiEndpoint?.apiEndpointId??"",te=_s(q(N,h,["tags"])),se=q(N,h,["authentication"]),Ce=q(N,h,["protocol"])??"REST",K=q(N,h,["api source type"]),ze=m.apiEndpoint?.apiEndpointId??X;return{selectionKey:X||ze,endpointId:ze,apiEndpoint:m.apiEndpoint,componentMeta:m.componentMeta,method:z,path:G,fullUrl:D,summary:$,operationId:X,tags:te,auth:Us(se),protocol:Ce,requestSchema:q(N,h,["request schema"]),responseSchema:q(N,h,["response schema"]),statusCodes:q(N,h,["status codes"]),parameters:q(N,h,["parameters"]),description:q(N,h,["notes","description"]),requestExample:q(N,h,["request example"]),sourceType:K}}),[e,C]),k=f.useMemo(()=>{const m=v.find(N=>N.fullUrl.toLowerCase().startsWith("http"));if(!m)return"";if(!m.path||m.path==="/")return m.fullUrl;const h=m.fullUrl.indexOf(m.path);return h>0?m.fullUrl.slice(0,h):m.fullUrl},[v]),U=f.useMemo(()=>{const m=C.servers[Number(_)]??C.defaultServer;return C.resolveServerUrl(m,y,k)},[k,C,y,_]),H=f.useMemo(()=>{if(!L&&w==="all"&&M==="all")return v;const m=L.toLowerCase();return v.filter(h=>{const N=!m||h.path.toLowerCase().includes(m)||h.method.toLowerCase().includes(m)||h.summary.toLowerCase().includes(m)||h.operationId.toLowerCase().includes(m)||h.tags.some($=>$.toLowerCase().includes(m)),D=M==="all"||h.method===M,G=C.hasSecuritySchemes?C.operationAuth(h.operationId):h.auth;return N&&D&&(w==="all"||G===w)})},[w,L,M,C,v]),pe=f.useMemo(()=>{if(P==="none")return[{group:"All Endpoints",endpoints:H}];const m=new Map;for(const h of H){const N=h.tags.length>0?h.tags:["Ungrouped"];for(const D of N)m.has(D)||m.set(D,[]),m.get(D).push(h)}return Array.from(m.entries()).sort(([h],[N])=>h.localeCompare(N)).map(([h,N])=>({group:h,endpoints:N}))},[H,P]),Y=f.useMemo(()=>{const m=b;return m?v.find(h=>h.selectionKey===m||h.operationId===m||h.endpointId===m)??null:null},[b,v]),Z=f.useMemo(()=>{const m=b;return m?n.find(h=>h.apiEndpoint.apiEndpointId===m)??null:null},[n,b]),W=f.useMemo(()=>{const m=b;return m?o.find(h=>h.apiEndpoint.apiEndpointId===m)??null:null},[o,b]);f.useEffect(()=>{if(!b)return;(Y??Z??W)||j(null)},[b,Z,W,Y,j]);const Q=f.useMemo(()=>n.filter(m=>{const h=ee(m.componentMeta.componentModalFields),N=ie(h,h),D=h.find(K=>K?.label?.toLowerCase()==="name"),G=h.find(K=>K?.label?.toLowerCase()==="graphql operation type"||K?.label?.toLowerCase()==="operation type"||K?.label?.toLowerCase()==="kind"),z=h.find(K=>K?.label?.toLowerCase()==="signature"),$=D?.componentFieldId?N[D.componentFieldId]:"",X=G?.componentFieldId?N[G.componentFieldId]:"",te=z?.componentFieldId?N[z.componentFieldId]:"";return(!L||$?.toLowerCase().includes(L.toLowerCase())||te?.toLowerCase().includes(L.toLowerCase()))&&(F==="all"||X===F)}),[n,L,F]),ue=f.useMemo(()=>{const m=new Map;return o.forEach(h=>{const N=ee(h.componentMeta.componentModalFields),D=ie(N,N),G=N.find(se=>se?.label?.toLowerCase()==="package name"),z=N.find(se=>se?.label?.toLowerCase()==="grpc service name"||se?.label?.toLowerCase()==="service name"),$=G?.componentFieldId?D[G.componentFieldId]:"",X=z?.componentFieldId?D[z.componentFieldId]:"",te=$?`${$}.${X}`:X||"Unknown";m.has(te)||m.set(te,[]),m.get(te).push(h)}),Array.from(m.entries()).map(([h,N])=>({serviceKey:h,methods:N.filter(D=>{const G=ee(D.componentMeta.componentModalFields),z=ie(G,G),$=G.find(K=>K?.label?.toLowerCase()==="grpc method name"||K?.label?.toLowerCase()==="method name"),X=G.find(K=>K?.label?.toLowerCase()==="grpc service name"||K?.label?.toLowerCase()==="service name"),te=$?.componentFieldId?z[$.componentFieldId]:"",se=X?.componentFieldId?z[X.componentFieldId]:"";return!L||te?.toLowerCase().includes(L.toLowerCase())||se?.toLowerCase().includes(L.toLowerCase())})}))},[o,L]);return t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsx(Os,{apiGroupVersions:l,selectedVersionId:i,onSelectedVersionIdChange:u,showServerControls:!xe&&!de,openApiRuntime:C,baseUrl:U,selectedEnv:y,fallbackBaseUrl:k,selectedServerIndex:_,onServerIndexChange:T}),r||a?t.jsx("div",{className:"flex h-[400px] items-center justify-center px-6 py-4",children:t.jsx(Ht,{})}):xe?t.jsxs("div",{className:"rest-endpoints-shell grid min-h-0 flex-1 xl:grid-cols-[264px_minmax(0,1fr)]",children:[t.jsxs("aside",{className:"rest-endpoints-sidebar overflow-y-auto border-r",children:[t.jsxs("div",{className:"space-y-2 border-b p-3",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Me,{className:"absolute top-1/2 left-3 h-3.5 w-3.5 -translate-y-1/2 text-[#828DA3]"}),t.jsx(Oe,{value:S,onChange:m=>E(m.target.value),placeholder:"Search operations...",className:"border-stock h-8! !rounded-[0.65rem] bg-[#1E2533] pl-8 text-xs shadow-none","aria-label":"Search operations"})]}),t.jsxs($e,{value:F,onValueChange:V,children:[t.jsx(Ve,{className:"border-stock h-8! w-full !rounded-[0.65rem] bg-[#1E2533]! text-xs shadow-none",children:t.jsx(Be,{placeholder:"All Types"})}),t.jsxs(_e,{children:[t.jsx(ge,{value:"all",children:"All Types"}),t.jsx(ge,{value:"Query",children:"Query"}),t.jsx(ge,{value:"Mutation",children:"Mutation"}),t.jsx(ge,{value:"Subscription",children:"Subscription"})]})]})]}),t.jsx("div",{className:"space-y-1 px-3 py-3",children:Q.length===0?t.jsxs("div",{className:"rest-endpoints-empty rounded-[14px] border border-dashed px-4 py-6 text-center text-sm",children:[t.jsx("p",{className:"mb-2 text-[#828DA3]",children:"No operations match these filters"}),t.jsx(ne,{variant:"link",onClick:()=>{E(""),V("all")},className:"h-auto p-0 text-[#3B82F6]",children:"Clear filters"})]}):Q.map(m=>t.jsx(Rs,{operation:m,selected:Z?.apiEndpoint.apiEndpointId===m.apiEndpoint.apiEndpointId,onSelect:()=>void j(m.apiEndpoint.apiEndpointId)},m.apiEndpoint.apiEndpointId))})]}),t.jsx("main",{className:"min-w-0 overflow-y-auto p-4",children:Z?t.jsx(Vs,{operation:Z,onClose:()=>void j(null)}):t.jsx("div",{className:"rest-endpoints-empty flex h-full items-center justify-center rounded-[16px] border border-dashed p-10 text-sm",children:"Select an operation to view its details"})})]}):de?t.jsxs("div",{className:"rest-endpoints-shell grid min-h-0 flex-1 xl:grid-cols-[264px_minmax(0,1fr)]",children:[t.jsxs("aside",{className:"rest-endpoints-sidebar overflow-y-auto border-r",children:[t.jsx("div",{className:"border-b p-3",children:t.jsxs("div",{className:"relative",children:[t.jsx(Me,{className:"absolute top-1/2 left-3 h-3.5 w-3.5 -translate-y-1/2 text-[#828DA3]"}),t.jsx(Oe,{value:S,onChange:m=>E(m.target.value),placeholder:"Search methods...",className:"border-stock h-8! !rounded-[0.65rem] bg-[#1E2533] pl-8 text-xs shadow-none","aria-label":"Search methods"})]})}),t.jsx("div",{className:"py-3",children:ue.every(m=>m.methods.length===0)?t.jsxs("div",{className:"rest-endpoints-empty mx-3 rounded-[14px] border border-dashed px-4 py-6 text-center text-sm",children:[t.jsx("p",{className:"mb-2 text-[#828DA3]",children:"No methods match these filters"}),t.jsx(ne,{variant:"link",onClick:()=>E(""),className:"h-auto p-0 text-[#3B82F6]",children:"Clear filters"})]}):ue.map(({serviceKey:m,methods:h})=>h.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsx("div",{className:"rest-endpoints-section-label px-5 pb-1 text-[11px] font-medium tracking-wide uppercase",children:m}),t.jsx("div",{className:"space-y-1 px-3",children:h.map(N=>t.jsx(ks,{method:N,selected:W?.apiEndpoint.apiEndpointId===N.apiEndpoint.apiEndpointId,onSelect:()=>void j(N.apiEndpoint.apiEndpointId)},N.apiEndpoint.apiEndpointId))})]},m))})]}),t.jsx("main",{className:"min-w-0 overflow-y-auto p-4",children:W?t.jsx(Bs,{method:W,onClose:()=>void j(null)}):t.jsx("div",{className:"rest-endpoints-empty flex h-full items-center justify-center rounded-[16px] border border-dashed p-10 text-sm",children:"Select a method to view its details"})})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"rest-endpoints-shell grid min-h-0 flex-1 xl:grid-cols-[264px_minmax(0,1fr)]",children:[t.jsxs("aside",{className:"rest-endpoints-sidebar overflow-y-auto border-r",children:[t.jsx("div",{className:"border-b p-3",children:t.jsxs("div",{className:"relative",children:[t.jsx(Me,{className:"absolute top-1/2 left-3 h-3.5 w-3.5 -translate-y-1/2 text-[#828DA3]"}),t.jsx(Oe,{value:S,onChange:m=>E(m.target.value),placeholder:"Search endpoints...",className:"border-stock h-8! !rounded-[0.65rem] bg-[#1E2533] pl-8 text-xs shadow-none","aria-label":"Search endpoints"})]})}),t.jsx("div",{className:"space-y-4 px-3 py-3",children:H.length===0?t.jsxs("div",{className:"rest-endpoints-empty rounded-[14px] border border-dashed px-4 py-6 text-center text-sm",children:[t.jsx("p",{className:"mb-2 text-[#828DA3]",children:"No endpoints match these filters"}),t.jsx(ne,{variant:"link",onClick:()=>{E(""),A("all"),I("all")},className:"h-auto p-0 text-[#3B82F6]",children:"Clear filters"})]}):pe.map(m=>t.jsxs("div",{className:"space-y-1",children:[P==="tags"&&t.jsxs("div",{className:"rest-endpoints-section-label flex items-center justify-between px-2 text-[11px] font-medium tracking-wide uppercase",children:[t.jsx("span",{children:m.group}),t.jsx("span",{className:"tabular-nums",children:m.endpoints.length})]}),m.endpoints.map(h=>t.jsx(Fs,{endpoint:h,selected:Y?.selectionKey===h.selectionKey,onSelect:()=>void j(h.selectionKey),baseUrl:U,readonly:!0,onDelete:async()=>{!h.endpointId||i!==null||(await p({variables:{organizationId:x,apiEndpointId:h.endpointId}}),be.success("API endpoint deleted successfully"))}},h.endpointId))]},m.group))})]}),t.jsx("main",{className:"min-w-0 overflow-y-auto p-4",children:Y?t.jsx($s,{endpoint:Y,baseUrl:U,openApiRuntime:C,onClose:()=>void j(null)}):t.jsx("div",{className:"rest-endpoints-empty flex h-full items-center justify-center rounded-[16px] border border-dashed p-10 text-sm",children:"Select an endpoint to view its details"})})]})}),t.jsx("style",{children:`
|
|
62
|
+
`);async function us(e,s,n,r){const{data:o}=await at.query({query:yt,variables:{orgId:e,serviceId:s,apiGroupId:n,versionId:r},fetchPolicy:"network-only"}),a=o?.apiGroupSpec;if(!a)throw new Error("Could not load spec content");return{content:a.content,fileName:a.fileName??null}}function ms(e,s,n){const r=new Blob([e],{type:n}),o=URL.createObjectURL(r),a=document.createElement("a");a.href=o,a.download=s,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}function fs(e){const s=e.trimStart();return s.startsWith("openapi:")||s.startsWith("swagger:")||s.startsWith("---")||!s.startsWith("{")&&!s.startsWith("[")}function xs({serviceId:e,apiGroupId:s,versionId:n}){const r=Ge()?.id,[o,a]=f.useState(!1);async function i(u){try{a(!0);const{content:l,fileName:p}=await us(r,e,s,n);if(u==="original"){const c=fs(l)?"yaml":"json",d=c==="yaml"?"text/yaml":"application/json";ms(l,p??`api-spec.${c}`,d);return}}catch(l){console.error("Download failed:",l),be.error("Failed to download spec file")}finally{a(!1)}}return t.jsxs(oe,{preset:"outline",disabled:o,onClick:()=>void i("original"),children:[t.jsx(Jt,{className:"h-4 w-4"}),o?"Downloading...":"Download"]})}function vt({bottomOffset:e=0,topOffset:s=0,className:n,children:r,...o}){const a=f.useRef(null),[i,u]=f.useState(null),[l,p]=f.useState(0);return f.useLayoutEffect(()=>{const c=a.current;if(!c)return;function d(){u(c.getBoundingClientRect())}function x(){p(window.innerHeight)}window.addEventListener("resize",x),document.addEventListener("scroll",d,!0),c.addEventListener("scroll",d);const g=new ResizeObserver(d);return g.observe(c),x(),d(),()=>{window.removeEventListener("resize",x),document.removeEventListener("scroll",d,!0),c.removeEventListener("scroll",d),g.unobserve(c)}},[]),t.jsx("div",{ref:a,...o,className:z("better-scrollbar",n),style:{height:i&&l?l-Math.max(0,s,i.y)-e:void 0},children:r})}function hs(e,s){const n=e.trim();if(!n)return"/";const r=n.replace(/^https?:\/\/[^/]+/i,"");let o=r.startsWith("/")?r:`/${r}`;if(o=o.replace(/\/{2,}/g,"/"),s){const a=s.startsWith("/")?s:`/${s}`;o.startsWith(a)&&(o=o.slice(a.length)||"/")}return o}function gs(e){const s=Array.isArray(e?.servers)?e.servers:[],n=s[0]??null,r=vs(s),o=r[0]??null,a=e?.components?.securitySchemes??{},i=Object.keys(a).length>0,u=e?.security,l=Is(e,a,u),p=Es(e),c=As(e),d=Cs(e),x=js(e),g=Ns(e),b=ws(e),y=Ss(e,a,u),N=Nt(u,a),E=ys(n?.url);return{servers:s,defaultServer:n,envOptions:r,defaultEnv:o,securitySchemes:a,hasSecuritySchemes:i,basePath:E,resolveBaseUrl(v,A){return st(n,v,A)},resolveServerUrl(v,A,M){return st(v??n,A,M)},operationAuth(v){return i?v?l.get(v)??N:N:"none"},operationResponses(v){return v?p.get(v.trim())??{}:{}},operationRequestBody(v){return v?c.get(v.trim())??null:null},operationParameters(v){return v?d.get(v.trim())??[]:[]},operationRequestBodyByPath(v,A){return x.get(ue(v,A))??null},operationParametersByPath(v,A){return g.get(ue(v,A))??[]},operationResponsesByPath(v,A){return b.get(ue(v,A))??{}},operationAuthByPath(v,A){return i?y.get(ue(v,A))??N:"none"},resolveRef(v){return bs(e,v)}}}function bs(e,s){if(!e||!s.startsWith("#/"))return null;const n=s.slice(2).split("/");let r=e;for(const o of n){if(r==null||typeof r!="object")return null;r=r[o]}return r==null||typeof r!="object"?null:r}function ue(e,s){return`${e.toUpperCase()}:${s}`}function ys(e){if(!e)return null;try{const n=new URL(e.replace(/\{[^}]+\}/g,"placeholder")).pathname;return n&&n!=="/"?n:null}catch{const s=e.match(/https?:\/\/[^/]+(\/[^?]*)/i);return s&&s[1]&&s[1]!=="/"?s[1]:null}}function vs(e){for(const s of e){const n=s.variables??{},r=Object.entries(n),o=r.find(([u])=>/env|stage|environment/i.test(u))??r.find(([,u])=>Array.isArray(u.enum)&&u.enum.length>0);if(!o)continue;const a=o[1].enum??[],i=Array.from(new Set(a.map(u=>u.trim()).filter(Boolean)));if(i.length>0)return i}return[]}function st(e,s,n){const r=e?.url?.trim();if(!r)return(n||"").trim();const o=s.trim().toLowerCase(),a=e?.variables??{},i={};for(const[l,p]of Object.entries(a)){const c=p,d=c.enum??[],x=d.find(g=>g.toLowerCase()===o)??d.find(g=>g.toLowerCase().includes(o))??c.default??d[0]??"";i[l]=x}return r.replace(/\{([^}]+)\}/g,(l,p)=>i[p]??"").trim()||(n||"").trim()}const Ce=new Set(["get","post","put","patch","delete","head","options","trace"]);function js(e){const s=new Map,n=e?.paths??{};for(const[r,o]of Object.entries(n))for(const[a,i]of Object.entries(o??{})){if(!Ce.has(a.toLowerCase()))continue;const u=i;if(!u?.requestBody)continue;const l=u.requestBody;let p=null,c="application/json";if(l.content){const d=l.content["application/json"];if(d?.schema)p=d.schema;else{const x=Object.entries(l.content)[0];x&&(c=x[0],p=x[1]?.schema??null)}}s.set(ue(a,r),{schema:p,contentType:c,required:l.required??!1})}return s}function Ns(e){const s=new Map,n=e?.paths??{};for(const[r,o]of Object.entries(n)){const a=o.parameters??[];for(const[i,u]of Object.entries(o??{})){if(!Ce.has(i.toLowerCase()))continue;const l=u,c=[...a,...l?.parameters??[]].filter(d=>d?.name).map(d=>({name:d.name??"",in:d.in??"query",required:d.required??!1,description:d.description??"",schema:d.schema??null}));c.length>0&&s.set(ue(i,r),c)}}return s}function ws(e){const s=new Map,n=e?.paths??{};for(const[r,o]of Object.entries(n))for(const[a,i]of Object.entries(o??{})){if(!Ce.has(a.toLowerCase()))continue;const u=i;if(!u?.responses)continue;const l={};for(const[p,c]of Object.entries(u.responses)){if(!c)continue;let d=null,x=null;const g=c.description??null,b=c.content?.["application/json"];if(b){if(b.schema&&(d=b.schema),b.example!==void 0)try{x=JSON.stringify(b.example,null,2)}catch{}else if(b.examples){const y=Object.values(b.examples)[0]?.value;if(y!==void 0)try{x=JSON.stringify(y,null,2)}catch{}}}if(!d&&c.schema&&(d=c.schema),!x&&c.examples?.["application/json"]!==void 0)try{x=JSON.stringify(c.examples["application/json"],null,2)}catch{}l[p]={schema:d,example:x,description:g}}Object.keys(l).length>0&&s.set(ue(a,r),l)}return s}function Ss(e,s,n){const r=new Map,o=e?.paths??{};for(const[a,i]of Object.entries(o))for(const[u,l]of Object.entries(i??{})){if(!Ce.has(u.toLowerCase()))continue;const p=l;r.set(ue(u,a),jt(p?.security,n,s))}return r}function Is(e,s,n){const r=new Map,o=e?.paths??{};for(const a of Object.values(o))for(const[i,u]of Object.entries(a??{})){if(i==="parameters")continue;const l=u,p=l?.operationId?.trim();p&&r.set(p,jt(l?.security,n,s))}return r}function jt(e,s,n){return Nt(e!==void 0?e:s,n)}function As(e){const s=new Map,n=e?.paths??{};for(const r of Object.values(n))for(const[o,a]of Object.entries(r??{})){if(o==="parameters")continue;const i=a;if(!i?.requestBody)continue;const u=i.operationId?.trim();if(!u)continue;const l=i.requestBody;let p=null,c="application/json";if(l.content){const d=l.content["application/json"];if(d?.schema)p=d.schema;else{const x=Object.entries(l.content)[0];x&&(c=x[0],p=x[1]?.schema??null)}}s.set(u,{schema:p,contentType:c,required:l.required??!1})}return s}function Cs(e){const s=new Map,n=e?.paths??{};for(const r of Object.values(n)){const o=r.parameters??[];for(const[a,i]of Object.entries(r??{})){if(a==="parameters")continue;const u=i,l=u?.operationId?.trim();if(!l)continue;const c=[...o,...u.parameters??[]].filter(d=>d?.name).map(d=>({name:d.name??"",in:d.in??"query",required:d.required??!1,description:d.description??"",schema:d.schema??null}));c.length>0&&s.set(l,c)}}return s}function Es(e){const s=new Map,n=e?.paths??{};for(const r of Object.values(n))if(r)for(const[o,a]of Object.entries(r)){if(o==="parameters")continue;const i=a;if(!i)continue;const u=i.operationId?.trim();if(!u||!i.responses)continue;const l={};for(const[p,c]of Object.entries(i.responses)){if(!c)continue;let d=null,x=null;const g=c.content?.["application/json"];if(g){if(g.schema&&(d=g.schema),g.example!==void 0)try{x=JSON.stringify(g.example,null,2)}catch{}else if(g.examples){const b=Object.values(g.examples)[0]?.value;if(b!==void 0)try{x=JSON.stringify(b,null,2)}catch{}}}if(!d&&c.schema&&(d=c.schema),!x&&c.examples?.["application/json"]!==void 0)try{x=JSON.stringify(c.examples["application/json"],null,2)}catch{}l[p]={schema:d,example:x,description:c.description??null}}Object.keys(l).length>0&&s.set(u,l)}return s}function Nt(e,s){if(!e||e.length===0)return"none";const n=e.flatMap(r=>Object.keys(r));if(n.length===0)return"none";for(const r of n){const o=s[r];if(!o)continue;const a=(o.type||"").toLowerCase(),i=(o.scheme||"").toLowerCase();return a==="oauth2"?"oauth2":a==="apikey"?"api-key":a==="http"&&i==="bearer"?"bearer":"other"}return"other"}function Os({apiGroupVersions:e=[],selectedVersionId:s=null,onSelectedVersionIdChange:n,showServerControls:r=!1,openApiRuntime:o,baseUrl:a="",selectedEnv:i="production",fallbackBaseUrl:u="",selectedServerIndex:l="0",onServerIndexChange:p}){const c=f.useMemo(()=>e.map((g,b)=>{const y=g.versionNumber,N=y!=null?`v${y}`:g.label?.trim()||"Latest";return{value:g.versionId,label:N,isLatest:b===0}}),[e]),d=c.find(g=>g.isLatest)?.value,x=s??d??"";return c.length===0?r&&o?t.jsx("div",{className:"flex w-full flex-wrap items-center gap-2 border-b bg-[#141925] px-4 py-2",children:t.jsx(nt,{openApiRuntime:o,baseUrl:a,selectedEnv:i,fallbackBaseUrl:u,selectedServerIndex:l,onServerIndexChange:p})}):null:t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 border-b bg-[#141925] px-4 py-2",children:[t.jsx(Ms,{label:"Versions",value:x,options:c,onValueChange:g=>n?.(g)}),r&&o?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hidden h-5 w-px bg-[#2A3242] sm:block"}),t.jsx(nt,{openApiRuntime:o,baseUrl:a,selectedEnv:i,fallbackBaseUrl:u,selectedServerIndex:l,onServerIndexChange:p})]}):null]})})}function Ms({label:e,value:s,options:n,onValueChange:r}){return t.jsxs(Ve,{value:s,onValueChange:r,children:[t.jsxs(Be,{className:"border-stock h-8 min-w-[9rem] gap-2 rounded-full bg-[#141925] px-3 text-xs shadow-none",children:[t.jsx("span",{className:"text-[#828DA3]",children:e}),t.jsx("span",{className:"max-w-[8rem] truncate font-medium",children:t.jsx(_e,{placeholder:`Select ${e}`})})]}),t.jsx(Ue,{children:n.map(o=>t.jsx(ge,{value:o.value,children:t.jsxs("span",{className:"flex items-center gap-2",children:[o.label,o.isLatest?t.jsx(fe,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"Latest"}):null]})},o.value))})]})}function nt({openApiRuntime:e,baseUrl:s,selectedEnv:n,fallbackBaseUrl:r,selectedServerIndex:o,onServerIndexChange:a}){const i=f.useMemo(()=>{const l=e.servers;return l.length?l.map((p,c)=>{const d=e.resolveServerUrl(p,n,r),x=p.description?.trim()||null;return{value:String(c),url:d,description:x}}):[{value:"0",url:s||r||"No server configured",description:null}]},[s,r,e,n]),u=i.find(l=>l.value===o)??i[0];return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsxs(Ve,{value:o,onValueChange:a,children:[t.jsxs(Be,{className:"border-stock h-8 max-w-[28rem] min-w-[18rem] gap-2 rounded-full bg-[#141925] px-3 text-xs shadow-none [&_[data-slot=select-value]]:hidden",children:[t.jsx("span",{className:"shrink-0 text-[#828DA3]",children:"Servers"}),t.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:u?.url??"Select server"}),t.jsx(_e,{})]}),t.jsx(Ue,{className:"max-w-[32rem]",children:i.map(l=>t.jsx(ge,{value:l.value,textValue:l.url,title:l.description?`${l.url} — ${l.description}`:l.url,children:t.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[t.jsx("span",{className:"truncate font-medium",children:l.url}),l.description?t.jsx("span",{className:"truncate text-[11px] text-[#828DA3]",children:l.description}):null]})},l.value))})]}),t.jsxs(oe,{variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5 px-2.5 text-xs",onClick:()=>void Ls(s),disabled:!s,children:[t.jsx(Ae,{className:"h-3.5 w-3.5"}),"Copy"]}),t.jsxs("span",{className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full border border-[#2A3242] px-3 text-xs text-[#828DA3]",children:[e.hasSecuritySchemes?t.jsx(os,{className:"h-3.5 w-3.5"}):t.jsx(ns,{className:"h-3.5 w-3.5"}),e.hasSecuritySchemes?"Auth required":"No auth"]})]})})}async function Ls(e){if(e)try{await navigator.clipboard.writeText(e),be.success("Server URL copied")}catch{be.error("Failed to copy")}}function wt(e){switch(e){case"string":return"text-emerald-400";case"integer":case"number":return"text-sky-400";case"boolean":return"text-amber-400";case"array":return"text-purple-400";case"object":return"text-orange-400";default:return"text-muted-foreground"}}function de({name:e,schema:s,isRequired:n,depth:r=0,showRequired:o=!0}){const[a,i]=f.useState(r<2),u=s.properties||s.items||s.allOf||s.oneOf||s.anyOf,l=s.type?s.type+(s.format?` (${s.format})`:""):s.$ref?s.$ref.split("/").pop()??"$ref":"unknown";return t.jsxs("div",{className:z(r>0&&"ml-4 border-l border-[#2A3242] pl-1"),children:[t.jsxs("div",{className:z("flex items-center gap-2 rounded-md px-3 py-1.5",u&&"cursor-pointer hover:bg-[#1E2533]"),onClick:()=>u&&i(!a),children:[u?a?t.jsx(mt,{className:"h-3.5 w-3.5 shrink-0 text-[#586378]"}):t.jsx(Yt,{className:"h-3.5 w-3.5 shrink-0 text-[#586378]"}):null,t.jsx("span",{className:"text-sm font-medium text-[#F4F7FC]",children:e}),t.jsx("span",{className:z("font-mono text-xs",wt(s.type)),children:l}),o&&n&&t.jsx("span",{className:"rounded bg-red-500/15 px-1.5 py-px text-[10px] leading-4 font-medium text-red-400 ring-1 ring-red-500/30",children:"required"}),s.example!==void 0&&t.jsxs("span",{className:"text-muted-foreground ml-auto text-xs",children:["e.g."," ",t.jsx("code",{className:"rounded bg-[#1E2533] px-1 py-0.5 text-[10px]",children:typeof s.example=="string"?s.example:JSON.stringify(s.example)})]})]}),a&&u&&t.jsxs("div",{className:"pl-1",children:[s.properties&&Object.entries(s.properties).map(([p,c])=>t.jsx(de,{name:p,schema:c,isRequired:s.required?.includes(p)??!1,depth:r+1,showRequired:o},p)),s.items&&t.jsx(de,{name:"[items]",schema:s.items,isRequired:!1,depth:r+1,showRequired:o}),s.allOf?.map((p,c)=>t.jsx(de,{name:`allOf[${c}]`,schema:p,isRequired:!1,depth:r+1,showRequired:o},`allOf-${c}`)),s.oneOf?.map((p,c)=>t.jsx(de,{name:`oneOf[${c}]`,schema:p,isRequired:!1,depth:r+1,showRequired:o},`oneOf-${c}`)),s.anyOf?.map((p,c)=>t.jsx(de,{name:`anyOf[${c}]`,schema:p,isRequired:!1,depth:r+1,showRequired:o},`anyOf-${c}`))]})]})}function ke({schema:e,showRequired:s=!0}){return!e.properties&&!e.items&&!e.allOf?t.jsxs("div",{className:"text-muted-foreground py-2 text-xs",children:["Type:"," ",t.jsx("span",{className:wt(e.type),children:e.type||"unknown"}),e.format&&t.jsxs("span",{children:[" (",e.format,")"]})]}):t.jsxs("div",{className:"rounded-lg border border-[#2A3242] bg-[#141925] p-2",children:[e.properties&&Object.entries(e.properties).map(([n,r])=>t.jsx(de,{name:n,schema:r,isRequired:e.required?.includes(n)??!1,depth:0,showRequired:s},n)),e.items&&t.jsx(de,{name:"[items]",schema:e.items,isRequired:!1,depth:0,showRequired:s}),e.allOf?.map((n,r)=>t.jsx(de,{name:`allOf[${r}]`,schema:n,isRequired:!1,depth:0,showRequired:s},`allOf-${r}`))]})}function Ds(){const{apiEndpoints:e,protocol:s,graphQLOperations:n,isGraphQLLoading:r,grpcMethods:o,isGrpcLoading:a,selectedVersionId:i,setSelectedVersionId:u,apiGroupVersions:l,deleteServiceApiEndpoint:p,serviceId:c,apiGroup:d}=bt(),x=Ge()?.id,g=d?.serviceApiGroupId??"",[b,y]=gt("endpointId",xt),[N,E]=f.useState(""),[v,A]=Ie(`${c}:apis-auth`,"all"),[M,w]=Ie(`${c}:apis-method`,"all"),[q]=Ie(`${c}:apis-groupby`,"tags"),[F,Q]=Ie(`${c}:apis-optype`,"all"),[O,K]=f.useState(null),[J,V]=f.useState("0"),R=f.useRef(void 0);f.useEffect(()=>{if(V("0"),R.current===void 0){R.current=i;return}R.current!==i&&(R.current=i,y(null))},[i,y]);const[D,ie]=f.useState(N);f.useEffect(()=>{const m=setTimeout(()=>ie(N),250);return()=>clearTimeout(m)},[N]),f.useEffect(()=>{const m=(s||"").toLowerCase();if(!(m==="rest"||m==="openapi"||m==="swagger")||!g||!x){K(null);return}let j=!1;async function P(){try{const{data:T}=await at.query({query:yt,variables:{orgId:x,serviceId:c,apiGroupId:g,versionId:i},fetchPolicy:"cache-first"}),_=T?.apiGroupSpec?.content;if(_==null)return;let U=null;try{U=JSON.parse(_)}catch{U=(await Kt(()=>import("./js-yaml-3VEnDAEN.js"),[])).load(_)}!j&&U&&typeof U=="object"&&K(U)}catch{j||K(null)}}return P(),()=>{j=!0}},[s,x,c,g,i]);const le=s==="graphql",xe=s==="grpc",C=f.useMemo(()=>gs(O),[O]),L=C.defaultEnv??"production",S=f.useMemo(()=>e.map(m=>{const h=se(m.componentMeta?.componentModalFields),j=pe(h,h),P=$(j,h,["url"])??"",T=hs(P,C.basePath),_=($(j,h,["method"])??"GET").toUpperCase(),U=$(j,h,["summary","label"])??"",X=$(j,h,["operation id","operationid"])??m.apiEndpoint?.apiEndpointId??"",ne=_s($(j,h,["tags"])),re=$(j,h,["authentication"]),Ee=$(j,h,["protocol"])??"REST",H=$(j,h,["api source type"]),Ke=m.apiEndpoint?.apiEndpointId??X;return{selectionKey:X||Ke,endpointId:Ke,apiEndpoint:m.apiEndpoint,componentMeta:m.componentMeta,method:_,path:T,fullUrl:P,summary:U,operationId:X,tags:ne,auth:Us(re),protocol:Ee,requestSchema:$(j,h,["request schema"]),responseSchema:$(j,h,["response schema"]),statusCodes:$(j,h,["status codes"]),parameters:$(j,h,["parameters"]),description:$(j,h,["notes","description"]),requestExample:$(j,h,["request example"]),sourceType:H}}),[e,C]),I=f.useMemo(()=>{const m=S.find(j=>j.fullUrl.toLowerCase().startsWith("http"));if(!m)return"";if(!m.path||m.path==="/")return m.fullUrl;const h=m.fullUrl.indexOf(m.path);return h>0?m.fullUrl.slice(0,h):m.fullUrl},[S]),G=f.useMemo(()=>{const m=C.servers[Number(J)]??C.defaultServer;return C.resolveServerUrl(m,L,I)},[I,C,L,J]),Y=f.useMemo(()=>{if(!D&&v==="all"&&M==="all")return S;const m=D.toLowerCase();return S.filter(h=>{const j=!m||h.path.toLowerCase().includes(m)||h.method.toLowerCase().includes(m)||h.summary.toLowerCase().includes(m)||h.operationId.toLowerCase().includes(m)||h.tags.some(U=>U.toLowerCase().includes(m)),P=M==="all"||h.method===M,T=C.hasSecuritySchemes?C.operationAuth(h.operationId):h.auth;return j&&P&&(v==="all"||T===v)})},[v,D,M,C,S]),ee=f.useMemo(()=>{if(q==="none")return[{group:"All Endpoints",endpoints:Y}];const m=new Map;for(const h of Y){const j=h.tags.length>0?h.tags:["Ungrouped"];for(const P of j)m.has(P)||m.set(P,[]),m.get(P).push(h)}return Array.from(m.entries()).sort(([h],[j])=>h.localeCompare(j)).map(([h,j])=>({group:h,endpoints:j}))},[Y,q]),te=f.useMemo(()=>{const m=b;return m?S.find(h=>h.selectionKey===m||h.operationId===m||h.endpointId===m)??null:null},[b,S]),B=f.useMemo(()=>{const m=b;return m?n.find(h=>h.apiEndpoint.apiEndpointId===m)??null:null},[n,b]),W=f.useMemo(()=>{const m=b;return m?o.find(h=>h.apiEndpoint.apiEndpointId===m)??null:null},[o,b]);f.useEffect(()=>{if(!b)return;(te??B??W)||y(null)},[b,B,W,te,y]);const Z=f.useMemo(()=>n.filter(m=>{const h=se(m.componentMeta.componentModalFields),j=pe(h,h),P=h.find(H=>H?.label?.toLowerCase()==="name"),T=h.find(H=>H?.label?.toLowerCase()==="graphql operation type"||H?.label?.toLowerCase()==="operation type"||H?.label?.toLowerCase()==="kind"),_=h.find(H=>H?.label?.toLowerCase()==="signature"),U=P?.componentFieldId?j[P.componentFieldId]:"",X=T?.componentFieldId?j[T.componentFieldId]:"",ne=_?.componentFieldId?j[_.componentFieldId]:"";return(!D||U?.toLowerCase().includes(D.toLowerCase())||ne?.toLowerCase().includes(D.toLowerCase()))&&(F==="all"||X===F)}),[n,D,F]),k=f.useMemo(()=>{const m=new Map;return o.forEach(h=>{const j=se(h.componentMeta.componentModalFields),P=pe(j,j),T=j.find(re=>re?.label?.toLowerCase()==="package name"),_=j.find(re=>re?.label?.toLowerCase()==="grpc service name"||re?.label?.toLowerCase()==="service name"),U=T?.componentFieldId?P[T.componentFieldId]:"",X=_?.componentFieldId?P[_.componentFieldId]:"",ne=U?`${U}.${X}`:X||"Unknown";m.has(ne)||m.set(ne,[]),m.get(ne).push(h)}),Array.from(m.entries()).map(([h,j])=>({serviceKey:h,methods:j.filter(P=>{const T=se(P.componentMeta.componentModalFields),_=pe(T,T),U=T.find(H=>H?.label?.toLowerCase()==="grpc method name"||H?.label?.toLowerCase()==="method name"),X=T.find(H=>H?.label?.toLowerCase()==="grpc service name"||H?.label?.toLowerCase()==="service name"),ne=U?.componentFieldId?_[U.componentFieldId]:"",re=X?.componentFieldId?_[X.componentFieldId]:"";return!D||ne?.toLowerCase().includes(D.toLowerCase())||re?.toLowerCase().includes(D.toLowerCase())})}))},[o,D]);return t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsx(Os,{apiGroupVersions:l,selectedVersionId:i,onSelectedVersionIdChange:u,showServerControls:!le&&!xe,openApiRuntime:C,baseUrl:G,selectedEnv:L,fallbackBaseUrl:I,selectedServerIndex:J,onServerIndexChange:V}),r||a?t.jsx("div",{className:"flex h-[400px] items-center justify-center px-6 py-4",children:t.jsx(Ht,{})}):le?t.jsxs("div",{className:"rest-endpoints-shell grid min-h-0 flex-1 xl:grid-cols-[264px_minmax(0,1fr)]",children:[t.jsxs("aside",{className:"rest-endpoints-sidebar overflow-y-auto border-r",children:[t.jsxs("div",{className:"space-y-2 border-b p-3",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Le,{className:"absolute top-1/2 left-3 h-3.5 w-3.5 -translate-y-1/2 text-[#828DA3]"}),t.jsx(Me,{value:N,onChange:m=>E(m.target.value),placeholder:"Search operations...",className:"border-stock h-8! !rounded-[0.65rem] bg-[#1E2533] pl-8 text-xs shadow-none","aria-label":"Search operations"})]}),t.jsxs(Ve,{value:F,onValueChange:Q,children:[t.jsx(Be,{className:"border-stock h-8! w-full !rounded-[0.65rem] bg-[#1E2533]! text-xs shadow-none",children:t.jsx(_e,{placeholder:"All Types"})}),t.jsxs(Ue,{children:[t.jsx(ge,{value:"all",children:"All Types"}),t.jsx(ge,{value:"Query",children:"Query"}),t.jsx(ge,{value:"Mutation",children:"Mutation"}),t.jsx(ge,{value:"Subscription",children:"Subscription"})]})]})]}),t.jsx("div",{className:"space-y-1 px-3 py-3",children:Z.length===0?t.jsxs("div",{className:"rest-endpoints-empty rounded-[14px] border border-dashed px-4 py-6 text-center text-sm",children:[t.jsx("p",{className:"mb-2 text-[#828DA3]",children:"No operations match these filters"}),t.jsx(oe,{variant:"link",onClick:()=>{E(""),Q("all")},className:"h-auto p-0 text-[#3B82F6]",children:"Clear filters"})]}):Z.map(m=>t.jsx(Rs,{operation:m,selected:B?.apiEndpoint.apiEndpointId===m.apiEndpoint.apiEndpointId,onSelect:()=>void y(m.apiEndpoint.apiEndpointId)},m.apiEndpoint.apiEndpointId))})]}),t.jsx("main",{className:"min-w-0 overflow-y-auto p-4",children:B?t.jsx(Vs,{operation:B,onClose:()=>void y(null)}):t.jsx("div",{className:"rest-endpoints-empty flex h-full items-center justify-center rounded-[16px] border border-dashed p-10 text-sm",children:"Select an operation to view its details"})})]}):xe?t.jsxs("div",{className:"rest-endpoints-shell grid min-h-0 flex-1 xl:grid-cols-[264px_minmax(0,1fr)]",children:[t.jsxs("aside",{className:"rest-endpoints-sidebar overflow-y-auto border-r",children:[t.jsx("div",{className:"border-b p-3",children:t.jsxs("div",{className:"relative",children:[t.jsx(Le,{className:"absolute top-1/2 left-3 h-3.5 w-3.5 -translate-y-1/2 text-[#828DA3]"}),t.jsx(Me,{value:N,onChange:m=>E(m.target.value),placeholder:"Search methods...",className:"border-stock h-8! !rounded-[0.65rem] bg-[#1E2533] pl-8 text-xs shadow-none","aria-label":"Search methods"})]})}),t.jsx("div",{className:"py-3",children:k.every(m=>m.methods.length===0)?t.jsxs("div",{className:"rest-endpoints-empty mx-3 rounded-[14px] border border-dashed px-4 py-6 text-center text-sm",children:[t.jsx("p",{className:"mb-2 text-[#828DA3]",children:"No methods match these filters"}),t.jsx(oe,{variant:"link",onClick:()=>E(""),className:"h-auto p-0 text-[#3B82F6]",children:"Clear filters"})]}):k.map(({serviceKey:m,methods:h})=>h.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsx("div",{className:"rest-endpoints-section-label px-5 pb-1 text-[11px] font-medium tracking-wide uppercase",children:m}),t.jsx("div",{className:"space-y-1 px-3",children:h.map(j=>t.jsx(ks,{method:j,selected:W?.apiEndpoint.apiEndpointId===j.apiEndpoint.apiEndpointId,onSelect:()=>void y(j.apiEndpoint.apiEndpointId)},j.apiEndpoint.apiEndpointId))})]},m))})]}),t.jsx("main",{className:"min-w-0 overflow-y-auto p-4",children:W?t.jsx(Bs,{method:W,onClose:()=>void y(null)}):t.jsx("div",{className:"rest-endpoints-empty flex h-full items-center justify-center rounded-[16px] border border-dashed p-10 text-sm",children:"Select a method to view its details"})})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"rest-endpoints-shell grid min-h-0 flex-1 xl:grid-cols-[264px_minmax(0,1fr)]",children:[t.jsxs("aside",{className:"rest-endpoints-sidebar overflow-y-auto border-r",children:[t.jsx("div",{className:"border-b p-3",children:t.jsxs("div",{className:"relative",children:[t.jsx(Le,{className:"absolute top-1/2 left-3 h-3.5 w-3.5 -translate-y-1/2 text-[#828DA3]"}),t.jsx(Me,{value:N,onChange:m=>E(m.target.value),placeholder:"Search endpoints...",className:"border-stock h-8! !rounded-[0.65rem] bg-[#1E2533] pl-8 text-xs shadow-none","aria-label":"Search endpoints"})]})}),t.jsx("div",{className:"space-y-4 px-3 py-3",children:Y.length===0?t.jsxs("div",{className:"rest-endpoints-empty rounded-[14px] border border-dashed px-4 py-6 text-center text-sm",children:[t.jsx("p",{className:"mb-2 text-[#828DA3]",children:"No endpoints match these filters"}),t.jsx(oe,{variant:"link",onClick:()=>{E(""),A("all"),w("all")},className:"h-auto p-0 text-[#3B82F6]",children:"Clear filters"})]}):ee.map(m=>t.jsxs("div",{className:"space-y-1",children:[q==="tags"&&t.jsxs("div",{className:"rest-endpoints-section-label flex items-center justify-between px-2 text-[11px] font-medium tracking-wide uppercase",children:[t.jsx("span",{children:m.group}),t.jsx("span",{className:"tabular-nums",children:m.endpoints.length})]}),m.endpoints.map(h=>t.jsx(Fs,{endpoint:h,selected:te?.selectionKey===h.selectionKey,onSelect:()=>void y(h.selectionKey),baseUrl:G,readonly:!0,onDelete:async()=>{!h.endpointId||i!==null||(await p({variables:{organizationId:x,apiEndpointId:h.endpointId}}),be.success("API endpoint deleted successfully"))}},h.endpointId))]},m.group))})]}),t.jsx("main",{className:"min-w-0 overflow-y-auto p-4",children:te?t.jsx($s,{endpoint:te,baseUrl:G,openApiRuntime:C,onClose:()=>void y(null)}):t.jsx("div",{className:"rest-endpoints-empty flex h-full items-center justify-center rounded-[16px] border border-dashed p-10 text-sm",children:"Select an endpoint to view its details"})})]})}),t.jsx("style",{children:`
|
|
63
63
|
.rest-endpoints-shell {
|
|
64
64
|
flex: 1;
|
|
65
65
|
min-height: 0;
|
|
@@ -97,11 +97,11 @@ import{r as f,a0 as At,a1 as Ct,a2 as Ke,a3 as Et,a4 as Ot,a5 as he,a6 as Mt,a7
|
|
|
97
97
|
.rest-nav-button-inactive:hover {
|
|
98
98
|
background: var(--secondary);
|
|
99
99
|
}
|
|
100
|
-
`})]})}function Fs({endpoint:e,selected:s,onSelect:n,baseUrl:r,readonly:o,onDelete:a}){return t.jsxs("div",{onClick:n,className:`rest-nav-button group flex w-full cursor-pointer items-center gap-2 px-3 py-2.5 text-left transition ${s?"rest-nav-button-active":"rest-nav-button-inactive"}`,children:[t.jsx(Wt,{method:e.method,className:"min-w-14 shrink-0 py-0.5 text-[10px]"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"truncate font-mono text-xs font-semibold text-[#F4F7FC]",children:e.path}),e.summary&&t.jsx("div",{className:"truncate text-[10px] text-[#828DA3]",children:e.summary})]}),t.jsx("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",onClick:i=>i.stopPropagation(),children:t.jsxs(Zt,{children:[t.jsx(Xt,{asChild:!0,children:t.jsx(
|
|
101
|
-
`).replace(/\\t/g," ")}function Ts(e){return ke(JSON.stringify(e,null,2))}function St({name:e,value:s,depth:n}){const[r,o]=f.useState(n<2),a=s!==null&&typeof s=="object",i=Array.isArray(s),u=a?i?s.map((x,g)=>[String(g),x]):Object.entries(s):[],l=a&&u.length>0,p=s===null?"null":i?"array":a?"object":typeof s,c=p==="string"?`"${String(s)}"`:s===null?"null":String(s),d=p==="string"?"text-green-400":p==="number"?"text-blue-400":p==="boolean"?"text-amber-400":"text-[#828DA3]";return t.jsxs("div",{className:B(n>0&&"ml-4 border-l border-[#2A3242]"),children:[t.jsxs("div",{className:B("flex items-baseline gap-2 px-3 py-1.5",l&&"cursor-pointer select-none hover:bg-[#1E2533]"),onClick:()=>l&&o(x=>!x),children:[l?t.jsx(mt,{className:B("h-3 w-3 shrink-0 text-[#586378] transition-transform",!r&&"-rotate-90")}):t.jsx("span",{className:"w-3 shrink-0"}),t.jsx("span",{className:"font-mono text-xs font-medium text-[#F4F7FC]",children:e}),l?t.jsx("span",{className:"font-mono text-[10px] text-[#828DA3]",children:p}):t.jsx("span",{className:B("font-mono text-xs",d),children:c})]}),l&&r&&t.jsx("div",{children:u.map(([x,g])=>t.jsx(St,{name:x,value:g,depth:n+1},x))})]})}function qs({data:e}){if(e==null)return t.jsx("div",{className:"text-muted-foreground px-3 py-2 text-xs",children:"No payload defined"});if(typeof e!="object")return t.jsx("pre",{className:"overflow-x-auto px-3 py-2.5 font-mono text-xs text-[#C9D1D9]",children:String(e)});const s=Array.isArray(e)?e.map((n,r)=>[String(r),n]):Object.entries(e);return s.length===0?t.jsx("div",{className:"text-muted-foreground px-3 py-2 font-mono text-xs",children:Array.isArray(e)?"[]":"{}"}):t.jsx("div",{className:"rounded-md border border-[#2A3242] bg-[#141925] py-1",children:s.map(([n,r])=>t.jsx(St,{name:n,value:r,depth:0},n))})}function je({label:e,raw:s}){const n=f.useMemo(()=>{try{return JSON.parse(s)}catch{return null}},[s]),r=n&&typeof n=="object"&&!Array.isArray(n)&&typeof n.query=="string"?ke(n.query):null,o=f.useMemo(()=>n===null?null:n&&typeof n=="object"&&!Array.isArray(n)&&"data"in n?n.data:n,[n]),a=f.useMemo(()=>n!==null?Ts(n):ke(s),[n,s]);return t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:e}),n!==null&&Ps(n)?t.jsx("div",{className:"rounded-md border border-[#2A3242]",children:t.jsx(Re,{schema:n,showRequired:!1})}):r?t.jsx("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-[#C9D1D9]",children:r}):n!==null?t.jsx(qs,{data:o}):t.jsx("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs leading-relaxed text-[#C9D1D9]",children:a})]})}function oe(e,s,n=new Set,r=0){if(r>8)return e;if(e.$ref){if(n.has(e.$ref))return{type:"object"};const a=s(e.$ref);if(a){const i=new Set(n);return i.add(e.$ref),oe(a,s,i,r+1)}return e}const o={...e};return e.properties&&(o.properties=Object.fromEntries(Object.entries(e.properties).map(([a,i])=>[a,oe(i,s,n,r+1)]))),e.items&&(o.items=oe(e.items,s,n,r+1)),e.allOf&&(o.allOf=e.allOf.map(a=>oe(a,s,n,r+1))),e.oneOf&&(o.oneOf=e.oneOf.map(a=>oe(a,s,n,r+1))),e.anyOf&&(o.anyOf=e.anyOf.map(a=>oe(a,s,n,r+1))),o}function me(e,s=0,n){if(!e||s>6)return null;if(e.$ref&&n){const a=n(e.$ref);return a?me(a,s+1,n):{}}if(e.$ref)return{};if(e.example!==void 0)return e.example;if(e.enum)return e.enum[0]??null;for(const a of["allOf","anyOf","oneOf"]){const i=e[a];if(Array.isArray(i)&&i.length>0){if(a==="allOf"){const u={};for(const l of i){const p=l.$ref&&n?n(l.$ref)??l:l;Object.assign(u,p)}return me(u,s+1,n)}return me(i[0],s+1,n)}}const r=e.type;if(r==="object"||e.properties){const a=e.properties??{},i={};for(const[u,l]of Object.entries(a))i[u]=me(l,s+1,n);return i}if(r==="array"||e.items){const a=e.items??{};return[me(a,s+1,n)]}const o=e.format;switch(r){case"string":return o==="email"?"user@example.com":o==="date-time"?"2024-01-01T00:00:00Z":o==="date"?"2024-01-01":o==="password"?"********":o==="uuid"?"00000000-0000-0000-0000-000000000000":o==="uri"?"https://example.com":"string";case"integer":return 0;case"number":return 0;case"boolean":return!0;default:return null}}function rt(e){return e.startsWith("2")?"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/30":e.startsWith("3")?"bg-sky-500/15 text-sky-400 ring-1 ring-sky-500/30":e.startsWith("4")?"bg-amber-500/15 text-amber-400 ring-1 ring-amber-500/30":e.startsWith("5")?"bg-red-500/15 text-red-400 ring-1 ring-red-500/30":"bg-[#1E2533] text-[#D2D9E6] ring-1 ring-[#2A3242]"}function Gs({endpoint:e,responses:s,openApiRuntime:n}){const[r,o]=f.useState(null),[a,i]=f.useState("schema"),[u,l]=f.useState({});function p(I){return u[I]??"schema"}function c(I,P){l(F=>({...F,[I]:P}))}const d=n?n.operationAuthByPath(e.method,e.path):e.auth,x=n?.operationRequestBodyByPath(e.method,e.path)??null,g=n?.operationParametersByPath(e.method,e.path)??[],b=g.filter(I=>I.in==="path"),j=g.filter(I=>I.in==="query"),S=g.filter(I=>I.in==="header"),E=n?I=>n.resolveRef(I):void 0,w=x?.schema,A=w&&E?oe(w,E):w,M=A?JSON.stringify(me(A,0,E),null,2):null;return t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:B("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium ring-1",d==="none"?"bg-[#1E2533] text-[#828DA3] ring-[#2A3242]":"bg-amber-500/15 text-amber-400 ring-amber-500/30"),children:[d==="none"?t.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M5.5 5a2.5 2.5 0 0 1 5 0H12V4a4 4 0 0 0-8 0v1h1.5Zm-3 2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H2.5Z"})}):t.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M8 1a4 4 0 0 0-4 4v1H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-1V5a4 4 0 0 0-4-4Zm2.5 5H5.5V5a2.5 2.5 0 0 1 5 0v1Z"})}),Qs(d)]}),e.description&&t.jsx("span",{className:"text-xs text-[#828DA3]",children:e.description})]}),b.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Path Parameters"}),t.jsx(Fe,{params:b})]}),j.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Query Parameters"}),t.jsx(Fe,{params:j})]}),S.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Headers"}),t.jsx(Fe,{params:S})]}),x&&t.jsxs("section",{children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h4",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Request Body"}),t.jsxs("span",{className:"text-[10px] text-[#586378]",children:[x.contentType,x.required?" · required":" · optional"]})]}),M&&t.jsxs("div",{className:"flex items-center rounded-md border border-[#2A3242] text-[10px]",children:[t.jsx("button",{type:"button",onClick:()=>i("example"),className:B("rounded-l-md px-2 py-1 transition",a==="example"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Example"}),t.jsx("button",{type:"button",onClick:()=>i("schema"),className:B("rounded-r-md px-2 py-1 transition",a==="schema"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Schema"})]})]}),a==="example"&&M?t.jsxs("div",{className:"relative",children:[t.jsx("button",{type:"button",className:"absolute top-2 right-2 text-[#828DA3] hover:text-[#D2D9E6]",onClick:()=>void Ne(M,"Example copied"),children:t.jsx(Ie,{className:"h-3 w-3"})}),t.jsx("pre",{className:"overflow-x-auto rounded-lg bg-[#1E2533] p-3 font-mono text-[11px] leading-relaxed text-[#D2D9E6]",children:M})]}):A?t.jsx(Re,{schema:A}):t.jsx("p",{className:"text-xs text-[#586378]",children:"No schema defined."})]}),s.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Responses"}),t.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:s.map(([I,P])=>{const F=n?.operationResponsesByPath(e.method,e.path)[I]?.description??"",V=P||F;return t.jsxs("button",{type:"button",onClick:()=>o(r===I?null:I),className:B("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium transition",rt(I),r===I&&"opacity-100",r!==null&&r!==I&&"opacity-50"),children:[t.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),I,V?` — ${V}`:""]},I)})}),t.jsx("div",{className:"space-y-2",children:s.map(([I,P])=>{const F=n?.operationResponsesByPath(e.method,e.path)[I],V=P||F?.description||"";if(!(r===I||r===null))return null;const J=F?.schema??null,_=J&&E?oe(J,E):J,T=F?.example??(_?JSON.stringify(me(_,0,E),null,2):null),R=_||T,L=p(I);return t.jsxs("div",{className:"rounded-lg border border-[#2A3242] bg-[#141925]",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[#2A3242] px-3 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:B("rounded-full px-2 py-0.5 text-xs font-semibold",rt(I)),children:I}),V&&t.jsx("span",{className:"text-xs text-[#D2D9E6]",children:V})]}),R&&t.jsxs("div",{className:"flex items-center rounded-md border border-[#2A3242] text-[10px]",children:[t.jsx("button",{type:"button",onClick:()=>c(I,"example"),className:B("rounded-l-md px-2 py-1 transition",L==="example"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Example"}),t.jsx("button",{type:"button",onClick:()=>c(I,"schema"),className:B("rounded-r-md px-2 py-1 transition",L==="schema"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Schema"})]})]}),R?L==="example"&&T?t.jsxs("div",{className:"relative px-3 py-3",children:[t.jsx("button",{type:"button",className:"absolute top-5 right-5 text-[#828DA3] hover:text-[#D2D9E6]",onClick:()=>void Ne(T,"Example copied"),children:t.jsx(Ie,{className:"h-3 w-3"})}),t.jsx("pre",{className:"overflow-x-auto rounded-lg bg-[#1E2533] p-3 font-mono text-[11px] leading-relaxed text-[#D2D9E6]",children:T})]}):_?t.jsx("div",{className:"px-3 py-3",children:t.jsx(Re,{schema:_,showRequired:!1})}):null:t.jsx("p",{className:"px-3 py-3 text-xs text-[#586378]",children:"No schema defined."})]},I)})})]})]})}function Fe({params:e}){return t.jsx("div",{className:"overflow-hidden rounded-lg border border-[#2A3242] bg-[#141925]",children:e.map((s,n)=>{const r=s.schema?.type??s.schema?.$ref?.split("/").pop()??"string";return t.jsxs("div",{className:B("flex flex-wrap items-baseline gap-x-2 gap-y-1 px-3 py-2.5 text-sm",n<e.length-1&&"border-b border-[#2A3242]"),children:[t.jsx("span",{className:"font-mono font-semibold text-[#F4F7FC]",children:s.name}),t.jsx("span",{className:"font-mono text-xs text-[#828DA3]",children:r}),s.required?t.jsx("span",{className:"rounded bg-red-500/15 px-1.5 py-0.5 text-[10px] font-medium text-red-400 ring-1 ring-red-500/30",children:"required"}):t.jsx("span",{className:"text-[10px] text-[#586378]",children:"optional"}),s.description&&t.jsx("span",{className:"w-full text-xs text-[#828DA3]",children:s.description})]},`${s.in}-${s.name}`)})})}function $s({endpoint:e,baseUrl:s,openApiRuntime:n,onClose:r}){const o=Ks(e.statusCodes),a=n?n.operationResponsesByPath(e.method,e.path):{},i=Object.keys(a),u=i.length>0?i.map(c=>{const d=o.find(([x])=>x===c);return d||[c,a[c]?.description??""]}):o,l=e.apiEndpoint.updatedAt||e.apiEndpoint.createdAt,p=Qe(s||Js(e.fullUrl,e.path),e.path);return t.jsxs("div",{className:"flex w-full flex-col overflow-hidden rounded-lg border bg-[#141925]",children:[t.jsxs("div",{className:"flex items-start justify-between border-b bg-[#141925] px-4 py-3",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("h3",{className:"font-mono text-sm font-semibold",children:[e.method," ",e.path]}),s&&t.jsx("p",{className:"text-muted-foreground text-xs",children:p}),t.jsx("p",{className:"text-muted-foreground mt-1 text-[11px]",children:l?`Updated ${new Date(l).toLocaleString()}`:null})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>void Ne(p,"URL copied"),disabled:!s,children:[t.jsx(Ie,{className:"h-3.5 w-3.5"}),"Copy URL"]}),t.jsx(Ge,{onClick:r})]})]}),t.jsx("div",{className:"space-y-4 px-4 py-4",children:t.jsx(Gs,{endpoint:e,responses:u,openApiRuntime:n})})]})}function Vs({operation:e,onClose:s}){const n=f.useMemo(()=>ee(e.componentMeta.componentModalFields),[e.componentMeta.componentModalFields]),r=f.useMemo(()=>ie(n,n),[n]),o=n.find(S=>S?.label?.toLowerCase()==="name"),a=n.find(S=>S?.label?.toLowerCase()==="graphql operation type"||S?.label?.toLowerCase()==="operation type"||S?.label?.toLowerCase()==="kind"),i=n.find(S=>S?.label?.toLowerCase()==="description"||S?.label?.toLowerCase()==="summary"),u=o?.componentFieldId?r[o.componentFieldId]:"N/A",l=q(r,n,["signature"]),p=a?.componentFieldId?r[a.componentFieldId]:"Query",c=i?.componentFieldId?r[i.componentFieldId]:void 0,d=q(r,n,["request schema"]),x=q(r,n,["response schema"]),g=q(r,n,["parameters"]),b=e.apiEndpoint.updatedAt||e.apiEndpoint.createdAt,j=f.useMemo(()=>{if(!l)return null;const S=l.match(/\(([^)]*)\)/),E=l.match(/\):\s*(.+)$/),w=S?.[1]?S[1].split(",").map(M=>M.trim()).filter(Boolean).map(M=>{const[I,P]=M.split(":").map(F=>F.trim());return{name:I,type:P}}):[],A=E?.[1]?.trim()??null;return{args:w,returnType:A}},[l]);return t.jsxs(vt,{topOffset:164,bottomOffset:12,className:"sticky top-3 w-full overflow-y-auto rounded-lg border bg-[#141925]",children:[t.jsxs("div",{className:"sticky top-0 z-10 border-b bg-[#141925] px-4 py-3",children:[t.jsxs("div",{className:"mb-1 flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${Pe(p)} shrink-0 text-white`,children:p}),t.jsx("h3",{className:"truncate font-mono text-sm font-semibold",children:u})]}),l&&t.jsx("p",{className:"text-muted-foreground mt-1 truncate font-mono text-xs",children:l})]}),t.jsx(Ge,{onClick:s})]}),t.jsx("p",{className:"text-muted-foreground text-[11px]",children:b?`Updated ${new Date(b).toLocaleString()}`:null})]}),t.jsx("div",{className:"space-y-4 px-4 py-4",children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${Pe(p)} text-white`,children:p}),t.jsx("span",{className:"font-mono text-sm font-semibold text-[#F4F7FC]",children:u})]}),c&&t.jsx("p",{className:"text-sm text-[#A0ADBE]",children:c}),l&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Signature"}),t.jsxs("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs text-[#C9D1D9]",children:[p.toLowerCase()," ",l]})]}),j&&j.args.length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Arguments"}),t.jsx("div",{className:"divide-y divide-[#2A3242] rounded-md border border-[#2A3242]",children:j.args.map((S,E)=>t.jsxs("div",{className:"flex items-baseline gap-2 px-3 py-2",children:[t.jsx("span",{className:"font-mono text-xs font-semibold text-[#F4F7FC]",children:S.name}),S.type&&t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:S.type})]},E))})]}),j?.returnType&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Returns"}),t.jsx("div",{className:"inline-flex items-center gap-1.5 rounded-md bg-[#0D1017] px-3 py-1.5",children:t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:j.returnType})})]}),g&&g!=="{}"&&t.jsx(je,{label:"Variables",raw:g}),d&&t.jsx(je,{label:"Operation",raw:d}),x&&t.jsx(je,{label:"Response",raw:x})]})})]})}function Bs({method:e,onClose:s}){const n=f.useMemo(()=>ee(e.componentMeta.componentModalFields),[e.componentMeta.componentModalFields]),r=f.useMemo(()=>ie(n,n),[n]),o=n.find(O=>O?.label?.toLowerCase()==="grpc method name"||O?.label?.toLowerCase()==="method name"),a=n.find(O=>O?.label?.toLowerCase()==="package name"),i=n.find(O=>O?.label?.toLowerCase()==="grpc service name"||O?.label?.toLowerCase()==="service name"),u=n.find(O=>O?.label?.toLowerCase()==="grpc rpc type"||O?.label?.toLowerCase()==="streaming type"||O?.label?.toLowerCase()==="rpc type"),l=n.find(O=>O?.label?.toLowerCase()==="request type"),p=n.find(O=>O?.label?.toLowerCase()==="response type"),c=n.find(O=>O?.label?.toLowerCase()==="proto snippet"),d=n.find(O=>O?.label?.toLowerCase()==="description"||O?.label?.toLowerCase()==="summary"),x=o?.componentFieldId?r[o.componentFieldId]:"N/A",g=a?.componentFieldId?r[a.componentFieldId]:"",b=i?.componentFieldId?r[i.componentFieldId]:"",j=u?.componentFieldId?It(r[u.componentFieldId]):"UNARY",S=l?.componentFieldId?r[l.componentFieldId]:void 0,E=p?.componentFieldId?r[p.componentFieldId]:void 0,w=c?.componentFieldId?r[c.componentFieldId]:void 0,A=d?.componentFieldId?r[d.componentFieldId]:void 0,M=q(r,n,["request schema"]),I=q(r,n,["response schema"]),P=e.apiEndpoint.updatedAt||e.apiEndpoint.createdAt,F=g?`${g}.${b||""}`:b||"N/A",V={UNARY:"Unary",SERVER_STREAMING:"Server Streaming",CLIENT_STREAMING:"Client Streaming",BIDIRECTIONAL_STREAMING:"Bidirectional Streaming"};return t.jsxs(vt,{topOffset:164,bottomOffset:12,className:"sticky top-3 w-full overflow-y-auto rounded-lg border bg-[#141925]",children:[t.jsxs("div",{className:"sticky top-0 z-10 border-b bg-[#141925] px-4 py-3",children:[t.jsxs("div",{className:"mb-1 flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${Te(j)} shrink-0 text-white`,children:V[j]??j}),t.jsx("h3",{className:"truncate font-mono text-sm font-semibold",children:x})]}),t.jsx("p",{className:"text-muted-foreground mt-1 truncate font-mono text-xs",children:F})]}),t.jsx(Ge,{onClick:s})]}),t.jsx("p",{className:"text-muted-foreground mt-1 text-[11px]",children:P?`Updated ${new Date(P).toLocaleString()}`:null})]}),t.jsx("div",{className:"space-y-4 px-4 py-4",children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${Te(j)} text-white`,children:V[j]??j}),t.jsx("span",{className:"font-mono text-sm font-semibold text-[#F4F7FC]",children:x})]}),t.jsx("p",{className:"font-mono text-xs text-[#828DA3]",children:F}),A&&t.jsx("p",{className:"text-sm text-[#A0ADBE]",children:A}),(S||E)&&t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Message Types"}),t.jsxs("div",{className:"divide-y divide-[#2A3242] rounded-md border border-[#2A3242]",children:[S&&t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[t.jsx("span",{className:"w-16 shrink-0 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Request"}),t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:S})]}),E&&t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[t.jsx("span",{className:"w-16 shrink-0 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Response"}),t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:E})]})]})]}),j!=="UNARY"&&t.jsxs("div",{className:"rounded-md border border-[#2A3242] bg-[#0D1017] px-3 py-2.5",children:[t.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Streaming Mode"}),t.jsxs("p",{className:"mt-1 text-xs text-[#A0ADBE]",children:[j==="SERVER_STREAMING"&&"The server sends a stream of messages in response to a single client request.",j==="CLIENT_STREAMING"&&"The client sends a stream of messages and the server replies with a single response.",j==="BIDIRECTIONAL_STREAMING"&&"Both client and server send streams of messages independently."]})]}),w&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Proto Definition"}),t.jsx("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs text-[#C9D1D9]",children:w.replace(/\\n/g,`
|
|
102
|
-
`)})]}),M&&t.jsx(je,{label:"Request",raw:M}),
|
|
100
|
+
`})]})}function Fs({endpoint:e,selected:s,onSelect:n,baseUrl:r,readonly:o,onDelete:a}){return t.jsxs("div",{onClick:n,className:`rest-nav-button group flex w-full cursor-pointer items-center gap-2 px-3 py-2.5 text-left transition ${s?"rest-nav-button-active":"rest-nav-button-inactive"}`,children:[t.jsx(Wt,{method:e.method,className:"min-w-14 shrink-0 py-0.5 text-[10px]"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"truncate font-mono text-xs font-semibold text-[#F4F7FC]",children:e.path}),e.summary&&t.jsx("div",{className:"truncate text-[10px] text-[#828DA3]",children:e.summary})]}),t.jsx("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",onClick:i=>i.stopPropagation(),children:t.jsxs(Zt,{children:[t.jsx(Xt,{asChild:!0,children:t.jsx(oe,{variant:"ghost",size:"icon",className:"size-6",children:t.jsx(ts,{className:"h-3 w-3"})})}),t.jsxs(es,{align:"end",children:[t.jsx(Se,{onClick:n,children:"Open docs"}),t.jsx(Se,{onClick:()=>void Ne(ze(r,e.path),"Full URL copied"),disabled:!r,children:"Copy URL"}),t.jsx(Se,{onClick:()=>void Ne(zs(r,e.path,e.method,e.auth),"cURL skeleton copied"),disabled:!r,children:"Copy cURL"}),!o&&t.jsx(Se,{className:"text-destructive",onClick:()=>void a(),children:"Delete"})]})]})})]})}function Rs({operation:e,selected:s,onSelect:n}){const r=f.useMemo(()=>se(e.componentMeta.componentModalFields),[e.componentMeta.componentModalFields]),o=f.useMemo(()=>pe(r,r),[r]),a=r.find(d=>d?.label?.toLowerCase()==="name"),i=r.find(d=>d?.label?.toLowerCase()==="graphql operation type"||d?.label?.toLowerCase()==="operation type"||d?.label?.toLowerCase()==="kind"),u=r.find(d=>d?.label?.toLowerCase()==="signature"),l=a?.componentFieldId?o[a.componentFieldId]:"N/A",p=i?.componentFieldId?o[i.componentFieldId]:"Query",c=u?.componentFieldId?o[u.componentFieldId]:void 0;return t.jsxs("div",{onClick:n,className:`rest-nav-button group flex w-full cursor-pointer items-center gap-2 px-3 py-2.5 text-left transition ${s?"rest-nav-button-active":"rest-nav-button-inactive"}`,children:[t.jsx(fe,{variant:"outline",className:`${Te(p)} shrink-0 px-1.5 py-0 text-[10px] text-white`,children:p.slice(0,1)}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"truncate font-mono text-xs font-semibold text-[#F4F7FC]",children:l}),c&&t.jsx("div",{className:"truncate text-[10px] text-[#828DA3]",children:c})]})]})}function ks({method:e,selected:s,onSelect:n}){const r=f.useMemo(()=>se(e.componentMeta.componentModalFields),[e.componentMeta.componentModalFields]),o=f.useMemo(()=>pe(r,r),[r]),a=r.find(b=>b?.label?.toLowerCase()==="grpc method name"||b?.label?.toLowerCase()==="method name"),i=r.find(b=>b?.label?.toLowerCase()==="grpc rpc type"||b?.label?.toLowerCase()==="streaming type"||b?.label?.toLowerCase()==="rpc type"),u=r.find(b=>b?.label?.toLowerCase()==="request type"),l=r.find(b=>b?.label?.toLowerCase()==="response type"),p=a?.componentFieldId?o[a.componentFieldId]:"N/A",c=i?.componentFieldId?It(o[i.componentFieldId]):"UNARY",d=u?.componentFieldId?o[u.componentFieldId]:void 0,x=l?.componentFieldId?o[l.componentFieldId]:void 0,g={UNARY:"Unary",SERVER_STREAMING:"S-Stream",CLIENT_STREAMING:"C-Stream",BIDIRECTIONAL_STREAMING:"Bidi"};return t.jsxs("div",{onClick:n,className:`rest-nav-button group flex w-full cursor-pointer items-center gap-2 px-3 py-2.5 text-left transition ${s?"rest-nav-button-active":"rest-nav-button-inactive"}`,children:[t.jsx(fe,{variant:"outline",className:`${qe(c)} shrink-0 px-1.5 py-0 text-[10px] text-white`,children:g[c]??c}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"truncate font-mono text-xs font-semibold text-[#F4F7FC]",children:p}),(d||x)&&t.jsxs("div",{className:"truncate font-mono text-[10px] text-[#828DA3]",children:[d," → ",x]})]})]})}function Ps(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const s=e;return!!("openapi"in s||"swagger"in s||typeof s.$schema=="string"||"$ref"in s||"properties"in s||"items"in s||"allOf"in s||"oneOf"in s||"anyOf"in s||typeof s.type=="string"&&(s.properties||s.items))}function Pe(e){return e.replace(/\\n/g,`
|
|
101
|
+
`).replace(/\\t/g," ")}function Ts(e){return Pe(JSON.stringify(e,null,2))}function St({name:e,value:s,depth:n}){const[r,o]=f.useState(n<2),a=s!==null&&typeof s=="object",i=Array.isArray(s),u=a?i?s.map((x,g)=>[String(g),x]):Object.entries(s):[],l=a&&u.length>0,p=s===null?"null":i?"array":a?"object":typeof s,c=p==="string"?`"${String(s)}"`:s===null?"null":String(s),d=p==="string"?"text-green-400":p==="number"?"text-blue-400":p==="boolean"?"text-amber-400":"text-[#828DA3]";return t.jsxs("div",{className:z(n>0&&"ml-4 border-l border-[#2A3242]"),children:[t.jsxs("div",{className:z("flex items-baseline gap-2 px-3 py-1.5",l&&"cursor-pointer select-none hover:bg-[#1E2533]"),onClick:()=>l&&o(x=>!x),children:[l?t.jsx(mt,{className:z("h-3 w-3 shrink-0 text-[#586378] transition-transform",!r&&"-rotate-90")}):t.jsx("span",{className:"w-3 shrink-0"}),t.jsx("span",{className:"font-mono text-xs font-medium text-[#F4F7FC]",children:e}),l?t.jsx("span",{className:"font-mono text-[10px] text-[#828DA3]",children:p}):t.jsx("span",{className:z("font-mono text-xs",d),children:c})]}),l&&r&&t.jsx("div",{children:u.map(([x,g])=>t.jsx(St,{name:x,value:g,depth:n+1},x))})]})}function qs({data:e}){if(e==null)return t.jsx("div",{className:"text-muted-foreground px-3 py-2 text-xs",children:"No payload defined"});if(typeof e!="object")return t.jsx("pre",{className:"overflow-x-auto px-3 py-2.5 font-mono text-xs text-[#C9D1D9]",children:String(e)});const s=Array.isArray(e)?e.map((n,r)=>[String(r),n]):Object.entries(e);return s.length===0?t.jsx("div",{className:"text-muted-foreground px-3 py-2 font-mono text-xs",children:Array.isArray(e)?"[]":"{}"}):t.jsx("div",{className:"rounded-md border border-[#2A3242] bg-[#141925] py-1",children:s.map(([n,r])=>t.jsx(St,{name:n,value:r,depth:0},n))})}function je({label:e,raw:s}){const n=f.useMemo(()=>{try{return JSON.parse(s)}catch{return null}},[s]),r=n&&typeof n=="object"&&!Array.isArray(n)&&typeof n.query=="string"?Pe(n.query):null,o=f.useMemo(()=>n===null?null:n&&typeof n=="object"&&!Array.isArray(n)&&"data"in n?n.data:n,[n]),a=f.useMemo(()=>n!==null?Ts(n):Pe(s),[n,s]);return t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:e}),n!==null&&Ps(n)?t.jsx("div",{className:"rounded-md border border-[#2A3242]",children:t.jsx(ke,{schema:n,showRequired:!1})}):r?t.jsx("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-[#C9D1D9]",children:r}):n!==null?t.jsx(qs,{data:o}):t.jsx("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs leading-relaxed text-[#C9D1D9]",children:a})]})}function ce(e,s,n=new Set,r=0){if(r>8)return e;if(e.$ref){if(n.has(e.$ref))return{type:"object"};const a=s(e.$ref);if(a){const i=new Set(n);return i.add(e.$ref),ce(a,s,i,r+1)}return e}const o={...e};return e.properties&&(o.properties=Object.fromEntries(Object.entries(e.properties).map(([a,i])=>[a,ce(i,s,n,r+1)]))),e.items&&(o.items=ce(e.items,s,n,r+1)),e.allOf&&(o.allOf=e.allOf.map(a=>ce(a,s,n,r+1))),e.oneOf&&(o.oneOf=e.oneOf.map(a=>ce(a,s,n,r+1))),e.anyOf&&(o.anyOf=e.anyOf.map(a=>ce(a,s,n,r+1))),o}function me(e,s=0,n){if(!e||s>6)return null;if(e.$ref&&n){const a=n(e.$ref);return a?me(a,s+1,n):{}}if(e.$ref)return{};if(e.example!==void 0)return e.example;if(e.enum)return e.enum[0]??null;for(const a of["allOf","anyOf","oneOf"]){const i=e[a];if(Array.isArray(i)&&i.length>0){if(a==="allOf"){const u={};for(const l of i){const p=l.$ref&&n?n(l.$ref)??l:l;Object.assign(u,p)}return me(u,s+1,n)}return me(i[0],s+1,n)}}const r=e.type;if(r==="object"||e.properties){const a=e.properties??{},i={};for(const[u,l]of Object.entries(a))i[u]=me(l,s+1,n);return i}if(r==="array"||e.items){const a=e.items??{};return[me(a,s+1,n)]}const o=e.format;switch(r){case"string":return o==="email"?"user@example.com":o==="date-time"?"2024-01-01T00:00:00Z":o==="date"?"2024-01-01":o==="password"?"********":o==="uuid"?"00000000-0000-0000-0000-000000000000":o==="uri"?"https://example.com":"string";case"integer":return 0;case"number":return 0;case"boolean":return!0;default:return null}}function rt(e){return e.startsWith("2")?"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/30":e.startsWith("3")?"bg-sky-500/15 text-sky-400 ring-1 ring-sky-500/30":e.startsWith("4")?"bg-amber-500/15 text-amber-400 ring-1 ring-amber-500/30":e.startsWith("5")?"bg-red-500/15 text-red-400 ring-1 ring-red-500/30":"bg-[#1E2533] text-[#D2D9E6] ring-1 ring-[#2A3242]"}function Gs({endpoint:e,responses:s,openApiRuntime:n}){const[r,o]=f.useState(null),[a,i]=f.useState("schema"),[u,l]=f.useState({});function p(w){return u[w]??"schema"}function c(w,q){l(F=>({...F,[w]:q}))}const d=n?n.operationAuthByPath(e.method,e.path):e.auth,x=n?.operationRequestBodyByPath(e.method,e.path)??null,g=n?.operationParametersByPath(e.method,e.path)??[],b=g.filter(w=>w.in==="path"),y=g.filter(w=>w.in==="query"),N=g.filter(w=>w.in==="header"),E=n?w=>n.resolveRef(w):void 0,v=x?.schema,A=v&&E?ce(v,E):v,M=A?JSON.stringify(me(A,0,E),null,2):null;return t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:z("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium ring-1",d==="none"?"bg-[#1E2533] text-[#828DA3] ring-[#2A3242]":"bg-amber-500/15 text-amber-400 ring-amber-500/30"),children:[d==="none"?t.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M5.5 5a2.5 2.5 0 0 1 5 0H12V4a4 4 0 0 0-8 0v1h1.5Zm-3 2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H2.5Z"})}):t.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M8 1a4 4 0 0 0-4 4v1H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-1V5a4 4 0 0 0-4-4Zm2.5 5H5.5V5a2.5 2.5 0 0 1 5 0v1Z"})}),Qs(d)]}),e.description&&t.jsx("span",{className:"text-xs text-[#828DA3]",children:e.description})]}),b.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Path Parameters"}),t.jsx(Re,{params:b})]}),y.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Query Parameters"}),t.jsx(Re,{params:y})]}),N.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Headers"}),t.jsx(Re,{params:N})]}),x&&t.jsxs("section",{children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h4",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Request Body"}),t.jsxs("span",{className:"text-[10px] text-[#586378]",children:[x.contentType,x.required?" · required":" · optional"]})]}),M&&t.jsxs("div",{className:"flex items-center rounded-md border border-[#2A3242] text-[10px]",children:[t.jsx("button",{type:"button",onClick:()=>i("example"),className:z("rounded-l-md px-2 py-1 transition",a==="example"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Example"}),t.jsx("button",{type:"button",onClick:()=>i("schema"),className:z("rounded-r-md px-2 py-1 transition",a==="schema"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Schema"})]})]}),a==="example"&&M?t.jsxs("div",{className:"relative",children:[t.jsx("button",{type:"button",className:"absolute top-2 right-2 text-[#828DA3] hover:text-[#D2D9E6]",onClick:()=>void Ne(M,"Example copied"),children:t.jsx(Ae,{className:"h-3 w-3"})}),t.jsx("pre",{className:"overflow-x-auto rounded-lg bg-[#1E2533] p-3 font-mono text-[11px] leading-relaxed text-[#D2D9E6]",children:M})]}):A?t.jsx(ke,{schema:A}):t.jsx("p",{className:"text-xs text-[#586378]",children:"No schema defined."})]}),s.length>0&&t.jsxs("section",{children:[t.jsx("h4",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Responses"}),t.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:s.map(([w,q])=>{const F=n?.operationResponsesByPath(e.method,e.path)[w]?.description??"",Q=q||F;return t.jsxs("button",{type:"button",onClick:()=>o(r===w?null:w),className:z("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium transition",rt(w),r===w&&"opacity-100",r!==null&&r!==w&&"opacity-50"),children:[t.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),w,Q?` — ${Q}`:""]},w)})}),t.jsx("div",{className:"space-y-2",children:s.map(([w,q])=>{const F=n?.operationResponsesByPath(e.method,e.path)[w],Q=q||F?.description||"";if(!(r===w||r===null))return null;const K=F?.schema??null,J=K&&E?ce(K,E):K,V=F?.example??(J?JSON.stringify(me(J,0,E),null,2):null),R=J||V,D=p(w);return t.jsxs("div",{className:"rounded-lg border border-[#2A3242] bg-[#141925]",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[#2A3242] px-3 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:z("rounded-full px-2 py-0.5 text-xs font-semibold",rt(w)),children:w}),Q&&t.jsx("span",{className:"text-xs text-[#D2D9E6]",children:Q})]}),R&&t.jsxs("div",{className:"flex items-center rounded-md border border-[#2A3242] text-[10px]",children:[t.jsx("button",{type:"button",onClick:()=>c(w,"example"),className:z("rounded-l-md px-2 py-1 transition",D==="example"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Example"}),t.jsx("button",{type:"button",onClick:()=>c(w,"schema"),className:z("rounded-r-md px-2 py-1 transition",D==="schema"?"bg-[#2A3242] text-[#D2D9E6]":"text-[#828DA3] hover:text-[#D2D9E6]"),children:"Schema"})]})]}),R?D==="example"&&V?t.jsxs("div",{className:"relative px-3 py-3",children:[t.jsx("button",{type:"button",className:"absolute top-5 right-5 text-[#828DA3] hover:text-[#D2D9E6]",onClick:()=>void Ne(V,"Example copied"),children:t.jsx(Ae,{className:"h-3 w-3"})}),t.jsx("pre",{className:"overflow-x-auto rounded-lg bg-[#1E2533] p-3 font-mono text-[11px] leading-relaxed text-[#D2D9E6]",children:V})]}):J?t.jsx("div",{className:"px-3 py-3",children:t.jsx(ke,{schema:J,showRequired:!1})}):null:t.jsx("p",{className:"px-3 py-3 text-xs text-[#586378]",children:"No schema defined."})]},w)})})]})]})}function Re({params:e}){return t.jsx("div",{className:"overflow-hidden rounded-lg border border-[#2A3242] bg-[#141925]",children:e.map((s,n)=>{const r=s.schema?.type??s.schema?.$ref?.split("/").pop()??"string";return t.jsxs("div",{className:z("flex flex-wrap items-baseline gap-x-2 gap-y-1 px-3 py-2.5 text-sm",n<e.length-1&&"border-b border-[#2A3242]"),children:[t.jsx("span",{className:"font-mono font-semibold text-[#F4F7FC]",children:s.name}),t.jsx("span",{className:"font-mono text-xs text-[#828DA3]",children:r}),s.required?t.jsx("span",{className:"rounded bg-red-500/15 px-1.5 py-0.5 text-[10px] font-medium text-red-400 ring-1 ring-red-500/30",children:"required"}):t.jsx("span",{className:"text-[10px] text-[#586378]",children:"optional"}),s.description&&t.jsx("span",{className:"w-full text-xs text-[#828DA3]",children:s.description})]},`${s.in}-${s.name}`)})})}function $s({endpoint:e,baseUrl:s,openApiRuntime:n,onClose:r}){const o=Ks(e.statusCodes),a=n?n.operationResponsesByPath(e.method,e.path):{},i=Object.keys(a),u=i.length>0?i.map(c=>{const d=o.find(([x])=>x===c);return d||[c,a[c]?.description??""]}):o,l=e.apiEndpoint.updatedAt||e.apiEndpoint.createdAt,p=ze(s||Js(e.fullUrl,e.path),e.path);return t.jsxs("div",{className:"flex w-full flex-col overflow-hidden rounded-lg border bg-[#141925]",children:[t.jsxs("div",{className:"flex items-start justify-between border-b bg-[#141925] px-4 py-3",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("h3",{className:"font-mono text-sm font-semibold",children:[e.method," ",e.path]}),s&&t.jsx("p",{className:"text-muted-foreground text-xs",children:p}),t.jsx("p",{className:"text-muted-foreground mt-1 text-[11px]",children:l?`Updated ${new Date(l).toLocaleString()}`:null})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsxs(oe,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>void Ne(p,"URL copied"),disabled:!s,children:[t.jsx(Ae,{className:"h-3.5 w-3.5"}),"Copy URL"]}),t.jsx($e,{onClick:r})]})]}),t.jsx("div",{className:"space-y-4 px-4 py-4",children:t.jsx(Gs,{endpoint:e,responses:u,openApiRuntime:n})})]})}function Vs({operation:e,onClose:s}){const n=f.useMemo(()=>se(e.componentMeta.componentModalFields),[e.componentMeta.componentModalFields]),r=f.useMemo(()=>pe(n,n),[n]),o=n.find(N=>N?.label?.toLowerCase()==="name"),a=n.find(N=>N?.label?.toLowerCase()==="graphql operation type"||N?.label?.toLowerCase()==="operation type"||N?.label?.toLowerCase()==="kind"),i=n.find(N=>N?.label?.toLowerCase()==="description"||N?.label?.toLowerCase()==="summary"),u=o?.componentFieldId?r[o.componentFieldId]:"N/A",l=$(r,n,["signature"]),p=a?.componentFieldId?r[a.componentFieldId]:"Query",c=i?.componentFieldId?r[i.componentFieldId]:void 0,d=$(r,n,["request schema"]),x=$(r,n,["response schema"]),g=$(r,n,["parameters"]),b=e.apiEndpoint.updatedAt||e.apiEndpoint.createdAt,y=f.useMemo(()=>{if(!l)return null;const N=l.match(/\(([^)]*)\)/),E=l.match(/\):\s*(.+)$/),v=N?.[1]?N[1].split(",").map(M=>M.trim()).filter(Boolean).map(M=>{const[w,q]=M.split(":").map(F=>F.trim());return{name:w,type:q}}):[],A=E?.[1]?.trim()??null;return{args:v,returnType:A}},[l]);return t.jsxs(vt,{topOffset:164,bottomOffset:12,className:"sticky top-3 w-full overflow-y-auto rounded-lg border bg-[#141925]",children:[t.jsxs("div",{className:"sticky top-0 z-10 border-b bg-[#141925] px-4 py-3",children:[t.jsxs("div",{className:"mb-1 flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${Te(p)} shrink-0 text-white`,children:p}),t.jsx("h3",{className:"truncate font-mono text-sm font-semibold",children:u})]}),l&&t.jsx("p",{className:"text-muted-foreground mt-1 truncate font-mono text-xs",children:l})]}),t.jsx($e,{onClick:s})]}),t.jsx("p",{className:"text-muted-foreground text-[11px]",children:b?`Updated ${new Date(b).toLocaleString()}`:null})]}),t.jsx("div",{className:"space-y-4 px-4 py-4",children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${Te(p)} text-white`,children:p}),t.jsx("span",{className:"font-mono text-sm font-semibold text-[#F4F7FC]",children:u})]}),c&&t.jsx("p",{className:"text-sm text-[#A0ADBE]",children:c}),l&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Signature"}),t.jsxs("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs text-[#C9D1D9]",children:[p.toLowerCase()," ",l]})]}),y&&y.args.length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Arguments"}),t.jsx("div",{className:"divide-y divide-[#2A3242] rounded-md border border-[#2A3242]",children:y.args.map((N,E)=>t.jsxs("div",{className:"flex items-baseline gap-2 px-3 py-2",children:[t.jsx("span",{className:"font-mono text-xs font-semibold text-[#F4F7FC]",children:N.name}),N.type&&t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:N.type})]},E))})]}),y?.returnType&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Returns"}),t.jsx("div",{className:"inline-flex items-center gap-1.5 rounded-md bg-[#0D1017] px-3 py-1.5",children:t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:y.returnType})})]}),g&&g!=="{}"&&t.jsx(je,{label:"Variables",raw:g}),d&&t.jsx(je,{label:"Operation",raw:d}),x&&t.jsx(je,{label:"Response",raw:x})]})})]})}function Bs({method:e,onClose:s}){const n=f.useMemo(()=>se(e.componentMeta.componentModalFields),[e.componentMeta.componentModalFields]),r=f.useMemo(()=>pe(n,n),[n]),o=n.find(O=>O?.label?.toLowerCase()==="grpc method name"||O?.label?.toLowerCase()==="method name"),a=n.find(O=>O?.label?.toLowerCase()==="package name"),i=n.find(O=>O?.label?.toLowerCase()==="grpc service name"||O?.label?.toLowerCase()==="service name"),u=n.find(O=>O?.label?.toLowerCase()==="grpc rpc type"||O?.label?.toLowerCase()==="streaming type"||O?.label?.toLowerCase()==="rpc type"),l=n.find(O=>O?.label?.toLowerCase()==="request type"),p=n.find(O=>O?.label?.toLowerCase()==="response type"),c=n.find(O=>O?.label?.toLowerCase()==="proto snippet"),d=n.find(O=>O?.label?.toLowerCase()==="description"||O?.label?.toLowerCase()==="summary"),x=o?.componentFieldId?r[o.componentFieldId]:"N/A",g=a?.componentFieldId?r[a.componentFieldId]:"",b=i?.componentFieldId?r[i.componentFieldId]:"",y=u?.componentFieldId?It(r[u.componentFieldId]):"UNARY",N=l?.componentFieldId?r[l.componentFieldId]:void 0,E=p?.componentFieldId?r[p.componentFieldId]:void 0,v=c?.componentFieldId?r[c.componentFieldId]:void 0,A=d?.componentFieldId?r[d.componentFieldId]:void 0,M=$(r,n,["request schema"]),w=$(r,n,["response schema"]),q=e.apiEndpoint.updatedAt||e.apiEndpoint.createdAt,F=g?`${g}.${b||""}`:b||"N/A",Q={UNARY:"Unary",SERVER_STREAMING:"Server Streaming",CLIENT_STREAMING:"Client Streaming",BIDIRECTIONAL_STREAMING:"Bidirectional Streaming"};return t.jsxs(vt,{topOffset:164,bottomOffset:12,className:"sticky top-3 w-full overflow-y-auto rounded-lg border bg-[#141925]",children:[t.jsxs("div",{className:"sticky top-0 z-10 border-b bg-[#141925] px-4 py-3",children:[t.jsxs("div",{className:"mb-1 flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${qe(y)} shrink-0 text-white`,children:Q[y]??y}),t.jsx("h3",{className:"truncate font-mono text-sm font-semibold",children:x})]}),t.jsx("p",{className:"text-muted-foreground mt-1 truncate font-mono text-xs",children:F})]}),t.jsx($e,{onClick:s})]}),t.jsx("p",{className:"text-muted-foreground mt-1 text-[11px]",children:q?`Updated ${new Date(q).toLocaleString()}`:null})]}),t.jsx("div",{className:"space-y-4 px-4 py-4",children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(fe,{variant:"outline",className:`${qe(y)} text-white`,children:Q[y]??y}),t.jsx("span",{className:"font-mono text-sm font-semibold text-[#F4F7FC]",children:x})]}),t.jsx("p",{className:"font-mono text-xs text-[#828DA3]",children:F}),A&&t.jsx("p",{className:"text-sm text-[#A0ADBE]",children:A}),(N||E)&&t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Message Types"}),t.jsxs("div",{className:"divide-y divide-[#2A3242] rounded-md border border-[#2A3242]",children:[N&&t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[t.jsx("span",{className:"w-16 shrink-0 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Request"}),t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:N})]}),E&&t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[t.jsx("span",{className:"w-16 shrink-0 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Response"}),t.jsx("span",{className:"font-mono text-xs text-[#3B82F6]",children:E})]})]})]}),y!=="UNARY"&&t.jsxs("div",{className:"rounded-md border border-[#2A3242] bg-[#0D1017] px-3 py-2.5",children:[t.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Streaming Mode"}),t.jsxs("p",{className:"mt-1 text-xs text-[#A0ADBE]",children:[y==="SERVER_STREAMING"&&"The server sends a stream of messages in response to a single client request.",y==="CLIENT_STREAMING"&&"The client sends a stream of messages and the server replies with a single response.",y==="BIDIRECTIONAL_STREAMING"&&"Both client and server send streams of messages independently."]})]}),v&&t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-[10px] font-semibold tracking-wider text-[#828DA3] uppercase",children:"Proto Definition"}),t.jsx("pre",{className:"overflow-x-auto rounded-md bg-[#0D1017] px-3 py-2.5 font-mono text-xs text-[#C9D1D9]",children:v.replace(/\\n/g,`
|
|
102
|
+
`)})]}),M&&t.jsx(je,{label:"Request",raw:M}),w&&t.jsx(je,{label:"Response",raw:w})]})})]})}function Te(e){switch(e){case"Query":return"bg-blue-500";case"Mutation":return"bg-green-500";case"Subscription":return"bg-purple-500";default:return"bg-gray-500"}}function It(e){const s=e.toLowerCase();return s==="unary"?"UNARY":s==="server streaming"?"SERVER_STREAMING":s==="client streaming"?"CLIENT_STREAMING":s==="bidirectional streaming"?"BIDIRECTIONAL_STREAMING":s==="server_streaming"?"SERVER_STREAMING":s==="client_streaming"?"CLIENT_STREAMING":s==="bidirectional_streaming"?"BIDIRECTIONAL_STREAMING":"UNARY"}function qe(e){switch(e){case"UNARY":return"bg-blue-500";case"SERVER_STREAMING":return"bg-green-500";case"CLIENT_STREAMING":return"bg-purple-500";case"BIDIRECTIONAL_STREAMING":return"bg-orange-500";default:return"bg-gray-500"}}function $(e,s,n){const r=new Set(n.map(i=>i.toLowerCase())),o=s.find(i=>r.has((i.label||"").toLowerCase()));if(!o?.componentFieldId)return null;const a=e[o.componentFieldId];if(typeof a=="string")return a;if(a==null)return null;if(typeof a=="number"||typeof a=="boolean")return String(a);if(typeof a=="object"){const i=a.text;if(typeof i=="string")return i;try{return JSON.stringify(a,null,2)}catch{return null}}return null}function _s(e){if(!e)return[];const s=e.trim();if(!s)return[];try{const n=JSON.parse(s);if(Array.isArray(n))return n.map(r=>String(r).trim()).filter(Boolean).slice(0,12)}catch{}return s.split(",").map(n=>n.trim()).filter(Boolean).slice(0,12)}function Us(e){const s=(e||"").toLowerCase();return!s||s.includes("none")||s.includes("public")?"none":s.includes("bearer")||s.includes("jwt")?"bearer":s.includes("api key")||s.includes("api-key")?"api-key":s.includes("oauth")?"oauth2":"other"}function Qs(e){switch(e){case"none":return"No auth";case"bearer":return"Bearer";case"api-key":return"API key";case"oauth2":return"OAuth2";default:return"Other"}}async function Ne(e,s){if(e)try{await navigator.clipboard.writeText(e),be.success(s)}catch{be.error("Failed to copy")}}function zs(e,s,n,r){return`curl -X ${n} \\
|
|
103
103
|
${r==="none"?"":r==="api-key"?` -H 'x-api-key: <API_KEY>' \\
|
|
104
104
|
`:` -H 'Authorization: Bearer <TOKEN>' \\
|
|
105
105
|
`} -H 'Content-Type: application/json' \\
|
|
106
106
|
${n==="GET"||n==="DELETE"?"":` -d '{}' \\
|
|
107
|
-
`} '${
|
|
107
|
+
`} '${ze(e,s)}'`}function ze(e,s){const n=e.endsWith("/")?e.slice(0,-1):e,r=s.startsWith("/")?s:`/${s}`;return`${n}${r}`}function Ks(e){if(!e)return[];try{const s=JSON.parse(e);return Object.entries(s).sort(([n],[r])=>n.localeCompare(r))}catch{return[]}}function Js(e,s){if(!e)return"";const n=e.indexOf(s);return n<0?e:e.slice(0,n)}function zn(){const{serviceId:e}=zt(),{apiGroupId:s}=Qt();return t.jsx(ds,{serviceId:e,serviceApiGroupId:s,children:t.jsx(Ws,{})})}function Ws(){const e=pt(),{apiGroup:s,serviceId:n,selectedVersionId:r,isApiEndpointsLoading:o}=bt(),i=f.useMemo(()=>s?.openApiSpecFileId??s?.swaggerSpecFileId??s?.graphqlSpecFileIds?.[0]??s?.grpcSpecFileIds?.[0]??null,[s])!==null,u=s.serviceApiGroupId??"";return t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsx(lt,{title:"API & Behavior",description:"Endpoints found in this service, with the files they were found in.",children:t.jsxs("div",{className:"flex items-center gap-2",children:[i&&t.jsx(xs,{serviceId:n,apiGroupId:u,versionId:r}),t.jsxs(oe,{preset:"outline",onClick:()=>e(`/services/${n}/apis`),children:[t.jsx(ut,{className:"h-4 w-4"}),"Back to APIs"]})]})}),t.jsx(ct,{noPadding:!0,children:o?t.jsx(ot,{label:"Loading API endpoints..."}):t.jsx(Ds,{})})]})}export{zn as ApiGroupEndpointsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-
|
|
1
|
+
import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-BDgZg3kW.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
|