decocms 2.172.0 → 2.172.1
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/dist/client/assets/{AlertCircle-BvnCc6-D.js → AlertCircle-DBHSxle0.js} +1 -1
- package/dist/client/assets/{AlignLeft-Du0NczL1.js → AlignLeft-BZi0b3qg.js} +1 -1
- package/dist/client/assets/{ArrowDown-C_8n0unK.js → ArrowDown-J5qOTRoA.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BQgzcaok.js → ArrowLeft-Cke1NjsZ.js} +1 -1
- package/dist/client/assets/{ArrowUp-o0gFtaSp.js → ArrowUp-aSx0u-5l.js} +1 -1
- package/dist/client/assets/{Check-BxC8tao2.js → Check-B8ndkg7T.js} +1 -1
- package/dist/client/assets/{CheckCircle-D_nIOFVe.js → CheckCircle-DAXfTEK-.js} +1 -1
- package/dist/client/assets/{CheckDone01-CakzFmCS.js → CheckDone01-CKxo2Bt7.js} +1 -1
- package/dist/client/assets/{CheckVerified02-B0-uBz5z.js → CheckVerified02-3DuNYJZt.js} +1 -1
- package/dist/client/assets/{ChevronDown-B6clHAxQ.js → ChevronDown-D9wVK5bH.js} +1 -1
- package/dist/client/assets/{ChevronLeft-ByevmkD8.js → ChevronLeft-DcNKgEQb.js} +1 -1
- package/dist/client/assets/{ChevronRight-BZWqxnWE.js → ChevronRight-BWpUvEdI.js} +1 -1
- package/dist/client/assets/{ChevronUp-DxXRh85A.js → ChevronUp-pA-2UtBp.js} +1 -1
- package/dist/client/assets/{Clock-aoVUv0E3.js → Clock-Bp-LAqbC.js} +1 -1
- package/dist/client/assets/{Code01-BfCMg42R.js → Code01-ChPYGYfB.js} +1 -1
- package/dist/client/assets/{Coins01-CRttGRCL.js → Coins01-CEldpOw2.js} +1 -1
- package/dist/client/assets/{Container-CHE6pZ9r.js → Container-CLsUjxhY.js} +1 -1
- package/dist/client/assets/{Copy01-Wuk9LRR2.js → Copy01-CgG_OJP6.js} +1 -1
- package/dist/client/assets/{Dataflow03-DheawpLZ.js → Dataflow03-DUfN03Mp.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-D5nivPvW.js → DotsHorizontal-COn1MVBJ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CgdYQJ7U.js → DotsVertical-B6C_2FFD.js} +1 -1
- package/dist/client/assets/{Download01-DTYQtrJQ.js → Download01-BgosRgo9.js} +1 -1
- package/dist/client/assets/{Edit01-BKkVXIhK.js → Edit01-BYoLi1wi.js} +1 -1
- package/dist/client/assets/{Edit05-BvgGPrtV.js → Edit05-CXzMSTEE.js} +1 -1
- package/dist/client/assets/{Eye-geJ1dSoO.js → Eye-MtNtMWW5.js} +1 -1
- package/dist/client/assets/{EyeOff-ClRv57XC.js → EyeOff-CY8Gwzvd.js} +1 -1
- package/dist/client/assets/{File02-C3A15tgy.js → File02-CBJOSTF8.js} +1 -1
- package/dist/client/assets/{File06-CJDVZeqU.js → File06-021s902A.js} +1 -1
- package/dist/client/assets/{FilterLines-DABMr8G9.js → FilterLines-zxDuDuuJ.js} +1 -1
- package/dist/client/assets/{Globe01-7vtf7Y1x.js → Globe01-BrfugmTH.js} +1 -1
- package/dist/client/assets/{Globe02-zQio7SJP.js → Globe02-D4GwpBVP.js} +1 -1
- package/dist/client/assets/{Grid01-CgI0fqut.js → Grid01-Cx4wu3Y9.js} +1 -1
- package/dist/client/assets/{Hash02-Bng1Hle8.js → Hash02-hnhH9Jxc.js} +1 -1
- package/dist/client/assets/{Home02-D1KSrO9o.js → Home02-DyHu25ax.js} +1 -1
- package/dist/client/assets/{Image01-BLsRmD6t.js → Image01-T3g4Xdvf.js} +1 -1
- package/dist/client/assets/{Inbox01-DGQRZkXS.js → Inbox01-BXbJXxyv.js} +1 -1
- package/dist/client/assets/{InfoCircle-DvSUioPF.js → InfoCircle-Da_z8Szm.js} +1 -1
- package/dist/client/assets/{Key01-Dib7ammN.js → Key01-4NZitUKS.js} +1 -1
- package/dist/client/assets/{LayersTwo01-BmzCQYk2.js → LayersTwo01-670JTIpk.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CWuWCiNa.js → LayoutLeft-CIpulo-e.js} +1 -1
- package/dist/client/assets/{Link01-DwbGnCZ-.js → Link01-BXmFSJRd.js} +1 -1
- package/dist/client/assets/{LinkExternal01-3ULSi1GW.js → LinkExternal01-Bq8XeN8a.js} +1 -1
- package/dist/client/assets/{List-3zjBAIRS.js → List-B0bmeecJ.js} +1 -1
- package/dist/client/assets/{Loading01-BbnQsfMx.js → Loading01-B87VIClz.js} +1 -1
- package/dist/client/assets/{Lock01-ClyjUTBv.js → Lock01-BdaMZYNr.js} +1 -1
- package/dist/client/assets/{Play-p1Z3ioGY.js → Play-DBH8t0rX.js} +1 -1
- package/dist/client/assets/{Plus-BJUL5Wvq.js → Plus-CDc4R7NF.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Dfcp2VAx.js → RefreshCcw01-CiW1ymIS.js} +1 -1
- package/dist/client/assets/{Save01-BNoezVOP.js → Save01-SGB22t4q.js} +1 -1
- package/dist/client/assets/{SearchMd-BJkDuyJ3.js → SearchMd-DEv7e_hZ.js} +1 -1
- package/dist/client/assets/{Settings01-k8tDFeX4.js → Settings01-ovVBguWq.js} +1 -1
- package/dist/client/assets/{Shield01-XMvdJvy8.js → Shield01-D18ahoYD.js} +1 -1
- package/dist/client/assets/{Terminal-Bq1nd15g.js → Terminal-DNbN4GE7.js} +1 -1
- package/dist/client/assets/{Trash01-BEjbK4f6.js → Trash01-DC96NOta.js} +1 -1
- package/dist/client/assets/{Upload01-r0pGX4kR.js → Upload01-BW9BwfoA.js} +1 -1
- package/dist/client/assets/{Users03-DTCxnqPZ.js → Users03-cvM2Ndk1.js} +1 -1
- package/dist/client/assets/{X-CEnrrbAn.js → X-C5okAsgi.js} +1 -1
- package/dist/client/assets/{XCircle-BKAmr_f6.js → XCircle-CFDOKqbE.js} +1 -1
- package/dist/client/assets/{XClose-CRDqusrl.js → XClose-BHPDEFB2.js} +1 -1
- package/dist/client/assets/{Zap-CNayKvai.js → Zap-CkD-kOX3.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-DWjxgkFC.js → agent-connections-preview-BlJ035nM.js} +1 -1
- package/dist/client/assets/{agent-detail-qPTQbHAB.js → agent-detail-NABTJfFm.js} +1 -1
- package/dist/client/assets/{agents-De8iH2o7.js → agents-CK1zn3pf.js} +1 -1
- package/dist/client/assets/{alert-dialog-B77zp5_9.js → alert-dialog-BQU839b3.js} +1 -1
- package/dist/client/assets/{auth-catchall-ajIqzmLh.js → auth-catchall-CuvA1tS7.js} +1 -1
- package/dist/client/assets/{automation-detail-l1ds4Esy.js → automation-detail-BnVlIGOj.js} +1 -1
- package/dist/client/assets/{automations-D-ICSDP7.js → automations-9UyxTFnE.js} +1 -1
- package/dist/client/assets/{avatar-DUHTdDSS.js → avatar-BzF6Jb9Z.js} +1 -1
- package/dist/client/assets/{badge-B33icYfV.js → badge-DSBNODR5.js} +1 -1
- package/dist/client/assets/{binder-C4RsQP3G.js → binder-Df6Go4wZ.js} +1 -1
- package/dist/client/assets/{breadcrumb-C11JDZLD.js → breadcrumb-C0C7xCxQ.js} +1 -1
- package/dist/client/assets/{card-Bfa3ZJIC.js → card-3wGXs2xF.js} +1 -1
- package/dist/client/assets/{chart-BLla5WT3.js → chart-DpmD8a68.js} +1 -1
- package/dist/client/assets/{checkbox-BuLFRc1C.js → checkbox-B3Rpe7-l.js} +1 -1
- package/dist/client/assets/{collapsible-DDvEBvNF.js → collapsible-Df2r9Beq.js} +1 -1
- package/dist/client/assets/{collection-detail-Bi5TVIvY.js → collection-detail-Bx2S4wNW.js} +1 -1
- package/dist/client/assets/{collection-display-button-CB65ibr7.js → collection-display-button-Dbmpw-3P.js} +1 -1
- package/dist/client/assets/{collection-search-C-DUGZUN.js → collection-search-Bl8CXpst.js} +1 -1
- package/dist/client/assets/{collection-tab-dHFGyC1m.js → collection-tab-Zi-tIaoO.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CNWTcnzH.js → collection-table-wrapper-CWpzycma.js} +1 -1
- package/dist/client/assets/{collection-tabs-hNcG012s.js → collection-tabs-XXmKF6cf.js} +1 -1
- package/dist/client/assets/{command-B_9ik1cM.js → command-DsOv8SIr.js} +1 -1
- package/dist/client/assets/{connect-DfuwjHHd.js → connect-DHGLggyX.js} +1 -1
- package/dist/client/assets/{connection-card-zeX_VYK4.js → connection-card-N3Tx1qhb.js} +1 -1
- package/dist/client/assets/{connection-detail-jw7eh9PA.js → connection-detail-D3Kdf77j.js} +1 -1
- package/dist/client/assets/{connection-status-DFBDMZAF.js → connection-status-BzysCDJU.js} +1 -1
- package/dist/client/assets/{connections-B6AcPhdJ.js → connections-CZhVovQk.js} +1 -1
- package/dist/client/assets/{constants-uVLQN0jY.js → constants-B4i933q7.js} +1 -1
- package/dist/client/assets/constants-BLiDtBGA.js +1 -0
- package/dist/client/assets/{context-ClCBXQoI.js → context-vne_tDFm.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-D_k6cEfv.js → create-organization-dialog-BhY0HdLQ.js} +1 -1
- package/dist/client/assets/{create-project-dialog-F0Ewm4t_.js → create-project-dialog-BLIvPVWr.js} +1 -1
- package/dist/client/assets/{danger-oup6oh4U.js → danger-lReiiLi3.js} +1 -1
- package/dist/client/assets/{danger-zone-vsCYRE0x.js → danger-zone-B5x8MB5G.js} +1 -1
- package/dist/client/assets/{dependencies-CACLYIk-.js → dependencies-6FYvuL0W.js} +1 -1
- package/dist/client/assets/{dialog-CvddUtOS.js → dialog-CflsNx8x.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CNJ1rfC3.js → dropdown-menu-DcNTx9lg.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Cl4-VlSa.js → dynamic-plugin-layout-t1gg8oRt.js} +1 -1
- package/dist/client/assets/{editable-task-title-BGawVgqA.js → editable-task-title-DD2nEqgz.js} +1 -1
- package/dist/client/assets/{empty-state-CpzrK9g6.js → empty-state-BJQVSVey.js} +1 -1
- package/dist/client/assets/{empty-state-CP4jllwU.js → empty-state-XvkhVm2a.js} +1 -1
- package/dist/client/assets/{env-vars-editor-CchFdE5U.js → env-vars-editor-D0IVO2-N.js} +1 -1
- package/dist/client/assets/{extract-connection-data-_6Kh3We4.js → extract-connection-data-Dcq9_d1D.js} +1 -1
- package/dist/client/assets/{file-browser-DnLypKL_.js → file-browser-B7VwaOBu.js} +2 -2
- package/dist/client/assets/{form-DmTtx5UX.js → form-t-VTqwHW.js} +1 -1
- package/dist/client/assets/{general-W7HUJ0d1.js → general-CHmY6WCR.js} +1 -1
- package/dist/client/assets/{grid-view-DcSLIihL.js → grid-view-CObD1ODK.js} +1 -1
- package/dist/client/assets/{home-CrqfmLIg.js → home-DAdz-q5X.js} +1 -1
- package/dist/client/assets/{icon-picker-DHh5HlMd.js → icon-picker-CXAPe9ug.js} +1 -1
- package/dist/client/assets/{index-MC5fCcRU.js → index-BPNTL7B5.js} +1 -1
- package/dist/client/assets/{index-BJ81Vsww.js → index-BUP2j-VZ.js} +3 -3
- package/dist/client/assets/{index-Cv3zhjFc.js → index-C1_svsm9.js} +1 -1
- package/dist/client/assets/{index-BKYpmcE7.js → index-CRVyuFS0.js} +1 -1
- package/dist/client/assets/{index-RAS9JMxX.js → index-CZ74MLAU.js} +1 -1
- package/dist/client/assets/{index-BvJY4WDC.js → index-CgdCtkSt.js} +1 -1
- package/dist/client/assets/{index-XiB7e0AL.js → index-D-cm4gF6.js} +1 -1
- package/dist/client/assets/{index-BX8jl6GF.js → index-D2ROEW_j.js} +1 -1
- package/dist/client/assets/{index-Bb9MktBE.js → index-D9ujiDbX.js} +1 -1
- package/dist/client/assets/{index-BYvtYdJ1.js → index-iDNDhzRC.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DyqlIjS8.js → infiniteQueryObserver-ueKf4rCa.js} +1 -1
- package/dist/client/assets/{input-95A3RU7n.js → input-OS0sGs_c.js} +1 -1
- package/dist/client/assets/{integration-icon-DKPtAPgu.js → integration-icon-DhNWPq_0.js} +1 -1
- package/dist/client/assets/{label-CKi_xgKG.js → label-Cj5QTzyK.js} +1 -1
- package/dist/client/assets/{layout-KmDEzVfx.js → layout-BjgZH_LK.js} +1 -1
- package/dist/client/assets/{layout-CacZ9vAP.js → layout-CunxSw7b.js} +1 -1
- package/dist/client/assets/login-BF9hcIwR.js +1 -0
- package/dist/client/assets/{logo-upload-aOk9IMA5.js → logo-upload-dZtFly9d.js} +1 -1
- package/dist/client/assets/{markdown-DrAh7zaw.js → markdown-BEHkpiAe.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CeIZPzvW.js → mcp-app-renderer-CqfIV03X.js} +1 -1
- package/dist/client/assets/{mcp-server-card-CZA2yTqZ.js → mcp-server-card-DnXtIYiQ.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Cjp4DUbD.js → mcp-server-detail-B5_9wNbY.js} +2 -2
- package/dist/client/assets/{members-dxBgS07V.js → members-BeuYhjqH.js} +1 -1
- package/dist/client/assets/{monaco-editor-BmHelGDg.js → monaco-editor-CjYCKOTC.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-C0T1_3ja.js → monitoring-dashboard-edit-DvViNUXq.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CDX0iyhB.js → monitoring-dashboard-view-CcuLeEOc.js} +1 -1
- package/dist/client/assets/{monitoring-Dygm51vZ.js → monitoring-hEPUjgsC.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cb1hCxgk.js → oauth-callback-BhMmtwfn.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-lIzsTYGK.js → oauth-callback-ai-provider-DdW8Ak96.js} +1 -1
- package/dist/client/assets/{org-ai-providers-CoYprATW.js → org-ai-providers-BRKDGo95.js} +1 -1
- package/dist/client/assets/{page-Cu7gHbt4.js → page-4HZ9ZSA4.js} +1 -1
- package/dist/client/assets/{page-DL6abyDO.js → page-DEXUji1V.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-cFVUXsMw.js → plugin-empty-state-6gk92Qyl.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DwzoJyko.js → plugin-empty-state-CXlis9nm.js} +1 -1
- package/dist/client/assets/{plugin-header-rHEUUeKT.js → plugin-header-Dne9u3jl.js} +1 -1
- package/dist/client/assets/{plugin-header-BhPYkg2t.js → plugin-header-kfwiBpJ4.js} +1 -1
- package/dist/client/assets/plugins-Ca0nbE2z.js +1 -0
- package/dist/client/assets/{popover-DAiH8HrC.js → popover-DFyjfZbz.js} +1 -1
- package/dist/client/assets/{project-app-view-C8IeiPWh.js → project-app-view-D8C1RwhY.js} +1 -1
- package/dist/client/assets/{project-layout-D1sK3RsI.js → project-layout-DoW61RN5.js} +1 -1
- package/dist/client/assets/{project-plugins-CLJvpqWA.js → project-plugins-CoTSSvm2.js} +1 -1
- package/dist/client/assets/{projects-list-D0-piP6V.js → projects-list-CDkYXY0c.js} +1 -1
- package/dist/client/assets/{readme-viewer-Cw2zVTtx.js → readme-viewer-2DAqsNDi.js} +1 -1
- package/dist/client/assets/{registry-layout-CQk4V9Fy.js → registry-layout-OLjzUiGm.js} +1 -1
- package/dist/client/assets/{registry-utils-BQ0EUN1b.js → registry-utils-DQ3Yz0aq.js} +1 -1
- package/dist/client/assets/{reports-layout-V83nUDoJ.js → reports-layout-CATRzkgZ.js} +1 -1
- package/dist/client/assets/{reset-password-DcRv69F2.js → reset-password-CBi8fGal.js} +1 -1
- package/dist/client/assets/{resizable-BRcjlpb9.js → resizable-5ZSV72uv.js} +1 -1
- package/dist/client/assets/{save-actions-Br5EOuh1.js → save-actions-BMwCSEwb.js} +1 -1
- package/dist/client/assets/{scroll-area-B93RC88a.js → scroll-area-D61RAolI.js} +1 -1
- package/dist/client/assets/{select-Iosam4nc.js → select-D2hoe72R.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-B55ZVK2k.js → select-virtual-mcp-DbjwN01X.js} +1 -1
- package/dist/client/assets/{shell-layout-BEtMdNiu.js → shell-layout-C1SmF7Hv.js} +2 -2
- package/dist/client/assets/{sidebar-settings-Zh3CDrTB.js → sidebar-settings-ZGimo8zw.js} +1 -1
- package/dist/client/assets/{skeleton-f9h0kyuC.js → skeleton-DnYWqER_.js} +1 -1
- package/dist/client/assets/{spinner-ClMTbKWw.js → spinner-CABex48W.js} +1 -1
- package/dist/client/assets/{store-invite-DQ0eTfXv.js → store-invite-BFE_gQ55.js} +1 -1
- package/dist/client/assets/{switch-2e_OzSa-.js → switch-CAcWD1sq.js} +1 -1
- package/dist/client/assets/{table-Dr847bjN.js → table-Cxzf-FHD.js} +1 -1
- package/dist/client/assets/{tabs-BlAwR39Z.js → tabs-D57oGoRB.js} +1 -1
- package/dist/client/assets/{task-status-myNxZFI-.js → task-status-D43Cwt6l.js} +1 -1
- package/dist/client/assets/tasks-BCjx4cWT.js +1 -0
- package/dist/client/assets/{tasks-panel-X0AV2-Sn.js → tasks-panel-CG3BQMOl.js} +1 -1
- package/dist/client/assets/{textarea-XcCjv61M.js → textarea-BHHzOaro.js} +1 -1
- package/dist/client/assets/{time-range-picker-_owYVo_t.js → time-range-picker-WMggaRPG.js} +1 -1
- package/dist/client/assets/{toggle-group-C_4VG-JK.js → toggle-group-BIoAHYZJ.js} +1 -1
- package/dist/client/assets/{tools-list-D9ljaQOJ.js → tools-list-x8d6J887.js} +1 -1
- package/dist/client/assets/{tooltip-DjLTvHpz.js → tooltip-CYJcicRO.js} +1 -1
- package/dist/client/assets/{topbar-portal-Bt-7uOLT.js → topbar-portal-f4GfspVt.js} +1 -1
- package/dist/client/assets/{types-B4Gd-u-3.js → types-BvJtOINP.js} +1 -1
- package/dist/client/assets/{use-automations-BeuGbjZ-.js → use-automations-BZqwiEM_.js} +1 -1
- package/dist/client/assets/{use-binding-BEPf7Gie.js → use-binding-DKk5_N9r.js} +1 -1
- package/dist/client/assets/{use-collections-BLzG3bJp.js → use-collections-DMxCeq8b.js} +1 -1
- package/dist/client/assets/{use-connection-D_u6jBgP.js → use-connection-ez0pyFtP.js} +1 -1
- package/dist/client/assets/{use-copy-8HTCCusQ.js → use-copy-CiJz8oao.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CCZ9ZXv4.js → use-create-virtual-mcp-B8asQT4w.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-B5invNZ7.js → use-install-from-registry-CfygxUq4.js} +1 -1
- package/dist/client/assets/{use-list-state-ByEy7Osm.js → use-list-state-CSB_h2rv.js} +1 -1
- package/dist/client/assets/{use-llm-VA4dgcLv.js → use-llm-76KQxHJG.js} +1 -1
- package/dist/client/assets/{use-local-storage-LMzJlC-M.js → use-local-storage-Do7hPFcT.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BQwPUsA-.js → use-mcp-prompts-Dejjnovy.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-e1qXr7bA.js → use-mcp-resources-C2GVZGS8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CCtN3o9e.js → use-mcp-tools-JJSno6Er.js} +1 -1
- package/dist/client/assets/{use-members-C3PUprae.js → use-members-D4TXNlgc.js} +1 -1
- package/dist/client/assets/{use-mobile-DXK-sBip.js → use-mobile-Dc15vEtL.js} +1 -1
- package/dist/client/assets/{use-project-D1gauJR3.js → use-project-fmhu7bPh.js} +1 -1
- package/dist/client/assets/{use-view-mode-DThyKTt5.js → use-view-mode-DmTBDQfD.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-dbqVkjzK.js → use-virtual-mcp-94OtcwcB.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CATkeJqj.js +1 -0
- package/dist/client/assets/{useMutation-D0WkcqTd.js → useMutation-7d0bWCn1.js} +1 -1
- package/dist/client/assets/useQuery-CN1pzVoX.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BD0TGQFj.js +1 -0
- package/dist/client/assets/{user-LylUdoHD.js → user-CztLlDB5.js} +1 -1
- package/dist/client/assets/{workflow-CA1DIkk0.js → workflow-BdfJ6OoL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/node_modules/pg-cloudflare/LICENSE +21 -0
- package/dist/server/node_modules/pg-cloudflare/README.md +112 -0
- package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +2 -0
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js +6 -0
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +1 -0
- package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +31 -0
- package/dist/server/node_modules/pg-cloudflare/dist/index.js +152 -0
- package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +1 -0
- package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +3 -0
- package/dist/server/node_modules/pg-cloudflare/package.json +39 -0
- package/dist/server/node_modules/pg-cloudflare/src/empty.ts +3 -0
- package/dist/server/node_modules/pg-cloudflare/src/index.ts +166 -0
- package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +25 -0
- package/dist/server/node_modules/pg-connection-string/LICENSE +21 -0
- package/dist/server/node_modules/pg-connection-string/README.md +105 -0
- package/dist/server/node_modules/pg-connection-string/esm/index.mjs +8 -0
- package/dist/server/node_modules/pg-connection-string/index.d.ts +36 -0
- package/dist/server/node_modules/pg-connection-string/index.js +231 -0
- package/dist/server/node_modules/pg-connection-string/package.json +52 -0
- package/dist/server/node_modules/pg-pool/LICENSE +21 -0
- package/dist/server/node_modules/pg-pool/README.md +357 -0
- package/dist/server/node_modules/pg-pool/esm/index.mjs +5 -0
- package/dist/server/node_modules/pg-pool/index.js +517 -0
- package/dist/server/node_modules/pg-pool/package.json +51 -0
- package/dist/server/node_modules/pg-protocol/LICENSE +21 -0
- package/dist/server/node_modules/pg-protocol/README.md +3 -0
- package/dist/server/node_modules/pg-protocol/dist/b.d.ts +1 -0
- package/dist/server/node_modules/pg-protocol/dist/b.js +23 -0
- package/dist/server/node_modules/pg-protocol/dist/b.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +15 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +16 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +1 -0
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +530 -0
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/index.d.ts +6 -0
- package/dist/server/node_modules/pg-protocol/dist/index.js +15 -0
- package/dist/server/node_modules/pg-protocol/dist/index.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +162 -0
- package/dist/server/node_modules/pg-protocol/dist/messages.js +160 -0
- package/dist/server/node_modules/pg-protocol/dist/messages.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +1 -0
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +252 -0
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +24 -0
- package/dist/server/node_modules/pg-protocol/dist/parser.js +324 -0
- package/dist/server/node_modules/pg-protocol/dist/parser.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +42 -0
- package/dist/server/node_modules/pg-protocol/dist/serializer.js +189 -0
- package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/esm/index.js +11 -0
- package/dist/server/node_modules/pg-protocol/package.json +45 -0
- package/dist/server/node_modules/pg-protocol/src/b.ts +25 -0
- package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +58 -0
- package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +85 -0
- package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +575 -0
- package/dist/server/node_modules/pg-protocol/src/index.ts +11 -0
- package/dist/server/node_modules/pg-protocol/src/messages.ts +262 -0
- package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +276 -0
- package/dist/server/node_modules/pg-protocol/src/parser.ts +413 -0
- package/dist/server/node_modules/pg-protocol/src/serializer.ts +274 -0
- package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +67 -0
- package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +166 -0
- package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +1 -0
- package/dist/server/node_modules/pg-types/.travis.yml +7 -0
- package/dist/server/node_modules/pg-types/Makefile +14 -0
- package/dist/server/node_modules/pg-types/README.md +75 -0
- package/dist/server/node_modules/pg-types/index.d.ts +137 -0
- package/dist/server/node_modules/pg-types/index.js +47 -0
- package/dist/server/node_modules/pg-types/index.test-d.ts +21 -0
- package/dist/server/node_modules/pg-types/lib/arrayParser.js +11 -0
- package/dist/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
- package/dist/server/node_modules/pg-types/lib/builtins.js +73 -0
- package/dist/server/node_modules/pg-types/lib/textParsers.js +215 -0
- package/dist/server/node_modules/pg-types/package.json +42 -0
- package/dist/server/node_modules/pg-types/test/index.js +24 -0
- package/dist/server/node_modules/pg-types/test/types.js +597 -0
- package/dist/server/node_modules/pgpass/README.md +74 -0
- package/dist/server/node_modules/pgpass/lib/helper.js +233 -0
- package/dist/server/node_modules/pgpass/lib/index.js +23 -0
- package/dist/server/node_modules/pgpass/package.json +41 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/xtend/LICENSE +20 -0
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/package.json +1 -1
- package/dist/client/assets/constants-Dxc17JqT.js +0 -1
- package/dist/client/assets/login-jzlEVf-H.js +0 -1
- package/dist/client/assets/plugins-D8nN3ns-.js +0 -1
- package/dist/client/assets/tasks-Cg_ykzKa.js +0 -1
- package/dist/client/assets/useInfiniteQuery-6ok0NRM6.js +0 -1
- package/dist/client/assets/useQuery-DMs04NaY.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-xBbNB0pB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,u as C,x as W,K as x,w,j as i,B as I}from"./index-
|
|
1
|
+
import{c as g,u as C,x as W,K as x,w,j as i,B as I}from"./index-BUP2j-VZ.js";import{a as _,u as L}from"./constants-B4i933q7.js";import{C as k}from"./collection-tab-Zi-tIaoO.js";import{E as O}from"./empty-state-BJQVSVey.js";import{u as S}from"./useMutation-7d0bWCn1.js";import{P as u}from"./index-CRVyuFS0.js";import{B as b,a as h,b as P,c as y}from"./breadcrumb-C0C7xCxQ.js";import{e as T}from"./Dataflow03-DUfN03Mp.js";import"./generate-id-Dyweu44Y.js";import"./collection-display-button-Dbmpw-3P.js";import"./dropdown-menu-DcNTx9lg.js";import"./Check-B8ndkg7T.js";import"./ChevronRight-BWpUvEdI.js";import"./ArrowDown-J5qOTRoA.js";import"./ArrowUp-aSx0u-5l.js";import"./Grid01-Cx4wu3Y9.js";import"./List-B0bmeecJ.js";import"./tooltip-CYJcicRO.js";import"./index-BPNTL7B5.js";import"./badge-DSBNODR5.js";import"./collection-search-Bl8CXpst.js";import"./Loading01-B87VIClz.js";import"./SearchMd-DEv7e_hZ.js";import"./input-OS0sGs_c.js";import"./card-3wGXs2xF.js";import"./integration-icon-DhNWPq_0.js";import"./Container-CLsUjxhY.js";import"./Copy01-CgG_OJP6.js";import"./DotsVertical-B6C_2FFD.js";import"./Edit01-BYoLi1wi.js";import"./Eye-MtNtMWW5.js";import"./Trash01-DC96NOta.js";import"./collection-table-wrapper-CWpzycma.js";import"./table-Cxzf-FHD.js";import"./empty-state-XvkhVm2a.js";import"./Inbox01-BXbJXxyv.js";import"./user-CztLlDB5.js";import"./avatar-BzF6Jb9Z.js";import"./useQuery-CN1pzVoX.js";import"./use-list-state-CSB_h2rv.js";import"./use-view-mode-DmTBDQfD.js";import"./use-mobile-Dc15vEtL.js";import"./constants-BLiDtBGA.js";import"./alert-dialog-BQU839b3.js";import"./use-collections-DMxCeq8b.js";import"./Plus-CDc4R7NF.js";import"./layout-BjgZH_LK.js";import"./use-local-storage-Do7hPFcT.js";function B(){const e=g.c(12),{org:t,project:r}=C(),a=W();let c;e[0]!==t.id?(c={connectionId:_,orgId:t.id},e[0]=t.id,e[1]=c):c=e[1];const l=L(c);let o;e[2]!==l||e[3]!==r?(o=async d=>{const m=r.enabledPlugins??[];if(m.includes(d))return;const p=[...m,d],j=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:r.id,enabledPlugins:p}});return j.structuredContent??j},e[2]=l,e[3]=r,e[4]=o):o=e[4];let n;e[5]!==t.id||e[6]!==r||e[7]!==a?(n=()=>{a.invalidateQueries({queryKey:x.project(t.id,r.slug)}),a.invalidateQueries({queryKey:x.projects(t.id)})},e[5]=t.id,e[6]=r,e[7]=a,e[8]=n):n=e[8];let s;return e[9]!==o||e[10]!==n?(s={mutationFn:o,onSuccess:n,onError:K},e[9]=o,e[10]=n,e[11]=s):s=e[11],S(s)}function K(e){w.error("Failed to enable plugin: "+(e instanceof Error?e.message:"Unknown error"))}function N(e){const t=g.c(12),{pluginId:r,title:a,description:c,icon:l}=e,o=B();let n;t[0]!==o||t[1]!==r?(n=async()=>{try{await o.mutateAsync(r),w.success("Plugin enabled!")}catch{}},t[0]=o,t[1]=r,t[2]=n):n=t[2];const s=n,f=l??null,d=o.isPending?"Enabling…":"Enable plugin";let m;t[3]!==o.isPending||t[4]!==s||t[5]!==d?(m=i.jsx(I,{onClick:s,disabled:o.isPending,children:d}),t[3]=o.isPending,t[4]=s,t[5]=d,t[6]=m):m=t[6];let p;return t[7]!==c||t[8]!==f||t[9]!==m||t[10]!==a?(p=i.jsx(O,{image:f,title:a,description:c,actions:m}),t[7]=c,t[8]=f,t[9]=m,t[10]=a,t[11]=p):p=t[11],p}const E="workflows",F={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function Te(){const e=g.c(5),{project:t,org:r}=C();if(!(t.enabledPlugins??[]).includes(E)){let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(u.Header,{children:i.jsx(u.Header.Left,{children:i.jsx(b,{children:i.jsx(h,{children:i.jsx(P,{children:i.jsx(y,{children:"Workflows"})})})})})}),e[0]=n):n=e[0];let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs(u,{children:[n,i.jsx(u.Content,{children:i.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:i.jsx(N,{pluginId:E,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:i.jsx("div",{className:"bg-muted p-4 rounded-full",children:i.jsx(T,{className:"size-8 text-muted-foreground"})})})})})]}),e[1]=s):s=e[1],s}let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(u.Header,{children:i.jsx(u.Header.Left,{children:i.jsx(b,{children:i.jsx(h,{children:i.jsx(P,{children:i.jsx(y,{children:"Workflows"})})})})})}),e[2]=l):l=e[2];let o;return e[3]!==r.slug?(o=i.jsxs(u,{children:[l,i.jsx(u.Content,{children:i.jsx(k,{connectionId:_,org:r.slug,activeCollection:F})})]}),e[3]=r.slug,e[4]=o):o=e[4],o}export{Te as default};
|
package/dist/client/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
|
|
13
13
|
<meta name="twitter:image" content="/og-image.png" />
|
|
14
14
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-BUP2j-VZ.js"></script>
|
|
16
16
|
<link rel="stylesheet" crossorigin href="/assets/index-Cta5OAsO.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2010 - 2021 Brian Carlson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# pg-cloudflare
|
|
2
|
+
|
|
3
|
+
`pg-cloudflare` makes it easier to take an existing package that relies on `tls` and `net`, and make it work in environments where only `connect()` is supported, such as Cloudflare Workers.
|
|
4
|
+
|
|
5
|
+
`pg-cloudflare` wraps `connect()`, the [TCP Socket API](https://github.com/wintercg/proposal-sockets-api) proposed within WinterCG, and implemented in [Cloudflare Workers](https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/), and exposes an interface with methods similar to what the `net` and `tls` modules in Node.js expose. (ex: `net.connect(path[, options][, callback])`). This minimizes the number of changes needed in order to make an existing package work across JavaScript runtimes.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm i --save-dev pg-cloudflare
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The package uses conditional exports to support bundlers that don't know about
|
|
14
|
+
`cloudflare:sockets`, so the consumer code by default imports an empty file. To
|
|
15
|
+
enable the package, resolve to the `cloudflare` condition in your bundler's
|
|
16
|
+
config. For example:
|
|
17
|
+
|
|
18
|
+
- `webpack.config.js`
|
|
19
|
+
```js
|
|
20
|
+
export default {
|
|
21
|
+
...,
|
|
22
|
+
resolve: { conditionNames: [..., "workerd"] },
|
|
23
|
+
plugins: [
|
|
24
|
+
// ignore cloudflare:sockets imports
|
|
25
|
+
new webpack.IgnorePlugin({
|
|
26
|
+
resourceRegExp: /^cloudflare:sockets$/,
|
|
27
|
+
}),
|
|
28
|
+
],
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
- `vite.config.js`
|
|
32
|
+
|
|
33
|
+
> [!NOTE]
|
|
34
|
+
> If you are using the [Cloudflare Vite plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) then the following configuration is not necessary.
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
...,
|
|
39
|
+
resolve: {
|
|
40
|
+
conditions: [..., "workerd"],
|
|
41
|
+
},
|
|
42
|
+
build: {
|
|
43
|
+
...,
|
|
44
|
+
// don't try to bundle cloudflare:sockets
|
|
45
|
+
rollupOptions: {
|
|
46
|
+
external: [..., 'cloudflare:sockets'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- `rollup.config.js`
|
|
53
|
+
```js
|
|
54
|
+
export default defineConfig({
|
|
55
|
+
...,
|
|
56
|
+
plugins: [..., nodeResolve({ exportConditions: [..., 'workerd'] })],
|
|
57
|
+
// don't try to bundle cloudflare:sockets
|
|
58
|
+
external: [..., 'cloudflare:sockets'],
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
- `esbuild.config.js`
|
|
62
|
+
```js
|
|
63
|
+
await esbuild.build({
|
|
64
|
+
...,
|
|
65
|
+
conditions: [..., 'workerd'],
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The concrete examples can be found in `packages/pg-bundler-test`.
|
|
70
|
+
|
|
71
|
+
## How to use conditionally, in non-Node.js environments
|
|
72
|
+
|
|
73
|
+
As implemented in `pg` [here](https://github.com/brianc/node-postgres/commit/07553428e9c0eacf761a5d4541a3300ff7859578#diff-34588ad868ebcb232660aba7ee6a99d1e02f4bc93f73497d2688c3f074e60533R5-R13), a typical use case might look as follows, where in a Node.js environment the `net` module is used, while in a non-Node.js environment, where `net` is unavailable, `pg-cloudflare` is used instead, providing an equivalent interface:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
module.exports.getStream = function getStream(ssl = false) {
|
|
77
|
+
const net = require('net')
|
|
78
|
+
if (typeof net.Socket === 'function') {
|
|
79
|
+
return net.Socket()
|
|
80
|
+
}
|
|
81
|
+
const { CloudflareSocket } = require('pg-cloudflare')
|
|
82
|
+
return new CloudflareSocket(ssl)
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Node.js implementation of the Socket API proposal
|
|
87
|
+
|
|
88
|
+
If you're looking for a way to rely on `connect()` as the interface you use to interact with raw sockets, but need this interface to be available in a Node.js environment, [`@arrowood.dev/socket`](https://github.com/Ethan-Arrowood/socket) provides a Node.js implementation of the Socket API.
|
|
89
|
+
|
|
90
|
+
### license
|
|
91
|
+
|
|
92
|
+
The MIT License (MIT)
|
|
93
|
+
|
|
94
|
+
Copyright (c) 2023 Brian M. Carlson
|
|
95
|
+
|
|
96
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
97
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
98
|
+
in the Software without restriction, including without limitation the rights
|
|
99
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
100
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
101
|
+
furnished to do so, subject to the following conditions:
|
|
102
|
+
|
|
103
|
+
The above copyright notice and this permission notice shall be included in
|
|
104
|
+
all copies or substantial portions of the Software.
|
|
105
|
+
|
|
106
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
107
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
108
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
109
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
110
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
111
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
112
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.js","sourceRoot":"","sources":["../src/empty.ts"],"names":[],"mappings":";;AAAA,kFAAkF;AAClF,0CAA0C;AAC1C,kBAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { TlsOptions } from 'cloudflare:sockets';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
/**
|
|
7
|
+
* Wrapper around the Cloudflare built-in socket that can be used by the `Connection`.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CloudflareSocket extends EventEmitter {
|
|
10
|
+
readonly ssl: boolean;
|
|
11
|
+
writable: boolean;
|
|
12
|
+
destroyed: boolean;
|
|
13
|
+
private _upgrading;
|
|
14
|
+
private _upgraded;
|
|
15
|
+
private _cfSocket;
|
|
16
|
+
private _cfWriter;
|
|
17
|
+
private _cfReader;
|
|
18
|
+
constructor(ssl: boolean);
|
|
19
|
+
setNoDelay(): this;
|
|
20
|
+
setKeepAlive(): this;
|
|
21
|
+
ref(): this;
|
|
22
|
+
unref(): this;
|
|
23
|
+
connect(port: number, host: string, connectListener?: (...args: unknown[]) => void): Promise<this | undefined>;
|
|
24
|
+
_listen(): Promise<void>;
|
|
25
|
+
_listenOnce(): Promise<void>;
|
|
26
|
+
write(data: Uint8Array | string, encoding?: BufferEncoding, callback?: (...args: unknown[]) => void): true | void;
|
|
27
|
+
end(data?: Buffer, encoding?: BufferEncoding, callback?: (...args: unknown[]) => void): this;
|
|
28
|
+
destroy(reason: string): this;
|
|
29
|
+
startTls(options: TlsOptions): void;
|
|
30
|
+
_addClosedHandler(): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CloudflareSocket = void 0;
|
|
4
|
+
const events_1 = require("events");
|
|
5
|
+
/**
|
|
6
|
+
* Wrapper around the Cloudflare built-in socket that can be used by the `Connection`.
|
|
7
|
+
*/
|
|
8
|
+
class CloudflareSocket extends events_1.EventEmitter {
|
|
9
|
+
constructor(ssl) {
|
|
10
|
+
super();
|
|
11
|
+
this.ssl = ssl;
|
|
12
|
+
this.writable = false;
|
|
13
|
+
this.destroyed = false;
|
|
14
|
+
this._upgrading = false;
|
|
15
|
+
this._upgraded = false;
|
|
16
|
+
this._cfSocket = null;
|
|
17
|
+
this._cfWriter = null;
|
|
18
|
+
this._cfReader = null;
|
|
19
|
+
}
|
|
20
|
+
setNoDelay() {
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
setKeepAlive() {
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
ref() {
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
unref() {
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
async connect(port, host, connectListener) {
|
|
33
|
+
try {
|
|
34
|
+
log('connecting');
|
|
35
|
+
if (connectListener)
|
|
36
|
+
this.once('connect', connectListener);
|
|
37
|
+
const options = this.ssl ? { secureTransport: 'starttls' } : {};
|
|
38
|
+
const mod = await import('cloudflare:sockets');
|
|
39
|
+
const connect = mod.connect;
|
|
40
|
+
this._cfSocket = connect(`${host}:${port}`, options);
|
|
41
|
+
this._cfWriter = this._cfSocket.writable.getWriter();
|
|
42
|
+
this._addClosedHandler();
|
|
43
|
+
this._cfReader = this._cfSocket.readable.getReader();
|
|
44
|
+
if (this.ssl) {
|
|
45
|
+
this._listenOnce().catch((e) => this.emit('error', e));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this._listen().catch((e) => this.emit('error', e));
|
|
49
|
+
}
|
|
50
|
+
await this._cfWriter.ready;
|
|
51
|
+
log('socket ready');
|
|
52
|
+
this.writable = true;
|
|
53
|
+
this.emit('connect');
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
this.emit('error', e);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async _listen() {
|
|
61
|
+
// eslint-disable-next-line no-constant-condition
|
|
62
|
+
while (true) {
|
|
63
|
+
log('awaiting receive from CF socket');
|
|
64
|
+
const { done, value } = await this._cfReader.read();
|
|
65
|
+
log('CF socket received:', done, value);
|
|
66
|
+
if (done) {
|
|
67
|
+
log('done');
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
this.emit('data', Buffer.from(value));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async _listenOnce() {
|
|
74
|
+
log('awaiting first receive from CF socket');
|
|
75
|
+
const { done, value } = await this._cfReader.read();
|
|
76
|
+
log('First CF socket received:', done, value);
|
|
77
|
+
this.emit('data', Buffer.from(value));
|
|
78
|
+
}
|
|
79
|
+
write(data, encoding = 'utf8', callback = () => { }) {
|
|
80
|
+
if (data.length === 0)
|
|
81
|
+
return callback();
|
|
82
|
+
if (typeof data === 'string')
|
|
83
|
+
data = Buffer.from(data, encoding);
|
|
84
|
+
log('sending data direct:', data);
|
|
85
|
+
this._cfWriter.write(data).then(() => {
|
|
86
|
+
log('data sent');
|
|
87
|
+
callback();
|
|
88
|
+
}, (err) => {
|
|
89
|
+
log('send error', err);
|
|
90
|
+
callback(err);
|
|
91
|
+
});
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
end(data = Buffer.alloc(0), encoding = 'utf8', callback = () => { }) {
|
|
95
|
+
log('ending CF socket');
|
|
96
|
+
this.write(data, encoding, (err) => {
|
|
97
|
+
this._cfSocket.close();
|
|
98
|
+
if (callback)
|
|
99
|
+
callback(err);
|
|
100
|
+
});
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
destroy(reason) {
|
|
104
|
+
log('destroying CF socket', reason);
|
|
105
|
+
this.destroyed = true;
|
|
106
|
+
return this.end();
|
|
107
|
+
}
|
|
108
|
+
startTls(options) {
|
|
109
|
+
if (this._upgraded) {
|
|
110
|
+
// Don't try to upgrade again.
|
|
111
|
+
this.emit('error', 'Cannot call `startTls()` more than once on a socket');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this._cfWriter.releaseLock();
|
|
115
|
+
this._cfReader.releaseLock();
|
|
116
|
+
this._upgrading = true;
|
|
117
|
+
this._cfSocket = this._cfSocket.startTls(options);
|
|
118
|
+
this._cfWriter = this._cfSocket.writable.getWriter();
|
|
119
|
+
this._cfReader = this._cfSocket.readable.getReader();
|
|
120
|
+
this._addClosedHandler();
|
|
121
|
+
this._listen().catch((e) => this.emit('error', e));
|
|
122
|
+
}
|
|
123
|
+
_addClosedHandler() {
|
|
124
|
+
this._cfSocket.closed.then(() => {
|
|
125
|
+
if (!this._upgrading) {
|
|
126
|
+
log('CF socket closed');
|
|
127
|
+
this._cfSocket = null;
|
|
128
|
+
this.emit('close');
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this._upgrading = false;
|
|
132
|
+
this._upgraded = true;
|
|
133
|
+
}
|
|
134
|
+
}).catch((e) => this.emit('error', e));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.CloudflareSocket = CloudflareSocket;
|
|
138
|
+
const debug = false;
|
|
139
|
+
function dump(data) {
|
|
140
|
+
if (data instanceof Uint8Array || data instanceof ArrayBuffer) {
|
|
141
|
+
const hex = Buffer.from(data).toString('hex');
|
|
142
|
+
const str = new TextDecoder().decode(data);
|
|
143
|
+
return `\n>>> STR: "${str.replace(/\n/g, '\\n')}"\n>>> HEX: ${hex}\n`;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
return data;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function log(...args) {
|
|
150
|
+
debug && console.log(...args.map(dump));
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,mCAAqC;A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gBACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;aACtB;QACH,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;IACxC,CAAC;CACF;AA/ID,4CA+IC;AAED,MAAM,KAAK,GAAG,KAAK,CAAA;AAEnB,SAAS,IAAI,CAAC,IAAa;IACzB,IAAI,IAAI,YAAY,UAAU,IAAI,IAAI,YAAY,WAAW,EAAE;QAC7D,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC7C,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC1C,OAAO,eAAe,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,GAAG,IAAI,CAAA;KACtE;SAAM;QACL,OAAO,IAAI,CAAA;KACZ;AACH,CAAC;AAED,SAAS,GAAG,CAAC,GAAG,IAAe;IAC7B,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pg-cloudflare",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "A socket implementation that can run on Cloudflare Workers using native TCP connections.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"ts-node": "^8.5.4",
|
|
10
|
+
"typescript": "^4.0.3"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"workerd": {
|
|
15
|
+
"import": "./esm/index.mjs",
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"default": "./dist/empty.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"build:watch": "tsc --watch",
|
|
25
|
+
"prepublish": "yarn build",
|
|
26
|
+
"test": "echo e2e test in pg package"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git://github.com/brianc/node-postgres.git",
|
|
31
|
+
"directory": "packages/pg-cloudflare"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"/dist/*{js,ts,map}",
|
|
35
|
+
"/src",
|
|
36
|
+
"/esm"
|
|
37
|
+
],
|
|
38
|
+
"gitHead": "d10e09c888f94abf77382aba6f353ca665a1cf09"
|
|
39
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { SocketOptions, Socket, TlsOptions } from 'cloudflare:sockets'
|
|
2
|
+
import { EventEmitter } from 'events'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper around the Cloudflare built-in socket that can be used by the `Connection`.
|
|
6
|
+
*/
|
|
7
|
+
export class CloudflareSocket extends EventEmitter {
|
|
8
|
+
writable = false
|
|
9
|
+
destroyed = false
|
|
10
|
+
|
|
11
|
+
private _upgrading = false
|
|
12
|
+
private _upgraded = false
|
|
13
|
+
private _cfSocket: Socket | null = null
|
|
14
|
+
private _cfWriter: WritableStreamDefaultWriter | null = null
|
|
15
|
+
private _cfReader: ReadableStreamDefaultReader | null = null
|
|
16
|
+
|
|
17
|
+
constructor(readonly ssl: boolean) {
|
|
18
|
+
super()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
setNoDelay() {
|
|
22
|
+
return this
|
|
23
|
+
}
|
|
24
|
+
setKeepAlive() {
|
|
25
|
+
return this
|
|
26
|
+
}
|
|
27
|
+
ref() {
|
|
28
|
+
return this
|
|
29
|
+
}
|
|
30
|
+
unref() {
|
|
31
|
+
return this
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async connect(port: number, host: string, connectListener?: (...args: unknown[]) => void) {
|
|
35
|
+
try {
|
|
36
|
+
log('connecting')
|
|
37
|
+
if (connectListener) this.once('connect', connectListener)
|
|
38
|
+
|
|
39
|
+
const options: SocketOptions = this.ssl ? { secureTransport: 'starttls' } : {}
|
|
40
|
+
const mod = await import('cloudflare:sockets')
|
|
41
|
+
const connect = mod.connect
|
|
42
|
+
this._cfSocket = connect(`${host}:${port}`, options)
|
|
43
|
+
this._cfWriter = this._cfSocket.writable.getWriter()
|
|
44
|
+
this._addClosedHandler()
|
|
45
|
+
|
|
46
|
+
this._cfReader = this._cfSocket.readable.getReader()
|
|
47
|
+
if (this.ssl) {
|
|
48
|
+
this._listenOnce().catch((e) => this.emit('error', e))
|
|
49
|
+
} else {
|
|
50
|
+
this._listen().catch((e) => this.emit('error', e))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
await this._cfWriter!.ready
|
|
54
|
+
log('socket ready')
|
|
55
|
+
this.writable = true
|
|
56
|
+
this.emit('connect')
|
|
57
|
+
|
|
58
|
+
return this
|
|
59
|
+
} catch (e) {
|
|
60
|
+
this.emit('error', e)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async _listen() {
|
|
65
|
+
// eslint-disable-next-line no-constant-condition
|
|
66
|
+
while (true) {
|
|
67
|
+
log('awaiting receive from CF socket')
|
|
68
|
+
const { done, value } = await this._cfReader!.read()
|
|
69
|
+
log('CF socket received:', done, value)
|
|
70
|
+
if (done) {
|
|
71
|
+
log('done')
|
|
72
|
+
break
|
|
73
|
+
}
|
|
74
|
+
this.emit('data', Buffer.from(value))
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async _listenOnce() {
|
|
79
|
+
log('awaiting first receive from CF socket')
|
|
80
|
+
const { done, value } = await this._cfReader!.read()
|
|
81
|
+
log('First CF socket received:', done, value)
|
|
82
|
+
this.emit('data', Buffer.from(value))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
write(
|
|
86
|
+
data: Uint8Array | string,
|
|
87
|
+
encoding: BufferEncoding = 'utf8',
|
|
88
|
+
callback: (...args: unknown[]) => void = () => {}
|
|
89
|
+
) {
|
|
90
|
+
if (data.length === 0) return callback()
|
|
91
|
+
if (typeof data === 'string') data = Buffer.from(data, encoding)
|
|
92
|
+
|
|
93
|
+
log('sending data direct:', data)
|
|
94
|
+
this._cfWriter!.write(data).then(
|
|
95
|
+
() => {
|
|
96
|
+
log('data sent')
|
|
97
|
+
callback()
|
|
98
|
+
},
|
|
99
|
+
(err) => {
|
|
100
|
+
log('send error', err)
|
|
101
|
+
callback(err)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
return true
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
end(data = Buffer.alloc(0), encoding: BufferEncoding = 'utf8', callback: (...args: unknown[]) => void = () => {}) {
|
|
108
|
+
log('ending CF socket')
|
|
109
|
+
this.write(data, encoding, (err) => {
|
|
110
|
+
this._cfSocket!.close()
|
|
111
|
+
if (callback) callback(err)
|
|
112
|
+
})
|
|
113
|
+
return this
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
destroy(reason: string) {
|
|
117
|
+
log('destroying CF socket', reason)
|
|
118
|
+
this.destroyed = true
|
|
119
|
+
return this.end()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
startTls(options: TlsOptions) {
|
|
123
|
+
if (this._upgraded) {
|
|
124
|
+
// Don't try to upgrade again.
|
|
125
|
+
this.emit('error', 'Cannot call `startTls()` more than once on a socket')
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
|
+
this._cfWriter!.releaseLock()
|
|
129
|
+
this._cfReader!.releaseLock()
|
|
130
|
+
this._upgrading = true
|
|
131
|
+
this._cfSocket = this._cfSocket!.startTls(options)
|
|
132
|
+
this._cfWriter = this._cfSocket.writable.getWriter()
|
|
133
|
+
this._cfReader = this._cfSocket.readable.getReader()
|
|
134
|
+
this._addClosedHandler()
|
|
135
|
+
this._listen().catch((e) => this.emit('error', e))
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
_addClosedHandler() {
|
|
139
|
+
this._cfSocket!.closed.then(() => {
|
|
140
|
+
if (!this._upgrading) {
|
|
141
|
+
log('CF socket closed')
|
|
142
|
+
this._cfSocket = null
|
|
143
|
+
this.emit('close')
|
|
144
|
+
} else {
|
|
145
|
+
this._upgrading = false
|
|
146
|
+
this._upgraded = true
|
|
147
|
+
}
|
|
148
|
+
}).catch((e) => this.emit('error', e))
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const debug = false
|
|
153
|
+
|
|
154
|
+
function dump(data: unknown) {
|
|
155
|
+
if (data instanceof Uint8Array || data instanceof ArrayBuffer) {
|
|
156
|
+
const hex = Buffer.from(data).toString('hex')
|
|
157
|
+
const str = new TextDecoder().decode(data)
|
|
158
|
+
return `\n>>> STR: "${str.replace(/\n/g, '\\n')}"\n>>> HEX: ${hex}\n`
|
|
159
|
+
} else {
|
|
160
|
+
return data
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function log(...args: unknown[]) {
|
|
165
|
+
debug && console.log(...args.map(dump))
|
|
166
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare module 'cloudflare:sockets' {
|
|
2
|
+
export class Socket {
|
|
3
|
+
public readonly readable: any
|
|
4
|
+
public readonly writable: any
|
|
5
|
+
public readonly closed: Promise<void>
|
|
6
|
+
public close(): Promise<void>
|
|
7
|
+
public startTls(options: TlsOptions): Socket
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TlsOptions = {
|
|
11
|
+
expectedServerHostname?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type SocketAddress = {
|
|
15
|
+
hostname: string
|
|
16
|
+
port: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type SocketOptions = {
|
|
20
|
+
secureTransport?: 'off' | 'on' | 'starttls'
|
|
21
|
+
allowHalfOpen?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function connect(address: string | SocketAddress, options?: SocketOptions): Socket
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Iced Development
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|