decocms 2.292.1 → 2.293.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/dist/client/assets/{AlertCircle-Cx8oex2u.js → AlertCircle-DnJbX_0w.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DtpIYMrr.js → ArrowNarrowLeft-M9-X6Sxy.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-BBjaHjTK.js → ArrowUpRight-BQK-oA7E.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Mywkb82K.js → CheckCircle-BTDGGZJo.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BE0rQ4ho.js → ChevronDown-D098IDk9.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BVJ2HUMt.js → ChevronRight-DIr3-XeU.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-B2y_5HwX.js → ChevronUp-qt4sL4uC.js} +1 -1
  8. package/dist/client/assets/{Container-CtsNRge8.js → Container-BvdKvtbe.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-BQnGY6Nc.js → DotsVertical-DGFUAKYN.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-SieYyhiZ.js → LinkExternal01-CS_vTEL0.js} +1 -1
  11. package/dist/client/assets/{Lock01-BrFrkt3t.js → Lock01-DepQhBci.js} +1 -1
  12. package/dist/client/assets/{Palette-2CChK5yr.js → Palette-SeD4BOqL.js} +1 -1
  13. package/dist/client/assets/{Play-BfzIvHVC.js → Play-B2WhNMxb.js} +1 -1
  14. package/dist/client/assets/{Plus-kLSd3TZy.js → Plus-6a_0gFD5.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-B-L6FvMp.js → RefreshCcw01-CmGHOB_j.js} +1 -1
  16. package/dist/client/assets/{SearchMd-BfBE-dHK.js → SearchMd-B4RJoOIR.js} +1 -1
  17. package/dist/client/assets/{Settings02-EP4I50bB.js → Settings02-86F4b3dQ.js} +1 -1
  18. package/dist/client/assets/{Shield01-D19-LRUf.js → Shield01-CzaXyqoU.js} +1 -1
  19. package/dist/client/assets/{Star01-MuiWZ8GS.js → Star01-BsL_E8DX.js} +1 -1
  20. package/dist/client/assets/{Sun-CTLobT4y.js → Sun-CoYtwe4c.js} +1 -1
  21. package/dist/client/assets/{Tool01-CeBylvMu.js → Tool01-Cxeqfwwz.js} +1 -1
  22. package/dist/client/assets/{Trash01-BLGcALKg.js → Trash01-Crqeojj8.js} +1 -1
  23. package/dist/client/assets/{User01-BLHrCCyy.js → User01-lfQ-qZIG.js} +1 -1
  24. package/dist/client/assets/{Users03-C3QqJn94.js → Users03-BEcIfaLP.js} +1 -1
  25. package/dist/client/assets/{X-BJbamPEP.js → X-DSm8Y-S-.js} +1 -1
  26. package/dist/client/assets/{XCircle-DP5EGLqX.js → XCircle-D0NNu2cU.js} +1 -1
  27. package/dist/client/assets/{XClose-BRn4UVuG.js → XClose-8tp9nQPE.js} +1 -1
  28. package/dist/client/assets/{Zap-kZUu0No-.js → Zap-GnwBp_Qp.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-B3o6QvJe.js → ZapSquare-DgxRVJjy.js} +1 -1
  30. package/dist/client/assets/accordion-CJq3HBrS.js +1 -0
  31. package/dist/client/assets/agent-icon-DxobcFDr.js +1 -0
  32. package/dist/client/assets/agents-list-eEeKypKu.js +1 -0
  33. package/dist/client/assets/ai-providers-D_bgIPsh.js +1 -0
  34. package/dist/client/assets/{alert-dialog-BFg1HHbW.js → alert-dialog-CscciHzk.js} +2 -2
  35. package/dist/client/assets/{auth-catchall-BPCBowrT.js → auth-catchall-DZZidYw0.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-0e1qSQoQ.js → automation-list-row-Br_pkbGs.js} +1 -1
  37. package/dist/client/assets/automations-Ch3eQvio.js +1 -0
  38. package/dist/client/assets/{avatar-BfSY5CVM.js → avatar-BQ09Qk0Z.js} +1 -1
  39. package/dist/client/assets/{badge-C_B8gNbw.js → badge-Clg4Tzdw.js} +1 -1
  40. package/dist/client/assets/brand-context-DZl3n4iE.js +1 -0
  41. package/dist/client/assets/{card-G6flwhwa.js → card-DUOq7Rl6.js} +1 -1
  42. package/dist/client/assets/chat-context-CfrtTY3a.js +31 -0
  43. package/dist/client/assets/{checkbox-LBmczTXJ.js → checkbox-D2GZcsVt.js} +1 -1
  44. package/dist/client/assets/collection-detail-ChjtG6Ga.js +1 -0
  45. package/dist/client/assets/collection-display-button-BZwsY1Wv.js +1 -0
  46. package/dist/client/assets/{collection-search-DoXoIAYq.js → collection-search-CzSQR8Hb.js} +1 -1
  47. package/dist/client/assets/{collection-search-CsSMb59s.js → collection-search-DW3g3zGc.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-B2fVBjE4.js → collection-table-wrapper-B84Op-Zk.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-CA1SpsaZ.js → collection-tabs-DVyOXsXh.js} +1 -1
  50. package/dist/client/assets/{collections-BAHpsq0P.js → collections-CzE8C7FB.js} +1 -1
  51. package/dist/client/assets/{command-CJYPyBOh.js → command-ChcvD0z3.js} +1 -1
  52. package/dist/client/assets/{connection-card-DZ1fYoPr.js → connection-card-C2vEoZIt.js} +1 -1
  53. package/dist/client/assets/connection-detail-BGY9VwYa.js +1 -0
  54. package/dist/client/assets/connection-form-helpers-CgA-QNzF.js +1 -0
  55. package/dist/client/assets/connections-DRgi7C4U.js +1 -0
  56. package/dist/client/assets/{constants-B-gCw63I.js → constants-CrD_AMxD.js} +1 -1
  57. package/dist/client/assets/{constants-Dw_UtizE.js → constants-nJzh8CYx.js} +2 -2
  58. package/dist/client/assets/{dialog-DjZXbytL.js → dialog-CVDAkUpR.js} +1 -1
  59. package/dist/client/assets/domain-settings-ClmaftJG.js +1 -0
  60. package/dist/client/assets/{drawer-BFBl_9mB.js → drawer-CFg3CiQr.js} +1 -1
  61. package/dist/client/assets/dropdown-menu-gP2-wJTw.js +1 -0
  62. package/dist/client/assets/dynamic-plugin-layout-DZA29J1C.js +1 -0
  63. package/dist/client/assets/{empty-state-CWYR2iH4.js → empty-state-C2PUUqhT.js} +1 -1
  64. package/dist/client/assets/{empty-state-DskpQs8Q.js → empty-state-CPpC79-7.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-DiYA0QYt.js → extract-connection-data-5g73Imwy.js} +1 -1
  66. package/dist/client/assets/features-CeA9UMCz.js +1 -0
  67. package/dist/client/assets/form-yPmbpUVF.js +1 -0
  68. package/dist/client/assets/general-CX6-dTKZ.js +1 -0
  69. package/dist/client/assets/index-B3vDeqTk.js +1 -0
  70. package/dist/client/assets/{index-Bm_-4bAj.js → index-BYM0cbyk.js} +3 -3
  71. package/dist/client/assets/{index-QvZR-ABK.js → index-BdUJIICa.js} +1 -1
  72. package/dist/client/assets/index-BzSFWy5-.js +189 -0
  73. package/dist/client/assets/index-C3hSkh4S.js +1 -0
  74. package/dist/client/assets/index-CXbGCxBV.js +547 -0
  75. package/dist/client/assets/{index-BnoHDdAn.js → index-CfanpUI7.js} +3 -3
  76. package/dist/client/assets/{index-x18ABRVV.js → index-CqrrK0SQ.js} +1 -1
  77. package/dist/client/assets/{index-DA_fcz0a.js → index-CsTWePfc.js} +1 -1
  78. package/dist/client/assets/index-DImBkhtD.js +1 -0
  79. package/dist/client/assets/index-Dbs2wH7N.js +1 -0
  80. package/dist/client/assets/index-DkZMRzTR.js +1 -0
  81. package/dist/client/assets/index-Dkaetwrr.js +142 -0
  82. package/dist/client/assets/{index-CllFnV9J.js → index-Dlk19fTc.js} +1 -1
  83. package/dist/client/assets/index-b9vWbQjO.js +1 -0
  84. package/dist/client/assets/{index-Bu0xhzLF.js → index-gKZjkMnf.js} +26 -26
  85. package/dist/client/assets/{infiniteQueryObserver-DEk-T30Y.js → infiniteQueryObserver-B9PWohpE.js} +1 -1
  86. package/dist/client/assets/{input-B5aMagwc.js → input-Cet4kRAV.js} +1 -1
  87. package/dist/client/assets/{integration-icon-B5mNngh-.js → integration-icon-BYjt2zM8.js} +1 -1
  88. package/dist/client/assets/{label-Bv4VMaQH.js → label-CaWfIbuT.js} +1 -1
  89. package/dist/client/assets/layout-BgwHTi9m.js +1 -0
  90. package/dist/client/assets/lean-canvas-recruit-modal-CNtMOKiS.js +116 -0
  91. package/dist/client/assets/{login-DFTX50_T.js → login-DDBhfkxa.js} +1 -1
  92. package/dist/client/assets/{members-BbGgTXF7.js → members-CpZry3vM.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-CV15HqlU.js → monaco-editor-D2GSkzL1.js} +1 -1
  94. package/dist/client/assets/{monitoring-stats-row-FCrYNYUL.js → monitoring-stats-row-B9-AgFrN.js} +1 -1
  95. package/dist/client/assets/{oauth-callback-W1x4HvAt.js → oauth-callback-ZTQDmTMI.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider-8jGGtkD-.js → oauth-callback-ai-provider-Gd1uARX2.js} +1 -1
  97. package/dist/client/assets/{onboarding-DiKHM7MB.js → onboarding-8fDDt_RN.js} +1 -1
  98. package/dist/client/assets/{org-layout-B-bINoer.js → org-layout-Bw77z4Sw.js} +1 -1
  99. package/dist/client/assets/org-plugin-layout-BIXLREf_.js +1 -0
  100. package/dist/client/assets/{task-status-D3v6N-jY.js → pair-CSF6pLZy.js} +40 -40
  101. package/dist/client/assets/plugin-empty-state-D452cObw.js +1 -0
  102. package/dist/client/assets/plugin-header-DesRdhcy.js +1 -0
  103. package/dist/client/assets/{plugin-layout-2a2a-fWN.js → plugin-layout-cW34W41Y.js} +1 -1
  104. package/dist/client/assets/{popover-CGtNHDEz.js → popover-dpRZqzOJ.js} +1 -1
  105. package/dist/client/assets/profile-AXVJhA8D.js +1 -0
  106. package/dist/client/assets/project-app-view-C0WWCGe_.js +1 -0
  107. package/dist/client/assets/registry-91e7KTfr.js +2 -0
  108. package/dist/client/assets/{registry-layout-YWa06n-y.js → registry-layout-DWruz43b.js} +1 -1
  109. package/dist/client/assets/required-auth-layout-DVgyyuV-.js +1 -0
  110. package/dist/client/assets/{reset-password-CfhsLJCK.js → reset-password-jjqpZRxZ.js} +1 -1
  111. package/dist/client/assets/roles-Bf8vBKyU.js +1 -0
  112. package/dist/client/assets/scroll-area-CH9Vosbx.js +1 -0
  113. package/dist/client/assets/{search-input-DRzVzeWW.js → search-input-BTdLweUR.js} +1 -1
  114. package/dist/client/assets/select-B6R2tTSM.js +1 -0
  115. package/dist/client/assets/{select-model-BdV3Nm5y.js → select-model-BMdrDFa3.js} +1 -1
  116. package/dist/client/assets/settings-layout-CnrVmFqe.js +1 -0
  117. package/dist/client/assets/{settings-section-nyO0fOgx.js → settings-section-Z9FmAPIg.js} +1 -1
  118. package/dist/client/assets/shell-layout-DaB5J-du.js +1 -0
  119. package/dist/client/assets/{skeleton-ClT50YXx.js → skeleton-BhVqr-eG.js} +1 -1
  120. package/dist/client/assets/sso-DZJw-CAn.js +1 -0
  121. package/dist/client/assets/store-D-L6Gt6i.js +1 -0
  122. package/dist/client/assets/store-registry-DdZCk03l.js +2 -0
  123. package/dist/client/assets/{switch-Bp1Tvx2h.js → switch-D_DqyrYW.js} +1 -1
  124. package/dist/client/assets/{table-BL7WuMkY.js → table-D1_6e_tY.js} +1 -1
  125. package/dist/client/assets/{tabs-CNz9F6wL.js → tabs-Bu_QsdLq.js} +1 -1
  126. package/dist/client/assets/task-status-DKnoaN0K.js +1 -0
  127. package/dist/client/assets/{textarea-BxmFQbso.js → textarea-BPX5qWaA.js} +1 -1
  128. package/dist/client/assets/{toggle-group-B4KaadHq.js → toggle-group-BJxlfhsN.js} +1 -1
  129. package/dist/client/assets/tools-list-CjPOU8GA.js +1 -0
  130. package/dist/client/assets/tooltip-DlUl6zVU.js +1 -0
  131. package/dist/client/assets/{types-BtVZ_7jK.js → types-CUVoLk-m.js} +6 -6
  132. package/dist/client/assets/{use-ai-providers-DqhLue8O.js → use-ai-providers-CKSasQTP.js} +1 -1
  133. package/dist/client/assets/{use-collections-CLt7BhQ3.js → use-collections-DKaygmj-.js} +1 -1
  134. package/dist/client/assets/{use-connection-BCV5VAjQ.js → use-connection-DLwIHVYP.js} +1 -1
  135. package/dist/client/assets/{use-copy-CYT1tdMJ.js → use-copy-CLL1wnsg.js} +1 -1
  136. package/dist/client/assets/use-create-virtual-mcp-B693GvUD.js +1 -0
  137. package/dist/client/assets/{use-decopilot-events-BNaQbe7E.js → use-decopilot-events-NXGOEGvZ.js} +1 -1
  138. package/dist/client/assets/{use-delete-connection-YzycomMd.js → use-delete-connection-DN8HxHVx.js} +1 -1
  139. package/dist/client/assets/{use-infinite-scroll-CoMWGssU.js → use-infinite-scroll-B32XN73V.js} +1 -1
  140. package/dist/client/assets/{use-list-state-jiGNrC7M.js → use-list-state-Cwr5OloB.js} +1 -1
  141. package/dist/client/assets/{use-mcp-tools-yi4edHzR.js → use-mcp-tools-CyPVbfii.js} +1 -1
  142. package/dist/client/assets/{use-members-BPb2gPfy.js → use-members-C8bjIWu8.js} +1 -1
  143. package/dist/client/assets/use-navigate-to-agent-DuF5pNCT.js +1 -0
  144. package/dist/client/assets/{use-org-sso-CEfAe1W3.js → use-org-sso-pbiXxD33.js} +1 -1
  145. package/dist/client/assets/{use-organization-roles-1TjtICKp.js → use-organization-roles-7NVaQG9M.js} +1 -1
  146. package/dist/client/assets/{use-organization-settings-B98QP_Ve.js → use-organization-settings-DpXizr85.js} +1 -1
  147. package/dist/client/assets/{use-registry-connections-D0FgXcrs.js → use-registry-connections-BFqaVIUz.js} +1 -1
  148. package/dist/client/assets/{use-status-sounds-B5WhjryL.js → use-status-sounds-DVyydX5_.js} +1 -1
  149. package/dist/client/assets/{use-tasks-COeMfIn8.js → use-tasks-tzb1zUeQ.js} +1 -1
  150. package/dist/client/assets/use-view-mode-D9sT86SW.js +1 -0
  151. package/dist/client/assets/{use-virtual-mcp-CZoeCuBL.js → use-virtual-mcp-SIWEo5E_.js} +1 -1
  152. package/dist/client/assets/useInfiniteQuery-B3rxurAJ.js +1 -0
  153. package/dist/client/assets/useSuspenseInfiniteQuery-KPnhOQU0.js +1 -0
  154. package/dist/client/assets/{user-CWcWoefF.js → user-DxM-AJLw.js} +1 -1
  155. package/dist/client/assets/view-mode-toggle-CussfoqD.js +1 -0
  156. package/dist/client/assets/workflow-a5DJAs_-.js +1 -0
  157. package/dist/client/assets/workflow-detail-DqMXf6Es.js +1 -0
  158. package/dist/client/index.html +1 -1
  159. package/dist/server/cli.js +1 -1
  160. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  161. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  162. package/dist/server/node_modules/ansi-styles/license +9 -0
  163. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  164. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  165. package/dist/server/node_modules/environment/index.d.ts +74 -0
  166. package/dist/server/node_modules/environment/index.js +47 -0
  167. package/dist/server/node_modules/environment/license +9 -0
  168. package/dist/server/node_modules/environment/package.json +74 -0
  169. package/dist/server/node_modules/environment/readme.md +94 -0
  170. package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
  171. package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
  172. package/dist/server/node_modules/escape-string-regexp/license +9 -0
  173. package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
  174. package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
  175. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  176. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  177. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  178. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  179. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  180. package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
  181. package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
  182. package/dist/server/node_modules/is-unicode-supported/license +9 -0
  183. package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
  184. package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
  185. package/dist/server/node_modules/pg-pool/LICENSE +21 -0
  186. package/dist/server/node_modules/pg-pool/README.md +357 -0
  187. package/dist/server/node_modules/pg-pool/esm/index.mjs +5 -0
  188. package/dist/server/node_modules/pg-pool/index.js +517 -0
  189. package/dist/server/node_modules/pg-pool/package.json +51 -0
  190. package/dist/server/node_modules/string-width/index.d.ts +39 -0
  191. package/dist/server/node_modules/string-width/index.js +82 -0
  192. package/dist/server/node_modules/string-width/license +9 -0
  193. package/dist/server/node_modules/string-width/package.json +64 -0
  194. package/dist/server/node_modules/string-width/readme.md +66 -0
  195. package/package.json +1 -1
  196. package/dist/client/assets/accordion-BP1gqDGq.js +0 -1
  197. package/dist/client/assets/agent-icon-Db8xI2bq.js +0 -1
  198. package/dist/client/assets/agents-list-CKkZAwkG.js +0 -1
  199. package/dist/client/assets/ai-providers-Cnvjm1DV.js +0 -1
  200. package/dist/client/assets/automations-Cr0E7mF8.js +0 -1
  201. package/dist/client/assets/brand-context-DMrJlbv3.js +0 -1
  202. package/dist/client/assets/chat-context-BJBiG4eq.js +0 -30
  203. package/dist/client/assets/collection-detail-D_lV_A0m.js +0 -1
  204. package/dist/client/assets/collection-display-button-BXL1tYdg.js +0 -1
  205. package/dist/client/assets/connection-detail-DGI32gtH.js +0 -1
  206. package/dist/client/assets/connection-form-helpers-Dim-adMo.js +0 -1
  207. package/dist/client/assets/connections-Dl4MUHeU.js +0 -1
  208. package/dist/client/assets/domain-settings-NIhMIJvG.js +0 -1
  209. package/dist/client/assets/dropdown-menu--l1OQ6xu.js +0 -1
  210. package/dist/client/assets/dynamic-plugin-layout-D8kk92gE.js +0 -1
  211. package/dist/client/assets/features-j7f3i077.js +0 -1
  212. package/dist/client/assets/form-BVdbuwTF.js +0 -1
  213. package/dist/client/assets/general-BLunjYWc.js +0 -1
  214. package/dist/client/assets/github-repo-picker-ku0KWxb8.js +0 -116
  215. package/dist/client/assets/index-CHcfXh0a.js +0 -1
  216. package/dist/client/assets/index-ClmOj0lo.js +0 -735
  217. package/dist/client/assets/index-I_6bIMcX.js +0 -1
  218. package/dist/client/assets/layout-ChoVtsz2.js +0 -1
  219. package/dist/client/assets/org-plugin-layout-enuMys5H.js +0 -1
  220. package/dist/client/assets/plugin-empty-state-DCR5r8Zj.js +0 -1
  221. package/dist/client/assets/plugin-header-DX2ycNO6.js +0 -1
  222. package/dist/client/assets/profile-C0rN-ocq.js +0 -1
  223. package/dist/client/assets/project-app-view-CQsZ6NHk.js +0 -1
  224. package/dist/client/assets/registry-BO2q_Gke.js +0 -2
  225. package/dist/client/assets/required-auth-layout-emsOE3qR.js +0 -1
  226. package/dist/client/assets/roles-BDsBxvE0.js +0 -1
  227. package/dist/client/assets/scroll-area-CoWBmpAM.js +0 -142
  228. package/dist/client/assets/select-DerdayxE.js +0 -1
  229. package/dist/client/assets/settings-layout-B3TmxZwq.js +0 -1
  230. package/dist/client/assets/shell-layout-cKwbYqFy.js +0 -1
  231. package/dist/client/assets/sso-DXETt_Ed.js +0 -1
  232. package/dist/client/assets/store-BBgqe7Dc.js +0 -1
  233. package/dist/client/assets/store-registry-DKa8Ghfu.js +0 -2
  234. package/dist/client/assets/tools-list-BNtwzSa4.js +0 -1
  235. package/dist/client/assets/use-create-virtual-mcp-DPW_d2QJ.js +0 -1
  236. package/dist/client/assets/use-mobile-BACO9YYc.js +0 -1
  237. package/dist/client/assets/use-navigate-to-agent-DbPOuTIs.js +0 -1
  238. package/dist/client/assets/use-view-mode-BLlR5qfu.js +0 -1
  239. package/dist/client/assets/useInfiniteQuery-BiAZtptE.js +0 -1
  240. package/dist/client/assets/useSuspenseInfiniteQuery-CPbx6xDm.js +0 -1
  241. package/dist/client/assets/view-mode-toggle-C_B0ABFw.js +0 -1
  242. package/dist/client/assets/workflow-Cq9jV44q.js +0 -1
  243. package/dist/client/assets/workflow-detail-CaiPxMVe.js +0 -1
@@ -0,0 +1,517 @@
1
+ 'use strict'
2
+ const EventEmitter = require('events').EventEmitter
3
+
4
+ const NOOP = function () {}
5
+
6
+ const removeWhere = (list, predicate) => {
7
+ const i = list.findIndex(predicate)
8
+
9
+ return i === -1 ? undefined : list.splice(i, 1)[0]
10
+ }
11
+
12
+ class IdleItem {
13
+ constructor(client, idleListener, timeoutId) {
14
+ this.client = client
15
+ this.idleListener = idleListener
16
+ this.timeoutId = timeoutId
17
+ }
18
+ }
19
+
20
+ class PendingItem {
21
+ constructor(callback) {
22
+ this.callback = callback
23
+ }
24
+ }
25
+
26
+ function throwOnDoubleRelease() {
27
+ throw new Error('Release called on client which has already been released to the pool.')
28
+ }
29
+
30
+ function promisify(Promise, callback) {
31
+ if (callback) {
32
+ return { callback: callback, result: undefined }
33
+ }
34
+ let rej
35
+ let res
36
+ const cb = function (err, client) {
37
+ err ? rej(err) : res(client)
38
+ }
39
+ const result = new Promise(function (resolve, reject) {
40
+ res = resolve
41
+ rej = reject
42
+ }).catch((err) => {
43
+ // replace the stack trace that leads to `TCP.onStreamRead` with one that leads back to the
44
+ // application that created the query
45
+ Error.captureStackTrace(err)
46
+ throw err
47
+ })
48
+ return { callback: cb, result: result }
49
+ }
50
+
51
+ function makeIdleListener(pool, client) {
52
+ return function idleListener(err) {
53
+ err.client = client
54
+
55
+ client.removeListener('error', idleListener)
56
+ client.on('error', () => {
57
+ pool.log('additional client error after disconnection due to error', err)
58
+ })
59
+ pool._remove(client)
60
+ // TODO - document that once the pool emits an error
61
+ // the client has already been closed & purged and is unusable
62
+ pool.emit('error', err, client)
63
+ }
64
+ }
65
+
66
+ class Pool extends EventEmitter {
67
+ constructor(options, Client) {
68
+ super()
69
+ this.options = Object.assign({}, options)
70
+
71
+ if (options != null && 'password' in options) {
72
+ // "hiding" the password so it doesn't show up in stack traces
73
+ // or if the client is console.logged
74
+ Object.defineProperty(this.options, 'password', {
75
+ configurable: true,
76
+ enumerable: false,
77
+ writable: true,
78
+ value: options.password,
79
+ })
80
+ }
81
+ if (options != null && options.ssl && options.ssl.key) {
82
+ // "hiding" the ssl->key so it doesn't show up in stack traces
83
+ // or if the client is console.logged
84
+ Object.defineProperty(this.options.ssl, 'key', {
85
+ enumerable: false,
86
+ })
87
+ }
88
+
89
+ this.options.max = this.options.max || this.options.poolSize || 10
90
+ this.options.min = this.options.min || 0
91
+ this.options.maxUses = this.options.maxUses || Infinity
92
+ this.options.allowExitOnIdle = this.options.allowExitOnIdle || false
93
+ this.options.maxLifetimeSeconds = this.options.maxLifetimeSeconds || 0
94
+ this.log = this.options.log || function () {}
95
+ this.Client = this.options.Client || Client || require('pg').Client
96
+ this.Promise = this.options.Promise || global.Promise
97
+
98
+ if (typeof this.options.idleTimeoutMillis === 'undefined') {
99
+ this.options.idleTimeoutMillis = 10000
100
+ }
101
+
102
+ this._clients = []
103
+ this._idle = []
104
+ this._expired = new WeakSet()
105
+ this._pendingQueue = []
106
+ this._endCallback = undefined
107
+ this.ending = false
108
+ this.ended = false
109
+ }
110
+
111
+ _promiseTry(f) {
112
+ const Promise = this.Promise
113
+ if (typeof Promise.try === 'function') {
114
+ return Promise.try(f)
115
+ }
116
+ return new Promise((resolve) => resolve(f()))
117
+ }
118
+
119
+ _isFull() {
120
+ return this._clients.length >= this.options.max
121
+ }
122
+
123
+ _isAboveMin() {
124
+ return this._clients.length > this.options.min
125
+ }
126
+
127
+ _pulseQueue() {
128
+ this.log('pulse queue')
129
+ if (this.ended) {
130
+ this.log('pulse queue ended')
131
+ return
132
+ }
133
+ if (this.ending) {
134
+ this.log('pulse queue on ending')
135
+ if (this._idle.length) {
136
+ this._idle.slice().map((item) => {
137
+ this._remove(item.client)
138
+ })
139
+ }
140
+ if (!this._clients.length) {
141
+ this.ended = true
142
+ this._endCallback()
143
+ }
144
+ return
145
+ }
146
+
147
+ // if we don't have any waiting, do nothing
148
+ if (!this._pendingQueue.length) {
149
+ this.log('no queued requests')
150
+ return
151
+ }
152
+ // if we don't have any idle clients and we have no more room do nothing
153
+ if (!this._idle.length && this._isFull()) {
154
+ return
155
+ }
156
+ const pendingItem = this._pendingQueue.shift()
157
+ if (this._idle.length) {
158
+ const idleItem = this._idle.pop()
159
+ clearTimeout(idleItem.timeoutId)
160
+ const client = idleItem.client
161
+ client.ref && client.ref()
162
+ const idleListener = idleItem.idleListener
163
+
164
+ return this._acquireClient(client, pendingItem, idleListener, false)
165
+ }
166
+ if (!this._isFull()) {
167
+ return this.newClient(pendingItem)
168
+ }
169
+ throw new Error('unexpected condition')
170
+ }
171
+
172
+ _remove(client, callback) {
173
+ const removed = removeWhere(this._idle, (item) => item.client === client)
174
+
175
+ if (removed !== undefined) {
176
+ clearTimeout(removed.timeoutId)
177
+ }
178
+
179
+ this._clients = this._clients.filter((c) => c !== client)
180
+ const context = this
181
+ client.end(() => {
182
+ context.emit('remove', client)
183
+
184
+ if (typeof callback === 'function') {
185
+ callback()
186
+ }
187
+ })
188
+ }
189
+
190
+ connect(cb) {
191
+ if (this.ending) {
192
+ const err = new Error('Cannot use a pool after calling end on the pool')
193
+ return cb ? cb(err) : this.Promise.reject(err)
194
+ }
195
+
196
+ const response = promisify(this.Promise, cb)
197
+ const result = response.result
198
+
199
+ // if we don't have to connect a new client, don't do so
200
+ if (this._isFull() || this._idle.length) {
201
+ // if we have idle clients schedule a pulse immediately
202
+ if (this._idle.length) {
203
+ process.nextTick(() => this._pulseQueue())
204
+ }
205
+
206
+ if (!this.options.connectionTimeoutMillis) {
207
+ this._pendingQueue.push(new PendingItem(response.callback))
208
+ return result
209
+ }
210
+
211
+ const queueCallback = (err, res, done) => {
212
+ clearTimeout(tid)
213
+ response.callback(err, res, done)
214
+ }
215
+
216
+ const pendingItem = new PendingItem(queueCallback)
217
+
218
+ // set connection timeout on checking out an existing client
219
+ const tid = setTimeout(() => {
220
+ // remove the callback from pending waiters because
221
+ // we're going to call it with a timeout error
222
+ removeWhere(this._pendingQueue, (i) => i.callback === queueCallback)
223
+ pendingItem.timedOut = true
224
+ response.callback(new Error('timeout exceeded when trying to connect'))
225
+ }, this.options.connectionTimeoutMillis)
226
+
227
+ if (tid.unref) {
228
+ tid.unref()
229
+ }
230
+
231
+ this._pendingQueue.push(pendingItem)
232
+ return result
233
+ }
234
+
235
+ this.newClient(new PendingItem(response.callback))
236
+
237
+ return result
238
+ }
239
+
240
+ newClient(pendingItem) {
241
+ const client = new this.Client(this.options)
242
+ this._clients.push(client)
243
+ const idleListener = makeIdleListener(this, client)
244
+
245
+ this.log('checking client timeout')
246
+
247
+ // connection timeout logic
248
+ let tid
249
+ let timeoutHit = false
250
+ if (this.options.connectionTimeoutMillis) {
251
+ tid = setTimeout(() => {
252
+ if (client.connection) {
253
+ this.log('ending client due to timeout')
254
+ timeoutHit = true
255
+ client.connection.stream.destroy()
256
+ } else if (!client.isConnected()) {
257
+ this.log('ending client due to timeout')
258
+ timeoutHit = true
259
+ // force kill the node driver, and let libpq do its teardown
260
+ client.end()
261
+ }
262
+ }, this.options.connectionTimeoutMillis)
263
+ }
264
+
265
+ this.log('connecting new client')
266
+ client.connect((err) => {
267
+ if (tid) {
268
+ clearTimeout(tid)
269
+ }
270
+ client.on('error', idleListener)
271
+ if (err) {
272
+ this.log('client failed to connect', err)
273
+ // remove the dead client from our list of clients
274
+ this._clients = this._clients.filter((c) => c !== client)
275
+ if (timeoutHit) {
276
+ err = new Error('Connection terminated due to connection timeout', { cause: err })
277
+ }
278
+
279
+ // this client won’t be released, so move on immediately
280
+ this._pulseQueue()
281
+
282
+ if (!pendingItem.timedOut) {
283
+ pendingItem.callback(err, undefined, NOOP)
284
+ }
285
+ } else {
286
+ this.log('new client connected')
287
+
288
+ if (this.options.onConnect) {
289
+ this._promiseTry(() => this.options.onConnect(client)).then(
290
+ () => {
291
+ this._afterConnect(client, pendingItem, idleListener)
292
+ },
293
+ (hookErr) => {
294
+ this._clients = this._clients.filter((c) => c !== client)
295
+ client.end(() => {
296
+ this._pulseQueue()
297
+ if (!pendingItem.timedOut) {
298
+ pendingItem.callback(hookErr, undefined, NOOP)
299
+ }
300
+ })
301
+ }
302
+ )
303
+ return
304
+ }
305
+
306
+ return this._afterConnect(client, pendingItem, idleListener)
307
+ }
308
+ })
309
+ }
310
+
311
+ _afterConnect(client, pendingItem, idleListener) {
312
+ if (this.options.maxLifetimeSeconds !== 0) {
313
+ const maxLifetimeTimeout = setTimeout(() => {
314
+ this.log('ending client due to expired lifetime')
315
+ this._expired.add(client)
316
+ const idleIndex = this._idle.findIndex((idleItem) => idleItem.client === client)
317
+ if (idleIndex !== -1) {
318
+ this._acquireClient(
319
+ client,
320
+ new PendingItem((err, client, clientRelease) => clientRelease()),
321
+ idleListener,
322
+ false
323
+ )
324
+ }
325
+ }, this.options.maxLifetimeSeconds * 1000)
326
+
327
+ maxLifetimeTimeout.unref()
328
+ client.once('end', () => clearTimeout(maxLifetimeTimeout))
329
+ }
330
+
331
+ return this._acquireClient(client, pendingItem, idleListener, true)
332
+ }
333
+
334
+ // acquire a client for a pending work item
335
+ _acquireClient(client, pendingItem, idleListener, isNew) {
336
+ if (isNew) {
337
+ this.emit('connect', client)
338
+ }
339
+
340
+ this.emit('acquire', client)
341
+
342
+ client.release = this._releaseOnce(client, idleListener)
343
+
344
+ client.removeListener('error', idleListener)
345
+
346
+ if (!pendingItem.timedOut) {
347
+ if (isNew && this.options.verify) {
348
+ this.options.verify(client, (err) => {
349
+ if (err) {
350
+ client.release(err)
351
+ return pendingItem.callback(err, undefined, NOOP)
352
+ }
353
+
354
+ pendingItem.callback(undefined, client, client.release)
355
+ })
356
+ } else {
357
+ pendingItem.callback(undefined, client, client.release)
358
+ }
359
+ } else {
360
+ if (isNew && this.options.verify) {
361
+ this.options.verify(client, client.release)
362
+ } else {
363
+ client.release()
364
+ }
365
+ }
366
+ }
367
+
368
+ // returns a function that wraps _release and throws if called more than once
369
+ _releaseOnce(client, idleListener) {
370
+ let released = false
371
+
372
+ return (err) => {
373
+ if (released) {
374
+ throwOnDoubleRelease()
375
+ }
376
+
377
+ released = true
378
+ this._release(client, idleListener, err)
379
+ }
380
+ }
381
+
382
+ // release a client back to the poll, include an error
383
+ // to remove it from the pool
384
+ _release(client, idleListener, err) {
385
+ client.on('error', idleListener)
386
+
387
+ client._poolUseCount = (client._poolUseCount || 0) + 1
388
+
389
+ this.emit('release', err, client)
390
+
391
+ // TODO(bmc): expose a proper, public interface _queryable and _ending
392
+ if (err || this.ending || !client._queryable || client._ending || client._poolUseCount >= this.options.maxUses) {
393
+ if (client._poolUseCount >= this.options.maxUses) {
394
+ this.log('remove expended client')
395
+ }
396
+
397
+ return this._remove(client, this._pulseQueue.bind(this))
398
+ }
399
+
400
+ const isExpired = this._expired.has(client)
401
+ if (isExpired) {
402
+ this.log('remove expired client')
403
+ this._expired.delete(client)
404
+ return this._remove(client, this._pulseQueue.bind(this))
405
+ }
406
+
407
+ // idle timeout
408
+ let tid
409
+ if (this.options.idleTimeoutMillis && this._isAboveMin()) {
410
+ tid = setTimeout(() => {
411
+ if (this._isAboveMin()) {
412
+ this.log('remove idle client')
413
+ this._remove(client, this._pulseQueue.bind(this))
414
+ }
415
+ }, this.options.idleTimeoutMillis)
416
+
417
+ if (this.options.allowExitOnIdle) {
418
+ // allow Node to exit if this is all that's left
419
+ tid.unref()
420
+ }
421
+ }
422
+
423
+ if (this.options.allowExitOnIdle) {
424
+ client.unref()
425
+ }
426
+
427
+ this._idle.push(new IdleItem(client, idleListener, tid))
428
+ this._pulseQueue()
429
+ }
430
+
431
+ query(text, values, cb) {
432
+ // guard clause against passing a function as the first parameter
433
+ if (typeof text === 'function') {
434
+ const response = promisify(this.Promise, text)
435
+ setImmediate(function () {
436
+ return response.callback(new Error('Passing a function as the first parameter to pool.query is not supported'))
437
+ })
438
+ return response.result
439
+ }
440
+
441
+ // allow plain text query without values
442
+ if (typeof values === 'function') {
443
+ cb = values
444
+ values = undefined
445
+ }
446
+ const response = promisify(this.Promise, cb)
447
+ cb = response.callback
448
+
449
+ this.connect((err, client) => {
450
+ if (err) {
451
+ return cb(err)
452
+ }
453
+
454
+ let clientReleased = false
455
+ const onError = (err) => {
456
+ if (clientReleased) {
457
+ return
458
+ }
459
+ clientReleased = true
460
+ client.release(err)
461
+ cb(err)
462
+ }
463
+
464
+ client.once('error', onError)
465
+ this.log('dispatching query')
466
+ try {
467
+ client.query(text, values, (err, res) => {
468
+ this.log('query dispatched')
469
+ client.removeListener('error', onError)
470
+ if (clientReleased) {
471
+ return
472
+ }
473
+ clientReleased = true
474
+ client.release(err)
475
+ if (err) {
476
+ return cb(err)
477
+ }
478
+ return cb(undefined, res)
479
+ })
480
+ } catch (err) {
481
+ client.release(err)
482
+ return cb(err)
483
+ }
484
+ })
485
+ return response.result
486
+ }
487
+
488
+ end(cb) {
489
+ this.log('ending')
490
+ if (this.ending) {
491
+ const err = new Error('Called end on pool more than once')
492
+ return cb ? cb(err) : this.Promise.reject(err)
493
+ }
494
+ this.ending = true
495
+ const promised = promisify(this.Promise, cb)
496
+ this._endCallback = promised.callback
497
+ this._pulseQueue()
498
+ return promised.result
499
+ }
500
+
501
+ get waitingCount() {
502
+ return this._pendingQueue.length
503
+ }
504
+
505
+ get idleCount() {
506
+ return this._idle.length
507
+ }
508
+
509
+ get expiredCount() {
510
+ return this._clients.reduce((acc, client) => acc + (this._expired.has(client) ? 1 : 0), 0)
511
+ }
512
+
513
+ get totalCount() {
514
+ return this._clients.length
515
+ }
516
+ }
517
+ module.exports = Pool
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "pg-pool",
3
+ "version": "3.13.0",
4
+ "description": "Connection pool for node-postgres",
5
+ "main": "index.js",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./esm/index.mjs",
9
+ "require": "./index.js",
10
+ "default": "./index.js"
11
+ }
12
+ },
13
+ "directories": {
14
+ "test": "test"
15
+ },
16
+ "scripts": {
17
+ "test": " node_modules/.bin/mocha"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git://github.com/brianc/node-postgres.git",
22
+ "directory": "packages/pg-pool"
23
+ },
24
+ "keywords": [
25
+ "pg",
26
+ "postgres",
27
+ "pool",
28
+ "database"
29
+ ],
30
+ "author": "Brian M. Carlson",
31
+ "license": "MIT",
32
+ "bugs": {
33
+ "url": "https://github.com/brianc/node-postgres/issues"
34
+ },
35
+ "homepage": "https://github.com/brianc/node-postgres/tree/master/packages/pg-pool#readme",
36
+ "devDependencies": {
37
+ "bluebird": "3.7.2",
38
+ "co": "4.6.0",
39
+ "expect.js": "0.3.1",
40
+ "lodash": "^4.17.11",
41
+ "mocha": "^11.7.5"
42
+ },
43
+ "peerDependencies": {
44
+ "pg": ">=8.0"
45
+ },
46
+ "files": [
47
+ "index.js",
48
+ "esm"
49
+ ],
50
+ "gitHead": "c9070cc8d526fca65780cedc25c1966b57cf7532"
51
+ }
@@ -0,0 +1,39 @@
1
+ export type Options = {
2
+ /**
3
+ Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).
4
+
5
+ @default true
6
+
7
+ > Ambiguous characters behave like wide or narrow characters depending on the context (language tag, script identification, associated font, source of data, or explicit markup; all can provide the context). __If the context cannot be established reliably, they should be treated as narrow characters by default.__
8
+ > - http://www.unicode.org/reports/tr11/
9
+ */
10
+ readonly ambiguousIsNarrow?: boolean;
11
+
12
+ /**
13
+ Whether [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) should be counted.
14
+
15
+ @default false
16
+ */
17
+ readonly countAnsiEscapeCodes?: boolean;
18
+ };
19
+
20
+ /**
21
+ Get the visual width of a string - the number of columns required to display it.
22
+
23
+ Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
24
+
25
+ @example
26
+ ```
27
+ import stringWidth from 'string-width';
28
+
29
+ stringWidth('a');
30
+ //=> 1
31
+
32
+ stringWidth('古');
33
+ //=> 2
34
+
35
+ stringWidth('\u001B[1m古\u001B[22m');
36
+ //=> 2
37
+ ```
38
+ */
39
+ export default function stringWidth(string: string, options?: Options): number;
@@ -0,0 +1,82 @@
1
+ import stripAnsi from 'strip-ansi';
2
+ import {eastAsianWidth} from 'get-east-asian-width';
3
+ import emojiRegex from 'emoji-regex';
4
+
5
+ const segmenter = new Intl.Segmenter();
6
+
7
+ const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
8
+
9
+ export default function stringWidth(string, options = {}) {
10
+ if (typeof string !== 'string' || string.length === 0) {
11
+ return 0;
12
+ }
13
+
14
+ const {
15
+ ambiguousIsNarrow = true,
16
+ countAnsiEscapeCodes = false,
17
+ } = options;
18
+
19
+ if (!countAnsiEscapeCodes) {
20
+ string = stripAnsi(string);
21
+ }
22
+
23
+ if (string.length === 0) {
24
+ return 0;
25
+ }
26
+
27
+ let width = 0;
28
+ const eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};
29
+
30
+ for (const {segment: character} of segmenter.segment(string)) {
31
+ const codePoint = character.codePointAt(0);
32
+
33
+ // Ignore control characters
34
+ if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
35
+ continue;
36
+ }
37
+
38
+ // Ignore zero-width characters
39
+ if (
40
+ (codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark
41
+ || codePoint === 0xFE_FF // Zero-width no-break space
42
+ ) {
43
+ continue;
44
+ }
45
+
46
+ // Ignore combining characters
47
+ if (
48
+ (codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks
49
+ || (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended
50
+ || (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement
51
+ || (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols
52
+ || (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks
53
+ ) {
54
+ continue;
55
+ }
56
+
57
+ // Ignore surrogate pairs
58
+ if (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {
59
+ continue;
60
+ }
61
+
62
+ // Ignore variation selectors
63
+ if (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {
64
+ continue;
65
+ }
66
+
67
+ // This covers some of the above cases, but we still keep them for performance reasons.
68
+ if (defaultIgnorableCodePointRegex.test(character)) {
69
+ continue;
70
+ }
71
+
72
+ // TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20.
73
+ if (emojiRegex().test(character)) {
74
+ width += 2;
75
+ continue;
76
+ }
77
+
78
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
79
+ }
80
+
81
+ return width;
82
+ }
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.