decocms 2.292.0 → 2.292.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-BJZjcLR8.js → AlertCircle-Cx8oex2u.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-Yoaq7-cz.js → ArrowNarrowLeft-DtpIYMrr.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DoZ1aCQb.js → ArrowUpRight-BBjaHjTK.js} +1 -1
- package/dist/client/assets/{CheckCircle-BbLUS0ek.js → CheckCircle-Mywkb82K.js} +1 -1
- package/dist/client/assets/{ChevronDown-CGHjchOw.js → ChevronDown-BE0rQ4ho.js} +1 -1
- package/dist/client/assets/{ChevronRight-Do3Je1ER.js → ChevronRight-BVJ2HUMt.js} +1 -1
- package/dist/client/assets/{ChevronUp-dSBPqUJ1.js → ChevronUp-B2y_5HwX.js} +1 -1
- package/dist/client/assets/{Container-CDgY_XYz.js → Container-CtsNRge8.js} +1 -1
- package/dist/client/assets/{DotsVertical-BxL7Owtq.js → DotsVertical-BQnGY6Nc.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DxLyrYeW.js → LinkExternal01-SieYyhiZ.js} +1 -1
- package/dist/client/assets/{Lock01-BI0K2L_g.js → Lock01-BrFrkt3t.js} +1 -1
- package/dist/client/assets/{Palette-CWiKw0AC.js → Palette-2CChK5yr.js} +1 -1
- package/dist/client/assets/{Play-C7K9es-c.js → Play-BfzIvHVC.js} +1 -1
- package/dist/client/assets/{Plus-BpCTKUfi.js → Plus-kLSd3TZy.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BEGaV3W5.js → RefreshCcw01-B-L6FvMp.js} +1 -1
- package/dist/client/assets/{SearchMd-fRD_HHud.js → SearchMd-BfBE-dHK.js} +1 -1
- package/dist/client/assets/{Settings02-DtQ4_bLf.js → Settings02-EP4I50bB.js} +1 -1
- package/dist/client/assets/{Shield01-Di_q_zxl.js → Shield01-D19-LRUf.js} +1 -1
- package/dist/client/assets/{Star01-CIsSx9uE.js → Star01-MuiWZ8GS.js} +1 -1
- package/dist/client/assets/{Sun-CgyDUxcQ.js → Sun-CTLobT4y.js} +1 -1
- package/dist/client/assets/{Tool01-By8ElVEn.js → Tool01-CeBylvMu.js} +1 -1
- package/dist/client/assets/{Trash01-BzOKZIoE.js → Trash01-BLGcALKg.js} +1 -1
- package/dist/client/assets/{User01-B6EEMzxh.js → User01-BLHrCCyy.js} +1 -1
- package/dist/client/assets/{Users03-CKRT_0yR.js → Users03-C3QqJn94.js} +1 -1
- package/dist/client/assets/{X-DXjTCsIF.js → X-BJbamPEP.js} +1 -1
- package/dist/client/assets/{XCircle-Ce7DOyui.js → XCircle-DP5EGLqX.js} +1 -1
- package/dist/client/assets/{XClose-Bnw2tzQy.js → XClose-BRn4UVuG.js} +1 -1
- package/dist/client/assets/{Zap-BEX7Xuxl.js → Zap-kZUu0No-.js} +1 -1
- package/dist/client/assets/{ZapSquare-CsTKlylz.js → ZapSquare-B3o6QvJe.js} +1 -1
- package/dist/client/assets/{accordion-rxim1ZAp.js → accordion-BP1gqDGq.js} +1 -1
- package/dist/client/assets/{agent-icon-DtvDglSH.js → agent-icon-Db8xI2bq.js} +1 -1
- package/dist/client/assets/{agents-list-Dn30Me50.js → agents-list-CKkZAwkG.js} +1 -1
- package/dist/client/assets/ai-providers-Cnvjm1DV.js +1 -0
- package/dist/client/assets/{alert-dialog-DkRKYqdD.js → alert-dialog-BFg1HHbW.js} +1 -1
- package/dist/client/assets/{auth-catchall-BgWDU-In.js → auth-catchall-BPCBowrT.js} +1 -1
- package/dist/client/assets/{automation-list-row-Dk3EbUOn.js → automation-list-row-0e1qSQoQ.js} +1 -1
- package/dist/client/assets/{automations-CbjDzR7F.js → automations-Cr0E7mF8.js} +1 -1
- package/dist/client/assets/{avatar-CAgGCSe2.js → avatar-BfSY5CVM.js} +1 -1
- package/dist/client/assets/{badge-DBxFBhAO.js → badge-C_B8gNbw.js} +1 -1
- package/dist/client/assets/{brand-context-C1u8HhCR.js → brand-context-DMrJlbv3.js} +1 -1
- package/dist/client/assets/{card-DWuJsQ-l.js → card-G6flwhwa.js} +1 -1
- package/dist/client/assets/{chat-context-w7qWGRrL.js → chat-context-BJBiG4eq.js} +1 -1
- package/dist/client/assets/{checkbox-CgUCf0vo.js → checkbox-LBmczTXJ.js} +1 -1
- package/dist/client/assets/{collection-detail-miARxdMD.js → collection-detail-D_lV_A0m.js} +1 -1
- package/dist/client/assets/{collection-display-button-IHUVDN00.js → collection-display-button-BXL1tYdg.js} +1 -1
- package/dist/client/assets/{collection-search-Dz-DfctK.js → collection-search-CsSMb59s.js} +1 -1
- package/dist/client/assets/{collection-search-9iq4cHBD.js → collection-search-DoXoIAYq.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-zolZkVPt.js → collection-table-wrapper-B2fVBjE4.js} +1 -1
- package/dist/client/assets/{collection-tabs-DQLxqY5f.js → collection-tabs-CA1SpsaZ.js} +1 -1
- package/dist/client/assets/{collections-U39XM2D0.js → collections-BAHpsq0P.js} +1 -1
- package/dist/client/assets/{command-YWTBTzZ-.js → command-CJYPyBOh.js} +1 -1
- package/dist/client/assets/{connection-card-CzIrL4EL.js → connection-card-DZ1fYoPr.js} +1 -1
- package/dist/client/assets/{connection-detail-BAaKFeAe.js → connection-detail-DGI32gtH.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CkuYmS0Y.js → connection-form-helpers-Dim-adMo.js} +1 -1
- package/dist/client/assets/{connections-BhrD0IQp.js → connections-Dl4MUHeU.js} +1 -1
- package/dist/client/assets/{constants-3nmHZB7k.js → constants-B-gCw63I.js} +1 -1
- package/dist/client/assets/{constants-C9aLxYHE.js → constants-Dw_UtizE.js} +1 -1
- package/dist/client/assets/{dialog-Dh1iMW0s.js → dialog-DjZXbytL.js} +1 -1
- package/dist/client/assets/{domain-settings-AVM0VKvz.js → domain-settings-NIhMIJvG.js} +1 -1
- package/dist/client/assets/{drawer-BVsQgzeD.js → drawer-BFBl_9mB.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BFB_BhxE.js → dropdown-menu--l1OQ6xu.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-89eFL9j5.js → dynamic-plugin-layout-D8kk92gE.js} +1 -1
- package/dist/client/assets/{empty-state-Ccngpo14.js → empty-state-CWYR2iH4.js} +1 -1
- package/dist/client/assets/{empty-state-DaBJGn03.js → empty-state-DskpQs8Q.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DTYSYxBG.js → extract-connection-data-DiYA0QYt.js} +1 -1
- package/dist/client/assets/{features-DyBQ3hAD.js → features-j7f3i077.js} +1 -1
- package/dist/client/assets/{form-D1t1amOF.js → form-BVdbuwTF.js} +1 -1
- package/dist/client/assets/{general-BSxOk1qz.js → general-BLunjYWc.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DSEipb9O.js → github-repo-picker-ku0KWxb8.js} +1 -1
- package/dist/client/assets/{index-DDmmZL9v.js → index-Bm_-4bAj.js} +1 -1
- package/dist/client/assets/{index-DskwxDSD.js → index-BnoHDdAn.js} +1 -1
- package/dist/client/assets/{index-DKd6U8ZD.js → index-Bu0xhzLF.js} +2 -2
- package/dist/client/assets/{index-Bgh3Fg-W.js → index-CHcfXh0a.js} +1 -1
- package/dist/client/assets/{index-BXJluhPl.js → index-CllFnV9J.js} +1 -1
- package/dist/client/assets/{index-CxNPMl3z.js → index-ClmOj0lo.js} +4 -4
- package/dist/client/assets/{index-D0Y3Q7N3.js → index-DA_fcz0a.js} +1 -1
- package/dist/client/assets/{index-CfcY28zS.js → index-I_6bIMcX.js} +1 -1
- package/dist/client/assets/{index-CiGNH6-A.js → index-QvZR-ABK.js} +1 -1
- package/dist/client/assets/{index-aI7M0qEI.js → index-x18ABRVV.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-RFzqIOTQ.js → infiniteQueryObserver-DEk-T30Y.js} +1 -1
- package/dist/client/assets/{input-rXpcOW54.js → input-B5aMagwc.js} +1 -1
- package/dist/client/assets/{integration-icon-wh5nd5gB.js → integration-icon-B5mNngh-.js} +1 -1
- package/dist/client/assets/{label-KG6f6ypV.js → label-Bv4VMaQH.js} +1 -1
- package/dist/client/assets/{layout-C1dBBrJO.js → layout-ChoVtsz2.js} +1 -1
- package/dist/client/assets/{login-aCzD1yj3.js → login-DFTX50_T.js} +1 -1
- package/dist/client/assets/{members-CcYrdU9b.js → members-BbGgTXF7.js} +1 -1
- package/dist/client/assets/{monaco-editor-CetiEdE3.js → monaco-editor-CV15HqlU.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bpsycv3a.js → monitoring-stats-row-FCrYNYUL.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bgqii5KN.js → oauth-callback-W1x4HvAt.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BM8V8XSD.js → oauth-callback-ai-provider-8jGGtkD-.js} +1 -1
- package/dist/client/assets/{onboarding-BstJNU1_.js → onboarding-DiKHM7MB.js} +1 -1
- package/dist/client/assets/{org-layout-Cbl-bpnq.js → org-layout-B-bINoer.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-D5W8iJ__.js → org-plugin-layout-enuMys5H.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-ClLmoORa.js → plugin-empty-state-DCR5r8Zj.js} +1 -1
- package/dist/client/assets/{plugin-header-BfIRczN-.js → plugin-header-DX2ycNO6.js} +1 -1
- package/dist/client/assets/{plugin-layout-CSlooCiQ.js → plugin-layout-2a2a-fWN.js} +1 -1
- package/dist/client/assets/{popover-oHy7A2NB.js → popover-CGtNHDEz.js} +1 -1
- package/dist/client/assets/{profile--BcrwHZB.js → profile-C0rN-ocq.js} +1 -1
- package/dist/client/assets/{project-app-view-7T_TcCNb.js → project-app-view-CQsZ6NHk.js} +1 -1
- package/dist/client/assets/registry-BO2q_Gke.js +2 -0
- package/dist/client/assets/{registry-layout-DSvJ6NrU.js → registry-layout-YWa06n-y.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C9I2Cbbq.js → required-auth-layout-emsOE3qR.js} +1 -1
- package/dist/client/assets/{reset-password-CIaSK0Sp.js → reset-password-CfhsLJCK.js} +1 -1
- package/dist/client/assets/{roles-BquZRSxB.js → roles-BDsBxvE0.js} +1 -1
- package/dist/client/assets/{scroll-area-UNfVJI8t.js → scroll-area-CoWBmpAM.js} +1 -1
- package/dist/client/assets/{search-input-DfM3hp54.js → search-input-DRzVzeWW.js} +1 -1
- package/dist/client/assets/{select-CIfh_MBY.js → select-DerdayxE.js} +1 -1
- package/dist/client/assets/{select-model-BuijBTi2.js → select-model-BdV3Nm5y.js} +1 -1
- package/dist/client/assets/{settings-layout-7GZHLZ6d.js → settings-layout-B3TmxZwq.js} +1 -1
- package/dist/client/assets/{settings-section-DU0g5n0Q.js → settings-section-nyO0fOgx.js} +1 -1
- package/dist/client/assets/{shell-layout-CcnEVz8S.js → shell-layout-cKwbYqFy.js} +1 -1
- package/dist/client/assets/{skeleton-DWxGcluE.js → skeleton-ClT50YXx.js} +1 -1
- package/dist/client/assets/{sso-BwOkQ_ww.js → sso-DXETt_Ed.js} +1 -1
- package/dist/client/assets/{store-R02TTTNN.js → store-BBgqe7Dc.js} +1 -1
- package/dist/client/assets/store-registry-DKa8Ghfu.js +2 -0
- package/dist/client/assets/{switch-CWaKO_3R.js → switch-Bp1Tvx2h.js} +1 -1
- package/dist/client/assets/{table-UpR-J_t9.js → table-BL7WuMkY.js} +1 -1
- package/dist/client/assets/{tabs-CgpYNCZH.js → tabs-CNz9F6wL.js} +1 -1
- package/dist/client/assets/{task-status-CPd-pzw_.js → task-status-D3v6N-jY.js} +1 -1
- package/dist/client/assets/{textarea-CVs7u-e-.js → textarea-BxmFQbso.js} +1 -1
- package/dist/client/assets/{toggle-group-DIrVgcK0.js → toggle-group-B4KaadHq.js} +1 -1
- package/dist/client/assets/{tools-list-C1Tdz1hL.js → tools-list-BNtwzSa4.js} +1 -1
- package/dist/client/assets/{types-DqiNUavs.js → types-BtVZ_7jK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D5Tufg2O.js → use-ai-providers-DqhLue8O.js} +1 -1
- package/dist/client/assets/{use-collections-DpIHOTql.js → use-collections-CLt7BhQ3.js} +1 -1
- package/dist/client/assets/{use-connection-1SSSHaHs.js → use-connection-BCV5VAjQ.js} +1 -1
- package/dist/client/assets/{use-copy-CDfDyhwS.js → use-copy-CYT1tdMJ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bkn7rT3M.js → use-create-virtual-mcp-DPW_d2QJ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CN5jq2Ax.js → use-decopilot-events-BNaQbe7E.js} +1 -1
- package/dist/client/assets/{use-delete-connection-3pf7Gnxc.js → use-delete-connection-YzycomMd.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DknIuIQ2.js → use-infinite-scroll-CoMWGssU.js} +1 -1
- package/dist/client/assets/{use-list-state-8iqNUJS2.js → use-list-state-jiGNrC7M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-qxi4PxSc.js → use-mcp-tools-yi4edHzR.js} +1 -1
- package/dist/client/assets/{use-members-Ck6hn7xk.js → use-members-BPb2gPfy.js} +1 -1
- package/dist/client/assets/{use-mobile-DrlR5BbG.js → use-mobile-BACO9YYc.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DlV84y97.js → use-navigate-to-agent-DbPOuTIs.js} +1 -1
- package/dist/client/assets/{use-org-sso-CWrx0G98.js → use-org-sso-CEfAe1W3.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DsSbdLcn.js → use-organization-roles-1TjtICKp.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DoI0c_Gi.js → use-organization-settings-B98QP_Ve.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BZXVzsNL.js → use-registry-connections-D0FgXcrs.js} +1 -1
- package/dist/client/assets/{use-status-sounds-UAO5zXMo.js → use-status-sounds-B5WhjryL.js} +1 -1
- package/dist/client/assets/{use-tasks-BGCdXCFh.js → use-tasks-COeMfIn8.js} +1 -1
- package/dist/client/assets/{use-view-mode-Cobet5rP.js → use-view-mode-BLlR5qfu.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-G7jm3TGl.js → use-virtual-mcp-CZoeCuBL.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BiAZtptE.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CPbx6xDm.js +1 -0
- package/dist/client/assets/{user-BXlY7NuV.js → user-CWcWoefF.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-PXHnKZlc.js → view-mode-toggle-C_B0ABFw.js} +1 -1
- package/dist/client/assets/{workflow-q8JEUlLD.js → workflow-Cq9jV44q.js} +1 -1
- package/dist/client/assets/workflow-detail-CaiPxMVe.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/node_modules/ansi-regex/index.d.ts +33 -0
- package/dist/server/node_modules/ansi-regex/index.js +14 -0
- package/dist/server/node_modules/{escape-string-regexp → ansi-regex}/license +1 -1
- package/dist/server/node_modules/ansi-regex/package.json +61 -0
- package/dist/server/node_modules/ansi-regex/readme.md +66 -0
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/dist/server/node_modules/emoji-regex/README.md +107 -0
- package/dist/server/node_modules/emoji-regex/index.d.ts +3 -0
- package/dist/server/node_modules/emoji-regex/index.js +4 -0
- package/dist/server/node_modules/emoji-regex/index.mjs +4 -0
- package/dist/server/node_modules/emoji-regex/package.json +45 -0
- package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
- package/dist/server/node_modules/restore-cursor/index.js +11 -0
- package/dist/server/node_modules/restore-cursor/license +9 -0
- package/dist/server/node_modules/restore-cursor/package.json +55 -0
- package/dist/server/node_modules/restore-cursor/readme.md +31 -0
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-CC7AZG4I.js +0 -1
- package/dist/client/assets/registry-CDfXAwnP.js +0 -2
- package/dist/client/assets/store-registry-DdbRGyFG.js +0 -2
- package/dist/client/assets/useInfiniteQuery-J4O9iX8k.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BBJXEpEL.js +0 -1
- package/dist/client/assets/workflow-detail-FemzGjdG.js +0 -1
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +0 -18
- package/dist/server/node_modules/escape-string-regexp/index.js +0 -11
- package/dist/server/node_modules/escape-string-regexp/package.json +0 -43
- package/dist/server/node_modules/escape-string-regexp/readme.md +0 -29
- package/dist/server/node_modules/pg/LICENSE +0 -21
- package/dist/server/node_modules/pg/README.md +0 -95
- package/dist/server/node_modules/pg/esm/index.mjs +0 -20
- package/dist/server/node_modules/pg/lib/client.js +0 -743
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
- package/dist/server/node_modules/pg/lib/connection.js +0 -221
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -91
- package/dist/server/node_modules/pg/lib/index.js +0 -73
- package/dist/server/node_modules/pg/lib/native/client.js +0 -323
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -252
- package/dist/server/node_modules/pg/lib/result.js +0 -109
- package/dist/server/node_modules/pg/lib/stream.js +0 -83
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -217
- package/dist/server/node_modules/pg/package.json +0 -76
- package/dist/server/node_modules/pg-pool/LICENSE +0 -21
- package/dist/server/node_modules/pg-pool/README.md +0 -357
- package/dist/server/node_modules/pg-pool/esm/index.mjs +0 -5
- package/dist/server/node_modules/pg-pool/index.js +0 -517
- package/dist/server/node_modules/pg-pool/package.json +0 -51
|
@@ -1,517 +0,0 @@
|
|
|
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
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
}
|