@malloy-publisher/server 0.0.110 → 0.0.112
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/app/assets/Chip-QKOHsU1g.js +1 -0
- package/dist/app/assets/{Container-Dg_Kf31J.js → Container-L_WqT4jT.js} +1 -1
- package/dist/app/assets/{DialogTitle-CHBg1LY0.js → DialogTitle-Bn08FgCr.js} +1 -1
- package/dist/app/assets/{Edit-C6YfplwT.js → Edit-BJgSEJcw.js} +1 -1
- package/dist/app/assets/FormControlContext-Dw41r2fL.js +1 -0
- package/dist/app/assets/HomePage-7j10faAk.js +3 -0
- package/dist/app/assets/MainPage-CAwngISZ.js +1 -0
- package/dist/app/assets/MenuItem-lIU1AdLr.js +1 -0
- package/dist/app/assets/{Modal-BKeOa8cn.js → Modal-D1yZSrQW.js} +1 -1
- package/dist/app/assets/{ModelPage-PyBDJf_o.js → ModelPage-BZzRs40Z.js} +2 -2
- package/dist/app/assets/MoreVert-BnS0-_a-.js +1 -0
- package/dist/app/assets/PackagePage-CpVMURqi.js +2 -0
- package/dist/app/assets/{ProjectPage-D5jntFzr.js → ProjectPage-Wkk3rsE4.js} +1 -1
- package/dist/app/assets/{RouteError-DMmcYLCb.js → RouteError-DSynFzxI.js} +1 -1
- package/dist/app/assets/{WorkbookPage-DyeCwzrs.js → WorkbookPage-CAKkhCC4.js} +2 -2
- package/dist/app/assets/{index-BWeiQV2D.js → index-BTifa3VC.js} +1 -1
- package/dist/app/assets/index-Csigubii.js +420 -0
- package/dist/app/assets/{index-BrYw7sx9.js → index-GXiK4wJn.js} +1 -1
- package/dist/app/assets/{index.es20-7LPyahVV.js → index.es20-Xp2DiRye.js} +1 -1
- package/dist/app/assets/{index.es23-D1ICAtTa.js → index.es23-DEF5rVoS.js} +2 -2
- package/dist/app/assets/{index.es307-Hyqfwej7.js → index.es310-AKXDC8rl.js} +1 -1
- package/dist/app/assets/{index.es308-DazkJUgb.js → index.es311-CE0-K0fx.js} +1 -1
- package/dist/app/assets/{index.es311-Bdd10041.js → index.es314-CsD4AFJi.js} +1 -1
- package/dist/app/assets/{index.es316-CoGLDRT0.js → index.es319-BAaFF8nF.js} +1 -1
- package/dist/app/assets/{index.es324-BsszfF5h.js → index.es327-CLjg00CO.js} +1 -1
- package/dist/app/assets/{index.es325-DRDvBdmi.js → index.es328-Dk49f56D.js} +1 -1
- package/dist/app/assets/{index.es328-CFMQ5MRM.js → index.es331-CNjOIk10.js} +1 -1
- package/dist/app/assets/{index.es332-fOGuE522.js → index.es335-BeNrivcI.js} +1 -1
- package/dist/app/assets/{index.es335-DaItj58o.js → index.es338-BhR7SkS5.js} +1 -1
- package/dist/app/assets/{index.es338-UjLQeCTc.js → index.es341-C_6PzCoq.js} +1 -1
- package/dist/app/assets/{index.es339-DRQ2Op-C.js → index.es342-D1uAr8c1.js} +1 -1
- package/dist/app/assets/{index.es353-DJ9OBLYp.js → index.es356-7PPXN4m3.js} +1 -1
- package/dist/app/assets/{index.es354-C2ph-Vgb.js → index.es357-CJh2QG0N.js} +1 -1
- package/dist/app/assets/{index.es355-CdFcIAjR.js → index.es358-C_zZutkw.js} +1 -1
- package/dist/app/assets/{index.es357-DnD6YfsZ.js → index.es360-DeQ44nE8.js} +1 -1
- package/dist/app/assets/{index.es362-DQGGaNK3.js → index.es365-oFKdnBEe.js} +1 -1
- package/dist/app/assets/{index.es364-SjsfRDU5.js → index.es367-BUiiHWL7.js} +1 -1
- package/dist/app/assets/{index.es365-BFB9M3aQ.js → index.es368-Bb8Mmpp1.js} +1 -1
- package/dist/app/assets/{index.es370-Cykbl5AV.js → index.es373-C5Q5iXfG.js} +1 -1
- package/dist/app/assets/{index.es371-C1_-FGZD.js → index.es374-s3ewK3v_.js} +1 -1
- package/dist/app/assets/{index.es373-TI9wv2aA.js → index.es376-Dot0I9EF.js} +1 -1
- package/dist/app/assets/{index.es374-D2MetvHl.js → index.es377-B6TLwhtH.js} +1 -1
- package/dist/app/assets/{index.es375-Cl8RLiLz.js → index.es378-mEifvHi6.js} +1 -1
- package/dist/app/assets/{index.es378-DEt7_vw7.js → index.es381-DdV8KTBv.js} +1 -1
- package/dist/app/assets/{index.es380-B_rO6vHZ.js → index.es383-B762Qvzb.js} +1 -1
- package/dist/app/assets/{index.es381-BALGI3Ev.js → index.es384-DBjLFE2E.js} +1 -1
- package/dist/app/assets/{index.es382-WH9q9eN4.js → index.es385-DkDs29_v.js} +1 -1
- package/dist/app/assets/{index.es388-CvzBQwR4.js → index.es391-BOBiTPht.js} +1 -1
- package/dist/app/assets/{index.es389-Sf3IwiTw.js → index.es392-BGdYwXRd.js} +1 -1
- package/dist/app/assets/{index.es390-CvRV_DLA.js → index.es393-BnuSumNM.js} +1 -1
- package/dist/app/assets/{index.es391-BMUNnyko.js → index.es394-DMJpONen.js} +1 -1
- package/dist/app/assets/{index.es393-gzScel_V.js → index.es396-Dexy1Fdn.js} +1 -1
- package/dist/app/assets/{index.es397-ChSe2MGM.js → index.es400-V_MXD6ds.js} +1 -1
- package/dist/app/assets/{index.es398-BM1JIu87.js → index.es401-CAcCA7it.js} +1 -1
- package/dist/app/assets/{index.es406-jeYEdLwu.js → index.es409-DgSxLsfq.js} +1 -1
- package/dist/app/assets/{index.es409-JBGcHOPL.js → index.es412-wcTkTrNP.js} +1 -1
- package/dist/app/assets/{index.es412-BneQpd2K.js → index.es415-hnSTt9Hn.js} +1 -1
- package/dist/app/assets/{index.es415-D2YJmODz.js → index.es418-DwuHSZfi.js} +1 -1
- package/dist/app/assets/{index.es419-Be9XEXai.js → index.es422-DWsCMo9a.js} +1 -1
- package/dist/app/assets/{index.es421-DNif9a-1.js → index.es424-CX2jVTDC.js} +1 -1
- package/dist/app/assets/{index.es429-QvpEdVuu.js → index.es432-DpOOpPot.js} +1 -1
- package/dist/app/assets/{index.es430-BSC0RjJg.js → index.es433--E-hGrgp.js} +1 -1
- package/dist/app/assets/{index.es437-CU58aSis.js → index.es440-NJaU5ncf.js} +1 -1
- package/dist/app/assets/{index.es438-DLcyg_Nq.js → index.es441-CR0Ohpvp.js} +1 -1
- package/dist/app/assets/{index.es448-FCeFQPCW.js → index.es451-sHTEx-Dl.js} +1 -1
- package/dist/app/assets/{index.es452-BRZPWepa.js → index.es455-9ZC7rz1G.js} +1 -1
- package/dist/app/assets/{index.es458-Bpkji9ao.js → index.es461-DAQjszqb.js} +1 -1
- package/dist/app/assets/{index.es463-BaecNR2n.js → index.es466-sT_GOjPl.js} +1 -1
- package/dist/app/assets/{index.es464-CTWl2km5.js → index.es467-D1qnNYJr.js} +1 -1
- package/dist/app/assets/{index.es466-CfLTsC9T.js → index.es469-DW1np4pg.js} +1 -1
- package/dist/app/assets/{index.es470-8ULDOKZc.js → index.es473-wVAdvQ6_.js} +1 -1
- package/dist/app/assets/{index.es472-DcGdjhrt.js → index.es475-CZM7KBU8.js} +1 -1
- package/dist/app/assets/{index.es474-DEhGnLk1.js → index.es477-OAyIdwW_.js} +1 -1
- package/dist/app/assets/{index.es477-CL6caFH2.js → index.es480-DSR8isSz.js} +1 -1
- package/dist/app/assets/{index.es478-Bxqeavdu.js → index.es481-CBydsWwB.js} +1 -1
- package/dist/app/assets/{index.es482-CkcBD1qi.js → index.es485-CJc4fpNV.js} +1 -1
- package/dist/app/assets/{index.es484-mnzfO9M-.js → index.es487-C1wULFp4.js} +1 -1
- package/dist/app/assets/{index.es491-D7XbqGCN.js → index.es494-BLp6ucpV.js} +1 -1
- package/dist/app/assets/{index.es493-CnKU-AzQ.js → index.es496-Tis1R15L.js} +1 -1
- package/dist/app/assets/{index.es495-o1LZm3EH.js → index.es498-DnIxUf2o.js} +1 -1
- package/dist/app/assets/{index.es499-txiTaLX0.js → index.es502-DhEHE70J.js} +1 -1
- package/dist/app/assets/{index.es509-DAhk5QW9.js → index.es512-B---8rhN.js} +1 -1
- package/dist/app/assets/{index.es510-BTIWftZ_.js → index.es513-BU_koFtA.js} +1 -1
- package/dist/app/assets/{index.es517-_uBYPj5P.js → index.es520-ZlB1VPRK.js} +1 -1
- package/dist/app/assets/{index.es518-Duh4FRo0.js → index.es521-VBglaSPm.js} +1 -1
- package/dist/app/assets/index.es7-4Yy4RzF4.js +1 -0
- package/dist/app/assets/index.modern-DMvoTRLq.js +17 -0
- package/dist/app/assets/{index.umd-DFsry6Xq.js → index.umd-B5zPGg7f.js} +1 -1
- package/dist/app/assets/listItemTextClasses-gPHO1JUj.js +1 -0
- package/dist/app/index.html +1 -1
- package/dist/instrumentation.js +2280 -1003
- package/dist/server.js +11373 -4120
- package/package.json +1 -1
- package/src/server.ts +11 -0
- package/src/service/connection.ts +10 -9
- package/src/service/project.ts +11 -17
- package/src/service/project_store.ts +156 -47
- package/dist/app/assets/Chip-CzV-d1RE.js +0 -1
- package/dist/app/assets/FormControlContext-VBpiETuD.js +0 -1
- package/dist/app/assets/HomePage-B7xMQBXw.js +0 -3
- package/dist/app/assets/MainPage-Cvxb9XmX.js +0 -1
- package/dist/app/assets/MenuItem-Ct1Eq8uZ.js +0 -1
- package/dist/app/assets/MoreVert-BXQIW75e.js +0 -1
- package/dist/app/assets/PackagePage-CdhWdIyz.js +0 -2
- package/dist/app/assets/index-D2hrtqN7.js +0 -420
- package/dist/app/assets/index.es7-CBMchwTf.js +0 -1
- package/dist/app/assets/index.modern-C9fiiwjh.js +0 -17
- package/dist/app/assets/listItemTextClasses-st6hnk8F.js +0 -1
- /package/dist/app/assets/{index.es296-CG6Dc4jp.js → index.es299-CG6Dc4jp.js} +0 -0
- /package/dist/app/assets/{index.es304-DsBKuouk.js → index.es307-DsBKuouk.js} +0 -0
- /package/dist/app/assets/{index.es305-D_z4Izcz.js → index.es308-D_z4Izcz.js} +0 -0
- /package/dist/app/assets/{index.es306-727ZlQH0.js → index.es309-727ZlQH0.js} +0 -0
- /package/dist/app/assets/{index.es309-Dn00JSTd.js → index.es312-Dn00JSTd.js} +0 -0
- /package/dist/app/assets/{index.es310-COJ4H7py.js → index.es313-COJ4H7py.js} +0 -0
- /package/dist/app/assets/{index.es312-Bu5BbsvL.js → index.es315-Bu5BbsvL.js} +0 -0
- /package/dist/app/assets/{index.es313-7O62HKoU.js → index.es316-7O62HKoU.js} +0 -0
- /package/dist/app/assets/{index.es314-BPT9niGB.js → index.es317-BPT9niGB.js} +0 -0
- /package/dist/app/assets/{index.es315-Dhn9LcZ4.js → index.es318-Dhn9LcZ4.js} +0 -0
- /package/dist/app/assets/{index.es317-eg146-Ew.js → index.es320-eg146-Ew.js} +0 -0
- /package/dist/app/assets/{index.es318-Du268qiB.js → index.es321-Du268qiB.js} +0 -0
- /package/dist/app/assets/{index.es319-fje9CFhw.js → index.es322-fje9CFhw.js} +0 -0
- /package/dist/app/assets/{index.es320-BwXTMy5W.js → index.es323-BwXTMy5W.js} +0 -0
- /package/dist/app/assets/{index.es321-3xVqZejG.js → index.es324-3xVqZejG.js} +0 -0
- /package/dist/app/assets/{index.es322-xW4inM5L.js → index.es325-xW4inM5L.js} +0 -0
- /package/dist/app/assets/{index.es323-DHo0CJ0O.js → index.es326-DHo0CJ0O.js} +0 -0
- /package/dist/app/assets/{index.es326-C3t2pwGQ.js → index.es329-C3t2pwGQ.js} +0 -0
- /package/dist/app/assets/{index.es327-DNquZEk8.js → index.es330-DNquZEk8.js} +0 -0
- /package/dist/app/assets/{index.es329-BHOwM8T6.js → index.es332-BHOwM8T6.js} +0 -0
- /package/dist/app/assets/{index.es330-DxSadP1t.js → index.es333-DxSadP1t.js} +0 -0
- /package/dist/app/assets/{index.es331-DbXoA79R.js → index.es334-DbXoA79R.js} +0 -0
- /package/dist/app/assets/{index.es333-Bp6g37R7.js → index.es336-Bp6g37R7.js} +0 -0
- /package/dist/app/assets/{index.es334-sacFqUAJ.js → index.es337-sacFqUAJ.js} +0 -0
- /package/dist/app/assets/{index.es336-C7gG9l05.js → index.es339-C7gG9l05.js} +0 -0
- /package/dist/app/assets/{index.es337-Dsg_Bt_b.js → index.es340-Dsg_Bt_b.js} +0 -0
- /package/dist/app/assets/{index.es340-D9R-vmeu.js → index.es343-D9R-vmeu.js} +0 -0
- /package/dist/app/assets/{index.es341-BPhBrDlE.js → index.es344-BPhBrDlE.js} +0 -0
- /package/dist/app/assets/{index.es342-C-TU5hQ_.js → index.es345-C-TU5hQ_.js} +0 -0
- /package/dist/app/assets/{index.es343-DtFQj3wx.js → index.es346-DtFQj3wx.js} +0 -0
- /package/dist/app/assets/{index.es344-m2LEI-9-.js → index.es347-m2LEI-9-.js} +0 -0
- /package/dist/app/assets/{index.es345-BoXegm-a.js → index.es348-BoXegm-a.js} +0 -0
- /package/dist/app/assets/{index.es346-B9wLZaAG.js → index.es349-B9wLZaAG.js} +0 -0
- /package/dist/app/assets/{index.es347-ClGRhx96.js → index.es350-ClGRhx96.js} +0 -0
- /package/dist/app/assets/{index.es348-DEIpsLCJ.js → index.es351-DEIpsLCJ.js} +0 -0
- /package/dist/app/assets/{index.es349-BgYniUM_.js → index.es352-BgYniUM_.js} +0 -0
- /package/dist/app/assets/{index.es350-COcR7UxN.js → index.es353-COcR7UxN.js} +0 -0
- /package/dist/app/assets/{index.es351-BjQB5zDj.js → index.es354-BjQB5zDj.js} +0 -0
- /package/dist/app/assets/{index.es352-C-nORZOA.js → index.es355-C-nORZOA.js} +0 -0
- /package/dist/app/assets/{index.es356-BX77sIaO.js → index.es359-BX77sIaO.js} +0 -0
- /package/dist/app/assets/{index.es358-B-DoSBHF.js → index.es361-B-DoSBHF.js} +0 -0
- /package/dist/app/assets/{index.es359-bCA53EVm.js → index.es362-bCA53EVm.js} +0 -0
- /package/dist/app/assets/{index.es360-w-ucz2PV.js → index.es363-w-ucz2PV.js} +0 -0
- /package/dist/app/assets/{index.es361-Dayu4EKP.js → index.es364-Dayu4EKP.js} +0 -0
- /package/dist/app/assets/{index.es363-DKXYxT9g.js → index.es366-DKXYxT9g.js} +0 -0
- /package/dist/app/assets/{index.es366-DfxzS6Rs.js → index.es369-DfxzS6Rs.js} +0 -0
- /package/dist/app/assets/{index.es367-SKMF96pI.js → index.es370-SKMF96pI.js} +0 -0
- /package/dist/app/assets/{index.es368-ajMbGru0.js → index.es371-ajMbGru0.js} +0 -0
- /package/dist/app/assets/{index.es369--30QC5Em.js → index.es372--30QC5Em.js} +0 -0
- /package/dist/app/assets/{index.es372-B430Bg39.js → index.es375-B430Bg39.js} +0 -0
- /package/dist/app/assets/{index.es376-CM8KxXT1.js → index.es379-CM8KxXT1.js} +0 -0
- /package/dist/app/assets/{index.es377-B1SYOhNW.js → index.es380-B1SYOhNW.js} +0 -0
- /package/dist/app/assets/{index.es379-DkBy-JyN.js → index.es382-DkBy-JyN.js} +0 -0
- /package/dist/app/assets/{index.es383-BILxekzW.js → index.es386-BILxekzW.js} +0 -0
- /package/dist/app/assets/{index.es384-C5wWYbrZ.js → index.es387-C5wWYbrZ.js} +0 -0
- /package/dist/app/assets/{index.es385-HzYwdGDm.js → index.es388-HzYwdGDm.js} +0 -0
- /package/dist/app/assets/{index.es386-T-Tgc4AT.js → index.es389-T-Tgc4AT.js} +0 -0
- /package/dist/app/assets/{index.es387-ifBTmRxC.js → index.es390-ifBTmRxC.js} +0 -0
- /package/dist/app/assets/{index.es392-BMj5Y0dO.js → index.es395-BMj5Y0dO.js} +0 -0
- /package/dist/app/assets/{index.es394-BjABl1g7.js → index.es397-BjABl1g7.js} +0 -0
- /package/dist/app/assets/{index.es395-xI-RfyKK.js → index.es398-xI-RfyKK.js} +0 -0
- /package/dist/app/assets/{index.es396-ySlJ1b_l.js → index.es399-ySlJ1b_l.js} +0 -0
- /package/dist/app/assets/{index.es399-BQoSv7ci.js → index.es402-BQoSv7ci.js} +0 -0
- /package/dist/app/assets/{index.es400-w8dY5SsB.js → index.es403-w8dY5SsB.js} +0 -0
- /package/dist/app/assets/{index.es401-TU54ms6u.js → index.es404-TU54ms6u.js} +0 -0
- /package/dist/app/assets/{index.es402-DREVFZK8.js → index.es405-DREVFZK8.js} +0 -0
- /package/dist/app/assets/{index.es403-BfivnA6A.js → index.es406-BfivnA6A.js} +0 -0
- /package/dist/app/assets/{index.es404-P4WzXJd0.js → index.es407-P4WzXJd0.js} +0 -0
- /package/dist/app/assets/{index.es405-BAng5TT0.js → index.es408-BAng5TT0.js} +0 -0
- /package/dist/app/assets/{index.es407-B5lbUyaz.js → index.es410-B5lbUyaz.js} +0 -0
- /package/dist/app/assets/{index.es408-mebxcVVE.js → index.es411-mebxcVVE.js} +0 -0
- /package/dist/app/assets/{index.es410-XBlWyCtg.js → index.es413-XBlWyCtg.js} +0 -0
- /package/dist/app/assets/{index.es411-BfCpw3nA.js → index.es414-BfCpw3nA.js} +0 -0
- /package/dist/app/assets/{index.es413-Cc5clBb7.js → index.es416-Cc5clBb7.js} +0 -0
- /package/dist/app/assets/{index.es414-IuBKFhSY.js → index.es417-IuBKFhSY.js} +0 -0
- /package/dist/app/assets/{index.es416-Du5NY7AG.js → index.es419-Du5NY7AG.js} +0 -0
- /package/dist/app/assets/{index.es417-Bvotw-X0.js → index.es420-Bvotw-X0.js} +0 -0
- /package/dist/app/assets/{index.es418-UIAJJxZW.js → index.es421-UIAJJxZW.js} +0 -0
- /package/dist/app/assets/{index.es420-D9-PGadD.js → index.es423-D9-PGadD.js} +0 -0
- /package/dist/app/assets/{index.es422-sdHcTMYB.js → index.es425-sdHcTMYB.js} +0 -0
- /package/dist/app/assets/{index.es423-Ci6OQyBP.js → index.es426-Ci6OQyBP.js} +0 -0
- /package/dist/app/assets/{index.es424-BC5c_5Pe.js → index.es427-BC5c_5Pe.js} +0 -0
- /package/dist/app/assets/{index.es425-Tz6hzZYG.js → index.es428-Tz6hzZYG.js} +0 -0
- /package/dist/app/assets/{index.es426-DB_GagMm.js → index.es429-DB_GagMm.js} +0 -0
- /package/dist/app/assets/{index.es427-DLbgOhZU.js → index.es430-DLbgOhZU.js} +0 -0
- /package/dist/app/assets/{index.es428-B0XVJmRM.js → index.es431-B0XVJmRM.js} +0 -0
- /package/dist/app/assets/{index.es431-shcSOmrb.js → index.es434-shcSOmrb.js} +0 -0
- /package/dist/app/assets/{index.es432-D4Tzg5kh.js → index.es435-D4Tzg5kh.js} +0 -0
- /package/dist/app/assets/{index.es433-Deuh7S70.js → index.es436-Deuh7S70.js} +0 -0
- /package/dist/app/assets/{index.es434-BUEGK8hf.js → index.es437-BUEGK8hf.js} +0 -0
- /package/dist/app/assets/{index.es435-BNioltXt.js → index.es438-BNioltXt.js} +0 -0
- /package/dist/app/assets/{index.es436-JqZropPD.js → index.es439-JqZropPD.js} +0 -0
- /package/dist/app/assets/{index.es439-LKU2TuZ1.js → index.es442-LKU2TuZ1.js} +0 -0
- /package/dist/app/assets/{index.es440-BFLt1xDp.js → index.es443-BFLt1xDp.js} +0 -0
- /package/dist/app/assets/{index.es441-DKykz6zU.js → index.es444-DKykz6zU.js} +0 -0
- /package/dist/app/assets/{index.es442-B3ZDOciz.js → index.es445-B3ZDOciz.js} +0 -0
- /package/dist/app/assets/{index.es443-CSHBycmS.js → index.es446-CSHBycmS.js} +0 -0
- /package/dist/app/assets/{index.es444-BIEUsx6d.js → index.es447-BIEUsx6d.js} +0 -0
- /package/dist/app/assets/{index.es445-B48N-Iqd.js → index.es448-B48N-Iqd.js} +0 -0
- /package/dist/app/assets/{index.es446-BY-TUvya.js → index.es449-BY-TUvya.js} +0 -0
- /package/dist/app/assets/{index.es447-zocC4JxJ.js → index.es450-zocC4JxJ.js} +0 -0
- /package/dist/app/assets/{index.es449-Cza_XSSt.js → index.es452-Cza_XSSt.js} +0 -0
- /package/dist/app/assets/{index.es450-Bg-kzb6g.js → index.es453-Bg-kzb6g.js} +0 -0
- /package/dist/app/assets/{index.es451-DhUJRlN_.js → index.es454-DhUJRlN_.js} +0 -0
- /package/dist/app/assets/{index.es453-C8lEn-DE.js → index.es456-C8lEn-DE.js} +0 -0
- /package/dist/app/assets/{index.es454-DhMKtDLN.js → index.es457-DhMKtDLN.js} +0 -0
- /package/dist/app/assets/{index.es455-CwjWoCRV.js → index.es458-CwjWoCRV.js} +0 -0
- /package/dist/app/assets/{index.es456-CzouJOBO.js → index.es459-CzouJOBO.js} +0 -0
- /package/dist/app/assets/{index.es457-B1bQXN8T.js → index.es460-B1bQXN8T.js} +0 -0
- /package/dist/app/assets/{index.es459-5LuOXUq_.js → index.es462-5LuOXUq_.js} +0 -0
- /package/dist/app/assets/{index.es460-DWJ3fJO_.js → index.es463-DWJ3fJO_.js} +0 -0
- /package/dist/app/assets/{index.es461-DJlmqQ1C.js → index.es464-DJlmqQ1C.js} +0 -0
- /package/dist/app/assets/{index.es462-QhoSD0DR.js → index.es465-QhoSD0DR.js} +0 -0
- /package/dist/app/assets/{index.es465-Be6lgOlo.js → index.es468-Be6lgOlo.js} +0 -0
- /package/dist/app/assets/{index.es467-BJ4Li9vH.js → index.es470-BJ4Li9vH.js} +0 -0
- /package/dist/app/assets/{index.es468-DQVVAn-B.js → index.es471-DQVVAn-B.js} +0 -0
- /package/dist/app/assets/{index.es469-BJGe-b2p.js → index.es472-BJGe-b2p.js} +0 -0
- /package/dist/app/assets/{index.es471-BLhTXw86.js → index.es474-BLhTXw86.js} +0 -0
- /package/dist/app/assets/{index.es473-atvbtKCR.js → index.es476-atvbtKCR.js} +0 -0
- /package/dist/app/assets/{index.es475-DkLiglaE.js → index.es478-DkLiglaE.js} +0 -0
- /package/dist/app/assets/{index.es476-C1w2a3ep.js → index.es479-C1w2a3ep.js} +0 -0
- /package/dist/app/assets/{index.es479-Cf8iN4DR.js → index.es482-Cf8iN4DR.js} +0 -0
- /package/dist/app/assets/{index.es480-COK4E0Yg.js → index.es483-COK4E0Yg.js} +0 -0
- /package/dist/app/assets/{index.es481-BknIz3MU.js → index.es484-BknIz3MU.js} +0 -0
- /package/dist/app/assets/{index.es483-BeQkCIfX.js → index.es486-BeQkCIfX.js} +0 -0
- /package/dist/app/assets/{index.es485-BSxZ-RaX.js → index.es488-BSxZ-RaX.js} +0 -0
- /package/dist/app/assets/{index.es486-C7L56vO4.js → index.es489-C7L56vO4.js} +0 -0
- /package/dist/app/assets/{index.es487-CUnW07Te.js → index.es490-CUnW07Te.js} +0 -0
- /package/dist/app/assets/{index.es488-C1XDQQGZ.js → index.es491-C1XDQQGZ.js} +0 -0
- /package/dist/app/assets/{index.es489-CQjiPCtT.js → index.es492-CQjiPCtT.js} +0 -0
- /package/dist/app/assets/{index.es490-DQ1-QYvQ.js → index.es493-DQ1-QYvQ.js} +0 -0
- /package/dist/app/assets/{index.es492-BbSNqyBO.js → index.es495-BbSNqyBO.js} +0 -0
- /package/dist/app/assets/{index.es494-CB2ApiWb.js → index.es497-CB2ApiWb.js} +0 -0
- /package/dist/app/assets/{index.es496-B_m7g4N7.js → index.es499-B_m7g4N7.js} +0 -0
- /package/dist/app/assets/{index.es497-B6W0miNI.js → index.es500-B6W0miNI.js} +0 -0
- /package/dist/app/assets/{index.es498-BMR_PYu6.js → index.es501-BMR_PYu6.js} +0 -0
- /package/dist/app/assets/{index.es500-Dj6nwHGl.js → index.es503-Dj6nwHGl.js} +0 -0
- /package/dist/app/assets/{index.es501-BpWG_bgh.js → index.es504-BpWG_bgh.js} +0 -0
- /package/dist/app/assets/{index.es502-BVUVsWT6.js → index.es505-BVUVsWT6.js} +0 -0
- /package/dist/app/assets/{index.es503-CAQ2eGtk.js → index.es506-CAQ2eGtk.js} +0 -0
- /package/dist/app/assets/{index.es504-BFOHcciG.js → index.es507-BFOHcciG.js} +0 -0
- /package/dist/app/assets/{index.es505-CdO5JTpU.js → index.es508-CdO5JTpU.js} +0 -0
- /package/dist/app/assets/{index.es506-CJaU5se_.js → index.es509-CJaU5se_.js} +0 -0
- /package/dist/app/assets/{index.es507-DYoNaHQp.js → index.es510-DYoNaHQp.js} +0 -0
- /package/dist/app/assets/{index.es508-m4uW47V2.js → index.es511-m4uW47V2.js} +0 -0
- /package/dist/app/assets/{index.es511-nyqBNV6O.js → index.es514-nyqBNV6O.js} +0 -0
- /package/dist/app/assets/{index.es512-C6j12Q_x.js → index.es515-C6j12Q_x.js} +0 -0
- /package/dist/app/assets/{index.es513-7A4Fjokl.js → index.es516-7A4Fjokl.js} +0 -0
- /package/dist/app/assets/{index.es514-CB0Krxn9.js → index.es517-CB0Krxn9.js} +0 -0
- /package/dist/app/assets/{index.es515-DCE3LsBG.js → index.es518-DCE3LsBG.js} +0 -0
- /package/dist/app/assets/{index.es516-C3FkfJm5.js → index.es519-C3FkfJm5.js} +0 -0
- /package/dist/app/assets/{index.es519-CVw76BM1.js → index.es522-CVw76BM1.js} +0 -0
- /package/dist/app/assets/{index.es520-HnGAYVZD.js → index.es523-HnGAYVZD.js} +0 -0
- /package/dist/app/assets/{index.es521-BVz_zdnA.js → index.es524-BVz_zdnA.js} +0 -0
- /package/dist/app/assets/{index.es522-C3khCPGq.js → index.es525-C3khCPGq.js} +0 -0
- /package/dist/app/assets/{index.es523-D-2ljcwZ.js → index.es526-D-2ljcwZ.js} +0 -0
- /package/dist/app/assets/{index.es524-Cv9koXgw.js → index.es527-Cv9koXgw.js} +0 -0
- /package/dist/app/assets/{index.es525-CD_QflpE.js → index.es528-CD_QflpE.js} +0 -0
- /package/dist/app/assets/{index.es526-DRW-0cLl.js → index.es529-DRW-0cLl.js} +0 -0
- /package/dist/app/assets/{index.es527-C-_shW-Y.js → index.es530-C-_shW-Y.js} +0 -0
- /package/dist/app/assets/{index.es528-LGGdnPYs.js → index.es531-LGGdnPYs.js} +0 -0
- /package/dist/app/assets/{index.es529-C3mMm8J8.js → index.es532-C3mMm8J8.js} +0 -0
- /package/dist/app/assets/{index.es530-BzJJZx-M.js → index.es533-BzJJZx-M.js} +0 -0
- /package/dist/app/assets/{index.es531-BXkSAIEj.js → index.es534-BXkSAIEj.js} +0 -0
- /package/dist/app/assets/{index.es532-BgDCqdQA.js → index.es535-BgDCqdQA.js} +0 -0
- /package/dist/app/assets/{index.es533-C8M2exoo.js → index.es536-C8M2exoo.js} +0 -0
- /package/dist/app/assets/{index.es534-DHJKELXO.js → index.es537-DHJKELXO.js} +0 -0
- /package/dist/app/assets/{index.es535-Cuk6v7N8.js → index.es538-Cuk6v7N8.js} +0 -0
- /package/dist/app/assets/{index.es536-DH5Ifo-i.js → index.es539-DH5Ifo-i.js} +0 -0
- /package/dist/app/assets/{index.es537-E3gJ1_iC.js → index.es540-E3gJ1_iC.js} +0 -0
- /package/dist/app/assets/{index.es538-DAi9KRSo.js → index.es541-DAi9KRSo.js} +0 -0
- /package/dist/app/assets/{index.es539-D7oLnXFd.js → index.es542-D7oLnXFd.js} +0 -0
- /package/dist/app/assets/{index.es540-BfjtVDDH.js → index.es543-BfjtVDDH.js} +0 -0
- /package/dist/app/assets/{index.es541-DnULxvSX.js → index.es544-DnULxvSX.js} +0 -0
- /package/dist/app/assets/{index.es542-CkXjmgJE.js → index.es545-CkXjmgJE.js} +0 -0
- /package/dist/app/assets/{index.es543-CfQXZHmo.js → index.es546-CfQXZHmo.js} +0 -0
- /package/dist/app/assets/{index.es544-DWedfzmr.js → index.es547-DWedfzmr.js} +0 -0
- /package/dist/app/assets/{index.es545-DUszq2jm.js → index.es548-DUszq2jm.js} +0 -0
- /package/dist/app/assets/{index.es546-B7mTdjB0.js → index.es549-B7mTdjB0.js} +0 -0
- /package/dist/app/assets/{index.es547-D5KoaKCx.js → index.es550-D5KoaKCx.js} +0 -0
- /package/dist/app/assets/{index.es548-BfHTSMKl.js → index.es551-BfHTSMKl.js} +0 -0
- /package/dist/app/assets/{index.es549-B0m2ddpp.js → index.es552-B0m2ddpp.js} +0 -0
- /package/dist/app/assets/{index.es550-CyktbL80.js → index.es553-CyktbL80.js} +0 -0
- /package/dist/app/assets/{index.es551-Csfq5Kiy.js → index.es554-Csfq5Kiy.js} +0 -0
- /package/dist/app/assets/{index.es552-CafNBF8u.js → index.es555-CafNBF8u.js} +0 -0
- /package/dist/app/assets/{index.es553-CTRr51gU.js → index.es556-CTRr51gU.js} +0 -0
- /package/dist/app/assets/{index.es554-D4h5O-jR.js → index.es557-D4h5O-jR.js} +0 -0
- /package/dist/app/assets/{index.es555-C39BiMTA.js → index.es558-C39BiMTA.js} +0 -0
- /package/dist/app/assets/{index.es556-Ddv68eIx.js → index.es559-Ddv68eIx.js} +0 -0
- /package/dist/app/assets/{index.es557-GBQ2dnAY.js → index.es560-GBQ2dnAY.js} +0 -0
- /package/dist/app/assets/{index.es558-PoHY5YXO.js → index.es561-PoHY5YXO.js} +0 -0
- /package/dist/app/assets/{index.es559-3e1v2bzS.js → index.es562-3e1v2bzS.js} +0 -0
- /package/dist/app/assets/{index.es560-CS3Unz2-.js → index.es563-CS3Unz2-.js} +0 -0
- /package/dist/app/assets/{index.es561-bN70gL4F.js → index.es564-bN70gL4F.js} +0 -0
- /package/dist/app/assets/{index.es562-CmCqftbK.js → index.es565-CmCqftbK.js} +0 -0
- /package/dist/app/assets/{index.es563-Ds-gbosJ.js → index.es566-Ds-gbosJ.js} +0 -0
- /package/dist/app/assets/{index.es564-CjDtw9vr.js → index.es567-CjDtw9vr.js} +0 -0
- /package/dist/app/assets/{index.es565-BthQWCQV.js → index.es568-BthQWCQV.js} +0 -0
- /package/dist/app/assets/{index.es566-DqwNpetd.js → index.es569-DqwNpetd.js} +0 -0
- /package/dist/app/assets/{index.es567-Bw305WKR.js → index.es570-Bw305WKR.js} +0 -0
- /package/dist/app/assets/{index.es568-DXbdFlpD.js → index.es571-DXbdFlpD.js} +0 -0
- /package/dist/app/assets/{index.es569-L9t79GZl.js → index.es572-L9t79GZl.js} +0 -0
- /package/dist/app/assets/{index.es570-CbfX1IO0.js → index.es573-CbfX1IO0.js} +0 -0
- /package/dist/app/assets/{index.es571-DBQeEorK.js → index.es574-DBQeEorK.js} +0 -0
- /package/dist/app/assets/{index.es572-BEBZ7ncR.js → index.es575-BEBZ7ncR.js} +0 -0
- /package/dist/app/assets/{index.es573-Bkuqu6BP.js → index.es576-Bkuqu6BP.js} +0 -0
- /package/dist/app/assets/{index.es574-D0r3Knsf.js → index.es577-D0r3Knsf.js} +0 -0
- /package/dist/app/assets/{index.es575-CVO1_9PV.js → index.es578-CVO1_9PV.js} +0 -0
package/dist/instrumentation.js
CHANGED
|
@@ -3110,9 +3110,9 @@ var require_resource = __commonJS((exports2) => {
|
|
|
3110
3110
|
// ../../node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js
|
|
3111
3111
|
var require_stable_attributes = __commonJS((exports2) => {
|
|
3112
3112
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3113
|
-
exports2.
|
|
3114
|
-
exports2.
|
|
3115
|
-
exports2.ATTR_USER_AGENT_ORIGINAL = exports2.ATTR_URL_SCHEME = exports2.ATTR_URL_QUERY = exports2.ATTR_URL_PATH = exports2.ATTR_URL_FULL = exports2.ATTR_URL_FRAGMENT = exports2.ATTR_TELEMETRY_SDK_VERSION = exports2.ATTR_TELEMETRY_SDK_NAME = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports2.ATTR_TELEMETRY_SDK_LANGUAGE = exports2.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports2.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports2.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports2.ATTR_SIGNALR_TRANSPORT = exports2.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports2.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports2.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports2.ATTR_SIGNALR_CONNECTION_STATUS = exports2.ATTR_SERVICE_VERSION = exports2.ATTR_SERVICE_NAME = exports2.ATTR_SERVER_PORT = exports2.ATTR_SERVER_ADDRESS = exports2.ATTR_OTEL_STATUS_DESCRIPTION = undefined;
|
|
3113
|
+
exports2.ATTR_EXCEPTION_TYPE = exports2.ATTR_EXCEPTION_STACKTRACE = exports2.ATTR_EXCEPTION_MESSAGE = exports2.ATTR_EXCEPTION_ESCAPED = exports2.ERROR_TYPE_VALUE_OTHER = exports2.ATTR_ERROR_TYPE = exports2.DOTNET_GC_HEAP_GENERATION_VALUE_POH = exports2.DOTNET_GC_HEAP_GENERATION_VALUE_LOH = exports2.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = exports2.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = exports2.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = exports2.ATTR_DOTNET_GC_HEAP_GENERATION = exports2.DB_SYSTEM_NAME_VALUE_POSTGRESQL = exports2.DB_SYSTEM_NAME_VALUE_MYSQL = exports2.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = exports2.DB_SYSTEM_NAME_VALUE_MARIADB = exports2.ATTR_DB_SYSTEM_NAME = exports2.ATTR_DB_STORED_PROCEDURE_NAME = exports2.ATTR_DB_RESPONSE_STATUS_CODE = exports2.ATTR_DB_QUERY_TEXT = exports2.ATTR_DB_QUERY_SUMMARY = exports2.ATTR_DB_OPERATION_NAME = exports2.ATTR_DB_OPERATION_BATCH_SIZE = exports2.ATTR_DB_NAMESPACE = exports2.ATTR_DB_COLLECTION_NAME = exports2.ATTR_CODE_STACKTRACE = exports2.ATTR_CODE_LINE_NUMBER = exports2.ATTR_CODE_FUNCTION_NAME = exports2.ATTR_CODE_FILE_PATH = exports2.ATTR_CODE_COLUMN_NUMBER = exports2.ATTR_CLIENT_PORT = exports2.ATTR_CLIENT_ADDRESS = exports2.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = exports2.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = exports2.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = exports2.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = exports2.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = exports2.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = exports2.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = exports2.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = exports2.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = exports2.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = exports2.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = exports2.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = exports2.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = exports2.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = exports2.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = exports2.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = exports2.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = exports2.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = undefined;
|
|
3114
|
+
exports2.OTEL_STATUS_CODE_VALUE_ERROR = exports2.ATTR_OTEL_STATUS_CODE = exports2.ATTR_OTEL_SCOPE_VERSION = exports2.ATTR_OTEL_SCOPE_NAME = exports2.NETWORK_TYPE_VALUE_IPV6 = exports2.NETWORK_TYPE_VALUE_IPV4 = exports2.ATTR_NETWORK_TYPE = exports2.NETWORK_TRANSPORT_VALUE_UNIX = exports2.NETWORK_TRANSPORT_VALUE_UDP = exports2.NETWORK_TRANSPORT_VALUE_TCP = exports2.NETWORK_TRANSPORT_VALUE_QUIC = exports2.NETWORK_TRANSPORT_VALUE_PIPE = exports2.ATTR_NETWORK_TRANSPORT = exports2.ATTR_NETWORK_PROTOCOL_VERSION = exports2.ATTR_NETWORK_PROTOCOL_NAME = exports2.ATTR_NETWORK_PEER_PORT = exports2.ATTR_NETWORK_PEER_ADDRESS = exports2.ATTR_NETWORK_LOCAL_PORT = exports2.ATTR_NETWORK_LOCAL_ADDRESS = exports2.JVM_THREAD_STATE_VALUE_WAITING = exports2.JVM_THREAD_STATE_VALUE_TIMED_WAITING = exports2.JVM_THREAD_STATE_VALUE_TERMINATED = exports2.JVM_THREAD_STATE_VALUE_RUNNABLE = exports2.JVM_THREAD_STATE_VALUE_NEW = exports2.JVM_THREAD_STATE_VALUE_BLOCKED = exports2.ATTR_JVM_THREAD_STATE = exports2.ATTR_JVM_THREAD_DAEMON = exports2.JVM_MEMORY_TYPE_VALUE_NON_HEAP = exports2.JVM_MEMORY_TYPE_VALUE_HEAP = exports2.ATTR_JVM_MEMORY_TYPE = exports2.ATTR_JVM_MEMORY_POOL_NAME = exports2.ATTR_JVM_GC_NAME = exports2.ATTR_JVM_GC_ACTION = exports2.ATTR_HTTP_ROUTE = exports2.ATTR_HTTP_RESPONSE_STATUS_CODE = exports2.ATTR_HTTP_RESPONSE_HEADER = exports2.ATTR_HTTP_REQUEST_RESEND_COUNT = exports2.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = exports2.HTTP_REQUEST_METHOD_VALUE_TRACE = exports2.HTTP_REQUEST_METHOD_VALUE_PUT = exports2.HTTP_REQUEST_METHOD_VALUE_POST = exports2.HTTP_REQUEST_METHOD_VALUE_PATCH = exports2.HTTP_REQUEST_METHOD_VALUE_OPTIONS = exports2.HTTP_REQUEST_METHOD_VALUE_HEAD = exports2.HTTP_REQUEST_METHOD_VALUE_GET = exports2.HTTP_REQUEST_METHOD_VALUE_DELETE = exports2.HTTP_REQUEST_METHOD_VALUE_CONNECT = exports2.HTTP_REQUEST_METHOD_VALUE_OTHER = exports2.ATTR_HTTP_REQUEST_METHOD = exports2.ATTR_HTTP_REQUEST_HEADER = undefined;
|
|
3115
|
+
exports2.ATTR_USER_AGENT_ORIGINAL = exports2.ATTR_URL_SCHEME = exports2.ATTR_URL_QUERY = exports2.ATTR_URL_PATH = exports2.ATTR_URL_FULL = exports2.ATTR_URL_FRAGMENT = exports2.ATTR_TELEMETRY_SDK_VERSION = exports2.ATTR_TELEMETRY_SDK_NAME = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports2.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports2.ATTR_TELEMETRY_SDK_LANGUAGE = exports2.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports2.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports2.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports2.ATTR_SIGNALR_TRANSPORT = exports2.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports2.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports2.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports2.ATTR_SIGNALR_CONNECTION_STATUS = exports2.ATTR_SERVICE_VERSION = exports2.ATTR_SERVICE_NAME = exports2.ATTR_SERVER_PORT = exports2.ATTR_SERVER_ADDRESS = exports2.ATTR_OTEL_STATUS_DESCRIPTION = exports2.OTEL_STATUS_CODE_VALUE_OK = undefined;
|
|
3116
3116
|
exports2.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result";
|
|
3117
3117
|
exports2.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted";
|
|
3118
3118
|
exports2.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled";
|
|
@@ -3130,6 +3130,7 @@ var require_stable_attributes = __commonJS((exports2) => {
|
|
|
3130
3130
|
exports2.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status";
|
|
3131
3131
|
exports2.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure";
|
|
3132
3132
|
exports2.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success";
|
|
3133
|
+
exports2.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = "aspnetcore.user.is_authenticated";
|
|
3133
3134
|
exports2.ATTR_CLIENT_ADDRESS = "client.address";
|
|
3134
3135
|
exports2.ATTR_CLIENT_PORT = "client.port";
|
|
3135
3136
|
exports2.ATTR_CODE_COLUMN_NUMBER = "code.column.number";
|
|
@@ -3309,6 +3310,13 @@ var require_stable_metrics = __commonJS((exports2) => {
|
|
|
3309
3310
|
exports2.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = "signalr.server.connection.duration";
|
|
3310
3311
|
});
|
|
3311
3312
|
|
|
3313
|
+
// ../../node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js
|
|
3314
|
+
var require_stable_events = __commonJS((exports2) => {
|
|
3315
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3316
|
+
exports2.EVENT_EXCEPTION = undefined;
|
|
3317
|
+
exports2.EVENT_EXCEPTION = "exception";
|
|
3318
|
+
});
|
|
3319
|
+
|
|
3312
3320
|
// ../../node_modules/@opentelemetry/semantic-conventions/build/src/index.js
|
|
3313
3321
|
var require_src2 = __commonJS((exports2) => {
|
|
3314
3322
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
@@ -3336,6 +3344,7 @@ var require_src2 = __commonJS((exports2) => {
|
|
|
3336
3344
|
__exportStar(require_resource(), exports2);
|
|
3337
3345
|
__exportStar(require_stable_attributes(), exports2);
|
|
3338
3346
|
__exportStar(require_stable_metrics(), exports2);
|
|
3347
|
+
__exportStar(require_stable_events(), exports2);
|
|
3339
3348
|
});
|
|
3340
3349
|
|
|
3341
3350
|
// ../../node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js
|
|
@@ -34161,7 +34170,7 @@ var require_constants6 = __commonJS((exports2) => {
|
|
|
34161
34170
|
var require_package2 = __commonJS((exports2, module2) => {
|
|
34162
34171
|
module2.exports = {
|
|
34163
34172
|
name: "@grpc/grpc-js",
|
|
34164
|
-
version: "1.
|
|
34173
|
+
version: "1.14.0",
|
|
34165
34174
|
description: "gRPC Library for Node - pure JS implementation",
|
|
34166
34175
|
homepage: "https://grpc.io/",
|
|
34167
34176
|
repository: "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
|
@@ -34218,23 +34227,25 @@ var require_package2 = __commonJS((exports2, module2) => {
|
|
|
34218
34227
|
compile: "tsc -p .",
|
|
34219
34228
|
format: 'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',
|
|
34220
34229
|
lint: "eslint src/*.ts test/*.ts",
|
|
34221
|
-
prepare: "npm run generate-types && npm run compile",
|
|
34230
|
+
prepare: "npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",
|
|
34222
34231
|
test: "gulp test",
|
|
34223
34232
|
check: "npm run lint",
|
|
34224
34233
|
fix: "eslint --fix src/*.ts test/*.ts",
|
|
34225
34234
|
pretest: "npm run generate-types && npm run generate-test-types && npm run compile",
|
|
34226
34235
|
posttest: "npm run check && madge -c ./build/src",
|
|
34227
|
-
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs
|
|
34228
|
-
"generate-test-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"
|
|
34236
|
+
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto",
|
|
34237
|
+
"generate-test-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto",
|
|
34238
|
+
"copy-protos": "node ./copy-protos"
|
|
34229
34239
|
},
|
|
34230
34240
|
dependencies: {
|
|
34231
|
-
"@grpc/proto-loader": "^0.
|
|
34241
|
+
"@grpc/proto-loader": "^0.8.0",
|
|
34232
34242
|
"@js-sdsl/ordered-map": "^4.4.2"
|
|
34233
34243
|
},
|
|
34234
34244
|
files: [
|
|
34235
34245
|
"src/**/*.ts",
|
|
34236
34246
|
"build/src/**/*.{js,d.ts,js.map}",
|
|
34237
|
-
"proto
|
|
34247
|
+
"proto/**/*.proto",
|
|
34248
|
+
"proto/**/LICENSE",
|
|
34238
34249
|
"LICENSE",
|
|
34239
34250
|
"deps/envoy-api/envoy/api/v2/**/*.proto",
|
|
34240
34251
|
"deps/envoy-api/envoy/config/**/*.proto",
|
|
@@ -34374,7 +34385,7 @@ var require_metadata = __commonJS((exports2) => {
|
|
|
34374
34385
|
var logging_1 = require_logging();
|
|
34375
34386
|
var constants_1 = require_constants6();
|
|
34376
34387
|
var error_1 = require_error();
|
|
34377
|
-
var LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/;
|
|
34388
|
+
var LEGAL_KEY_REGEX = /^[:0-9a-z_.-]+$/;
|
|
34378
34389
|
var LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/;
|
|
34379
34390
|
function isLegalKey(key) {
|
|
34380
34391
|
return LEGAL_KEY_REGEX.test(key);
|
|
@@ -34414,6 +34425,7 @@ var require_metadata = __commonJS((exports2) => {
|
|
|
34414
34425
|
class Metadata {
|
|
34415
34426
|
constructor(options = {}) {
|
|
34416
34427
|
this.internalRepr = new Map;
|
|
34428
|
+
this.opaqueData = new Map;
|
|
34417
34429
|
this.options = options;
|
|
34418
34430
|
}
|
|
34419
34431
|
set(key, value) {
|
|
@@ -34479,6 +34491,9 @@ var require_metadata = __commonJS((exports2) => {
|
|
|
34479
34491
|
toHttp2Headers() {
|
|
34480
34492
|
const result = {};
|
|
34481
34493
|
for (const [key, values] of this.internalRepr) {
|
|
34494
|
+
if (key.startsWith(":")) {
|
|
34495
|
+
continue;
|
|
34496
|
+
}
|
|
34482
34497
|
result[key] = values.map(bufToString);
|
|
34483
34498
|
}
|
|
34484
34499
|
return result;
|
|
@@ -34490,6 +34505,12 @@ var require_metadata = __commonJS((exports2) => {
|
|
|
34490
34505
|
}
|
|
34491
34506
|
return result;
|
|
34492
34507
|
}
|
|
34508
|
+
setOpaque(key, value) {
|
|
34509
|
+
this.opaqueData.set(key, value);
|
|
34510
|
+
}
|
|
34511
|
+
getOpaque(key) {
|
|
34512
|
+
return this.opaqueData.get(key);
|
|
34513
|
+
}
|
|
34493
34514
|
static fromHttp2Headers(headers) {
|
|
34494
34515
|
const result = new Metadata;
|
|
34495
34516
|
for (const key of Object.keys(headers)) {
|
|
@@ -34771,12 +34792,14 @@ var require_uri_parser = __commonJS((exports2) => {
|
|
|
34771
34792
|
// ../../node_modules/@grpc/grpc-js/build/src/resolver.js
|
|
34772
34793
|
var require_resolver = __commonJS((exports2) => {
|
|
34773
34794
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
34795
|
+
exports2.CHANNEL_ARGS_CONFIG_SELECTOR_KEY = undefined;
|
|
34774
34796
|
exports2.registerResolver = registerResolver;
|
|
34775
34797
|
exports2.registerDefaultScheme = registerDefaultScheme;
|
|
34776
34798
|
exports2.createResolver = createResolver;
|
|
34777
34799
|
exports2.getDefaultAuthority = getDefaultAuthority;
|
|
34778
34800
|
exports2.mapUriDefaultScheme = mapUriDefaultScheme;
|
|
34779
34801
|
var uri_parser_1 = require_uri_parser();
|
|
34802
|
+
exports2.CHANNEL_ARGS_CONFIG_SELECTOR_KEY = "grpc.internal.config_selector";
|
|
34780
34803
|
var registeredResolvers = {};
|
|
34781
34804
|
var defaultScheme = null;
|
|
34782
34805
|
function registerResolver(scheme, resolverClass) {
|
|
@@ -35865,7 +35888,7 @@ var require_load_balancer_child_handler = __commonJS((exports2) => {
|
|
|
35865
35888
|
configUpdateRequiresNewPolicyInstance(oldConfig, newConfig) {
|
|
35866
35889
|
return oldConfig.getLoadBalancerName() !== newConfig.getLoadBalancerName();
|
|
35867
35890
|
}
|
|
35868
|
-
updateAddressList(endpointList, lbConfig, options) {
|
|
35891
|
+
updateAddressList(endpointList, lbConfig, options, resolutionNote) {
|
|
35869
35892
|
let childToUpdate;
|
|
35870
35893
|
if (this.currentChild === null || this.latestConfig === null || this.configUpdateRequiresNewPolicyInstance(this.latestConfig, lbConfig)) {
|
|
35871
35894
|
const newHelper = new this.ChildPolicyHelper(this);
|
|
@@ -35889,7 +35912,7 @@ var require_load_balancer_child_handler = __commonJS((exports2) => {
|
|
|
35889
35912
|
}
|
|
35890
35913
|
}
|
|
35891
35914
|
this.latestConfig = lbConfig;
|
|
35892
|
-
childToUpdate.updateAddressList(endpointList, lbConfig, options);
|
|
35915
|
+
return childToUpdate.updateAddressList(endpointList, lbConfig, options, resolutionNote);
|
|
35893
35916
|
}
|
|
35894
35917
|
exitIdle() {
|
|
35895
35918
|
if (this.currentChild) {
|
|
@@ -36050,46 +36073,7 @@ var require_resolving_load_balancer = __commonJS((exports2) => {
|
|
|
36050
36073
|
addChannelzChild: channelControlHelper.addChannelzChild.bind(channelControlHelper),
|
|
36051
36074
|
removeChannelzChild: channelControlHelper.removeChannelzChild.bind(channelControlHelper)
|
|
36052
36075
|
});
|
|
36053
|
-
this.innerResolver = (0, resolver_1.createResolver)(target,
|
|
36054
|
-
onSuccessfulResolution: (endpointList, serviceConfig, serviceConfigError, configSelector, attributes) => {
|
|
36055
|
-
var _a;
|
|
36056
|
-
this.backoffTimeout.stop();
|
|
36057
|
-
this.backoffTimeout.reset();
|
|
36058
|
-
let workingServiceConfig = null;
|
|
36059
|
-
if (serviceConfig === null) {
|
|
36060
|
-
if (serviceConfigError === null) {
|
|
36061
|
-
this.previousServiceConfig = null;
|
|
36062
|
-
workingServiceConfig = this.defaultServiceConfig;
|
|
36063
|
-
} else {
|
|
36064
|
-
if (this.previousServiceConfig === null) {
|
|
36065
|
-
this.handleResolutionFailure(serviceConfigError);
|
|
36066
|
-
} else {
|
|
36067
|
-
workingServiceConfig = this.previousServiceConfig;
|
|
36068
|
-
}
|
|
36069
|
-
}
|
|
36070
|
-
} else {
|
|
36071
|
-
workingServiceConfig = serviceConfig;
|
|
36072
|
-
this.previousServiceConfig = serviceConfig;
|
|
36073
|
-
}
|
|
36074
|
-
const workingConfigList = (_a = workingServiceConfig === null || workingServiceConfig === undefined ? undefined : workingServiceConfig.loadBalancingConfig) !== null && _a !== undefined ? _a : [];
|
|
36075
|
-
const loadBalancingConfig = (0, load_balancer_1.selectLbConfigFromList)(workingConfigList, true);
|
|
36076
|
-
if (loadBalancingConfig === null) {
|
|
36077
|
-
this.handleResolutionFailure({
|
|
36078
|
-
code: constants_1.Status.UNAVAILABLE,
|
|
36079
|
-
details: "All load balancer options in service config are not compatible",
|
|
36080
|
-
metadata: new metadata_1.Metadata
|
|
36081
|
-
});
|
|
36082
|
-
configSelector === null || configSelector === undefined || configSelector.unref();
|
|
36083
|
-
return;
|
|
36084
|
-
}
|
|
36085
|
-
this.childLoadBalancer.updateAddressList(endpointList, loadBalancingConfig, Object.assign(Object.assign({}, this.channelOptions), attributes));
|
|
36086
|
-
const finalServiceConfig = workingServiceConfig !== null && workingServiceConfig !== undefined ? workingServiceConfig : this.defaultServiceConfig;
|
|
36087
|
-
this.onSuccessfulResolution(finalServiceConfig, configSelector !== null && configSelector !== undefined ? configSelector : getDefaultConfigSelector(finalServiceConfig));
|
|
36088
|
-
},
|
|
36089
|
-
onError: (error) => {
|
|
36090
|
-
this.handleResolutionFailure(error);
|
|
36091
|
-
}
|
|
36092
|
-
}, channelOptions);
|
|
36076
|
+
this.innerResolver = (0, resolver_1.createResolver)(target, this.handleResolverResult.bind(this), channelOptions);
|
|
36093
36077
|
const backoffOptions = {
|
|
36094
36078
|
initialDelay: channelOptions["grpc.initial_reconnect_backoff_ms"],
|
|
36095
36079
|
maxDelay: channelOptions["grpc.max_reconnect_backoff_ms"]
|
|
@@ -36104,6 +36088,43 @@ var require_resolving_load_balancer = __commonJS((exports2) => {
|
|
|
36104
36088
|
}, backoffOptions);
|
|
36105
36089
|
this.backoffTimeout.unref();
|
|
36106
36090
|
}
|
|
36091
|
+
handleResolverResult(endpointList, attributes, serviceConfig, resolutionNote) {
|
|
36092
|
+
var _a, _b;
|
|
36093
|
+
this.backoffTimeout.stop();
|
|
36094
|
+
this.backoffTimeout.reset();
|
|
36095
|
+
let resultAccepted = true;
|
|
36096
|
+
let workingServiceConfig = null;
|
|
36097
|
+
if (serviceConfig === null) {
|
|
36098
|
+
workingServiceConfig = this.defaultServiceConfig;
|
|
36099
|
+
} else if (serviceConfig.ok) {
|
|
36100
|
+
workingServiceConfig = serviceConfig.value;
|
|
36101
|
+
} else {
|
|
36102
|
+
if (this.previousServiceConfig !== null) {
|
|
36103
|
+
workingServiceConfig = this.previousServiceConfig;
|
|
36104
|
+
} else {
|
|
36105
|
+
resultAccepted = false;
|
|
36106
|
+
this.handleResolutionFailure(serviceConfig.error);
|
|
36107
|
+
}
|
|
36108
|
+
}
|
|
36109
|
+
if (workingServiceConfig !== null) {
|
|
36110
|
+
const workingConfigList = (_a = workingServiceConfig === null || workingServiceConfig === undefined ? undefined : workingServiceConfig.loadBalancingConfig) !== null && _a !== undefined ? _a : [];
|
|
36111
|
+
const loadBalancingConfig = (0, load_balancer_1.selectLbConfigFromList)(workingConfigList, true);
|
|
36112
|
+
if (loadBalancingConfig === null) {
|
|
36113
|
+
resultAccepted = false;
|
|
36114
|
+
this.handleResolutionFailure({
|
|
36115
|
+
code: constants_1.Status.UNAVAILABLE,
|
|
36116
|
+
details: "All load balancer options in service config are not compatible",
|
|
36117
|
+
metadata: new metadata_1.Metadata
|
|
36118
|
+
});
|
|
36119
|
+
} else {
|
|
36120
|
+
resultAccepted = this.childLoadBalancer.updateAddressList(endpointList, loadBalancingConfig, Object.assign(Object.assign({}, this.channelOptions), attributes), resolutionNote);
|
|
36121
|
+
}
|
|
36122
|
+
}
|
|
36123
|
+
if (resultAccepted) {
|
|
36124
|
+
this.onSuccessfulResolution(workingServiceConfig, (_b = attributes[resolver_1.CHANNEL_ARGS_CONFIG_SELECTOR_KEY]) !== null && _b !== undefined ? _b : getDefaultConfigSelector(workingServiceConfig));
|
|
36125
|
+
}
|
|
36126
|
+
return resultAccepted;
|
|
36127
|
+
}
|
|
36107
36128
|
updateResolution() {
|
|
36108
36129
|
this.innerResolver.updateResolution();
|
|
36109
36130
|
if (this.currentState === connectivity_state_1.ConnectivityState.IDLE) {
|
|
@@ -36194,7 +36215,8 @@ var require_channel_options = __commonJS((exports2) => {
|
|
|
36194
36215
|
"grpc-node.tls_enable_trace": true,
|
|
36195
36216
|
"grpc.lb.ring_hash.ring_size_cap": true,
|
|
36196
36217
|
"grpc-node.retry_max_attempts_limit": true,
|
|
36197
|
-
"grpc-node.flow_control_window": true
|
|
36218
|
+
"grpc-node.flow_control_window": true,
|
|
36219
|
+
"grpc.server_call_metric_recording": true
|
|
36198
36220
|
};
|
|
36199
36221
|
function channelOptionsEqual(options1, options2) {
|
|
36200
36222
|
const keys1 = Object.keys(options1).sort();
|
|
@@ -37278,6 +37300,10 @@ ${callerStack}`;
|
|
|
37278
37300
|
var _a, _b;
|
|
37279
37301
|
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getPeer()) !== null && _b !== undefined ? _b : "unknown";
|
|
37280
37302
|
}
|
|
37303
|
+
getAuthContext() {
|
|
37304
|
+
var _a, _b;
|
|
37305
|
+
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getAuthContext()) !== null && _b !== undefined ? _b : null;
|
|
37306
|
+
}
|
|
37281
37307
|
}
|
|
37282
37308
|
exports2.ClientUnaryCallImpl = ClientUnaryCallImpl;
|
|
37283
37309
|
|
|
@@ -37294,6 +37320,10 @@ ${callerStack}`;
|
|
|
37294
37320
|
var _a, _b;
|
|
37295
37321
|
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getPeer()) !== null && _b !== undefined ? _b : "unknown";
|
|
37296
37322
|
}
|
|
37323
|
+
getAuthContext() {
|
|
37324
|
+
var _a, _b;
|
|
37325
|
+
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getAuthContext()) !== null && _b !== undefined ? _b : null;
|
|
37326
|
+
}
|
|
37297
37327
|
_read(_size) {
|
|
37298
37328
|
var _a;
|
|
37299
37329
|
(_a = this.call) === null || _a === undefined || _a.startRead();
|
|
@@ -37314,6 +37344,10 @@ ${callerStack}`;
|
|
|
37314
37344
|
var _a, _b;
|
|
37315
37345
|
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getPeer()) !== null && _b !== undefined ? _b : "unknown";
|
|
37316
37346
|
}
|
|
37347
|
+
getAuthContext() {
|
|
37348
|
+
var _a, _b;
|
|
37349
|
+
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getAuthContext()) !== null && _b !== undefined ? _b : null;
|
|
37350
|
+
}
|
|
37317
37351
|
_write(chunk, encoding, cb) {
|
|
37318
37352
|
var _a;
|
|
37319
37353
|
const context = {
|
|
@@ -37347,6 +37381,10 @@ ${callerStack}`;
|
|
|
37347
37381
|
var _a, _b;
|
|
37348
37382
|
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getPeer()) !== null && _b !== undefined ? _b : "unknown";
|
|
37349
37383
|
}
|
|
37384
|
+
getAuthContext() {
|
|
37385
|
+
var _a, _b;
|
|
37386
|
+
return (_b = (_a = this.call) === null || _a === undefined ? undefined : _a.getAuthContext()) !== null && _b !== undefined ? _b : null;
|
|
37387
|
+
}
|
|
37350
37388
|
_read(_size) {
|
|
37351
37389
|
var _a;
|
|
37352
37390
|
(_a = this.call) === null || _a === undefined || _a.startRead();
|
|
@@ -37375,7 +37413,23 @@ ${callerStack}`;
|
|
|
37375
37413
|
var require_call_interface = __commonJS((exports2) => {
|
|
37376
37414
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
37377
37415
|
exports2.InterceptingListenerImpl = undefined;
|
|
37416
|
+
exports2.statusOrFromValue = statusOrFromValue;
|
|
37417
|
+
exports2.statusOrFromError = statusOrFromError;
|
|
37378
37418
|
exports2.isInterceptingListener = isInterceptingListener;
|
|
37419
|
+
var metadata_1 = require_metadata();
|
|
37420
|
+
function statusOrFromValue(value) {
|
|
37421
|
+
return {
|
|
37422
|
+
ok: true,
|
|
37423
|
+
value
|
|
37424
|
+
};
|
|
37425
|
+
}
|
|
37426
|
+
function statusOrFromError(error) {
|
|
37427
|
+
var _a;
|
|
37428
|
+
return {
|
|
37429
|
+
ok: false,
|
|
37430
|
+
error: Object.assign(Object.assign({}, error), { metadata: (_a = error.metadata) !== null && _a !== undefined ? _a : new metadata_1.Metadata })
|
|
37431
|
+
};
|
|
37432
|
+
}
|
|
37379
37433
|
function isInterceptingListener(listener) {
|
|
37380
37434
|
return listener.onReceiveMetadata !== undefined && listener.onReceiveMetadata.length === 1;
|
|
37381
37435
|
}
|
|
@@ -37636,6 +37690,9 @@ var require_client_interceptors = __commonJS((exports2) => {
|
|
|
37636
37690
|
}
|
|
37637
37691
|
});
|
|
37638
37692
|
}
|
|
37693
|
+
getAuthContext() {
|
|
37694
|
+
return this.nextCall.getAuthContext();
|
|
37695
|
+
}
|
|
37639
37696
|
}
|
|
37640
37697
|
exports2.InterceptingCall = InterceptingCall;
|
|
37641
37698
|
function getCall(channel, path, options) {
|
|
@@ -37715,6 +37772,9 @@ var require_client_interceptors = __commonJS((exports2) => {
|
|
|
37715
37772
|
halfClose() {
|
|
37716
37773
|
this.call.halfClose();
|
|
37717
37774
|
}
|
|
37775
|
+
getAuthContext() {
|
|
37776
|
+
return this.call.getAuthContext();
|
|
37777
|
+
}
|
|
37718
37778
|
}
|
|
37719
37779
|
|
|
37720
37780
|
class BaseUnaryInterceptingCall extends BaseInterceptingCall {
|
|
@@ -42868,11 +42928,11 @@ var require_descriptor = __commonJS((exports2, module2) => {
|
|
|
42868
42928
|
42,
|
|
42869
42929
|
42
|
|
42870
42930
|
],
|
|
42871
|
-
"php_generic_services",
|
|
42872
42931
|
[
|
|
42873
42932
|
38,
|
|
42874
42933
|
38
|
|
42875
|
-
]
|
|
42934
|
+
],
|
|
42935
|
+
"php_generic_services"
|
|
42876
42936
|
],
|
|
42877
42937
|
nested: {
|
|
42878
42938
|
OptimizeMode: {
|
|
@@ -45624,8 +45684,8 @@ var require_src25 = __commonJS((exports2) => {
|
|
|
45624
45684
|
responseSerialize: createSerializer(responseType),
|
|
45625
45685
|
responseDeserialize: createDeserializer(responseType, options),
|
|
45626
45686
|
originalName: camelCase(method.name),
|
|
45627
|
-
requestType: createMessageDefinition(requestType, fileDescriptors),
|
|
45628
|
-
responseType: createMessageDefinition(responseType, fileDescriptors),
|
|
45687
|
+
requestType: createMessageDefinition(requestType, options, fileDescriptors),
|
|
45688
|
+
responseType: createMessageDefinition(responseType, options, fileDescriptors),
|
|
45629
45689
|
options: mapMethodOptions(method.parsedOptions)
|
|
45630
45690
|
};
|
|
45631
45691
|
}
|
|
@@ -45636,12 +45696,14 @@ var require_src25 = __commonJS((exports2) => {
|
|
|
45636
45696
|
}
|
|
45637
45697
|
return def;
|
|
45638
45698
|
}
|
|
45639
|
-
function createMessageDefinition(message, fileDescriptors) {
|
|
45699
|
+
function createMessageDefinition(message, options, fileDescriptors) {
|
|
45640
45700
|
const messageDescriptor = message.toDescriptor("proto3");
|
|
45641
45701
|
return {
|
|
45642
45702
|
format: "Protocol Buffer 3 DescriptorProto",
|
|
45643
45703
|
type: messageDescriptor.$type.toObject(messageDescriptor, descriptorOptions),
|
|
45644
|
-
fileDescriptorProtos: fileDescriptors
|
|
45704
|
+
fileDescriptorProtos: fileDescriptors,
|
|
45705
|
+
serialize: createSerializer(message),
|
|
45706
|
+
deserialize: createDeserializer(message, options)
|
|
45645
45707
|
};
|
|
45646
45708
|
}
|
|
45647
45709
|
function createEnumDefinition(enumType, fileDescriptors) {
|
|
@@ -45656,7 +45718,7 @@ var require_src25 = __commonJS((exports2) => {
|
|
|
45656
45718
|
if (obj instanceof Protobuf.Service) {
|
|
45657
45719
|
return createServiceDefinition(obj, name, options, fileDescriptors);
|
|
45658
45720
|
} else if (obj instanceof Protobuf.Type) {
|
|
45659
|
-
return createMessageDefinition(obj, fileDescriptors);
|
|
45721
|
+
return createMessageDefinition(obj, options, fileDescriptors);
|
|
45660
45722
|
} else if (obj instanceof Protobuf.Enum) {
|
|
45661
45723
|
return createEnumDefinition(obj, fileDescriptors);
|
|
45662
45724
|
} else {
|
|
@@ -46238,263 +46300,970 @@ var require_channelz = __commonJS((exports2) => {
|
|
|
46238
46300
|
}
|
|
46239
46301
|
});
|
|
46240
46302
|
|
|
46241
|
-
// ../../node_modules/@grpc/grpc-js/build/src/
|
|
46242
|
-
var
|
|
46303
|
+
// ../../node_modules/@grpc/grpc-js/build/src/call-number.js
|
|
46304
|
+
var require_call_number = __commonJS((exports2) => {
|
|
46243
46305
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46244
|
-
exports2.
|
|
46245
|
-
var
|
|
46246
|
-
|
|
46247
|
-
|
|
46248
|
-
|
|
46249
|
-
|
|
46250
|
-
var subchannel_address_1 = require_subchannel_address();
|
|
46251
|
-
var channelz_1 = require_channelz();
|
|
46252
|
-
var TRACER_NAME = "subchannel";
|
|
46253
|
-
var KEEPALIVE_MAX_TIME_MS = ~(1 << 31);
|
|
46306
|
+
exports2.getNextCallNumber = getNextCallNumber;
|
|
46307
|
+
var nextCallNumber = 0;
|
|
46308
|
+
function getNextCallNumber() {
|
|
46309
|
+
return nextCallNumber++;
|
|
46310
|
+
}
|
|
46311
|
+
});
|
|
46254
46312
|
|
|
46255
|
-
|
|
46256
|
-
|
|
46257
|
-
|
|
46258
|
-
|
|
46259
|
-
|
|
46260
|
-
|
|
46261
|
-
|
|
46262
|
-
|
|
46263
|
-
|
|
46264
|
-
|
|
46265
|
-
|
|
46266
|
-
|
|
46267
|
-
|
|
46268
|
-
|
|
46269
|
-
|
|
46270
|
-
|
|
46271
|
-
|
|
46272
|
-
|
|
46273
|
-
|
|
46274
|
-
|
|
46275
|
-
this.backoffTimeout.unref();
|
|
46276
|
-
this.subchannelAddressString = (0, subchannel_address_1.subchannelAddressToString)(subchannelAddress);
|
|
46277
|
-
this.keepaliveTime = (_a = options["grpc.keepalive_time_ms"]) !== null && _a !== undefined ? _a : -1;
|
|
46278
|
-
if (options["grpc.enable_channelz"] === 0) {
|
|
46279
|
-
this.channelzEnabled = false;
|
|
46280
|
-
this.channelzTrace = new channelz_1.ChannelzTraceStub;
|
|
46281
|
-
this.callTracker = new channelz_1.ChannelzCallTrackerStub;
|
|
46282
|
-
this.childrenTracker = new channelz_1.ChannelzChildrenTrackerStub;
|
|
46283
|
-
this.streamTracker = new channelz_1.ChannelzCallTrackerStub;
|
|
46284
|
-
} else {
|
|
46285
|
-
this.channelzTrace = new channelz_1.ChannelzTrace;
|
|
46286
|
-
this.callTracker = new channelz_1.ChannelzCallTracker;
|
|
46287
|
-
this.childrenTracker = new channelz_1.ChannelzChildrenTracker;
|
|
46288
|
-
this.streamTracker = new channelz_1.ChannelzCallTracker;
|
|
46289
|
-
}
|
|
46290
|
-
this.channelzRef = (0, channelz_1.registerChannelzSubchannel)(this.subchannelAddressString, () => this.getChannelzInfo(), this.channelzEnabled);
|
|
46291
|
-
this.channelzTrace.addTrace("CT_INFO", "Subchannel created");
|
|
46292
|
-
this.trace("Subchannel constructed with options " + JSON.stringify(options, undefined, 2));
|
|
46293
|
-
this.secureConnector = credentials._createSecureConnector(channelTarget, options);
|
|
46294
|
-
}
|
|
46295
|
-
getChannelzInfo() {
|
|
46296
|
-
return {
|
|
46297
|
-
state: this.connectivityState,
|
|
46298
|
-
trace: this.channelzTrace,
|
|
46299
|
-
callTracker: this.callTracker,
|
|
46300
|
-
children: this.childrenTracker.getChildLists(),
|
|
46301
|
-
target: this.subchannelAddressString
|
|
46302
|
-
};
|
|
46303
|
-
}
|
|
46304
|
-
trace(text) {
|
|
46305
|
-
logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, "(" + this.channelzRef.id + ") " + this.subchannelAddressString + " " + text);
|
|
46313
|
+
// ../../node_modules/@grpc/grpc-js/build/src/compression-algorithms.js
|
|
46314
|
+
var require_compression_algorithms = __commonJS((exports2) => {
|
|
46315
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46316
|
+
exports2.CompressionAlgorithms = undefined;
|
|
46317
|
+
var CompressionAlgorithms;
|
|
46318
|
+
(function(CompressionAlgorithms2) {
|
|
46319
|
+
CompressionAlgorithms2[CompressionAlgorithms2["identity"] = 0] = "identity";
|
|
46320
|
+
CompressionAlgorithms2[CompressionAlgorithms2["deflate"] = 1] = "deflate";
|
|
46321
|
+
CompressionAlgorithms2[CompressionAlgorithms2["gzip"] = 2] = "gzip";
|
|
46322
|
+
})(CompressionAlgorithms || (exports2.CompressionAlgorithms = CompressionAlgorithms = {}));
|
|
46323
|
+
});
|
|
46324
|
+
|
|
46325
|
+
// ../../node_modules/@grpc/grpc-js/build/src/filter.js
|
|
46326
|
+
var require_filter = __commonJS((exports2) => {
|
|
46327
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46328
|
+
exports2.BaseFilter = undefined;
|
|
46329
|
+
|
|
46330
|
+
class BaseFilter {
|
|
46331
|
+
async sendMetadata(metadata) {
|
|
46332
|
+
return metadata;
|
|
46306
46333
|
}
|
|
46307
|
-
|
|
46308
|
-
|
|
46334
|
+
receiveMetadata(metadata) {
|
|
46335
|
+
return metadata;
|
|
46309
46336
|
}
|
|
46310
|
-
|
|
46311
|
-
|
|
46312
|
-
this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING);
|
|
46313
|
-
} else {
|
|
46314
|
-
this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.IDLE);
|
|
46315
|
-
}
|
|
46337
|
+
async sendMessage(message) {
|
|
46338
|
+
return message;
|
|
46316
46339
|
}
|
|
46317
|
-
|
|
46318
|
-
|
|
46340
|
+
async receiveMessage(message) {
|
|
46341
|
+
return message;
|
|
46319
46342
|
}
|
|
46320
|
-
|
|
46321
|
-
|
|
46322
|
-
this.backoffTimeout.reset();
|
|
46343
|
+
receiveTrailers(status) {
|
|
46344
|
+
return status;
|
|
46323
46345
|
}
|
|
46324
|
-
|
|
46325
|
-
|
|
46326
|
-
|
|
46327
|
-
|
|
46328
|
-
|
|
46346
|
+
}
|
|
46347
|
+
exports2.BaseFilter = BaseFilter;
|
|
46348
|
+
});
|
|
46349
|
+
|
|
46350
|
+
// ../../node_modules/@grpc/grpc-js/build/src/compression-filter.js
|
|
46351
|
+
var require_compression_filter = __commonJS((exports2) => {
|
|
46352
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46353
|
+
exports2.CompressionFilterFactory = exports2.CompressionFilter = undefined;
|
|
46354
|
+
var zlib = require("zlib");
|
|
46355
|
+
var compression_algorithms_1 = require_compression_algorithms();
|
|
46356
|
+
var constants_1 = require_constants6();
|
|
46357
|
+
var filter_1 = require_filter();
|
|
46358
|
+
var logging = require_logging();
|
|
46359
|
+
var isCompressionAlgorithmKey = (key) => {
|
|
46360
|
+
return typeof key === "number" && typeof compression_algorithms_1.CompressionAlgorithms[key] === "string";
|
|
46361
|
+
};
|
|
46362
|
+
|
|
46363
|
+
class CompressionHandler {
|
|
46364
|
+
async writeMessage(message, compress) {
|
|
46365
|
+
let messageBuffer = message;
|
|
46366
|
+
if (compress) {
|
|
46367
|
+
messageBuffer = await this.compressMessage(messageBuffer);
|
|
46329
46368
|
}
|
|
46330
|
-
|
|
46331
|
-
|
|
46332
|
-
|
|
46333
|
-
|
|
46334
|
-
|
|
46335
|
-
}
|
|
46336
|
-
transport.addDisconnectListener((tooManyPings) => {
|
|
46337
|
-
this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE);
|
|
46338
|
-
if (tooManyPings && this.keepaliveTime > 0) {
|
|
46339
|
-
this.keepaliveTime *= 2;
|
|
46340
|
-
logging.log(constants_1.LogVerbosity.ERROR, `Connection to ${(0, uri_parser_1.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`);
|
|
46341
|
-
}
|
|
46342
|
-
});
|
|
46343
|
-
} else {
|
|
46344
|
-
transport.shutdown();
|
|
46345
|
-
}
|
|
46346
|
-
}, (error) => {
|
|
46347
|
-
this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, `${error}`);
|
|
46348
|
-
});
|
|
46369
|
+
const output = Buffer.allocUnsafe(messageBuffer.length + 5);
|
|
46370
|
+
output.writeUInt8(compress ? 1 : 0, 0);
|
|
46371
|
+
output.writeUInt32BE(messageBuffer.length, 1);
|
|
46372
|
+
messageBuffer.copy(output, 5);
|
|
46373
|
+
return output;
|
|
46349
46374
|
}
|
|
46350
|
-
|
|
46351
|
-
|
|
46352
|
-
|
|
46353
|
-
|
|
46354
|
-
|
|
46355
|
-
if (errorMessage) {
|
|
46356
|
-
this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] + " -> " + connectivity_state_1.ConnectivityState[newState] + ' with error "' + errorMessage + '"');
|
|
46357
|
-
} else {
|
|
46358
|
-
this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] + " -> " + connectivity_state_1.ConnectivityState[newState]);
|
|
46359
|
-
}
|
|
46360
|
-
if (this.channelzEnabled) {
|
|
46361
|
-
this.channelzTrace.addTrace("CT_INFO", "Connectivity state change to " + connectivity_state_1.ConnectivityState[newState]);
|
|
46362
|
-
}
|
|
46363
|
-
const previousState = this.connectivityState;
|
|
46364
|
-
this.connectivityState = newState;
|
|
46365
|
-
switch (newState) {
|
|
46366
|
-
case connectivity_state_1.ConnectivityState.READY:
|
|
46367
|
-
this.stopBackoff();
|
|
46368
|
-
break;
|
|
46369
|
-
case connectivity_state_1.ConnectivityState.CONNECTING:
|
|
46370
|
-
this.startBackoff();
|
|
46371
|
-
this.startConnectingInternal();
|
|
46372
|
-
this.continueConnecting = false;
|
|
46373
|
-
break;
|
|
46374
|
-
case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE:
|
|
46375
|
-
if (this.channelzEnabled && this.transport) {
|
|
46376
|
-
this.childrenTracker.unrefChild(this.transport.getChannelzRef());
|
|
46377
|
-
}
|
|
46378
|
-
(_a = this.transport) === null || _a === undefined || _a.shutdown();
|
|
46379
|
-
this.transport = null;
|
|
46380
|
-
if (!this.backoffTimeout.isRunning()) {
|
|
46381
|
-
process.nextTick(() => {
|
|
46382
|
-
this.handleBackoffTimer();
|
|
46383
|
-
});
|
|
46384
|
-
}
|
|
46385
|
-
break;
|
|
46386
|
-
case connectivity_state_1.ConnectivityState.IDLE:
|
|
46387
|
-
if (this.channelzEnabled && this.transport) {
|
|
46388
|
-
this.childrenTracker.unrefChild(this.transport.getChannelzRef());
|
|
46389
|
-
}
|
|
46390
|
-
(_b = this.transport) === null || _b === undefined || _b.shutdown();
|
|
46391
|
-
this.transport = null;
|
|
46392
|
-
break;
|
|
46393
|
-
default:
|
|
46394
|
-
throw new Error(`Invalid state: unknown ConnectivityState ${newState}`);
|
|
46395
|
-
}
|
|
46396
|
-
for (const listener of this.stateListeners) {
|
|
46397
|
-
listener(this, previousState, newState, this.keepaliveTime, errorMessage);
|
|
46375
|
+
async readMessage(data) {
|
|
46376
|
+
const compressed = data.readUInt8(0) === 1;
|
|
46377
|
+
let messageBuffer = data.slice(5);
|
|
46378
|
+
if (compressed) {
|
|
46379
|
+
messageBuffer = await this.decompressMessage(messageBuffer);
|
|
46398
46380
|
}
|
|
46399
|
-
return
|
|
46381
|
+
return messageBuffer;
|
|
46400
46382
|
}
|
|
46401
|
-
|
|
46402
|
-
|
|
46403
|
-
|
|
46383
|
+
}
|
|
46384
|
+
|
|
46385
|
+
class IdentityHandler extends CompressionHandler {
|
|
46386
|
+
async compressMessage(message) {
|
|
46387
|
+
return message;
|
|
46404
46388
|
}
|
|
46405
|
-
|
|
46406
|
-
|
|
46407
|
-
|
|
46408
|
-
|
|
46409
|
-
|
|
46410
|
-
|
|
46411
|
-
this.secureConnector.destroy();
|
|
46412
|
-
process.nextTick(() => {
|
|
46413
|
-
this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING, connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE);
|
|
46414
|
-
});
|
|
46415
|
-
}
|
|
46389
|
+
async writeMessage(message, compress) {
|
|
46390
|
+
const output = Buffer.allocUnsafe(message.length + 5);
|
|
46391
|
+
output.writeUInt8(0, 0);
|
|
46392
|
+
output.writeUInt32BE(message.length, 1);
|
|
46393
|
+
message.copy(output, 5);
|
|
46394
|
+
return output;
|
|
46416
46395
|
}
|
|
46417
|
-
|
|
46418
|
-
|
|
46419
|
-
this.unref();
|
|
46420
|
-
return true;
|
|
46421
|
-
}
|
|
46422
|
-
return false;
|
|
46396
|
+
decompressMessage(message) {
|
|
46397
|
+
return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'));
|
|
46423
46398
|
}
|
|
46424
|
-
|
|
46425
|
-
|
|
46426
|
-
|
|
46427
|
-
|
|
46428
|
-
|
|
46429
|
-
|
|
46430
|
-
this.callTracker.addCallStarted();
|
|
46431
|
-
this.streamTracker.addCallStarted();
|
|
46432
|
-
statsTracker = {
|
|
46433
|
-
onCallEnd: (status) => {
|
|
46434
|
-
if (status.code === constants_1.Status.OK) {
|
|
46435
|
-
this.callTracker.addCallSucceeded();
|
|
46436
|
-
} else {
|
|
46437
|
-
this.callTracker.addCallFailed();
|
|
46438
|
-
}
|
|
46439
|
-
}
|
|
46440
|
-
};
|
|
46441
|
-
} else {
|
|
46442
|
-
statsTracker = {};
|
|
46443
|
-
}
|
|
46444
|
-
return this.transport.createCall(metadata, host, method, listener, statsTracker);
|
|
46399
|
+
}
|
|
46400
|
+
|
|
46401
|
+
class DeflateHandler extends CompressionHandler {
|
|
46402
|
+
constructor(maxRecvMessageLength) {
|
|
46403
|
+
super();
|
|
46404
|
+
this.maxRecvMessageLength = maxRecvMessageLength;
|
|
46445
46405
|
}
|
|
46446
|
-
|
|
46447
|
-
|
|
46448
|
-
|
|
46449
|
-
if (
|
|
46450
|
-
|
|
46406
|
+
compressMessage(message) {
|
|
46407
|
+
return new Promise((resolve, reject) => {
|
|
46408
|
+
zlib.deflate(message, (err, output) => {
|
|
46409
|
+
if (err) {
|
|
46410
|
+
reject(err);
|
|
46411
|
+
} else {
|
|
46412
|
+
resolve(output);
|
|
46451
46413
|
}
|
|
46452
|
-
}
|
|
46414
|
+
});
|
|
46453
46415
|
});
|
|
46454
46416
|
}
|
|
46455
|
-
|
|
46456
|
-
return
|
|
46417
|
+
decompressMessage(message) {
|
|
46418
|
+
return new Promise((resolve, reject) => {
|
|
46419
|
+
let totalLength = 0;
|
|
46420
|
+
const messageParts = [];
|
|
46421
|
+
const decompresser = zlib.createInflate();
|
|
46422
|
+
decompresser.on("data", (chunk) => {
|
|
46423
|
+
messageParts.push(chunk);
|
|
46424
|
+
totalLength += chunk.byteLength;
|
|
46425
|
+
if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) {
|
|
46426
|
+
decompresser.destroy();
|
|
46427
|
+
reject({
|
|
46428
|
+
code: constants_1.Status.RESOURCE_EXHAUSTED,
|
|
46429
|
+
details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`
|
|
46430
|
+
});
|
|
46431
|
+
}
|
|
46432
|
+
});
|
|
46433
|
+
decompresser.on("end", () => {
|
|
46434
|
+
resolve(Buffer.concat(messageParts));
|
|
46435
|
+
});
|
|
46436
|
+
decompresser.write(message);
|
|
46437
|
+
decompresser.end();
|
|
46438
|
+
});
|
|
46457
46439
|
}
|
|
46458
|
-
|
|
46459
|
-
|
|
46440
|
+
}
|
|
46441
|
+
|
|
46442
|
+
class GzipHandler extends CompressionHandler {
|
|
46443
|
+
constructor(maxRecvMessageLength) {
|
|
46444
|
+
super();
|
|
46445
|
+
this.maxRecvMessageLength = maxRecvMessageLength;
|
|
46460
46446
|
}
|
|
46461
|
-
|
|
46462
|
-
|
|
46447
|
+
compressMessage(message) {
|
|
46448
|
+
return new Promise((resolve, reject) => {
|
|
46449
|
+
zlib.gzip(message, (err, output) => {
|
|
46450
|
+
if (err) {
|
|
46451
|
+
reject(err);
|
|
46452
|
+
} else {
|
|
46453
|
+
resolve(output);
|
|
46454
|
+
}
|
|
46455
|
+
});
|
|
46456
|
+
});
|
|
46463
46457
|
}
|
|
46464
|
-
|
|
46465
|
-
|
|
46466
|
-
|
|
46467
|
-
|
|
46458
|
+
decompressMessage(message) {
|
|
46459
|
+
return new Promise((resolve, reject) => {
|
|
46460
|
+
let totalLength = 0;
|
|
46461
|
+
const messageParts = [];
|
|
46462
|
+
const decompresser = zlib.createGunzip();
|
|
46463
|
+
decompresser.on("data", (chunk) => {
|
|
46464
|
+
messageParts.push(chunk);
|
|
46465
|
+
totalLength += chunk.byteLength;
|
|
46466
|
+
if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) {
|
|
46467
|
+
decompresser.destroy();
|
|
46468
|
+
reject({
|
|
46469
|
+
code: constants_1.Status.RESOURCE_EXHAUSTED,
|
|
46470
|
+
details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`
|
|
46471
|
+
});
|
|
46472
|
+
}
|
|
46473
|
+
});
|
|
46474
|
+
decompresser.on("end", () => {
|
|
46475
|
+
resolve(Buffer.concat(messageParts));
|
|
46476
|
+
});
|
|
46477
|
+
decompresser.write(message);
|
|
46478
|
+
decompresser.end();
|
|
46468
46479
|
});
|
|
46469
46480
|
}
|
|
46470
|
-
|
|
46471
|
-
|
|
46481
|
+
}
|
|
46482
|
+
|
|
46483
|
+
class UnknownHandler extends CompressionHandler {
|
|
46484
|
+
constructor(compressionName) {
|
|
46485
|
+
super();
|
|
46486
|
+
this.compressionName = compressionName;
|
|
46472
46487
|
}
|
|
46473
|
-
|
|
46474
|
-
return this.
|
|
46488
|
+
compressMessage(message) {
|
|
46489
|
+
return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`));
|
|
46475
46490
|
}
|
|
46476
|
-
|
|
46477
|
-
return
|
|
46491
|
+
decompressMessage(message) {
|
|
46492
|
+
return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`));
|
|
46478
46493
|
}
|
|
46479
|
-
|
|
46480
|
-
|
|
46481
|
-
|
|
46482
|
-
|
|
46494
|
+
}
|
|
46495
|
+
function getCompressionHandler(compressionName, maxReceiveMessageSize) {
|
|
46496
|
+
switch (compressionName) {
|
|
46497
|
+
case "identity":
|
|
46498
|
+
return new IdentityHandler;
|
|
46499
|
+
case "deflate":
|
|
46500
|
+
return new DeflateHandler(maxReceiveMessageSize);
|
|
46501
|
+
case "gzip":
|
|
46502
|
+
return new GzipHandler(maxReceiveMessageSize);
|
|
46503
|
+
default:
|
|
46504
|
+
return new UnknownHandler(compressionName);
|
|
46483
46505
|
}
|
|
46484
|
-
|
|
46485
|
-
|
|
46506
|
+
}
|
|
46507
|
+
|
|
46508
|
+
class CompressionFilter extends filter_1.BaseFilter {
|
|
46509
|
+
constructor(channelOptions, sharedFilterConfig) {
|
|
46510
|
+
var _a, _b, _c;
|
|
46511
|
+
super();
|
|
46512
|
+
this.sharedFilterConfig = sharedFilterConfig;
|
|
46513
|
+
this.sendCompression = new IdentityHandler;
|
|
46514
|
+
this.receiveCompression = new IdentityHandler;
|
|
46515
|
+
this.currentCompressionAlgorithm = "identity";
|
|
46516
|
+
const compressionAlgorithmKey = channelOptions["grpc.default_compression_algorithm"];
|
|
46517
|
+
this.maxReceiveMessageLength = (_a = channelOptions["grpc.max_receive_message_length"]) !== null && _a !== undefined ? _a : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;
|
|
46518
|
+
this.maxSendMessageLength = (_b = channelOptions["grpc.max_send_message_length"]) !== null && _b !== undefined ? _b : constants_1.DEFAULT_MAX_SEND_MESSAGE_LENGTH;
|
|
46519
|
+
if (compressionAlgorithmKey !== undefined) {
|
|
46520
|
+
if (isCompressionAlgorithmKey(compressionAlgorithmKey)) {
|
|
46521
|
+
const clientSelectedEncoding = compression_algorithms_1.CompressionAlgorithms[compressionAlgorithmKey];
|
|
46522
|
+
const serverSupportedEncodings = (_c = sharedFilterConfig.serverSupportedEncodingHeader) === null || _c === undefined ? undefined : _c.split(",");
|
|
46523
|
+
if (!serverSupportedEncodings || serverSupportedEncodings.includes(clientSelectedEncoding)) {
|
|
46524
|
+
this.currentCompressionAlgorithm = clientSelectedEncoding;
|
|
46525
|
+
this.sendCompression = getCompressionHandler(this.currentCompressionAlgorithm, -1);
|
|
46526
|
+
}
|
|
46527
|
+
} else {
|
|
46528
|
+
logging.log(constants_1.LogVerbosity.ERROR, `Invalid value provided for grpc.default_compression_algorithm option: ${compressionAlgorithmKey}`);
|
|
46529
|
+
}
|
|
46530
|
+
}
|
|
46486
46531
|
}
|
|
46487
|
-
|
|
46488
|
-
|
|
46489
|
-
|
|
46532
|
+
async sendMetadata(metadata) {
|
|
46533
|
+
const headers = await metadata;
|
|
46534
|
+
headers.set("grpc-accept-encoding", "identity,deflate,gzip");
|
|
46535
|
+
headers.set("accept-encoding", "identity");
|
|
46536
|
+
if (this.currentCompressionAlgorithm === "identity") {
|
|
46537
|
+
headers.remove("grpc-encoding");
|
|
46538
|
+
} else {
|
|
46539
|
+
headers.set("grpc-encoding", this.currentCompressionAlgorithm);
|
|
46490
46540
|
}
|
|
46541
|
+
return headers;
|
|
46491
46542
|
}
|
|
46492
|
-
|
|
46493
|
-
|
|
46543
|
+
receiveMetadata(metadata) {
|
|
46544
|
+
const receiveEncoding = metadata.get("grpc-encoding");
|
|
46545
|
+
if (receiveEncoding.length > 0) {
|
|
46546
|
+
const encoding = receiveEncoding[0];
|
|
46547
|
+
if (typeof encoding === "string") {
|
|
46548
|
+
this.receiveCompression = getCompressionHandler(encoding, this.maxReceiveMessageLength);
|
|
46549
|
+
}
|
|
46550
|
+
}
|
|
46551
|
+
metadata.remove("grpc-encoding");
|
|
46552
|
+
const serverSupportedEncodingsHeader = metadata.get("grpc-accept-encoding")[0];
|
|
46553
|
+
if (serverSupportedEncodingsHeader) {
|
|
46554
|
+
this.sharedFilterConfig.serverSupportedEncodingHeader = serverSupportedEncodingsHeader;
|
|
46555
|
+
const serverSupportedEncodings = serverSupportedEncodingsHeader.split(",");
|
|
46556
|
+
if (!serverSupportedEncodings.includes(this.currentCompressionAlgorithm)) {
|
|
46557
|
+
this.sendCompression = new IdentityHandler;
|
|
46558
|
+
this.currentCompressionAlgorithm = "identity";
|
|
46559
|
+
}
|
|
46560
|
+
}
|
|
46561
|
+
metadata.remove("grpc-accept-encoding");
|
|
46562
|
+
return metadata;
|
|
46494
46563
|
}
|
|
46495
|
-
|
|
46496
|
-
|
|
46497
|
-
|
|
46564
|
+
async sendMessage(message) {
|
|
46565
|
+
var _a;
|
|
46566
|
+
const resolvedMessage = await message;
|
|
46567
|
+
if (this.maxSendMessageLength !== -1 && resolvedMessage.message.length > this.maxSendMessageLength) {
|
|
46568
|
+
throw {
|
|
46569
|
+
code: constants_1.Status.RESOURCE_EXHAUSTED,
|
|
46570
|
+
details: `Attempted to send message with a size larger than ${this.maxSendMessageLength}`
|
|
46571
|
+
};
|
|
46572
|
+
}
|
|
46573
|
+
let compress;
|
|
46574
|
+
if (this.sendCompression instanceof IdentityHandler) {
|
|
46575
|
+
compress = false;
|
|
46576
|
+
} else {
|
|
46577
|
+
compress = (((_a = resolvedMessage.flags) !== null && _a !== undefined ? _a : 0) & 2) === 0;
|
|
46578
|
+
}
|
|
46579
|
+
return {
|
|
46580
|
+
message: await this.sendCompression.writeMessage(resolvedMessage.message, compress),
|
|
46581
|
+
flags: resolvedMessage.flags
|
|
46582
|
+
};
|
|
46583
|
+
}
|
|
46584
|
+
async receiveMessage(message) {
|
|
46585
|
+
return this.receiveCompression.readMessage(await message);
|
|
46586
|
+
}
|
|
46587
|
+
}
|
|
46588
|
+
exports2.CompressionFilter = CompressionFilter;
|
|
46589
|
+
|
|
46590
|
+
class CompressionFilterFactory {
|
|
46591
|
+
constructor(channel, options) {
|
|
46592
|
+
this.options = options;
|
|
46593
|
+
this.sharedFilterConfig = {};
|
|
46594
|
+
}
|
|
46595
|
+
createFilter() {
|
|
46596
|
+
return new CompressionFilter(this.options, this.sharedFilterConfig);
|
|
46597
|
+
}
|
|
46598
|
+
}
|
|
46599
|
+
exports2.CompressionFilterFactory = CompressionFilterFactory;
|
|
46600
|
+
});
|
|
46601
|
+
|
|
46602
|
+
// ../../node_modules/@grpc/grpc-js/build/src/control-plane-status.js
|
|
46603
|
+
var require_control_plane_status = __commonJS((exports2) => {
|
|
46604
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46605
|
+
exports2.restrictControlPlaneStatusCode = restrictControlPlaneStatusCode;
|
|
46606
|
+
var constants_1 = require_constants6();
|
|
46607
|
+
var INAPPROPRIATE_CONTROL_PLANE_CODES = [
|
|
46608
|
+
constants_1.Status.OK,
|
|
46609
|
+
constants_1.Status.INVALID_ARGUMENT,
|
|
46610
|
+
constants_1.Status.NOT_FOUND,
|
|
46611
|
+
constants_1.Status.ALREADY_EXISTS,
|
|
46612
|
+
constants_1.Status.FAILED_PRECONDITION,
|
|
46613
|
+
constants_1.Status.ABORTED,
|
|
46614
|
+
constants_1.Status.OUT_OF_RANGE,
|
|
46615
|
+
constants_1.Status.DATA_LOSS
|
|
46616
|
+
];
|
|
46617
|
+
function restrictControlPlaneStatusCode(code, details) {
|
|
46618
|
+
if (INAPPROPRIATE_CONTROL_PLANE_CODES.includes(code)) {
|
|
46619
|
+
return {
|
|
46620
|
+
code: constants_1.Status.INTERNAL,
|
|
46621
|
+
details: `Invalid status from control plane: ${code} ${constants_1.Status[code]} ${details}`
|
|
46622
|
+
};
|
|
46623
|
+
} else {
|
|
46624
|
+
return { code, details };
|
|
46625
|
+
}
|
|
46626
|
+
}
|
|
46627
|
+
});
|
|
46628
|
+
|
|
46629
|
+
// ../../node_modules/@grpc/grpc-js/build/src/deadline.js
|
|
46630
|
+
var require_deadline = __commonJS((exports2) => {
|
|
46631
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46632
|
+
exports2.minDeadline = minDeadline;
|
|
46633
|
+
exports2.getDeadlineTimeoutString = getDeadlineTimeoutString;
|
|
46634
|
+
exports2.getRelativeTimeout = getRelativeTimeout;
|
|
46635
|
+
exports2.deadlineToString = deadlineToString;
|
|
46636
|
+
exports2.formatDateDifference = formatDateDifference;
|
|
46637
|
+
function minDeadline(...deadlineList) {
|
|
46638
|
+
let minValue = Infinity;
|
|
46639
|
+
for (const deadline of deadlineList) {
|
|
46640
|
+
const deadlineMsecs = deadline instanceof Date ? deadline.getTime() : deadline;
|
|
46641
|
+
if (deadlineMsecs < minValue) {
|
|
46642
|
+
minValue = deadlineMsecs;
|
|
46643
|
+
}
|
|
46644
|
+
}
|
|
46645
|
+
return minValue;
|
|
46646
|
+
}
|
|
46647
|
+
var units = [
|
|
46648
|
+
["m", 1],
|
|
46649
|
+
["S", 1000],
|
|
46650
|
+
["M", 60 * 1000],
|
|
46651
|
+
["H", 60 * 60 * 1000]
|
|
46652
|
+
];
|
|
46653
|
+
function getDeadlineTimeoutString(deadline) {
|
|
46654
|
+
const now = new Date().getTime();
|
|
46655
|
+
if (deadline instanceof Date) {
|
|
46656
|
+
deadline = deadline.getTime();
|
|
46657
|
+
}
|
|
46658
|
+
const timeoutMs = Math.max(deadline - now, 0);
|
|
46659
|
+
for (const [unit, factor] of units) {
|
|
46660
|
+
const amount = timeoutMs / factor;
|
|
46661
|
+
if (amount < 1e8) {
|
|
46662
|
+
return String(Math.ceil(amount)) + unit;
|
|
46663
|
+
}
|
|
46664
|
+
}
|
|
46665
|
+
throw new Error("Deadline is too far in the future");
|
|
46666
|
+
}
|
|
46667
|
+
var MAX_TIMEOUT_TIME = 2147483647;
|
|
46668
|
+
function getRelativeTimeout(deadline) {
|
|
46669
|
+
const deadlineMs = deadline instanceof Date ? deadline.getTime() : deadline;
|
|
46670
|
+
const now = new Date().getTime();
|
|
46671
|
+
const timeout = deadlineMs - now;
|
|
46672
|
+
if (timeout < 0) {
|
|
46673
|
+
return 0;
|
|
46674
|
+
} else if (timeout > MAX_TIMEOUT_TIME) {
|
|
46675
|
+
return Infinity;
|
|
46676
|
+
} else {
|
|
46677
|
+
return timeout;
|
|
46678
|
+
}
|
|
46679
|
+
}
|
|
46680
|
+
function deadlineToString(deadline) {
|
|
46681
|
+
if (deadline instanceof Date) {
|
|
46682
|
+
return deadline.toISOString();
|
|
46683
|
+
} else {
|
|
46684
|
+
const dateDeadline = new Date(deadline);
|
|
46685
|
+
if (Number.isNaN(dateDeadline.getTime())) {
|
|
46686
|
+
return "" + deadline;
|
|
46687
|
+
} else {
|
|
46688
|
+
return dateDeadline.toISOString();
|
|
46689
|
+
}
|
|
46690
|
+
}
|
|
46691
|
+
}
|
|
46692
|
+
function formatDateDifference(startDate, endDate) {
|
|
46693
|
+
return ((endDate.getTime() - startDate.getTime()) / 1000).toFixed(3) + "s";
|
|
46694
|
+
}
|
|
46695
|
+
});
|
|
46696
|
+
|
|
46697
|
+
// ../../node_modules/@grpc/grpc-js/build/src/filter-stack.js
|
|
46698
|
+
var require_filter_stack = __commonJS((exports2) => {
|
|
46699
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46700
|
+
exports2.FilterStackFactory = exports2.FilterStack = undefined;
|
|
46701
|
+
|
|
46702
|
+
class FilterStack {
|
|
46703
|
+
constructor(filters) {
|
|
46704
|
+
this.filters = filters;
|
|
46705
|
+
}
|
|
46706
|
+
sendMetadata(metadata) {
|
|
46707
|
+
let result = metadata;
|
|
46708
|
+
for (let i = 0;i < this.filters.length; i++) {
|
|
46709
|
+
result = this.filters[i].sendMetadata(result);
|
|
46710
|
+
}
|
|
46711
|
+
return result;
|
|
46712
|
+
}
|
|
46713
|
+
receiveMetadata(metadata) {
|
|
46714
|
+
let result = metadata;
|
|
46715
|
+
for (let i = this.filters.length - 1;i >= 0; i--) {
|
|
46716
|
+
result = this.filters[i].receiveMetadata(result);
|
|
46717
|
+
}
|
|
46718
|
+
return result;
|
|
46719
|
+
}
|
|
46720
|
+
sendMessage(message) {
|
|
46721
|
+
let result = message;
|
|
46722
|
+
for (let i = 0;i < this.filters.length; i++) {
|
|
46723
|
+
result = this.filters[i].sendMessage(result);
|
|
46724
|
+
}
|
|
46725
|
+
return result;
|
|
46726
|
+
}
|
|
46727
|
+
receiveMessage(message) {
|
|
46728
|
+
let result = message;
|
|
46729
|
+
for (let i = this.filters.length - 1;i >= 0; i--) {
|
|
46730
|
+
result = this.filters[i].receiveMessage(result);
|
|
46731
|
+
}
|
|
46732
|
+
return result;
|
|
46733
|
+
}
|
|
46734
|
+
receiveTrailers(status) {
|
|
46735
|
+
let result = status;
|
|
46736
|
+
for (let i = this.filters.length - 1;i >= 0; i--) {
|
|
46737
|
+
result = this.filters[i].receiveTrailers(result);
|
|
46738
|
+
}
|
|
46739
|
+
return result;
|
|
46740
|
+
}
|
|
46741
|
+
push(filters) {
|
|
46742
|
+
this.filters.unshift(...filters);
|
|
46743
|
+
}
|
|
46744
|
+
getFilters() {
|
|
46745
|
+
return this.filters;
|
|
46746
|
+
}
|
|
46747
|
+
}
|
|
46748
|
+
exports2.FilterStack = FilterStack;
|
|
46749
|
+
|
|
46750
|
+
class FilterStackFactory {
|
|
46751
|
+
constructor(factories) {
|
|
46752
|
+
this.factories = factories;
|
|
46753
|
+
}
|
|
46754
|
+
push(filterFactories) {
|
|
46755
|
+
this.factories.unshift(...filterFactories);
|
|
46756
|
+
}
|
|
46757
|
+
clone() {
|
|
46758
|
+
return new FilterStackFactory([...this.factories]);
|
|
46759
|
+
}
|
|
46760
|
+
createFilter() {
|
|
46761
|
+
return new FilterStack(this.factories.map((factory) => factory.createFilter()));
|
|
46762
|
+
}
|
|
46763
|
+
}
|
|
46764
|
+
exports2.FilterStackFactory = FilterStackFactory;
|
|
46765
|
+
});
|
|
46766
|
+
|
|
46767
|
+
// ../../node_modules/@grpc/grpc-js/build/src/single-subchannel-channel.js
|
|
46768
|
+
var require_single_subchannel_channel = __commonJS((exports2) => {
|
|
46769
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46770
|
+
exports2.SingleSubchannelChannel = undefined;
|
|
46771
|
+
var call_number_1 = require_call_number();
|
|
46772
|
+
var channelz_1 = require_channelz();
|
|
46773
|
+
var compression_filter_1 = require_compression_filter();
|
|
46774
|
+
var connectivity_state_1 = require_connectivity_state();
|
|
46775
|
+
var constants_1 = require_constants6();
|
|
46776
|
+
var control_plane_status_1 = require_control_plane_status();
|
|
46777
|
+
var deadline_1 = require_deadline();
|
|
46778
|
+
var filter_stack_1 = require_filter_stack();
|
|
46779
|
+
var metadata_1 = require_metadata();
|
|
46780
|
+
var resolver_1 = require_resolver();
|
|
46781
|
+
var uri_parser_1 = require_uri_parser();
|
|
46782
|
+
|
|
46783
|
+
class SubchannelCallWrapper {
|
|
46784
|
+
constructor(subchannel, method, filterStackFactory, options, callNumber) {
|
|
46785
|
+
var _a, _b;
|
|
46786
|
+
this.subchannel = subchannel;
|
|
46787
|
+
this.method = method;
|
|
46788
|
+
this.options = options;
|
|
46789
|
+
this.callNumber = callNumber;
|
|
46790
|
+
this.childCall = null;
|
|
46791
|
+
this.pendingMessage = null;
|
|
46792
|
+
this.readPending = false;
|
|
46793
|
+
this.halfClosePending = false;
|
|
46794
|
+
this.pendingStatus = null;
|
|
46795
|
+
this.readFilterPending = false;
|
|
46796
|
+
this.writeFilterPending = false;
|
|
46797
|
+
const splitPath = this.method.split("/");
|
|
46798
|
+
let serviceName = "";
|
|
46799
|
+
if (splitPath.length >= 2) {
|
|
46800
|
+
serviceName = splitPath[1];
|
|
46801
|
+
}
|
|
46802
|
+
const hostname = (_b = (_a = (0, uri_parser_1.splitHostPort)(this.options.host)) === null || _a === undefined ? undefined : _a.host) !== null && _b !== undefined ? _b : "localhost";
|
|
46803
|
+
this.serviceUrl = `https://${hostname}/${serviceName}`;
|
|
46804
|
+
const timeout = (0, deadline_1.getRelativeTimeout)(options.deadline);
|
|
46805
|
+
if (timeout !== Infinity) {
|
|
46806
|
+
if (timeout <= 0) {
|
|
46807
|
+
this.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, "Deadline exceeded");
|
|
46808
|
+
} else {
|
|
46809
|
+
setTimeout(() => {
|
|
46810
|
+
this.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, "Deadline exceeded");
|
|
46811
|
+
}, timeout);
|
|
46812
|
+
}
|
|
46813
|
+
}
|
|
46814
|
+
this.filterStack = filterStackFactory.createFilter();
|
|
46815
|
+
}
|
|
46816
|
+
cancelWithStatus(status, details) {
|
|
46817
|
+
if (this.childCall) {
|
|
46818
|
+
this.childCall.cancelWithStatus(status, details);
|
|
46819
|
+
} else {
|
|
46820
|
+
this.pendingStatus = {
|
|
46821
|
+
code: status,
|
|
46822
|
+
details,
|
|
46823
|
+
metadata: new metadata_1.Metadata
|
|
46824
|
+
};
|
|
46825
|
+
}
|
|
46826
|
+
}
|
|
46827
|
+
getPeer() {
|
|
46828
|
+
var _a, _b;
|
|
46829
|
+
return (_b = (_a = this.childCall) === null || _a === undefined ? undefined : _a.getPeer()) !== null && _b !== undefined ? _b : this.subchannel.getAddress();
|
|
46830
|
+
}
|
|
46831
|
+
async start(metadata, listener) {
|
|
46832
|
+
if (this.pendingStatus) {
|
|
46833
|
+
listener.onReceiveStatus(this.pendingStatus);
|
|
46834
|
+
return;
|
|
46835
|
+
}
|
|
46836
|
+
if (this.subchannel.getConnectivityState() !== connectivity_state_1.ConnectivityState.READY) {
|
|
46837
|
+
listener.onReceiveStatus({
|
|
46838
|
+
code: constants_1.Status.UNAVAILABLE,
|
|
46839
|
+
details: "Subchannel not ready",
|
|
46840
|
+
metadata: new metadata_1.Metadata
|
|
46841
|
+
});
|
|
46842
|
+
return;
|
|
46843
|
+
}
|
|
46844
|
+
const filteredMetadata = await this.filterStack.sendMetadata(Promise.resolve(metadata));
|
|
46845
|
+
let credsMetadata;
|
|
46846
|
+
try {
|
|
46847
|
+
credsMetadata = await this.subchannel.getCallCredentials().generateMetadata({ method_name: this.method, service_url: this.serviceUrl });
|
|
46848
|
+
} catch (e) {
|
|
46849
|
+
const error = e;
|
|
46850
|
+
const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(typeof error.code === "number" ? error.code : constants_1.Status.UNKNOWN, `Getting metadata from plugin failed with error: ${error.message}`);
|
|
46851
|
+
listener.onReceiveStatus({
|
|
46852
|
+
code,
|
|
46853
|
+
details,
|
|
46854
|
+
metadata: new metadata_1.Metadata
|
|
46855
|
+
});
|
|
46856
|
+
return;
|
|
46857
|
+
}
|
|
46858
|
+
credsMetadata.merge(filteredMetadata);
|
|
46859
|
+
const childListener = {
|
|
46860
|
+
onReceiveMetadata: async (metadata2) => {
|
|
46861
|
+
listener.onReceiveMetadata(await this.filterStack.receiveMetadata(metadata2));
|
|
46862
|
+
},
|
|
46863
|
+
onReceiveMessage: async (message) => {
|
|
46864
|
+
this.readFilterPending = true;
|
|
46865
|
+
const filteredMessage = await this.filterStack.receiveMessage(message);
|
|
46866
|
+
this.readFilterPending = false;
|
|
46867
|
+
listener.onReceiveMessage(filteredMessage);
|
|
46868
|
+
if (this.pendingStatus) {
|
|
46869
|
+
listener.onReceiveStatus(this.pendingStatus);
|
|
46870
|
+
}
|
|
46871
|
+
},
|
|
46872
|
+
onReceiveStatus: async (status) => {
|
|
46873
|
+
const filteredStatus = await this.filterStack.receiveTrailers(status);
|
|
46874
|
+
if (this.readFilterPending) {
|
|
46875
|
+
this.pendingStatus = filteredStatus;
|
|
46876
|
+
} else {
|
|
46877
|
+
listener.onReceiveStatus(filteredStatus);
|
|
46878
|
+
}
|
|
46879
|
+
}
|
|
46880
|
+
};
|
|
46881
|
+
this.childCall = this.subchannel.createCall(credsMetadata, this.options.host, this.method, childListener);
|
|
46882
|
+
if (this.readPending) {
|
|
46883
|
+
this.childCall.startRead();
|
|
46884
|
+
}
|
|
46885
|
+
if (this.pendingMessage) {
|
|
46886
|
+
this.childCall.sendMessageWithContext(this.pendingMessage.context, this.pendingMessage.message);
|
|
46887
|
+
}
|
|
46888
|
+
if (this.halfClosePending && !this.writeFilterPending) {
|
|
46889
|
+
this.childCall.halfClose();
|
|
46890
|
+
}
|
|
46891
|
+
}
|
|
46892
|
+
async sendMessageWithContext(context, message) {
|
|
46893
|
+
this.writeFilterPending = true;
|
|
46894
|
+
const filteredMessage = await this.filterStack.sendMessage(Promise.resolve({ message, flags: context.flags }));
|
|
46895
|
+
this.writeFilterPending = false;
|
|
46896
|
+
if (this.childCall) {
|
|
46897
|
+
this.childCall.sendMessageWithContext(context, filteredMessage.message);
|
|
46898
|
+
if (this.halfClosePending) {
|
|
46899
|
+
this.childCall.halfClose();
|
|
46900
|
+
}
|
|
46901
|
+
} else {
|
|
46902
|
+
this.pendingMessage = { context, message: filteredMessage.message };
|
|
46903
|
+
}
|
|
46904
|
+
}
|
|
46905
|
+
startRead() {
|
|
46906
|
+
if (this.childCall) {
|
|
46907
|
+
this.childCall.startRead();
|
|
46908
|
+
} else {
|
|
46909
|
+
this.readPending = true;
|
|
46910
|
+
}
|
|
46911
|
+
}
|
|
46912
|
+
halfClose() {
|
|
46913
|
+
if (this.childCall && !this.writeFilterPending) {
|
|
46914
|
+
this.childCall.halfClose();
|
|
46915
|
+
} else {
|
|
46916
|
+
this.halfClosePending = true;
|
|
46917
|
+
}
|
|
46918
|
+
}
|
|
46919
|
+
getCallNumber() {
|
|
46920
|
+
return this.callNumber;
|
|
46921
|
+
}
|
|
46922
|
+
setCredentials(credentials) {
|
|
46923
|
+
throw new Error("Method not implemented.");
|
|
46924
|
+
}
|
|
46925
|
+
getAuthContext() {
|
|
46926
|
+
if (this.childCall) {
|
|
46927
|
+
return this.childCall.getAuthContext();
|
|
46928
|
+
} else {
|
|
46929
|
+
return null;
|
|
46930
|
+
}
|
|
46931
|
+
}
|
|
46932
|
+
}
|
|
46933
|
+
|
|
46934
|
+
class SingleSubchannelChannel {
|
|
46935
|
+
constructor(subchannel, target, options) {
|
|
46936
|
+
this.subchannel = subchannel;
|
|
46937
|
+
this.target = target;
|
|
46938
|
+
this.channelzEnabled = false;
|
|
46939
|
+
this.channelzTrace = new channelz_1.ChannelzTrace;
|
|
46940
|
+
this.callTracker = new channelz_1.ChannelzCallTracker;
|
|
46941
|
+
this.childrenTracker = new channelz_1.ChannelzChildrenTracker;
|
|
46942
|
+
this.channelzEnabled = options["grpc.enable_channelz"] !== 0;
|
|
46943
|
+
this.channelzRef = (0, channelz_1.registerChannelzChannel)((0, uri_parser_1.uriToString)(target), () => ({
|
|
46944
|
+
target: `${(0, uri_parser_1.uriToString)(target)} (${subchannel.getAddress()})`,
|
|
46945
|
+
state: this.subchannel.getConnectivityState(),
|
|
46946
|
+
trace: this.channelzTrace,
|
|
46947
|
+
callTracker: this.callTracker,
|
|
46948
|
+
children: this.childrenTracker.getChildLists()
|
|
46949
|
+
}), this.channelzEnabled);
|
|
46950
|
+
if (this.channelzEnabled) {
|
|
46951
|
+
this.childrenTracker.refChild(subchannel.getChannelzRef());
|
|
46952
|
+
}
|
|
46953
|
+
this.filterStackFactory = new filter_stack_1.FilterStackFactory([new compression_filter_1.CompressionFilterFactory(this, options)]);
|
|
46954
|
+
}
|
|
46955
|
+
close() {
|
|
46956
|
+
if (this.channelzEnabled) {
|
|
46957
|
+
this.childrenTracker.unrefChild(this.subchannel.getChannelzRef());
|
|
46958
|
+
}
|
|
46959
|
+
(0, channelz_1.unregisterChannelzRef)(this.channelzRef);
|
|
46960
|
+
}
|
|
46961
|
+
getTarget() {
|
|
46962
|
+
return (0, uri_parser_1.uriToString)(this.target);
|
|
46963
|
+
}
|
|
46964
|
+
getConnectivityState(tryToConnect) {
|
|
46965
|
+
throw new Error("Method not implemented.");
|
|
46966
|
+
}
|
|
46967
|
+
watchConnectivityState(currentState, deadline, callback) {
|
|
46968
|
+
throw new Error("Method not implemented.");
|
|
46969
|
+
}
|
|
46970
|
+
getChannelzRef() {
|
|
46971
|
+
return this.channelzRef;
|
|
46972
|
+
}
|
|
46973
|
+
createCall(method, deadline) {
|
|
46974
|
+
const callOptions = {
|
|
46975
|
+
deadline,
|
|
46976
|
+
host: (0, resolver_1.getDefaultAuthority)(this.target),
|
|
46977
|
+
flags: constants_1.Propagate.DEFAULTS,
|
|
46978
|
+
parentCall: null
|
|
46979
|
+
};
|
|
46980
|
+
return new SubchannelCallWrapper(this.subchannel, method, this.filterStackFactory, callOptions, (0, call_number_1.getNextCallNumber)());
|
|
46981
|
+
}
|
|
46982
|
+
}
|
|
46983
|
+
exports2.SingleSubchannelChannel = SingleSubchannelChannel;
|
|
46984
|
+
});
|
|
46985
|
+
|
|
46986
|
+
// ../../node_modules/@grpc/grpc-js/build/src/subchannel.js
|
|
46987
|
+
var require_subchannel = __commonJS((exports2) => {
|
|
46988
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46989
|
+
exports2.Subchannel = undefined;
|
|
46990
|
+
var connectivity_state_1 = require_connectivity_state();
|
|
46991
|
+
var backoff_timeout_1 = require_backoff_timeout();
|
|
46992
|
+
var logging = require_logging();
|
|
46993
|
+
var constants_1 = require_constants6();
|
|
46994
|
+
var uri_parser_1 = require_uri_parser();
|
|
46995
|
+
var subchannel_address_1 = require_subchannel_address();
|
|
46996
|
+
var channelz_1 = require_channelz();
|
|
46997
|
+
var single_subchannel_channel_1 = require_single_subchannel_channel();
|
|
46998
|
+
var TRACER_NAME = "subchannel";
|
|
46999
|
+
var KEEPALIVE_MAX_TIME_MS = ~(1 << 31);
|
|
47000
|
+
|
|
47001
|
+
class Subchannel {
|
|
47002
|
+
constructor(channelTarget, subchannelAddress, options, credentials, connector) {
|
|
47003
|
+
var _a;
|
|
47004
|
+
this.channelTarget = channelTarget;
|
|
47005
|
+
this.subchannelAddress = subchannelAddress;
|
|
47006
|
+
this.options = options;
|
|
47007
|
+
this.connector = connector;
|
|
47008
|
+
this.connectivityState = connectivity_state_1.ConnectivityState.IDLE;
|
|
47009
|
+
this.transport = null;
|
|
47010
|
+
this.continueConnecting = false;
|
|
47011
|
+
this.stateListeners = new Set;
|
|
47012
|
+
this.refcount = 0;
|
|
47013
|
+
this.channelzEnabled = true;
|
|
47014
|
+
this.dataProducers = new Map;
|
|
47015
|
+
this.subchannelChannel = null;
|
|
47016
|
+
const backoffOptions = {
|
|
47017
|
+
initialDelay: options["grpc.initial_reconnect_backoff_ms"],
|
|
47018
|
+
maxDelay: options["grpc.max_reconnect_backoff_ms"]
|
|
47019
|
+
};
|
|
47020
|
+
this.backoffTimeout = new backoff_timeout_1.BackoffTimeout(() => {
|
|
47021
|
+
this.handleBackoffTimer();
|
|
47022
|
+
}, backoffOptions);
|
|
47023
|
+
this.backoffTimeout.unref();
|
|
47024
|
+
this.subchannelAddressString = (0, subchannel_address_1.subchannelAddressToString)(subchannelAddress);
|
|
47025
|
+
this.keepaliveTime = (_a = options["grpc.keepalive_time_ms"]) !== null && _a !== undefined ? _a : -1;
|
|
47026
|
+
if (options["grpc.enable_channelz"] === 0) {
|
|
47027
|
+
this.channelzEnabled = false;
|
|
47028
|
+
this.channelzTrace = new channelz_1.ChannelzTraceStub;
|
|
47029
|
+
this.callTracker = new channelz_1.ChannelzCallTrackerStub;
|
|
47030
|
+
this.childrenTracker = new channelz_1.ChannelzChildrenTrackerStub;
|
|
47031
|
+
this.streamTracker = new channelz_1.ChannelzCallTrackerStub;
|
|
47032
|
+
} else {
|
|
47033
|
+
this.channelzTrace = new channelz_1.ChannelzTrace;
|
|
47034
|
+
this.callTracker = new channelz_1.ChannelzCallTracker;
|
|
47035
|
+
this.childrenTracker = new channelz_1.ChannelzChildrenTracker;
|
|
47036
|
+
this.streamTracker = new channelz_1.ChannelzCallTracker;
|
|
47037
|
+
}
|
|
47038
|
+
this.channelzRef = (0, channelz_1.registerChannelzSubchannel)(this.subchannelAddressString, () => this.getChannelzInfo(), this.channelzEnabled);
|
|
47039
|
+
this.channelzTrace.addTrace("CT_INFO", "Subchannel created");
|
|
47040
|
+
this.trace("Subchannel constructed with options " + JSON.stringify(options, undefined, 2));
|
|
47041
|
+
this.secureConnector = credentials._createSecureConnector(channelTarget, options);
|
|
47042
|
+
}
|
|
47043
|
+
getChannelzInfo() {
|
|
47044
|
+
return {
|
|
47045
|
+
state: this.connectivityState,
|
|
47046
|
+
trace: this.channelzTrace,
|
|
47047
|
+
callTracker: this.callTracker,
|
|
47048
|
+
children: this.childrenTracker.getChildLists(),
|
|
47049
|
+
target: this.subchannelAddressString
|
|
47050
|
+
};
|
|
47051
|
+
}
|
|
47052
|
+
trace(text) {
|
|
47053
|
+
logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, "(" + this.channelzRef.id + ") " + this.subchannelAddressString + " " + text);
|
|
47054
|
+
}
|
|
47055
|
+
refTrace(text) {
|
|
47056
|
+
logging.trace(constants_1.LogVerbosity.DEBUG, "subchannel_refcount", "(" + this.channelzRef.id + ") " + this.subchannelAddressString + " " + text);
|
|
47057
|
+
}
|
|
47058
|
+
handleBackoffTimer() {
|
|
47059
|
+
if (this.continueConnecting) {
|
|
47060
|
+
this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING);
|
|
47061
|
+
} else {
|
|
47062
|
+
this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.IDLE);
|
|
47063
|
+
}
|
|
47064
|
+
}
|
|
47065
|
+
startBackoff() {
|
|
47066
|
+
this.backoffTimeout.runOnce();
|
|
47067
|
+
}
|
|
47068
|
+
stopBackoff() {
|
|
47069
|
+
this.backoffTimeout.stop();
|
|
47070
|
+
this.backoffTimeout.reset();
|
|
47071
|
+
}
|
|
47072
|
+
startConnectingInternal() {
|
|
47073
|
+
let options = this.options;
|
|
47074
|
+
if (options["grpc.keepalive_time_ms"]) {
|
|
47075
|
+
const adjustedKeepaliveTime = Math.min(this.keepaliveTime, KEEPALIVE_MAX_TIME_MS);
|
|
47076
|
+
options = Object.assign(Object.assign({}, options), { "grpc.keepalive_time_ms": adjustedKeepaliveTime });
|
|
47077
|
+
}
|
|
47078
|
+
this.connector.connect(this.subchannelAddress, this.secureConnector, options).then((transport) => {
|
|
47079
|
+
if (this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.READY)) {
|
|
47080
|
+
this.transport = transport;
|
|
47081
|
+
if (this.channelzEnabled) {
|
|
47082
|
+
this.childrenTracker.refChild(transport.getChannelzRef());
|
|
47083
|
+
}
|
|
47084
|
+
transport.addDisconnectListener((tooManyPings) => {
|
|
47085
|
+
this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE);
|
|
47086
|
+
if (tooManyPings && this.keepaliveTime > 0) {
|
|
47087
|
+
this.keepaliveTime *= 2;
|
|
47088
|
+
logging.log(constants_1.LogVerbosity.ERROR, `Connection to ${(0, uri_parser_1.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`);
|
|
47089
|
+
}
|
|
47090
|
+
});
|
|
47091
|
+
} else {
|
|
47092
|
+
transport.shutdown();
|
|
47093
|
+
}
|
|
47094
|
+
}, (error) => {
|
|
47095
|
+
this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, `${error}`);
|
|
47096
|
+
});
|
|
47097
|
+
}
|
|
47098
|
+
transitionToState(oldStates, newState, errorMessage) {
|
|
47099
|
+
var _a, _b;
|
|
47100
|
+
if (oldStates.indexOf(this.connectivityState) === -1) {
|
|
47101
|
+
return false;
|
|
47102
|
+
}
|
|
47103
|
+
if (errorMessage) {
|
|
47104
|
+
this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] + " -> " + connectivity_state_1.ConnectivityState[newState] + ' with error "' + errorMessage + '"');
|
|
47105
|
+
} else {
|
|
47106
|
+
this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] + " -> " + connectivity_state_1.ConnectivityState[newState]);
|
|
47107
|
+
}
|
|
47108
|
+
if (this.channelzEnabled) {
|
|
47109
|
+
this.channelzTrace.addTrace("CT_INFO", "Connectivity state change to " + connectivity_state_1.ConnectivityState[newState]);
|
|
47110
|
+
}
|
|
47111
|
+
const previousState = this.connectivityState;
|
|
47112
|
+
this.connectivityState = newState;
|
|
47113
|
+
switch (newState) {
|
|
47114
|
+
case connectivity_state_1.ConnectivityState.READY:
|
|
47115
|
+
this.stopBackoff();
|
|
47116
|
+
break;
|
|
47117
|
+
case connectivity_state_1.ConnectivityState.CONNECTING:
|
|
47118
|
+
this.startBackoff();
|
|
47119
|
+
this.startConnectingInternal();
|
|
47120
|
+
this.continueConnecting = false;
|
|
47121
|
+
break;
|
|
47122
|
+
case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE:
|
|
47123
|
+
if (this.channelzEnabled && this.transport) {
|
|
47124
|
+
this.childrenTracker.unrefChild(this.transport.getChannelzRef());
|
|
47125
|
+
}
|
|
47126
|
+
(_a = this.transport) === null || _a === undefined || _a.shutdown();
|
|
47127
|
+
this.transport = null;
|
|
47128
|
+
if (!this.backoffTimeout.isRunning()) {
|
|
47129
|
+
process.nextTick(() => {
|
|
47130
|
+
this.handleBackoffTimer();
|
|
47131
|
+
});
|
|
47132
|
+
}
|
|
47133
|
+
break;
|
|
47134
|
+
case connectivity_state_1.ConnectivityState.IDLE:
|
|
47135
|
+
if (this.channelzEnabled && this.transport) {
|
|
47136
|
+
this.childrenTracker.unrefChild(this.transport.getChannelzRef());
|
|
47137
|
+
}
|
|
47138
|
+
(_b = this.transport) === null || _b === undefined || _b.shutdown();
|
|
47139
|
+
this.transport = null;
|
|
47140
|
+
break;
|
|
47141
|
+
default:
|
|
47142
|
+
throw new Error(`Invalid state: unknown ConnectivityState ${newState}`);
|
|
47143
|
+
}
|
|
47144
|
+
for (const listener of this.stateListeners) {
|
|
47145
|
+
listener(this, previousState, newState, this.keepaliveTime, errorMessage);
|
|
47146
|
+
}
|
|
47147
|
+
return true;
|
|
47148
|
+
}
|
|
47149
|
+
ref() {
|
|
47150
|
+
this.refTrace("refcount " + this.refcount + " -> " + (this.refcount + 1));
|
|
47151
|
+
this.refcount += 1;
|
|
47152
|
+
}
|
|
47153
|
+
unref() {
|
|
47154
|
+
this.refTrace("refcount " + this.refcount + " -> " + (this.refcount - 1));
|
|
47155
|
+
this.refcount -= 1;
|
|
47156
|
+
if (this.refcount === 0) {
|
|
47157
|
+
this.channelzTrace.addTrace("CT_INFO", "Shutting down");
|
|
47158
|
+
(0, channelz_1.unregisterChannelzRef)(this.channelzRef);
|
|
47159
|
+
this.secureConnector.destroy();
|
|
47160
|
+
process.nextTick(() => {
|
|
47161
|
+
this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING, connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE);
|
|
47162
|
+
});
|
|
47163
|
+
}
|
|
47164
|
+
}
|
|
47165
|
+
unrefIfOneRef() {
|
|
47166
|
+
if (this.refcount === 1) {
|
|
47167
|
+
this.unref();
|
|
47168
|
+
return true;
|
|
47169
|
+
}
|
|
47170
|
+
return false;
|
|
47171
|
+
}
|
|
47172
|
+
createCall(metadata, host, method, listener) {
|
|
47173
|
+
if (!this.transport) {
|
|
47174
|
+
throw new Error("Cannot create call, subchannel not READY");
|
|
47175
|
+
}
|
|
47176
|
+
let statsTracker;
|
|
47177
|
+
if (this.channelzEnabled) {
|
|
47178
|
+
this.callTracker.addCallStarted();
|
|
47179
|
+
this.streamTracker.addCallStarted();
|
|
47180
|
+
statsTracker = {
|
|
47181
|
+
onCallEnd: (status) => {
|
|
47182
|
+
if (status.code === constants_1.Status.OK) {
|
|
47183
|
+
this.callTracker.addCallSucceeded();
|
|
47184
|
+
} else {
|
|
47185
|
+
this.callTracker.addCallFailed();
|
|
47186
|
+
}
|
|
47187
|
+
}
|
|
47188
|
+
};
|
|
47189
|
+
} else {
|
|
47190
|
+
statsTracker = {};
|
|
47191
|
+
}
|
|
47192
|
+
return this.transport.createCall(metadata, host, method, listener, statsTracker);
|
|
47193
|
+
}
|
|
47194
|
+
startConnecting() {
|
|
47195
|
+
process.nextTick(() => {
|
|
47196
|
+
if (!this.transitionToState([connectivity_state_1.ConnectivityState.IDLE], connectivity_state_1.ConnectivityState.CONNECTING)) {
|
|
47197
|
+
if (this.connectivityState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) {
|
|
47198
|
+
this.continueConnecting = true;
|
|
47199
|
+
}
|
|
47200
|
+
}
|
|
47201
|
+
});
|
|
47202
|
+
}
|
|
47203
|
+
getConnectivityState() {
|
|
47204
|
+
return this.connectivityState;
|
|
47205
|
+
}
|
|
47206
|
+
addConnectivityStateListener(listener) {
|
|
47207
|
+
this.stateListeners.add(listener);
|
|
47208
|
+
}
|
|
47209
|
+
removeConnectivityStateListener(listener) {
|
|
47210
|
+
this.stateListeners.delete(listener);
|
|
47211
|
+
}
|
|
47212
|
+
resetBackoff() {
|
|
47213
|
+
process.nextTick(() => {
|
|
47214
|
+
this.backoffTimeout.reset();
|
|
47215
|
+
this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING);
|
|
47216
|
+
});
|
|
47217
|
+
}
|
|
47218
|
+
getAddress() {
|
|
47219
|
+
return this.subchannelAddressString;
|
|
47220
|
+
}
|
|
47221
|
+
getChannelzRef() {
|
|
47222
|
+
return this.channelzRef;
|
|
47223
|
+
}
|
|
47224
|
+
isHealthy() {
|
|
47225
|
+
return true;
|
|
47226
|
+
}
|
|
47227
|
+
addHealthStateWatcher(listener) {}
|
|
47228
|
+
removeHealthStateWatcher(listener) {}
|
|
47229
|
+
getRealSubchannel() {
|
|
47230
|
+
return this;
|
|
47231
|
+
}
|
|
47232
|
+
realSubchannelEquals(other) {
|
|
47233
|
+
return other.getRealSubchannel() === this;
|
|
47234
|
+
}
|
|
47235
|
+
throttleKeepalive(newKeepaliveTime) {
|
|
47236
|
+
if (newKeepaliveTime > this.keepaliveTime) {
|
|
47237
|
+
this.keepaliveTime = newKeepaliveTime;
|
|
47238
|
+
}
|
|
47239
|
+
}
|
|
47240
|
+
getCallCredentials() {
|
|
47241
|
+
return this.secureConnector.getCallCredentials();
|
|
47242
|
+
}
|
|
47243
|
+
getChannel() {
|
|
47244
|
+
if (!this.subchannelChannel) {
|
|
47245
|
+
this.subchannelChannel = new single_subchannel_channel_1.SingleSubchannelChannel(this, this.channelTarget, this.options);
|
|
47246
|
+
}
|
|
47247
|
+
return this.subchannelChannel;
|
|
47248
|
+
}
|
|
47249
|
+
addDataWatcher(dataWatcher) {
|
|
47250
|
+
throw new Error("Not implemented");
|
|
47251
|
+
}
|
|
47252
|
+
getOrCreateDataProducer(name, createDataProducer) {
|
|
47253
|
+
const existingProducer = this.dataProducers.get(name);
|
|
47254
|
+
if (existingProducer) {
|
|
47255
|
+
return existingProducer;
|
|
47256
|
+
}
|
|
47257
|
+
const newProducer = createDataProducer(this);
|
|
47258
|
+
this.dataProducers.set(name, newProducer);
|
|
47259
|
+
return newProducer;
|
|
47260
|
+
}
|
|
47261
|
+
removeDataProducer(name) {
|
|
47262
|
+
this.dataProducers.delete(name);
|
|
47263
|
+
}
|
|
47264
|
+
}
|
|
47265
|
+
exports2.Subchannel = Subchannel;
|
|
47266
|
+
});
|
|
46498
47267
|
|
|
46499
47268
|
// ../../node_modules/@grpc/grpc-js/build/src/environment.js
|
|
46500
47269
|
var require_environment6 = __commonJS((exports2) => {
|
|
@@ -46513,6 +47282,7 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46513
47282
|
var dns_1 = require("dns");
|
|
46514
47283
|
var service_config_1 = require_service_config();
|
|
46515
47284
|
var constants_1 = require_constants6();
|
|
47285
|
+
var call_interface_1 = require_call_interface();
|
|
46516
47286
|
var metadata_1 = require_metadata();
|
|
46517
47287
|
var logging = require_logging();
|
|
46518
47288
|
var constants_2 = require_constants6();
|
|
@@ -46535,8 +47305,7 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46535
47305
|
this.pendingLookupPromise = null;
|
|
46536
47306
|
this.pendingTxtPromise = null;
|
|
46537
47307
|
this.latestLookupResult = null;
|
|
46538
|
-
this.
|
|
46539
|
-
this.latestServiceConfigError = null;
|
|
47308
|
+
this.latestServiceConfigResult = null;
|
|
46540
47309
|
this.continueResolving = false;
|
|
46541
47310
|
this.isNextResolutionTimerRunning = false;
|
|
46542
47311
|
this.isServiceConfigEnabled = true;
|
|
@@ -46599,7 +47368,7 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46599
47368
|
if (!this.returnedIpResult) {
|
|
46600
47369
|
trace("Returning IP address for target " + (0, uri_parser_1.uriToString)(this.target));
|
|
46601
47370
|
setImmediate(() => {
|
|
46602
|
-
this.listener.
|
|
47371
|
+
this.listener((0, call_interface_1.statusOrFromValue)(this.ipResult), {}, null, "");
|
|
46603
47372
|
});
|
|
46604
47373
|
this.returnedIpResult = true;
|
|
46605
47374
|
}
|
|
@@ -46611,11 +47380,10 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46611
47380
|
if (this.dnsHostname === null) {
|
|
46612
47381
|
trace("Failed to parse DNS address " + (0, uri_parser_1.uriToString)(this.target));
|
|
46613
47382
|
setImmediate(() => {
|
|
46614
|
-
this.listener.
|
|
47383
|
+
this.listener((0, call_interface_1.statusOrFromError)({
|
|
46615
47384
|
code: constants_1.Status.UNAVAILABLE,
|
|
46616
|
-
details: `Failed to parse DNS address ${(0, uri_parser_1.uriToString)(this.target)}
|
|
46617
|
-
|
|
46618
|
-
});
|
|
47385
|
+
details: `Failed to parse DNS address ${(0, uri_parser_1.uriToString)(this.target)}`
|
|
47386
|
+
}), {}, null, "");
|
|
46619
47387
|
});
|
|
46620
47388
|
this.stopNextResolutionTimer();
|
|
46621
47389
|
} else {
|
|
@@ -46631,18 +47399,13 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46631
47399
|
return;
|
|
46632
47400
|
}
|
|
46633
47401
|
this.pendingLookupPromise = null;
|
|
46634
|
-
this.
|
|
46635
|
-
this.backoff.stop();
|
|
46636
|
-
this.latestLookupResult = addressList.map((address) => ({
|
|
47402
|
+
this.latestLookupResult = (0, call_interface_1.statusOrFromValue)(addressList.map((address) => ({
|
|
46637
47403
|
addresses: [address]
|
|
46638
|
-
}));
|
|
47404
|
+
})));
|
|
46639
47405
|
const allAddressesString = "[" + addressList.map((addr) => addr.host + ":" + addr.port).join(",") + "]";
|
|
46640
47406
|
trace("Resolved addresses for target " + (0, uri_parser_1.uriToString)(this.target) + ": " + allAddressesString);
|
|
46641
|
-
|
|
46642
|
-
|
|
46643
|
-
return;
|
|
46644
|
-
}
|
|
46645
|
-
this.listener.onSuccessfulResolution(this.latestLookupResult, this.latestServiceConfig, this.latestServiceConfigError, null, {});
|
|
47407
|
+
const healthStatus = this.listener(this.latestLookupResult, {}, this.latestServiceConfigResult, "");
|
|
47408
|
+
this.handleHealthStatus(healthStatus);
|
|
46646
47409
|
}, (err) => {
|
|
46647
47410
|
if (this.pendingLookupPromise === null) {
|
|
46648
47411
|
return;
|
|
@@ -46650,7 +47413,7 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46650
47413
|
trace("Resolution error for target " + (0, uri_parser_1.uriToString)(this.target) + ": " + err.message);
|
|
46651
47414
|
this.pendingLookupPromise = null;
|
|
46652
47415
|
this.stopNextResolutionTimer();
|
|
46653
|
-
this.listener.
|
|
47416
|
+
this.listener((0, call_interface_1.statusOrFromError)(this.defaultResolutionError), {}, this.latestServiceConfigResult, "");
|
|
46654
47417
|
});
|
|
46655
47418
|
if (this.isServiceConfigEnabled && this.pendingTxtPromise === null) {
|
|
46656
47419
|
this.pendingTxtPromise = this.resolveTxt(hostname);
|
|
@@ -46659,22 +47422,35 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46659
47422
|
return;
|
|
46660
47423
|
}
|
|
46661
47424
|
this.pendingTxtPromise = null;
|
|
47425
|
+
let serviceConfig;
|
|
46662
47426
|
try {
|
|
46663
|
-
|
|
47427
|
+
serviceConfig = (0, service_config_1.extractAndSelectServiceConfig)(txtRecord, this.percentage);
|
|
47428
|
+
if (serviceConfig) {
|
|
47429
|
+
this.latestServiceConfigResult = (0, call_interface_1.statusOrFromValue)(serviceConfig);
|
|
47430
|
+
} else {
|
|
47431
|
+
this.latestServiceConfigResult = null;
|
|
47432
|
+
}
|
|
46664
47433
|
} catch (err) {
|
|
46665
|
-
this.
|
|
47434
|
+
this.latestServiceConfigResult = (0, call_interface_1.statusOrFromError)({
|
|
46666
47435
|
code: constants_1.Status.UNAVAILABLE,
|
|
46667
|
-
details: `Parsing service config failed with error ${err.message}
|
|
46668
|
-
|
|
46669
|
-
};
|
|
47436
|
+
details: `Parsing service config failed with error ${err.message}`
|
|
47437
|
+
});
|
|
46670
47438
|
}
|
|
46671
47439
|
if (this.latestLookupResult !== null) {
|
|
46672
|
-
this.listener
|
|
47440
|
+
this.listener(this.latestLookupResult, {}, this.latestServiceConfigResult, "");
|
|
46673
47441
|
}
|
|
46674
47442
|
}, (err) => {});
|
|
46675
47443
|
}
|
|
46676
47444
|
}
|
|
46677
47445
|
}
|
|
47446
|
+
handleHealthStatus(healthStatus) {
|
|
47447
|
+
if (healthStatus) {
|
|
47448
|
+
this.backoff.stop();
|
|
47449
|
+
this.backoff.reset();
|
|
47450
|
+
} else {
|
|
47451
|
+
this.continueResolving = true;
|
|
47452
|
+
}
|
|
47453
|
+
}
|
|
46678
47454
|
async lookup(hostname) {
|
|
46679
47455
|
if (environment_1.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) {
|
|
46680
47456
|
trace("Using alternative DNS resolver.");
|
|
@@ -46748,8 +47524,7 @@ var require_resolver_dns = __commonJS((exports2) => {
|
|
|
46748
47524
|
this.pendingLookupPromise = null;
|
|
46749
47525
|
this.pendingTxtPromise = null;
|
|
46750
47526
|
this.latestLookupResult = null;
|
|
46751
|
-
this.
|
|
46752
|
-
this.latestServiceConfigError = null;
|
|
47527
|
+
this.latestServiceConfigResult = null;
|
|
46753
47528
|
this.returnedIpResult = false;
|
|
46754
47529
|
}
|
|
46755
47530
|
static getDefaultAuthority(target) {
|
|
@@ -47410,6 +48185,9 @@ var require_subchannel_call = __commonJS((exports2) => {
|
|
|
47410
48185
|
getCallNumber() {
|
|
47411
48186
|
return this.callId;
|
|
47412
48187
|
}
|
|
48188
|
+
getAuthContext() {
|
|
48189
|
+
return this.transport.getAuthContext();
|
|
48190
|
+
}
|
|
47413
48191
|
startRead() {
|
|
47414
48192
|
if (this.finalStatus !== null && this.finalStatus.code !== constants_1.Status.OK) {
|
|
47415
48193
|
this.readsClosed = true;
|
|
@@ -47460,21 +48238,12 @@ var require_subchannel_call = __commonJS((exports2) => {
|
|
|
47460
48238
|
exports2.Http2SubchannelCall = Http2SubchannelCall;
|
|
47461
48239
|
});
|
|
47462
48240
|
|
|
47463
|
-
// ../../node_modules/@grpc/grpc-js/build/src/call-number.js
|
|
47464
|
-
var require_call_number = __commonJS((exports2) => {
|
|
47465
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47466
|
-
exports2.getNextCallNumber = getNextCallNumber;
|
|
47467
|
-
var nextCallNumber = 0;
|
|
47468
|
-
function getNextCallNumber() {
|
|
47469
|
-
return nextCallNumber++;
|
|
47470
|
-
}
|
|
47471
|
-
});
|
|
47472
|
-
|
|
47473
48241
|
// ../../node_modules/@grpc/grpc-js/build/src/transport.js
|
|
47474
48242
|
var require_transport = __commonJS((exports2) => {
|
|
47475
48243
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47476
48244
|
exports2.Http2SubchannelConnector = undefined;
|
|
47477
48245
|
var http2 = require("http2");
|
|
48246
|
+
var tls_1 = require("tls");
|
|
47478
48247
|
var channelz_1 = require_channelz();
|
|
47479
48248
|
var constants_1 = require_constants6();
|
|
47480
48249
|
var http_proxy_1 = require_http_proxy();
|
|
@@ -47567,6 +48336,14 @@ var require_transport = __commonJS((exports2) => {
|
|
|
47567
48336
|
if (this.keepaliveWithoutCalls) {
|
|
47568
48337
|
this.maybeStartKeepalivePingTimer();
|
|
47569
48338
|
}
|
|
48339
|
+
if (session.socket instanceof tls_1.TLSSocket) {
|
|
48340
|
+
this.authContext = {
|
|
48341
|
+
transportSecurityType: "ssl",
|
|
48342
|
+
sslPeerCertificate: session.socket.getPeerCertificate()
|
|
48343
|
+
};
|
|
48344
|
+
} else {
|
|
48345
|
+
this.authContext = {};
|
|
48346
|
+
}
|
|
47570
48347
|
}
|
|
47571
48348
|
getChannelzInfo() {
|
|
47572
48349
|
var _a, _b, _c;
|
|
@@ -47807,6 +48584,9 @@ var require_transport = __commonJS((exports2) => {
|
|
|
47807
48584
|
getOptions() {
|
|
47808
48585
|
return this.options;
|
|
47809
48586
|
}
|
|
48587
|
+
getAuthContext() {
|
|
48588
|
+
return this.authContext;
|
|
48589
|
+
}
|
|
47810
48590
|
shutdown() {
|
|
47811
48591
|
this.session.close();
|
|
47812
48592
|
(0, channelz_1.unregisterChannelzRef)(this.channelzRef);
|
|
@@ -47830,6 +48610,7 @@ var require_transport = __commonJS((exports2) => {
|
|
|
47830
48610
|
return Promise.reject("Connection closed before starting HTTP/2 handshake");
|
|
47831
48611
|
}
|
|
47832
48612
|
return new Promise((resolve, reject) => {
|
|
48613
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
47833
48614
|
let remoteName = null;
|
|
47834
48615
|
let realTarget = this.channelTarget;
|
|
47835
48616
|
if ("grpc.http_connect_target" in options) {
|
|
@@ -47842,8 +48623,8 @@ var require_transport = __commonJS((exports2) => {
|
|
|
47842
48623
|
const scheme = secureConnectResult.secure ? "https" : "http";
|
|
47843
48624
|
const targetPath = (0, resolver_1.getDefaultAuthority)(realTarget);
|
|
47844
48625
|
const closeHandler = () => {
|
|
47845
|
-
var
|
|
47846
|
-
(
|
|
48626
|
+
var _a2;
|
|
48627
|
+
(_a2 = this.session) === null || _a2 === undefined || _a2.destroy();
|
|
47847
48628
|
this.session = null;
|
|
47848
48629
|
setImmediate(() => {
|
|
47849
48630
|
if (!reportedError) {
|
|
@@ -47853,8 +48634,8 @@ var require_transport = __commonJS((exports2) => {
|
|
|
47853
48634
|
});
|
|
47854
48635
|
};
|
|
47855
48636
|
const errorHandler = (error) => {
|
|
47856
|
-
var
|
|
47857
|
-
(
|
|
48637
|
+
var _a2;
|
|
48638
|
+
(_a2 = this.session) === null || _a2 === undefined || _a2.destroy();
|
|
47858
48639
|
errorMessage = error.message;
|
|
47859
48640
|
this.trace("connection failed with error " + errorMessage);
|
|
47860
48641
|
if (!reportedError) {
|
|
@@ -47865,614 +48646,170 @@ var require_transport = __commonJS((exports2) => {
|
|
|
47865
48646
|
const sessionOptions = {
|
|
47866
48647
|
createConnection: (authority, option) => {
|
|
47867
48648
|
return secureConnectResult.socket;
|
|
48649
|
+
},
|
|
48650
|
+
settings: {
|
|
48651
|
+
initialWindowSize: (_d = (_a = options["grpc-node.flow_control_window"]) !== null && _a !== undefined ? _a : (_c = (_b = http2.getDefaultSettings) === null || _b === undefined ? undefined : _b.call(http2)) === null || _c === undefined ? undefined : _c.initialWindowSize) !== null && _d !== undefined ? _d : 65535
|
|
47868
48652
|
}
|
|
47869
48653
|
};
|
|
47870
|
-
if (options["grpc-node.flow_control_window"] !== undefined) {
|
|
47871
|
-
sessionOptions.settings = {
|
|
47872
|
-
initialWindowSize: options["grpc-node.flow_control_window"]
|
|
47873
|
-
};
|
|
47874
|
-
}
|
|
47875
48654
|
const session = http2.connect(`${scheme}://${targetPath}`, sessionOptions);
|
|
48655
|
+
const defaultWin = (_g = (_f = (_e = http2.getDefaultSettings) === null || _e === undefined ? undefined : _e.call(http2)) === null || _f === undefined ? undefined : _f.initialWindowSize) !== null && _g !== undefined ? _g : 65535;
|
|
48656
|
+
const connWin = options["grpc-node.flow_control_window"];
|
|
47876
48657
|
this.session = session;
|
|
47877
48658
|
let errorMessage = "Failed to connect";
|
|
47878
48659
|
let reportedError = false;
|
|
47879
48660
|
session.unref();
|
|
47880
48661
|
session.once("remoteSettings", () => {
|
|
48662
|
+
var _a2;
|
|
48663
|
+
if (connWin && connWin > defaultWin) {
|
|
48664
|
+
try {
|
|
48665
|
+
session.setLocalWindowSize(connWin);
|
|
48666
|
+
} catch (_b2) {
|
|
48667
|
+
const delta = connWin - ((_a2 = session.state.localWindowSize) !== null && _a2 !== undefined ? _a2 : defaultWin);
|
|
48668
|
+
if (delta > 0)
|
|
48669
|
+
session.incrementWindowSize(delta);
|
|
48670
|
+
}
|
|
48671
|
+
}
|
|
47881
48672
|
session.removeAllListeners();
|
|
47882
48673
|
secureConnectResult.socket.removeListener("close", closeHandler);
|
|
47883
48674
|
secureConnectResult.socket.removeListener("error", errorHandler);
|
|
47884
48675
|
resolve(new Http2Transport(session, address, options, remoteName));
|
|
47885
48676
|
this.session = null;
|
|
47886
48677
|
});
|
|
47887
|
-
session.once("close", closeHandler);
|
|
47888
|
-
session.once("error", errorHandler);
|
|
47889
|
-
secureConnectResult.socket.once("close", closeHandler);
|
|
47890
|
-
secureConnectResult.socket.once("error", errorHandler);
|
|
47891
|
-
});
|
|
47892
|
-
}
|
|
47893
|
-
tcpConnect(address, options) {
|
|
47894
|
-
return (0, http_proxy_1.getProxiedConnection)(address, options).then((proxiedSocket) => {
|
|
47895
|
-
if (proxiedSocket) {
|
|
47896
|
-
return proxiedSocket;
|
|
47897
|
-
} else {
|
|
47898
|
-
return new Promise((resolve, reject) => {
|
|
47899
|
-
const closeCallback = () => {
|
|
47900
|
-
reject(new Error("Socket closed"));
|
|
47901
|
-
};
|
|
47902
|
-
const errorCallback = (error) => {
|
|
47903
|
-
reject(error);
|
|
47904
|
-
};
|
|
47905
|
-
const socket = net.connect(address, () => {
|
|
47906
|
-
socket.removeListener("close", closeCallback);
|
|
47907
|
-
socket.removeListener("error", errorCallback);
|
|
47908
|
-
resolve(socket);
|
|
47909
|
-
});
|
|
47910
|
-
socket.once("close", closeCallback);
|
|
47911
|
-
socket.once("error", errorCallback);
|
|
47912
|
-
});
|
|
47913
|
-
}
|
|
47914
|
-
});
|
|
47915
|
-
}
|
|
47916
|
-
async connect(address, secureConnector, options) {
|
|
47917
|
-
if (this.isShutdown) {
|
|
47918
|
-
return Promise.reject();
|
|
47919
|
-
}
|
|
47920
|
-
let tcpConnection = null;
|
|
47921
|
-
let secureConnectResult = null;
|
|
47922
|
-
const addressString = (0, subchannel_address_1.subchannelAddressToString)(address);
|
|
47923
|
-
try {
|
|
47924
|
-
this.trace(addressString + " Waiting for secureConnector to be ready");
|
|
47925
|
-
await secureConnector.waitForReady();
|
|
47926
|
-
this.trace(addressString + " secureConnector is ready");
|
|
47927
|
-
tcpConnection = await this.tcpConnect(address, options);
|
|
47928
|
-
tcpConnection.setNoDelay();
|
|
47929
|
-
this.trace(addressString + " Established TCP connection");
|
|
47930
|
-
secureConnectResult = await secureConnector.connect(tcpConnection);
|
|
47931
|
-
this.trace(addressString + " Established secure connection");
|
|
47932
|
-
return this.createSession(secureConnectResult, address, options);
|
|
47933
|
-
} catch (e) {
|
|
47934
|
-
tcpConnection === null || tcpConnection === undefined || tcpConnection.destroy();
|
|
47935
|
-
secureConnectResult === null || secureConnectResult === undefined || secureConnectResult.socket.destroy();
|
|
47936
|
-
throw e;
|
|
47937
|
-
}
|
|
47938
|
-
}
|
|
47939
|
-
shutdown() {
|
|
47940
|
-
var _a;
|
|
47941
|
-
this.isShutdown = true;
|
|
47942
|
-
(_a = this.session) === null || _a === undefined || _a.close();
|
|
47943
|
-
this.session = null;
|
|
47944
|
-
}
|
|
47945
|
-
}
|
|
47946
|
-
exports2.Http2SubchannelConnector = Http2SubchannelConnector;
|
|
47947
|
-
});
|
|
47948
|
-
|
|
47949
|
-
// ../../node_modules/@grpc/grpc-js/build/src/subchannel-pool.js
|
|
47950
|
-
var require_subchannel_pool = __commonJS((exports2) => {
|
|
47951
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47952
|
-
exports2.SubchannelPool = undefined;
|
|
47953
|
-
exports2.getSubchannelPool = getSubchannelPool;
|
|
47954
|
-
var channel_options_1 = require_channel_options();
|
|
47955
|
-
var subchannel_1 = require_subchannel();
|
|
47956
|
-
var subchannel_address_1 = require_subchannel_address();
|
|
47957
|
-
var uri_parser_1 = require_uri_parser();
|
|
47958
|
-
var transport_1 = require_transport();
|
|
47959
|
-
var REF_CHECK_INTERVAL = 1e4;
|
|
47960
|
-
|
|
47961
|
-
class SubchannelPool {
|
|
47962
|
-
constructor() {
|
|
47963
|
-
this.pool = Object.create(null);
|
|
47964
|
-
this.cleanupTimer = null;
|
|
47965
|
-
}
|
|
47966
|
-
unrefUnusedSubchannels() {
|
|
47967
|
-
let allSubchannelsUnrefed = true;
|
|
47968
|
-
for (const channelTarget in this.pool) {
|
|
47969
|
-
const subchannelObjArray = this.pool[channelTarget];
|
|
47970
|
-
const refedSubchannels = subchannelObjArray.filter((value) => !value.subchannel.unrefIfOneRef());
|
|
47971
|
-
if (refedSubchannels.length > 0) {
|
|
47972
|
-
allSubchannelsUnrefed = false;
|
|
47973
|
-
}
|
|
47974
|
-
this.pool[channelTarget] = refedSubchannels;
|
|
47975
|
-
}
|
|
47976
|
-
if (allSubchannelsUnrefed && this.cleanupTimer !== null) {
|
|
47977
|
-
clearInterval(this.cleanupTimer);
|
|
47978
|
-
this.cleanupTimer = null;
|
|
47979
|
-
}
|
|
47980
|
-
}
|
|
47981
|
-
ensureCleanupTask() {
|
|
47982
|
-
var _a, _b;
|
|
47983
|
-
if (this.cleanupTimer === null) {
|
|
47984
|
-
this.cleanupTimer = setInterval(() => {
|
|
47985
|
-
this.unrefUnusedSubchannels();
|
|
47986
|
-
}, REF_CHECK_INTERVAL);
|
|
47987
|
-
(_b = (_a = this.cleanupTimer).unref) === null || _b === undefined || _b.call(_a);
|
|
47988
|
-
}
|
|
47989
|
-
}
|
|
47990
|
-
getOrCreateSubchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials) {
|
|
47991
|
-
this.ensureCleanupTask();
|
|
47992
|
-
const channelTarget = (0, uri_parser_1.uriToString)(channelTargetUri);
|
|
47993
|
-
if (channelTarget in this.pool) {
|
|
47994
|
-
const subchannelObjArray = this.pool[channelTarget];
|
|
47995
|
-
for (const subchannelObj of subchannelObjArray) {
|
|
47996
|
-
if ((0, subchannel_address_1.subchannelAddressEqual)(subchannelTarget, subchannelObj.subchannelAddress) && (0, channel_options_1.channelOptionsEqual)(channelArguments, subchannelObj.channelArguments) && channelCredentials._equals(subchannelObj.channelCredentials)) {
|
|
47997
|
-
return subchannelObj.subchannel;
|
|
47998
|
-
}
|
|
47999
|
-
}
|
|
48000
|
-
}
|
|
48001
|
-
const subchannel = new subchannel_1.Subchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials, new transport_1.Http2SubchannelConnector(channelTargetUri));
|
|
48002
|
-
if (!(channelTarget in this.pool)) {
|
|
48003
|
-
this.pool[channelTarget] = [];
|
|
48004
|
-
}
|
|
48005
|
-
this.pool[channelTarget].push({
|
|
48006
|
-
subchannelAddress: subchannelTarget,
|
|
48007
|
-
channelArguments,
|
|
48008
|
-
channelCredentials,
|
|
48009
|
-
subchannel
|
|
48010
|
-
});
|
|
48011
|
-
subchannel.ref();
|
|
48012
|
-
return subchannel;
|
|
48013
|
-
}
|
|
48014
|
-
}
|
|
48015
|
-
exports2.SubchannelPool = SubchannelPool;
|
|
48016
|
-
var globalSubchannelPool = new SubchannelPool;
|
|
48017
|
-
function getSubchannelPool(global2) {
|
|
48018
|
-
if (global2) {
|
|
48019
|
-
return globalSubchannelPool;
|
|
48020
|
-
} else {
|
|
48021
|
-
return new SubchannelPool;
|
|
48022
|
-
}
|
|
48023
|
-
}
|
|
48024
|
-
});
|
|
48025
|
-
|
|
48026
|
-
// ../../node_modules/@grpc/grpc-js/build/src/filter-stack.js
|
|
48027
|
-
var require_filter_stack = __commonJS((exports2) => {
|
|
48028
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48029
|
-
exports2.FilterStackFactory = exports2.FilterStack = undefined;
|
|
48030
|
-
|
|
48031
|
-
class FilterStack {
|
|
48032
|
-
constructor(filters) {
|
|
48033
|
-
this.filters = filters;
|
|
48034
|
-
}
|
|
48035
|
-
sendMetadata(metadata) {
|
|
48036
|
-
let result = metadata;
|
|
48037
|
-
for (let i = 0;i < this.filters.length; i++) {
|
|
48038
|
-
result = this.filters[i].sendMetadata(result);
|
|
48039
|
-
}
|
|
48040
|
-
return result;
|
|
48041
|
-
}
|
|
48042
|
-
receiveMetadata(metadata) {
|
|
48043
|
-
let result = metadata;
|
|
48044
|
-
for (let i = this.filters.length - 1;i >= 0; i--) {
|
|
48045
|
-
result = this.filters[i].receiveMetadata(result);
|
|
48046
|
-
}
|
|
48047
|
-
return result;
|
|
48048
|
-
}
|
|
48049
|
-
sendMessage(message) {
|
|
48050
|
-
let result = message;
|
|
48051
|
-
for (let i = 0;i < this.filters.length; i++) {
|
|
48052
|
-
result = this.filters[i].sendMessage(result);
|
|
48053
|
-
}
|
|
48054
|
-
return result;
|
|
48055
|
-
}
|
|
48056
|
-
receiveMessage(message) {
|
|
48057
|
-
let result = message;
|
|
48058
|
-
for (let i = this.filters.length - 1;i >= 0; i--) {
|
|
48059
|
-
result = this.filters[i].receiveMessage(result);
|
|
48060
|
-
}
|
|
48061
|
-
return result;
|
|
48062
|
-
}
|
|
48063
|
-
receiveTrailers(status) {
|
|
48064
|
-
let result = status;
|
|
48065
|
-
for (let i = this.filters.length - 1;i >= 0; i--) {
|
|
48066
|
-
result = this.filters[i].receiveTrailers(result);
|
|
48067
|
-
}
|
|
48068
|
-
return result;
|
|
48069
|
-
}
|
|
48070
|
-
push(filters) {
|
|
48071
|
-
this.filters.unshift(...filters);
|
|
48072
|
-
}
|
|
48073
|
-
getFilters() {
|
|
48074
|
-
return this.filters;
|
|
48075
|
-
}
|
|
48076
|
-
}
|
|
48077
|
-
exports2.FilterStack = FilterStack;
|
|
48078
|
-
|
|
48079
|
-
class FilterStackFactory {
|
|
48080
|
-
constructor(factories) {
|
|
48081
|
-
this.factories = factories;
|
|
48082
|
-
}
|
|
48083
|
-
push(filterFactories) {
|
|
48084
|
-
this.factories.unshift(...filterFactories);
|
|
48085
|
-
}
|
|
48086
|
-
clone() {
|
|
48087
|
-
return new FilterStackFactory([...this.factories]);
|
|
48088
|
-
}
|
|
48089
|
-
createFilter() {
|
|
48090
|
-
return new FilterStack(this.factories.map((factory) => factory.createFilter()));
|
|
48091
|
-
}
|
|
48092
|
-
}
|
|
48093
|
-
exports2.FilterStackFactory = FilterStackFactory;
|
|
48094
|
-
});
|
|
48095
|
-
|
|
48096
|
-
// ../../node_modules/@grpc/grpc-js/build/src/compression-algorithms.js
|
|
48097
|
-
var require_compression_algorithms = __commonJS((exports2) => {
|
|
48098
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48099
|
-
exports2.CompressionAlgorithms = undefined;
|
|
48100
|
-
var CompressionAlgorithms;
|
|
48101
|
-
(function(CompressionAlgorithms2) {
|
|
48102
|
-
CompressionAlgorithms2[CompressionAlgorithms2["identity"] = 0] = "identity";
|
|
48103
|
-
CompressionAlgorithms2[CompressionAlgorithms2["deflate"] = 1] = "deflate";
|
|
48104
|
-
CompressionAlgorithms2[CompressionAlgorithms2["gzip"] = 2] = "gzip";
|
|
48105
|
-
})(CompressionAlgorithms || (exports2.CompressionAlgorithms = CompressionAlgorithms = {}));
|
|
48106
|
-
});
|
|
48107
|
-
|
|
48108
|
-
// ../../node_modules/@grpc/grpc-js/build/src/filter.js
|
|
48109
|
-
var require_filter = __commonJS((exports2) => {
|
|
48110
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48111
|
-
exports2.BaseFilter = undefined;
|
|
48112
|
-
|
|
48113
|
-
class BaseFilter {
|
|
48114
|
-
async sendMetadata(metadata) {
|
|
48115
|
-
return metadata;
|
|
48116
|
-
}
|
|
48117
|
-
receiveMetadata(metadata) {
|
|
48118
|
-
return metadata;
|
|
48119
|
-
}
|
|
48120
|
-
async sendMessage(message) {
|
|
48121
|
-
return message;
|
|
48122
|
-
}
|
|
48123
|
-
async receiveMessage(message) {
|
|
48124
|
-
return message;
|
|
48125
|
-
}
|
|
48126
|
-
receiveTrailers(status) {
|
|
48127
|
-
return status;
|
|
48128
|
-
}
|
|
48129
|
-
}
|
|
48130
|
-
exports2.BaseFilter = BaseFilter;
|
|
48131
|
-
});
|
|
48132
|
-
|
|
48133
|
-
// ../../node_modules/@grpc/grpc-js/build/src/compression-filter.js
|
|
48134
|
-
var require_compression_filter = __commonJS((exports2) => {
|
|
48135
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48136
|
-
exports2.CompressionFilterFactory = exports2.CompressionFilter = undefined;
|
|
48137
|
-
var zlib = require("zlib");
|
|
48138
|
-
var compression_algorithms_1 = require_compression_algorithms();
|
|
48139
|
-
var constants_1 = require_constants6();
|
|
48140
|
-
var filter_1 = require_filter();
|
|
48141
|
-
var logging = require_logging();
|
|
48142
|
-
var isCompressionAlgorithmKey = (key) => {
|
|
48143
|
-
return typeof key === "number" && typeof compression_algorithms_1.CompressionAlgorithms[key] === "string";
|
|
48144
|
-
};
|
|
48145
|
-
|
|
48146
|
-
class CompressionHandler {
|
|
48147
|
-
async writeMessage(message, compress) {
|
|
48148
|
-
let messageBuffer = message;
|
|
48149
|
-
if (compress) {
|
|
48150
|
-
messageBuffer = await this.compressMessage(messageBuffer);
|
|
48151
|
-
}
|
|
48152
|
-
const output = Buffer.allocUnsafe(messageBuffer.length + 5);
|
|
48153
|
-
output.writeUInt8(compress ? 1 : 0, 0);
|
|
48154
|
-
output.writeUInt32BE(messageBuffer.length, 1);
|
|
48155
|
-
messageBuffer.copy(output, 5);
|
|
48156
|
-
return output;
|
|
48157
|
-
}
|
|
48158
|
-
async readMessage(data) {
|
|
48159
|
-
const compressed = data.readUInt8(0) === 1;
|
|
48160
|
-
let messageBuffer = data.slice(5);
|
|
48161
|
-
if (compressed) {
|
|
48162
|
-
messageBuffer = await this.decompressMessage(messageBuffer);
|
|
48163
|
-
}
|
|
48164
|
-
return messageBuffer;
|
|
48165
|
-
}
|
|
48166
|
-
}
|
|
48167
|
-
|
|
48168
|
-
class IdentityHandler extends CompressionHandler {
|
|
48169
|
-
async compressMessage(message) {
|
|
48170
|
-
return message;
|
|
48171
|
-
}
|
|
48172
|
-
async writeMessage(message, compress) {
|
|
48173
|
-
const output = Buffer.allocUnsafe(message.length + 5);
|
|
48174
|
-
output.writeUInt8(0, 0);
|
|
48175
|
-
output.writeUInt32BE(message.length, 1);
|
|
48176
|
-
message.copy(output, 5);
|
|
48177
|
-
return output;
|
|
48178
|
-
}
|
|
48179
|
-
decompressMessage(message) {
|
|
48180
|
-
return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'));
|
|
48181
|
-
}
|
|
48182
|
-
}
|
|
48183
|
-
|
|
48184
|
-
class DeflateHandler extends CompressionHandler {
|
|
48185
|
-
constructor(maxRecvMessageLength) {
|
|
48186
|
-
super();
|
|
48187
|
-
this.maxRecvMessageLength = maxRecvMessageLength;
|
|
48188
|
-
}
|
|
48189
|
-
compressMessage(message) {
|
|
48190
|
-
return new Promise((resolve, reject) => {
|
|
48191
|
-
zlib.deflate(message, (err, output) => {
|
|
48192
|
-
if (err) {
|
|
48193
|
-
reject(err);
|
|
48194
|
-
} else {
|
|
48195
|
-
resolve(output);
|
|
48196
|
-
}
|
|
48197
|
-
});
|
|
48198
|
-
});
|
|
48199
|
-
}
|
|
48200
|
-
decompressMessage(message) {
|
|
48201
|
-
return new Promise((resolve, reject) => {
|
|
48202
|
-
let totalLength = 0;
|
|
48203
|
-
const messageParts = [];
|
|
48204
|
-
const decompresser = zlib.createInflate();
|
|
48205
|
-
decompresser.on("data", (chunk) => {
|
|
48206
|
-
messageParts.push(chunk);
|
|
48207
|
-
totalLength += chunk.byteLength;
|
|
48208
|
-
if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) {
|
|
48209
|
-
decompresser.destroy();
|
|
48210
|
-
reject({
|
|
48211
|
-
code: constants_1.Status.RESOURCE_EXHAUSTED,
|
|
48212
|
-
details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`
|
|
48213
|
-
});
|
|
48214
|
-
}
|
|
48215
|
-
});
|
|
48216
|
-
decompresser.on("end", () => {
|
|
48217
|
-
resolve(Buffer.concat(messageParts));
|
|
48218
|
-
});
|
|
48219
|
-
decompresser.write(message);
|
|
48220
|
-
decompresser.end();
|
|
48221
|
-
});
|
|
48222
|
-
}
|
|
48223
|
-
}
|
|
48224
|
-
|
|
48225
|
-
class GzipHandler extends CompressionHandler {
|
|
48226
|
-
constructor(maxRecvMessageLength) {
|
|
48227
|
-
super();
|
|
48228
|
-
this.maxRecvMessageLength = maxRecvMessageLength;
|
|
48229
|
-
}
|
|
48230
|
-
compressMessage(message) {
|
|
48231
|
-
return new Promise((resolve, reject) => {
|
|
48232
|
-
zlib.gzip(message, (err, output) => {
|
|
48233
|
-
if (err) {
|
|
48234
|
-
reject(err);
|
|
48235
|
-
} else {
|
|
48236
|
-
resolve(output);
|
|
48237
|
-
}
|
|
48238
|
-
});
|
|
48239
|
-
});
|
|
48240
|
-
}
|
|
48241
|
-
decompressMessage(message) {
|
|
48242
|
-
return new Promise((resolve, reject) => {
|
|
48243
|
-
let totalLength = 0;
|
|
48244
|
-
const messageParts = [];
|
|
48245
|
-
const decompresser = zlib.createGunzip();
|
|
48246
|
-
decompresser.on("data", (chunk) => {
|
|
48247
|
-
messageParts.push(chunk);
|
|
48248
|
-
totalLength += chunk.byteLength;
|
|
48249
|
-
if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) {
|
|
48250
|
-
decompresser.destroy();
|
|
48251
|
-
reject({
|
|
48252
|
-
code: constants_1.Status.RESOURCE_EXHAUSTED,
|
|
48253
|
-
details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`
|
|
48254
|
-
});
|
|
48255
|
-
}
|
|
48256
|
-
});
|
|
48257
|
-
decompresser.on("end", () => {
|
|
48258
|
-
resolve(Buffer.concat(messageParts));
|
|
48259
|
-
});
|
|
48260
|
-
decompresser.write(message);
|
|
48261
|
-
decompresser.end();
|
|
48678
|
+
session.once("close", closeHandler);
|
|
48679
|
+
session.once("error", errorHandler);
|
|
48680
|
+
secureConnectResult.socket.once("close", closeHandler);
|
|
48681
|
+
secureConnectResult.socket.once("error", errorHandler);
|
|
48262
48682
|
});
|
|
48263
48683
|
}
|
|
48264
|
-
|
|
48265
|
-
|
|
48266
|
-
|
|
48267
|
-
|
|
48268
|
-
super();
|
|
48269
|
-
this.compressionName = compressionName;
|
|
48270
|
-
}
|
|
48271
|
-
compressMessage(message) {
|
|
48272
|
-
return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`));
|
|
48273
|
-
}
|
|
48274
|
-
decompressMessage(message) {
|
|
48275
|
-
return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`));
|
|
48276
|
-
}
|
|
48277
|
-
}
|
|
48278
|
-
function getCompressionHandler(compressionName, maxReceiveMessageSize) {
|
|
48279
|
-
switch (compressionName) {
|
|
48280
|
-
case "identity":
|
|
48281
|
-
return new IdentityHandler;
|
|
48282
|
-
case "deflate":
|
|
48283
|
-
return new DeflateHandler(maxReceiveMessageSize);
|
|
48284
|
-
case "gzip":
|
|
48285
|
-
return new GzipHandler(maxReceiveMessageSize);
|
|
48286
|
-
default:
|
|
48287
|
-
return new UnknownHandler(compressionName);
|
|
48288
|
-
}
|
|
48289
|
-
}
|
|
48290
|
-
|
|
48291
|
-
class CompressionFilter extends filter_1.BaseFilter {
|
|
48292
|
-
constructor(channelOptions, sharedFilterConfig) {
|
|
48293
|
-
var _a, _b, _c;
|
|
48294
|
-
super();
|
|
48295
|
-
this.sharedFilterConfig = sharedFilterConfig;
|
|
48296
|
-
this.sendCompression = new IdentityHandler;
|
|
48297
|
-
this.receiveCompression = new IdentityHandler;
|
|
48298
|
-
this.currentCompressionAlgorithm = "identity";
|
|
48299
|
-
const compressionAlgorithmKey = channelOptions["grpc.default_compression_algorithm"];
|
|
48300
|
-
this.maxReceiveMessageLength = (_a = channelOptions["grpc.max_receive_message_length"]) !== null && _a !== undefined ? _a : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;
|
|
48301
|
-
this.maxSendMessageLength = (_b = channelOptions["grpc.max_send_message_length"]) !== null && _b !== undefined ? _b : constants_1.DEFAULT_MAX_SEND_MESSAGE_LENGTH;
|
|
48302
|
-
if (compressionAlgorithmKey !== undefined) {
|
|
48303
|
-
if (isCompressionAlgorithmKey(compressionAlgorithmKey)) {
|
|
48304
|
-
const clientSelectedEncoding = compression_algorithms_1.CompressionAlgorithms[compressionAlgorithmKey];
|
|
48305
|
-
const serverSupportedEncodings = (_c = sharedFilterConfig.serverSupportedEncodingHeader) === null || _c === undefined ? undefined : _c.split(",");
|
|
48306
|
-
if (!serverSupportedEncodings || serverSupportedEncodings.includes(clientSelectedEncoding)) {
|
|
48307
|
-
this.currentCompressionAlgorithm = clientSelectedEncoding;
|
|
48308
|
-
this.sendCompression = getCompressionHandler(this.currentCompressionAlgorithm, -1);
|
|
48309
|
-
}
|
|
48684
|
+
tcpConnect(address, options) {
|
|
48685
|
+
return (0, http_proxy_1.getProxiedConnection)(address, options).then((proxiedSocket) => {
|
|
48686
|
+
if (proxiedSocket) {
|
|
48687
|
+
return proxiedSocket;
|
|
48310
48688
|
} else {
|
|
48311
|
-
|
|
48689
|
+
return new Promise((resolve, reject) => {
|
|
48690
|
+
const closeCallback = () => {
|
|
48691
|
+
reject(new Error("Socket closed"));
|
|
48692
|
+
};
|
|
48693
|
+
const errorCallback = (error) => {
|
|
48694
|
+
reject(error);
|
|
48695
|
+
};
|
|
48696
|
+
const socket = net.connect(address, () => {
|
|
48697
|
+
socket.removeListener("close", closeCallback);
|
|
48698
|
+
socket.removeListener("error", errorCallback);
|
|
48699
|
+
resolve(socket);
|
|
48700
|
+
});
|
|
48701
|
+
socket.once("close", closeCallback);
|
|
48702
|
+
socket.once("error", errorCallback);
|
|
48703
|
+
});
|
|
48312
48704
|
}
|
|
48313
|
-
}
|
|
48314
|
-
}
|
|
48315
|
-
async sendMetadata(metadata) {
|
|
48316
|
-
const headers = await metadata;
|
|
48317
|
-
headers.set("grpc-accept-encoding", "identity,deflate,gzip");
|
|
48318
|
-
headers.set("accept-encoding", "identity");
|
|
48319
|
-
if (this.currentCompressionAlgorithm === "identity") {
|
|
48320
|
-
headers.remove("grpc-encoding");
|
|
48321
|
-
} else {
|
|
48322
|
-
headers.set("grpc-encoding", this.currentCompressionAlgorithm);
|
|
48323
|
-
}
|
|
48324
|
-
return headers;
|
|
48705
|
+
});
|
|
48325
48706
|
}
|
|
48326
|
-
|
|
48327
|
-
|
|
48328
|
-
|
|
48329
|
-
const encoding = receiveEncoding[0];
|
|
48330
|
-
if (typeof encoding === "string") {
|
|
48331
|
-
this.receiveCompression = getCompressionHandler(encoding, this.maxReceiveMessageLength);
|
|
48332
|
-
}
|
|
48707
|
+
async connect(address, secureConnector, options) {
|
|
48708
|
+
if (this.isShutdown) {
|
|
48709
|
+
return Promise.reject();
|
|
48333
48710
|
}
|
|
48334
|
-
|
|
48335
|
-
|
|
48336
|
-
|
|
48337
|
-
|
|
48338
|
-
|
|
48339
|
-
|
|
48340
|
-
|
|
48341
|
-
|
|
48342
|
-
|
|
48711
|
+
let tcpConnection = null;
|
|
48712
|
+
let secureConnectResult = null;
|
|
48713
|
+
const addressString = (0, subchannel_address_1.subchannelAddressToString)(address);
|
|
48714
|
+
try {
|
|
48715
|
+
this.trace(addressString + " Waiting for secureConnector to be ready");
|
|
48716
|
+
await secureConnector.waitForReady();
|
|
48717
|
+
this.trace(addressString + " secureConnector is ready");
|
|
48718
|
+
tcpConnection = await this.tcpConnect(address, options);
|
|
48719
|
+
tcpConnection.setNoDelay();
|
|
48720
|
+
this.trace(addressString + " Established TCP connection");
|
|
48721
|
+
secureConnectResult = await secureConnector.connect(tcpConnection);
|
|
48722
|
+
this.trace(addressString + " Established secure connection");
|
|
48723
|
+
return this.createSession(secureConnectResult, address, options);
|
|
48724
|
+
} catch (e) {
|
|
48725
|
+
tcpConnection === null || tcpConnection === undefined || tcpConnection.destroy();
|
|
48726
|
+
secureConnectResult === null || secureConnectResult === undefined || secureConnectResult.socket.destroy();
|
|
48727
|
+
throw e;
|
|
48343
48728
|
}
|
|
48344
|
-
metadata.remove("grpc-accept-encoding");
|
|
48345
|
-
return metadata;
|
|
48346
48729
|
}
|
|
48347
|
-
|
|
48730
|
+
shutdown() {
|
|
48348
48731
|
var _a;
|
|
48349
|
-
|
|
48350
|
-
|
|
48351
|
-
|
|
48352
|
-
code: constants_1.Status.RESOURCE_EXHAUSTED,
|
|
48353
|
-
details: `Attempted to send message with a size larger than ${this.maxSendMessageLength}`
|
|
48354
|
-
};
|
|
48355
|
-
}
|
|
48356
|
-
let compress;
|
|
48357
|
-
if (this.sendCompression instanceof IdentityHandler) {
|
|
48358
|
-
compress = false;
|
|
48359
|
-
} else {
|
|
48360
|
-
compress = (((_a = resolvedMessage.flags) !== null && _a !== undefined ? _a : 0) & 2) === 0;
|
|
48361
|
-
}
|
|
48362
|
-
return {
|
|
48363
|
-
message: await this.sendCompression.writeMessage(resolvedMessage.message, compress),
|
|
48364
|
-
flags: resolvedMessage.flags
|
|
48365
|
-
};
|
|
48366
|
-
}
|
|
48367
|
-
async receiveMessage(message) {
|
|
48368
|
-
return this.receiveCompression.readMessage(await message);
|
|
48369
|
-
}
|
|
48370
|
-
}
|
|
48371
|
-
exports2.CompressionFilter = CompressionFilter;
|
|
48372
|
-
|
|
48373
|
-
class CompressionFilterFactory {
|
|
48374
|
-
constructor(channel, options) {
|
|
48375
|
-
this.options = options;
|
|
48376
|
-
this.sharedFilterConfig = {};
|
|
48377
|
-
}
|
|
48378
|
-
createFilter() {
|
|
48379
|
-
return new CompressionFilter(this.options, this.sharedFilterConfig);
|
|
48732
|
+
this.isShutdown = true;
|
|
48733
|
+
(_a = this.session) === null || _a === undefined || _a.close();
|
|
48734
|
+
this.session = null;
|
|
48380
48735
|
}
|
|
48381
48736
|
}
|
|
48382
|
-
exports2.
|
|
48737
|
+
exports2.Http2SubchannelConnector = Http2SubchannelConnector;
|
|
48383
48738
|
});
|
|
48384
48739
|
|
|
48385
|
-
// ../../node_modules/@grpc/grpc-js/build/src/
|
|
48386
|
-
var
|
|
48740
|
+
// ../../node_modules/@grpc/grpc-js/build/src/subchannel-pool.js
|
|
48741
|
+
var require_subchannel_pool = __commonJS((exports2) => {
|
|
48387
48742
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48388
|
-
exports2.
|
|
48389
|
-
exports2.
|
|
48390
|
-
|
|
48391
|
-
|
|
48392
|
-
|
|
48393
|
-
|
|
48394
|
-
|
|
48395
|
-
|
|
48396
|
-
|
|
48397
|
-
|
|
48398
|
-
|
|
48399
|
-
|
|
48400
|
-
|
|
48401
|
-
return minValue;
|
|
48402
|
-
}
|
|
48403
|
-
var units = [
|
|
48404
|
-
["m", 1],
|
|
48405
|
-
["S", 1000],
|
|
48406
|
-
["M", 60 * 1000],
|
|
48407
|
-
["H", 60 * 60 * 1000]
|
|
48408
|
-
];
|
|
48409
|
-
function getDeadlineTimeoutString(deadline) {
|
|
48410
|
-
const now = new Date().getTime();
|
|
48411
|
-
if (deadline instanceof Date) {
|
|
48412
|
-
deadline = deadline.getTime();
|
|
48743
|
+
exports2.SubchannelPool = undefined;
|
|
48744
|
+
exports2.getSubchannelPool = getSubchannelPool;
|
|
48745
|
+
var channel_options_1 = require_channel_options();
|
|
48746
|
+
var subchannel_1 = require_subchannel();
|
|
48747
|
+
var subchannel_address_1 = require_subchannel_address();
|
|
48748
|
+
var uri_parser_1 = require_uri_parser();
|
|
48749
|
+
var transport_1 = require_transport();
|
|
48750
|
+
var REF_CHECK_INTERVAL = 1e4;
|
|
48751
|
+
|
|
48752
|
+
class SubchannelPool {
|
|
48753
|
+
constructor() {
|
|
48754
|
+
this.pool = Object.create(null);
|
|
48755
|
+
this.cleanupTimer = null;
|
|
48413
48756
|
}
|
|
48414
|
-
|
|
48415
|
-
|
|
48416
|
-
const
|
|
48417
|
-
|
|
48418
|
-
|
|
48757
|
+
unrefUnusedSubchannels() {
|
|
48758
|
+
let allSubchannelsUnrefed = true;
|
|
48759
|
+
for (const channelTarget in this.pool) {
|
|
48760
|
+
const subchannelObjArray = this.pool[channelTarget];
|
|
48761
|
+
const refedSubchannels = subchannelObjArray.filter((value) => !value.subchannel.unrefIfOneRef());
|
|
48762
|
+
if (refedSubchannels.length > 0) {
|
|
48763
|
+
allSubchannelsUnrefed = false;
|
|
48764
|
+
}
|
|
48765
|
+
this.pool[channelTarget] = refedSubchannels;
|
|
48766
|
+
}
|
|
48767
|
+
if (allSubchannelsUnrefed && this.cleanupTimer !== null) {
|
|
48768
|
+
clearInterval(this.cleanupTimer);
|
|
48769
|
+
this.cleanupTimer = null;
|
|
48419
48770
|
}
|
|
48420
48771
|
}
|
|
48421
|
-
|
|
48422
|
-
|
|
48423
|
-
|
|
48424
|
-
|
|
48425
|
-
|
|
48426
|
-
|
|
48427
|
-
|
|
48428
|
-
|
|
48429
|
-
return 0;
|
|
48430
|
-
} else if (timeout > MAX_TIMEOUT_TIME) {
|
|
48431
|
-
return Infinity;
|
|
48432
|
-
} else {
|
|
48433
|
-
return timeout;
|
|
48772
|
+
ensureCleanupTask() {
|
|
48773
|
+
var _a, _b;
|
|
48774
|
+
if (this.cleanupTimer === null) {
|
|
48775
|
+
this.cleanupTimer = setInterval(() => {
|
|
48776
|
+
this.unrefUnusedSubchannels();
|
|
48777
|
+
}, REF_CHECK_INTERVAL);
|
|
48778
|
+
(_b = (_a = this.cleanupTimer).unref) === null || _b === undefined || _b.call(_a);
|
|
48779
|
+
}
|
|
48434
48780
|
}
|
|
48435
|
-
|
|
48436
|
-
|
|
48437
|
-
|
|
48438
|
-
|
|
48439
|
-
|
|
48440
|
-
|
|
48441
|
-
|
|
48442
|
-
|
|
48443
|
-
|
|
48444
|
-
|
|
48781
|
+
getOrCreateSubchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials) {
|
|
48782
|
+
this.ensureCleanupTask();
|
|
48783
|
+
const channelTarget = (0, uri_parser_1.uriToString)(channelTargetUri);
|
|
48784
|
+
if (channelTarget in this.pool) {
|
|
48785
|
+
const subchannelObjArray = this.pool[channelTarget];
|
|
48786
|
+
for (const subchannelObj of subchannelObjArray) {
|
|
48787
|
+
if ((0, subchannel_address_1.subchannelAddressEqual)(subchannelTarget, subchannelObj.subchannelAddress) && (0, channel_options_1.channelOptionsEqual)(channelArguments, subchannelObj.channelArguments) && channelCredentials._equals(subchannelObj.channelCredentials)) {
|
|
48788
|
+
return subchannelObj.subchannel;
|
|
48789
|
+
}
|
|
48790
|
+
}
|
|
48791
|
+
}
|
|
48792
|
+
const subchannel = new subchannel_1.Subchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials, new transport_1.Http2SubchannelConnector(channelTargetUri));
|
|
48793
|
+
if (!(channelTarget in this.pool)) {
|
|
48794
|
+
this.pool[channelTarget] = [];
|
|
48445
48795
|
}
|
|
48796
|
+
this.pool[channelTarget].push({
|
|
48797
|
+
subchannelAddress: subchannelTarget,
|
|
48798
|
+
channelArguments,
|
|
48799
|
+
channelCredentials,
|
|
48800
|
+
subchannel
|
|
48801
|
+
});
|
|
48802
|
+
subchannel.ref();
|
|
48803
|
+
return subchannel;
|
|
48446
48804
|
}
|
|
48447
48805
|
}
|
|
48448
|
-
|
|
48449
|
-
|
|
48450
|
-
|
|
48451
|
-
|
|
48452
|
-
|
|
48453
|
-
// ../../node_modules/@grpc/grpc-js/build/src/control-plane-status.js
|
|
48454
|
-
var require_control_plane_status = __commonJS((exports2) => {
|
|
48455
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48456
|
-
exports2.restrictControlPlaneStatusCode = restrictControlPlaneStatusCode;
|
|
48457
|
-
var constants_1 = require_constants6();
|
|
48458
|
-
var INAPPROPRIATE_CONTROL_PLANE_CODES = [
|
|
48459
|
-
constants_1.Status.OK,
|
|
48460
|
-
constants_1.Status.INVALID_ARGUMENT,
|
|
48461
|
-
constants_1.Status.NOT_FOUND,
|
|
48462
|
-
constants_1.Status.ALREADY_EXISTS,
|
|
48463
|
-
constants_1.Status.FAILED_PRECONDITION,
|
|
48464
|
-
constants_1.Status.ABORTED,
|
|
48465
|
-
constants_1.Status.OUT_OF_RANGE,
|
|
48466
|
-
constants_1.Status.DATA_LOSS
|
|
48467
|
-
];
|
|
48468
|
-
function restrictControlPlaneStatusCode(code, details) {
|
|
48469
|
-
if (INAPPROPRIATE_CONTROL_PLANE_CODES.includes(code)) {
|
|
48470
|
-
return {
|
|
48471
|
-
code: constants_1.Status.INTERNAL,
|
|
48472
|
-
details: `Invalid status from control plane: ${code} ${constants_1.Status[code]} ${details}`
|
|
48473
|
-
};
|
|
48806
|
+
exports2.SubchannelPool = SubchannelPool;
|
|
48807
|
+
var globalSubchannelPool = new SubchannelPool;
|
|
48808
|
+
function getSubchannelPool(global2) {
|
|
48809
|
+
if (global2) {
|
|
48810
|
+
return globalSubchannelPool;
|
|
48474
48811
|
} else {
|
|
48475
|
-
return
|
|
48812
|
+
return new SubchannelPool;
|
|
48476
48813
|
}
|
|
48477
48814
|
}
|
|
48478
48815
|
});
|
|
@@ -48550,7 +48887,7 @@ var require_load_balancing_call = __commonJS((exports2) => {
|
|
|
48550
48887
|
this.trace("ended with status: code=" + status.code + ' details="' + status.details + '" start time=' + this.startTime.toISOString());
|
|
48551
48888
|
const finalStatus = Object.assign(Object.assign({}, status), { progress });
|
|
48552
48889
|
(_a = this.listener) === null || _a === undefined || _a.onReceiveStatus(finalStatus);
|
|
48553
|
-
(_b = this.onCallEnded) === null || _b === undefined || _b.call(this, finalStatus.code);
|
|
48890
|
+
(_b = this.onCallEnded) === null || _b === undefined || _b.call(this, finalStatus.code, finalStatus.details, finalStatus.metadata);
|
|
48554
48891
|
}
|
|
48555
48892
|
}
|
|
48556
48893
|
doPick() {
|
|
@@ -48707,6 +49044,13 @@ var require_load_balancing_call = __commonJS((exports2) => {
|
|
|
48707
49044
|
getCallNumber() {
|
|
48708
49045
|
return this.callNumber;
|
|
48709
49046
|
}
|
|
49047
|
+
getAuthContext() {
|
|
49048
|
+
if (this.child) {
|
|
49049
|
+
return this.child.getAuthContext();
|
|
49050
|
+
} else {
|
|
49051
|
+
return null;
|
|
49052
|
+
}
|
|
49053
|
+
}
|
|
48710
49054
|
}
|
|
48711
49055
|
exports2.LoadBalancingCall = LoadBalancingCall;
|
|
48712
49056
|
});
|
|
@@ -48982,6 +49326,13 @@ var require_resolving_call = __commonJS((exports2) => {
|
|
|
48982
49326
|
getCallNumber() {
|
|
48983
49327
|
return this.callNumber;
|
|
48984
49328
|
}
|
|
49329
|
+
getAuthContext() {
|
|
49330
|
+
if (this.child) {
|
|
49331
|
+
return this.child.getAuthContext();
|
|
49332
|
+
} else {
|
|
49333
|
+
return null;
|
|
49334
|
+
}
|
|
49335
|
+
}
|
|
48985
49336
|
}
|
|
48986
49337
|
exports2.ResolvingCall = ResolvingCall;
|
|
48987
49338
|
});
|
|
@@ -49226,13 +49577,17 @@ var require_retrying_call = __commonJS((exports2) => {
|
|
|
49226
49577
|
return value === code || value.toString().toLowerCase() === ((_a = constants_1.Status[code]) === null || _a === undefined ? undefined : _a.toLowerCase());
|
|
49227
49578
|
});
|
|
49228
49579
|
}
|
|
49580
|
+
getNextRetryJitter() {
|
|
49581
|
+
return Math.random() * (1.2 - 0.8) + 0.8;
|
|
49582
|
+
}
|
|
49229
49583
|
getNextRetryBackoffMs() {
|
|
49230
49584
|
var _a;
|
|
49231
49585
|
const retryPolicy = (_a = this.callConfig) === null || _a === undefined ? undefined : _a.methodConfig.retryPolicy;
|
|
49232
49586
|
if (!retryPolicy) {
|
|
49233
49587
|
return 0;
|
|
49234
49588
|
}
|
|
49235
|
-
const
|
|
49589
|
+
const jitter = this.getNextRetryJitter();
|
|
49590
|
+
const nextBackoffMs = jitter * this.nextRetryBackoffSec * 1000;
|
|
49236
49591
|
const maxBackoffSec = Number(retryPolicy.maxBackoff.substring(0, retryPolicy.maxBackoff.length - 1));
|
|
49237
49592
|
this.nextRetryBackoffSec = Math.min(this.nextRetryBackoffSec * retryPolicy.backoffMultiplier, maxBackoffSec);
|
|
49238
49593
|
return nextBackoffMs;
|
|
@@ -49586,6 +49941,13 @@ var require_retrying_call = __commonJS((exports2) => {
|
|
|
49586
49941
|
getHost() {
|
|
49587
49942
|
return this.host;
|
|
49588
49943
|
}
|
|
49944
|
+
getAuthContext() {
|
|
49945
|
+
if (this.committedCallIndex !== null) {
|
|
49946
|
+
return this.underlyingCalls[this.committedCallIndex].call.getAuthContext();
|
|
49947
|
+
} else {
|
|
49948
|
+
return null;
|
|
49949
|
+
}
|
|
49950
|
+
}
|
|
49589
49951
|
}
|
|
49590
49952
|
exports2.RetryingCall = RetryingCall;
|
|
49591
49953
|
});
|
|
@@ -49600,6 +49962,8 @@ var require_subchannel_interface = __commonJS((exports2) => {
|
|
|
49600
49962
|
this.child = child;
|
|
49601
49963
|
this.healthy = true;
|
|
49602
49964
|
this.healthListeners = new Set;
|
|
49965
|
+
this.refcount = 0;
|
|
49966
|
+
this.dataWatchers = new Set;
|
|
49603
49967
|
child.addHealthStateWatcher((childHealthy) => {
|
|
49604
49968
|
if (this.healthy) {
|
|
49605
49969
|
this.updateHealthListeners();
|
|
@@ -49631,9 +49995,19 @@ var require_subchannel_interface = __commonJS((exports2) => {
|
|
|
49631
49995
|
}
|
|
49632
49996
|
ref() {
|
|
49633
49997
|
this.child.ref();
|
|
49998
|
+
this.refcount += 1;
|
|
49634
49999
|
}
|
|
49635
50000
|
unref() {
|
|
49636
50001
|
this.child.unref();
|
|
50002
|
+
this.refcount -= 1;
|
|
50003
|
+
if (this.refcount === 0) {
|
|
50004
|
+
this.destroy();
|
|
50005
|
+
}
|
|
50006
|
+
}
|
|
50007
|
+
destroy() {
|
|
50008
|
+
for (const watcher of this.dataWatchers) {
|
|
50009
|
+
watcher.destroy();
|
|
50010
|
+
}
|
|
49637
50011
|
}
|
|
49638
50012
|
getChannelzRef() {
|
|
49639
50013
|
return this.child.getChannelzRef();
|
|
@@ -49647,6 +50021,10 @@ var require_subchannel_interface = __commonJS((exports2) => {
|
|
|
49647
50021
|
removeHealthStateWatcher(listener) {
|
|
49648
50022
|
this.healthListeners.delete(listener);
|
|
49649
50023
|
}
|
|
50024
|
+
addDataWatcher(dataWatcher) {
|
|
50025
|
+
dataWatcher.setSubchannel(this.getRealSubchannel());
|
|
50026
|
+
this.dataWatchers.add(dataWatcher);
|
|
50027
|
+
}
|
|
49650
50028
|
setHealthy(healthy) {
|
|
49651
50029
|
if (healthy !== this.healthy) {
|
|
49652
50030
|
this.healthy = healthy;
|
|
@@ -49664,6 +50042,9 @@ var require_subchannel_interface = __commonJS((exports2) => {
|
|
|
49664
50042
|
getCallCredentials() {
|
|
49665
50043
|
return this.child.getCallCredentials();
|
|
49666
50044
|
}
|
|
50045
|
+
getChannel() {
|
|
50046
|
+
return this.child.getChannel();
|
|
50047
|
+
}
|
|
49667
50048
|
}
|
|
49668
50049
|
exports2.BaseSubchannelWrapper = BaseSubchannelWrapper;
|
|
49669
50050
|
});
|
|
@@ -50278,6 +50659,12 @@ var require_server_call = __commonJS((exports2) => {
|
|
|
50278
50659
|
getHost() {
|
|
50279
50660
|
return this.call.getHost();
|
|
50280
50661
|
}
|
|
50662
|
+
getAuthContext() {
|
|
50663
|
+
return this.call.getAuthContext();
|
|
50664
|
+
}
|
|
50665
|
+
getMetricsRecorder() {
|
|
50666
|
+
return this.call.getMetricsRecorder();
|
|
50667
|
+
}
|
|
50281
50668
|
}
|
|
50282
50669
|
exports2.ServerUnaryCallImpl = ServerUnaryCallImpl;
|
|
50283
50670
|
|
|
@@ -50307,6 +50694,12 @@ var require_server_call = __commonJS((exports2) => {
|
|
|
50307
50694
|
getHost() {
|
|
50308
50695
|
return this.call.getHost();
|
|
50309
50696
|
}
|
|
50697
|
+
getAuthContext() {
|
|
50698
|
+
return this.call.getAuthContext();
|
|
50699
|
+
}
|
|
50700
|
+
getMetricsRecorder() {
|
|
50701
|
+
return this.call.getMetricsRecorder();
|
|
50702
|
+
}
|
|
50310
50703
|
}
|
|
50311
50704
|
exports2.ServerReadableStreamImpl = ServerReadableStreamImpl;
|
|
50312
50705
|
|
|
@@ -50343,6 +50736,12 @@ var require_server_call = __commonJS((exports2) => {
|
|
|
50343
50736
|
getHost() {
|
|
50344
50737
|
return this.call.getHost();
|
|
50345
50738
|
}
|
|
50739
|
+
getAuthContext() {
|
|
50740
|
+
return this.call.getAuthContext();
|
|
50741
|
+
}
|
|
50742
|
+
getMetricsRecorder() {
|
|
50743
|
+
return this.call.getMetricsRecorder();
|
|
50744
|
+
}
|
|
50346
50745
|
_write(chunk, encoding, callback) {
|
|
50347
50746
|
this.call.sendMessage(chunk, callback);
|
|
50348
50747
|
}
|
|
@@ -50392,6 +50791,12 @@ var require_server_call = __commonJS((exports2) => {
|
|
|
50392
50791
|
getHost() {
|
|
50393
50792
|
return this.call.getHost();
|
|
50394
50793
|
}
|
|
50794
|
+
getAuthContext() {
|
|
50795
|
+
return this.call.getAuthContext();
|
|
50796
|
+
}
|
|
50797
|
+
getMetricsRecorder() {
|
|
50798
|
+
return this.call.getMetricsRecorder();
|
|
50799
|
+
}
|
|
50395
50800
|
_read(size) {
|
|
50396
50801
|
this.call.startRead();
|
|
50397
50802
|
}
|
|
@@ -50699,6 +51104,327 @@ var require_server_credentials = __commonJS((exports2) => {
|
|
|
50699
51104
|
}
|
|
50700
51105
|
});
|
|
50701
51106
|
|
|
51107
|
+
// ../../node_modules/@grpc/grpc-js/build/src/duration.js
|
|
51108
|
+
var require_duration = __commonJS((exports2) => {
|
|
51109
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
51110
|
+
exports2.durationMessageToDuration = durationMessageToDuration;
|
|
51111
|
+
exports2.msToDuration = msToDuration;
|
|
51112
|
+
exports2.durationToMs = durationToMs;
|
|
51113
|
+
exports2.isDuration = isDuration;
|
|
51114
|
+
exports2.isDurationMessage = isDurationMessage;
|
|
51115
|
+
exports2.parseDuration = parseDuration;
|
|
51116
|
+
exports2.durationToString = durationToString;
|
|
51117
|
+
function durationMessageToDuration(message) {
|
|
51118
|
+
return {
|
|
51119
|
+
seconds: Number.parseInt(message.seconds),
|
|
51120
|
+
nanos: message.nanos
|
|
51121
|
+
};
|
|
51122
|
+
}
|
|
51123
|
+
function msToDuration(millis) {
|
|
51124
|
+
return {
|
|
51125
|
+
seconds: millis / 1000 | 0,
|
|
51126
|
+
nanos: millis % 1000 * 1e6 | 0
|
|
51127
|
+
};
|
|
51128
|
+
}
|
|
51129
|
+
function durationToMs(duration) {
|
|
51130
|
+
return duration.seconds * 1000 + duration.nanos / 1e6 | 0;
|
|
51131
|
+
}
|
|
51132
|
+
function isDuration(value) {
|
|
51133
|
+
return typeof value.seconds === "number" && typeof value.nanos === "number";
|
|
51134
|
+
}
|
|
51135
|
+
function isDurationMessage(value) {
|
|
51136
|
+
return typeof value.seconds === "string" && typeof value.nanos === "number";
|
|
51137
|
+
}
|
|
51138
|
+
var durationRegex = /^(\d+)(?:\.(\d+))?s$/;
|
|
51139
|
+
function parseDuration(value) {
|
|
51140
|
+
const match = value.match(durationRegex);
|
|
51141
|
+
if (!match) {
|
|
51142
|
+
return null;
|
|
51143
|
+
}
|
|
51144
|
+
return {
|
|
51145
|
+
seconds: Number.parseInt(match[1], 10),
|
|
51146
|
+
nanos: match[2] ? Number.parseInt(match[2].padEnd(9, "0"), 10) : 0
|
|
51147
|
+
};
|
|
51148
|
+
}
|
|
51149
|
+
function durationToString(duration) {
|
|
51150
|
+
if (duration.nanos === 0) {
|
|
51151
|
+
return `${duration.seconds}s`;
|
|
51152
|
+
}
|
|
51153
|
+
let scaleFactor;
|
|
51154
|
+
if (duration.nanos % 1e6 === 0) {
|
|
51155
|
+
scaleFactor = 1e6;
|
|
51156
|
+
} else if (duration.nanos % 1000 === 0) {
|
|
51157
|
+
scaleFactor = 1000;
|
|
51158
|
+
} else {
|
|
51159
|
+
scaleFactor = 1;
|
|
51160
|
+
}
|
|
51161
|
+
return `${duration.seconds}.${duration.nanos / scaleFactor}s`;
|
|
51162
|
+
}
|
|
51163
|
+
});
|
|
51164
|
+
|
|
51165
|
+
// ../../node_modules/@grpc/grpc-js/build/src/orca.js
|
|
51166
|
+
var require_orca = __commonJS((exports2) => {
|
|
51167
|
+
var __dirname = "/home/runner/work/publisher/publisher/node_modules/@grpc/grpc-js/build/src";
|
|
51168
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
51169
|
+
exports2.OrcaOobMetricsSubchannelWrapper = exports2.GRPC_METRICS_HEADER = exports2.ServerMetricRecorder = exports2.PerRequestMetricRecorder = undefined;
|
|
51170
|
+
exports2.createOrcaClient = createOrcaClient;
|
|
51171
|
+
exports2.createMetricsReader = createMetricsReader;
|
|
51172
|
+
var make_client_1 = require_make_client();
|
|
51173
|
+
var duration_1 = require_duration();
|
|
51174
|
+
var channel_credentials_1 = require_channel_credentials();
|
|
51175
|
+
var subchannel_interface_1 = require_subchannel_interface();
|
|
51176
|
+
var constants_1 = require_constants6();
|
|
51177
|
+
var backoff_timeout_1 = require_backoff_timeout();
|
|
51178
|
+
var connectivity_state_1 = require_connectivity_state();
|
|
51179
|
+
var loadedOrcaProto = null;
|
|
51180
|
+
function loadOrcaProto() {
|
|
51181
|
+
if (loadedOrcaProto) {
|
|
51182
|
+
return loadedOrcaProto;
|
|
51183
|
+
}
|
|
51184
|
+
const loaderLoadSync = require_src25().loadSync;
|
|
51185
|
+
const loadedProto = loaderLoadSync("xds/service/orca/v3/orca.proto", {
|
|
51186
|
+
keepCase: true,
|
|
51187
|
+
longs: String,
|
|
51188
|
+
enums: String,
|
|
51189
|
+
defaults: true,
|
|
51190
|
+
oneofs: true,
|
|
51191
|
+
includeDirs: [
|
|
51192
|
+
`${__dirname}/../../proto/xds`,
|
|
51193
|
+
`${__dirname}/../../proto/protoc-gen-validate`
|
|
51194
|
+
]
|
|
51195
|
+
});
|
|
51196
|
+
return (0, make_client_1.loadPackageDefinition)(loadedProto);
|
|
51197
|
+
}
|
|
51198
|
+
|
|
51199
|
+
class PerRequestMetricRecorder {
|
|
51200
|
+
constructor() {
|
|
51201
|
+
this.message = {};
|
|
51202
|
+
}
|
|
51203
|
+
recordRequestCostMetric(name, value) {
|
|
51204
|
+
if (!this.message.request_cost) {
|
|
51205
|
+
this.message.request_cost = {};
|
|
51206
|
+
}
|
|
51207
|
+
this.message.request_cost[name] = value;
|
|
51208
|
+
}
|
|
51209
|
+
recordUtilizationMetric(name, value) {
|
|
51210
|
+
if (!this.message.utilization) {
|
|
51211
|
+
this.message.utilization = {};
|
|
51212
|
+
}
|
|
51213
|
+
this.message.utilization[name] = value;
|
|
51214
|
+
}
|
|
51215
|
+
recordNamedMetric(name, value) {
|
|
51216
|
+
if (!this.message.named_metrics) {
|
|
51217
|
+
this.message.named_metrics = {};
|
|
51218
|
+
}
|
|
51219
|
+
this.message.named_metrics[name] = value;
|
|
51220
|
+
}
|
|
51221
|
+
recordCPUUtilizationMetric(value) {
|
|
51222
|
+
this.message.cpu_utilization = value;
|
|
51223
|
+
}
|
|
51224
|
+
recordMemoryUtilizationMetric(value) {
|
|
51225
|
+
this.message.mem_utilization = value;
|
|
51226
|
+
}
|
|
51227
|
+
recordApplicationUtilizationMetric(value) {
|
|
51228
|
+
this.message.application_utilization = value;
|
|
51229
|
+
}
|
|
51230
|
+
recordQpsMetric(value) {
|
|
51231
|
+
this.message.rps_fractional = value;
|
|
51232
|
+
}
|
|
51233
|
+
recordEpsMetric(value) {
|
|
51234
|
+
this.message.eps = value;
|
|
51235
|
+
}
|
|
51236
|
+
serialize() {
|
|
51237
|
+
const orcaProto = loadOrcaProto();
|
|
51238
|
+
return orcaProto.xds.data.orca.v3.OrcaLoadReport.serialize(this.message);
|
|
51239
|
+
}
|
|
51240
|
+
}
|
|
51241
|
+
exports2.PerRequestMetricRecorder = PerRequestMetricRecorder;
|
|
51242
|
+
var DEFAULT_REPORT_INTERVAL_MS = 30000;
|
|
51243
|
+
|
|
51244
|
+
class ServerMetricRecorder {
|
|
51245
|
+
constructor() {
|
|
51246
|
+
this.message = {};
|
|
51247
|
+
this.serviceImplementation = {
|
|
51248
|
+
StreamCoreMetrics: (call) => {
|
|
51249
|
+
const reportInterval = call.request.report_interval ? (0, duration_1.durationToMs)((0, duration_1.durationMessageToDuration)(call.request.report_interval)) : DEFAULT_REPORT_INTERVAL_MS;
|
|
51250
|
+
const reportTimer = setInterval(() => {
|
|
51251
|
+
call.write(this.message);
|
|
51252
|
+
}, reportInterval);
|
|
51253
|
+
call.on("cancelled", () => {
|
|
51254
|
+
clearInterval(reportTimer);
|
|
51255
|
+
});
|
|
51256
|
+
}
|
|
51257
|
+
};
|
|
51258
|
+
}
|
|
51259
|
+
putUtilizationMetric(name, value) {
|
|
51260
|
+
if (!this.message.utilization) {
|
|
51261
|
+
this.message.utilization = {};
|
|
51262
|
+
}
|
|
51263
|
+
this.message.utilization[name] = value;
|
|
51264
|
+
}
|
|
51265
|
+
setAllUtilizationMetrics(metrics) {
|
|
51266
|
+
this.message.utilization = Object.assign({}, metrics);
|
|
51267
|
+
}
|
|
51268
|
+
deleteUtilizationMetric(name) {
|
|
51269
|
+
var _a;
|
|
51270
|
+
(_a = this.message.utilization) === null || _a === undefined || delete _a[name];
|
|
51271
|
+
}
|
|
51272
|
+
setCpuUtilizationMetric(value) {
|
|
51273
|
+
this.message.cpu_utilization = value;
|
|
51274
|
+
}
|
|
51275
|
+
deleteCpuUtilizationMetric() {
|
|
51276
|
+
delete this.message.cpu_utilization;
|
|
51277
|
+
}
|
|
51278
|
+
setApplicationUtilizationMetric(value) {
|
|
51279
|
+
this.message.application_utilization = value;
|
|
51280
|
+
}
|
|
51281
|
+
deleteApplicationUtilizationMetric() {
|
|
51282
|
+
delete this.message.application_utilization;
|
|
51283
|
+
}
|
|
51284
|
+
setQpsMetric(value) {
|
|
51285
|
+
this.message.rps_fractional = value;
|
|
51286
|
+
}
|
|
51287
|
+
deleteQpsMetric() {
|
|
51288
|
+
delete this.message.rps_fractional;
|
|
51289
|
+
}
|
|
51290
|
+
setEpsMetric(value) {
|
|
51291
|
+
this.message.eps = value;
|
|
51292
|
+
}
|
|
51293
|
+
deleteEpsMetric() {
|
|
51294
|
+
delete this.message.eps;
|
|
51295
|
+
}
|
|
51296
|
+
addToServer(server) {
|
|
51297
|
+
const serviceDefinition = loadOrcaProto().xds.service.orca.v3.OpenRcaService.service;
|
|
51298
|
+
server.addService(serviceDefinition, this.serviceImplementation);
|
|
51299
|
+
}
|
|
51300
|
+
}
|
|
51301
|
+
exports2.ServerMetricRecorder = ServerMetricRecorder;
|
|
51302
|
+
function createOrcaClient(channel) {
|
|
51303
|
+
const ClientClass = loadOrcaProto().xds.service.orca.v3.OpenRcaService;
|
|
51304
|
+
return new ClientClass("unused", channel_credentials_1.ChannelCredentials.createInsecure(), { channelOverride: channel });
|
|
51305
|
+
}
|
|
51306
|
+
exports2.GRPC_METRICS_HEADER = "endpoint-load-metrics-bin";
|
|
51307
|
+
var PARSED_LOAD_REPORT_KEY = "grpc_orca_load_report";
|
|
51308
|
+
function createMetricsReader(listener, previousOnCallEnded) {
|
|
51309
|
+
return (code, details, metadata) => {
|
|
51310
|
+
let parsedLoadReport = metadata.getOpaque(PARSED_LOAD_REPORT_KEY);
|
|
51311
|
+
if (parsedLoadReport) {
|
|
51312
|
+
listener(parsedLoadReport);
|
|
51313
|
+
} else {
|
|
51314
|
+
const serializedLoadReport = metadata.get(exports2.GRPC_METRICS_HEADER);
|
|
51315
|
+
if (serializedLoadReport.length > 0) {
|
|
51316
|
+
const orcaProto = loadOrcaProto();
|
|
51317
|
+
parsedLoadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(serializedLoadReport[0]);
|
|
51318
|
+
listener(parsedLoadReport);
|
|
51319
|
+
metadata.setOpaque(PARSED_LOAD_REPORT_KEY, parsedLoadReport);
|
|
51320
|
+
}
|
|
51321
|
+
}
|
|
51322
|
+
if (previousOnCallEnded) {
|
|
51323
|
+
previousOnCallEnded(code, details, metadata);
|
|
51324
|
+
}
|
|
51325
|
+
};
|
|
51326
|
+
}
|
|
51327
|
+
var DATA_PRODUCER_KEY = "orca_oob_metrics";
|
|
51328
|
+
|
|
51329
|
+
class OobMetricsDataWatcher {
|
|
51330
|
+
constructor(metricsListener, intervalMs) {
|
|
51331
|
+
this.metricsListener = metricsListener;
|
|
51332
|
+
this.intervalMs = intervalMs;
|
|
51333
|
+
this.dataProducer = null;
|
|
51334
|
+
}
|
|
51335
|
+
setSubchannel(subchannel) {
|
|
51336
|
+
const producer = subchannel.getOrCreateDataProducer(DATA_PRODUCER_KEY, createOobMetricsDataProducer);
|
|
51337
|
+
this.dataProducer = producer;
|
|
51338
|
+
producer.addDataWatcher(this);
|
|
51339
|
+
}
|
|
51340
|
+
destroy() {
|
|
51341
|
+
var _a;
|
|
51342
|
+
(_a = this.dataProducer) === null || _a === undefined || _a.removeDataWatcher(this);
|
|
51343
|
+
}
|
|
51344
|
+
getInterval() {
|
|
51345
|
+
return this.intervalMs;
|
|
51346
|
+
}
|
|
51347
|
+
onMetricsUpdate(metrics) {
|
|
51348
|
+
this.metricsListener(metrics);
|
|
51349
|
+
}
|
|
51350
|
+
}
|
|
51351
|
+
|
|
51352
|
+
class OobMetricsDataProducer {
|
|
51353
|
+
constructor(subchannel) {
|
|
51354
|
+
this.subchannel = subchannel;
|
|
51355
|
+
this.dataWatchers = new Set;
|
|
51356
|
+
this.orcaSupported = true;
|
|
51357
|
+
this.metricsCall = null;
|
|
51358
|
+
this.currentInterval = Infinity;
|
|
51359
|
+
this.backoffTimer = new backoff_timeout_1.BackoffTimeout(() => this.updateMetricsSubscription());
|
|
51360
|
+
this.subchannelStateListener = () => this.updateMetricsSubscription();
|
|
51361
|
+
const channel = subchannel.getChannel();
|
|
51362
|
+
this.client = createOrcaClient(channel);
|
|
51363
|
+
subchannel.addConnectivityStateListener(this.subchannelStateListener);
|
|
51364
|
+
}
|
|
51365
|
+
addDataWatcher(dataWatcher) {
|
|
51366
|
+
this.dataWatchers.add(dataWatcher);
|
|
51367
|
+
this.updateMetricsSubscription();
|
|
51368
|
+
}
|
|
51369
|
+
removeDataWatcher(dataWatcher) {
|
|
51370
|
+
var _a;
|
|
51371
|
+
this.dataWatchers.delete(dataWatcher);
|
|
51372
|
+
if (this.dataWatchers.size === 0) {
|
|
51373
|
+
this.subchannel.removeDataProducer(DATA_PRODUCER_KEY);
|
|
51374
|
+
(_a = this.metricsCall) === null || _a === undefined || _a.cancel();
|
|
51375
|
+
this.metricsCall = null;
|
|
51376
|
+
this.client.close();
|
|
51377
|
+
this.subchannel.removeConnectivityStateListener(this.subchannelStateListener);
|
|
51378
|
+
} else {
|
|
51379
|
+
this.updateMetricsSubscription();
|
|
51380
|
+
}
|
|
51381
|
+
}
|
|
51382
|
+
updateMetricsSubscription() {
|
|
51383
|
+
var _a;
|
|
51384
|
+
if (this.dataWatchers.size === 0 || !this.orcaSupported || this.subchannel.getConnectivityState() !== connectivity_state_1.ConnectivityState.READY) {
|
|
51385
|
+
return;
|
|
51386
|
+
}
|
|
51387
|
+
const newInterval = Math.min(...Array.from(this.dataWatchers).map((watcher) => watcher.getInterval()));
|
|
51388
|
+
if (!this.metricsCall || newInterval !== this.currentInterval) {
|
|
51389
|
+
(_a = this.metricsCall) === null || _a === undefined || _a.cancel();
|
|
51390
|
+
this.currentInterval = newInterval;
|
|
51391
|
+
const metricsCall = this.client.streamCoreMetrics({ report_interval: (0, duration_1.msToDuration)(newInterval) });
|
|
51392
|
+
this.metricsCall = metricsCall;
|
|
51393
|
+
metricsCall.on("data", (report) => {
|
|
51394
|
+
this.dataWatchers.forEach((watcher) => {
|
|
51395
|
+
watcher.onMetricsUpdate(report);
|
|
51396
|
+
});
|
|
51397
|
+
});
|
|
51398
|
+
metricsCall.on("error", (error) => {
|
|
51399
|
+
this.metricsCall = null;
|
|
51400
|
+
if (error.code === constants_1.Status.UNIMPLEMENTED) {
|
|
51401
|
+
this.orcaSupported = false;
|
|
51402
|
+
return;
|
|
51403
|
+
}
|
|
51404
|
+
if (error.code === constants_1.Status.CANCELLED) {
|
|
51405
|
+
return;
|
|
51406
|
+
}
|
|
51407
|
+
this.backoffTimer.runOnce();
|
|
51408
|
+
});
|
|
51409
|
+
}
|
|
51410
|
+
}
|
|
51411
|
+
}
|
|
51412
|
+
|
|
51413
|
+
class OrcaOobMetricsSubchannelWrapper extends subchannel_interface_1.BaseSubchannelWrapper {
|
|
51414
|
+
constructor(child, metricsListener, intervalMs) {
|
|
51415
|
+
super(child);
|
|
51416
|
+
this.addDataWatcher(new OobMetricsDataWatcher(metricsListener, intervalMs));
|
|
51417
|
+
}
|
|
51418
|
+
getWrappedSubchannel() {
|
|
51419
|
+
return this.child;
|
|
51420
|
+
}
|
|
51421
|
+
}
|
|
51422
|
+
exports2.OrcaOobMetricsSubchannelWrapper = OrcaOobMetricsSubchannelWrapper;
|
|
51423
|
+
function createOobMetricsDataProducer(subchannel) {
|
|
51424
|
+
return new OobMetricsDataProducer(subchannel);
|
|
51425
|
+
}
|
|
51426
|
+
});
|
|
51427
|
+
|
|
50702
51428
|
// ../../node_modules/@grpc/grpc-js/build/src/server-interceptors.js
|
|
50703
51429
|
var require_server_interceptors = __commonJS((exports2) => {
|
|
50704
51430
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -50712,6 +51438,8 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
50712
51438
|
var zlib = require("zlib");
|
|
50713
51439
|
var stream_decoder_1 = require_stream_decoder();
|
|
50714
51440
|
var logging = require_logging();
|
|
51441
|
+
var tls_1 = require("tls");
|
|
51442
|
+
var orca_1 = require_orca();
|
|
50715
51443
|
var TRACER_NAME = "server_call";
|
|
50716
51444
|
function trace(text) {
|
|
50717
51445
|
logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);
|
|
@@ -50983,6 +51711,15 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
50983
51711
|
getHost() {
|
|
50984
51712
|
return this.nextCall.getHost();
|
|
50985
51713
|
}
|
|
51714
|
+
getAuthContext() {
|
|
51715
|
+
return this.nextCall.getAuthContext();
|
|
51716
|
+
}
|
|
51717
|
+
getConnectionInfo() {
|
|
51718
|
+
return this.nextCall.getConnectionInfo();
|
|
51719
|
+
}
|
|
51720
|
+
getMetricsRecorder() {
|
|
51721
|
+
return this.nextCall.getMetricsRecorder();
|
|
51722
|
+
}
|
|
50986
51723
|
}
|
|
50987
51724
|
exports2.ServerInterceptingCall = ServerInterceptingCall;
|
|
50988
51725
|
var GRPC_ACCEPT_ENCODING_HEADER = "grpc-accept-encoding";
|
|
@@ -51013,7 +51750,7 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
51013
51750
|
|
|
51014
51751
|
class BaseServerInterceptingCall {
|
|
51015
51752
|
constructor(stream, headers, callEventTracker, handler, options) {
|
|
51016
|
-
var _a;
|
|
51753
|
+
var _a, _b;
|
|
51017
51754
|
this.stream = stream;
|
|
51018
51755
|
this.callEventTracker = callEventTracker;
|
|
51019
51756
|
this.handler = handler;
|
|
@@ -51031,6 +51768,7 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
51031
51768
|
this.isReadPending = false;
|
|
51032
51769
|
this.receivedHalfClose = false;
|
|
51033
51770
|
this.streamEnded = false;
|
|
51771
|
+
this.metricsRecorder = new orca_1.PerRequestMetricRecorder;
|
|
51034
51772
|
this.stream.once("error", (err) => {});
|
|
51035
51773
|
this.stream.once("close", () => {
|
|
51036
51774
|
var _a2;
|
|
@@ -51080,6 +51818,14 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
51080
51818
|
metadata.remove(http2.constants.HTTP2_HEADER_TE);
|
|
51081
51819
|
metadata.remove(http2.constants.HTTP2_HEADER_CONTENT_TYPE);
|
|
51082
51820
|
this.metadata = metadata;
|
|
51821
|
+
const socket = (_b = stream.session) === null || _b === undefined ? undefined : _b.socket;
|
|
51822
|
+
this.connectionInfo = {
|
|
51823
|
+
localAddress: socket === null || socket === undefined ? undefined : socket.localAddress,
|
|
51824
|
+
localPort: socket === null || socket === undefined ? undefined : socket.localPort,
|
|
51825
|
+
remoteAddress: socket === null || socket === undefined ? undefined : socket.remoteAddress,
|
|
51826
|
+
remotePort: socket === null || socket === undefined ? undefined : socket.remotePort
|
|
51827
|
+
};
|
|
51828
|
+
this.shouldSendMetrics = !!options["grpc.server_call_metric_recording"];
|
|
51083
51829
|
}
|
|
51084
51830
|
handleTimeoutHeader(timeoutHeader) {
|
|
51085
51831
|
const match = timeoutHeader.toString().match(DEADLINE_REGEX);
|
|
@@ -51310,22 +52056,25 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
51310
52056
|
});
|
|
51311
52057
|
}
|
|
51312
52058
|
sendStatus(status) {
|
|
51313
|
-
var _a, _b;
|
|
52059
|
+
var _a, _b, _c;
|
|
51314
52060
|
if (this.checkCancelled()) {
|
|
51315
52061
|
return;
|
|
51316
52062
|
}
|
|
51317
52063
|
trace("Request to method " + ((_a = this.handler) === null || _a === undefined ? undefined : _a.path) + " ended with status code: " + constants_1.Status[status.code] + " details: " + status.details);
|
|
52064
|
+
const statusMetadata = (_c = (_b = status.metadata) === null || _b === undefined ? undefined : _b.clone()) !== null && _c !== undefined ? _c : new metadata_1.Metadata;
|
|
52065
|
+
if (this.shouldSendMetrics) {
|
|
52066
|
+
statusMetadata.set(orca_1.GRPC_METRICS_HEADER, this.metricsRecorder.serialize());
|
|
52067
|
+
}
|
|
51318
52068
|
if (this.metadataSent) {
|
|
51319
52069
|
if (!this.wantTrailers) {
|
|
51320
52070
|
this.wantTrailers = true;
|
|
51321
52071
|
this.stream.once("wantTrailers", () => {
|
|
51322
|
-
var _a2;
|
|
51323
52072
|
if (this.callEventTracker && !this.streamEnded) {
|
|
51324
52073
|
this.streamEnded = true;
|
|
51325
52074
|
this.callEventTracker.onStreamEnd(true);
|
|
51326
52075
|
this.callEventTracker.onCallEnd(status);
|
|
51327
52076
|
}
|
|
51328
|
-
const trailersToSend = Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) },
|
|
52077
|
+
const trailersToSend = Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) }, statusMetadata.toHttp2Headers());
|
|
51329
52078
|
this.stream.sendTrailers(trailersToSend);
|
|
51330
52079
|
this.notifyOnCancel();
|
|
51331
52080
|
});
|
|
@@ -51339,7 +52088,7 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
51339
52088
|
this.callEventTracker.onStreamEnd(true);
|
|
51340
52089
|
this.callEventTracker.onCallEnd(status);
|
|
51341
52090
|
}
|
|
51342
|
-
const trailersToSend = Object.assign(Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) }, defaultResponseHeaders),
|
|
52091
|
+
const trailersToSend = Object.assign(Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) }, defaultResponseHeaders), statusMetadata.toHttp2Headers());
|
|
51343
52092
|
this.stream.respond(trailersToSend, { endStream: true });
|
|
51344
52093
|
this.notifyOnCancel();
|
|
51345
52094
|
}
|
|
@@ -51377,6 +52126,24 @@ var require_server_interceptors = __commonJS((exports2) => {
|
|
|
51377
52126
|
getHost() {
|
|
51378
52127
|
return this.host;
|
|
51379
52128
|
}
|
|
52129
|
+
getAuthContext() {
|
|
52130
|
+
var _a;
|
|
52131
|
+
if (((_a = this.stream.session) === null || _a === undefined ? undefined : _a.socket) instanceof tls_1.TLSSocket) {
|
|
52132
|
+
const peerCertificate = this.stream.session.socket.getPeerCertificate();
|
|
52133
|
+
return {
|
|
52134
|
+
transportSecurityType: "ssl",
|
|
52135
|
+
sslPeerCertificate: peerCertificate.raw ? peerCertificate : undefined
|
|
52136
|
+
};
|
|
52137
|
+
} else {
|
|
52138
|
+
return {};
|
|
52139
|
+
}
|
|
52140
|
+
}
|
|
52141
|
+
getConnectionInfo() {
|
|
52142
|
+
return this.connectionInfo;
|
|
52143
|
+
}
|
|
52144
|
+
getMetricsRecorder() {
|
|
52145
|
+
return this.metricsRecorder;
|
|
52146
|
+
}
|
|
51380
52147
|
}
|
|
51381
52148
|
exports2.BaseServerInterceptingCall = BaseServerInterceptingCall;
|
|
51382
52149
|
function getServerInterceptingCall(interceptors, stream, headers, callEventTracker, handler, options) {
|
|
@@ -51825,19 +52592,23 @@ var require_server = __commonJS((exports2) => {
|
|
|
51825
52592
|
}
|
|
51826
52593
|
resolvePort(port) {
|
|
51827
52594
|
return new Promise((resolve, reject) => {
|
|
51828
|
-
|
|
51829
|
-
|
|
51830
|
-
|
|
51831
|
-
|
|
51832
|
-
|
|
51833
|
-
|
|
51834
|
-
|
|
51835
|
-
|
|
51836
|
-
|
|
51837
|
-
},
|
|
51838
|
-
onError: (error) => {
|
|
51839
|
-
reject(new Error(error.details));
|
|
52595
|
+
let seenResolution = false;
|
|
52596
|
+
const resolverListener = (endpointList, attributes, serviceConfig, resolutionNote) => {
|
|
52597
|
+
if (seenResolution) {
|
|
52598
|
+
return true;
|
|
52599
|
+
}
|
|
52600
|
+
seenResolution = true;
|
|
52601
|
+
if (!endpointList.ok) {
|
|
52602
|
+
reject(new Error(endpointList.error.details));
|
|
52603
|
+
return true;
|
|
51840
52604
|
}
|
|
52605
|
+
const addressList = [].concat(...endpointList.value.map((endpoint) => endpoint.addresses));
|
|
52606
|
+
if (addressList.length === 0) {
|
|
52607
|
+
reject(new Error(`No addresses resolved for port ${port}`));
|
|
52608
|
+
return true;
|
|
52609
|
+
}
|
|
52610
|
+
resolve(addressList);
|
|
52611
|
+
return true;
|
|
51841
52612
|
};
|
|
51842
52613
|
const resolver = (0, resolver_1.createResolver)(port, resolverListener, this.options);
|
|
51843
52614
|
resolver.updateResolution();
|
|
@@ -52848,38 +53619,6 @@ var require_status_builder = __commonJS((exports2) => {
|
|
|
52848
53619
|
exports2.StatusBuilder = StatusBuilder;
|
|
52849
53620
|
});
|
|
52850
53621
|
|
|
52851
|
-
// ../../node_modules/@grpc/grpc-js/build/src/duration.js
|
|
52852
|
-
var require_duration = __commonJS((exports2) => {
|
|
52853
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
52854
|
-
exports2.msToDuration = msToDuration;
|
|
52855
|
-
exports2.durationToMs = durationToMs;
|
|
52856
|
-
exports2.isDuration = isDuration;
|
|
52857
|
-
exports2.parseDuration = parseDuration;
|
|
52858
|
-
function msToDuration(millis) {
|
|
52859
|
-
return {
|
|
52860
|
-
seconds: millis / 1000 | 0,
|
|
52861
|
-
nanos: millis % 1000 * 1e6 | 0
|
|
52862
|
-
};
|
|
52863
|
-
}
|
|
52864
|
-
function durationToMs(duration) {
|
|
52865
|
-
return duration.seconds * 1000 + duration.nanos / 1e6 | 0;
|
|
52866
|
-
}
|
|
52867
|
-
function isDuration(value) {
|
|
52868
|
-
return typeof value.seconds === "number" && typeof value.nanos === "number";
|
|
52869
|
-
}
|
|
52870
|
-
var durationRegex = /^(\d+)(?:\.(\d+))?s$/;
|
|
52871
|
-
function parseDuration(value) {
|
|
52872
|
-
const match = value.match(durationRegex);
|
|
52873
|
-
if (!match) {
|
|
52874
|
-
return null;
|
|
52875
|
-
}
|
|
52876
|
-
return {
|
|
52877
|
-
seconds: Number.parseInt(match[1], 10),
|
|
52878
|
-
nanos: match[2] ? Number.parseInt(match[2].padEnd(9, "0"), 10) : 0
|
|
52879
|
-
};
|
|
52880
|
-
}
|
|
52881
|
-
});
|
|
52882
|
-
|
|
52883
53622
|
// ../../node_modules/@grpc/grpc-js/build/src/load-balancer-pick-first.js
|
|
52884
53623
|
var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
52885
53624
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -52894,6 +53633,7 @@ var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
|
52894
53633
|
var constants_1 = require_constants6();
|
|
52895
53634
|
var subchannel_address_2 = require_subchannel_address();
|
|
52896
53635
|
var net_1 = require("net");
|
|
53636
|
+
var call_interface_1 = require_call_interface();
|
|
52897
53637
|
var TRACER_NAME = "pick_first";
|
|
52898
53638
|
function trace(text) {
|
|
52899
53639
|
logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);
|
|
@@ -52996,6 +53736,7 @@ var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
|
52996
53736
|
this.lastError = null;
|
|
52997
53737
|
this.latestAddressList = null;
|
|
52998
53738
|
this.latestOptions = {};
|
|
53739
|
+
this.latestResolutionNote = "";
|
|
52999
53740
|
this.connectionDelayTimeout = setTimeout(() => {}, 0);
|
|
53000
53741
|
clearTimeout(this.connectionDelayTimeout);
|
|
53001
53742
|
}
|
|
@@ -53017,7 +53758,7 @@ var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
|
53017
53758
|
this.updateState(connectivity_state_1.ConnectivityState.READY, new PickFirstPicker(this.currentPick), null);
|
|
53018
53759
|
}
|
|
53019
53760
|
} else if (((_a = this.latestAddressList) === null || _a === undefined ? undefined : _a.length) === 0) {
|
|
53020
|
-
const errorMessage = `No connection established. Last error: ${this.lastError}`;
|
|
53761
|
+
const errorMessage = `No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;
|
|
53021
53762
|
this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({
|
|
53022
53763
|
details: errorMessage
|
|
53023
53764
|
}), errorMessage);
|
|
@@ -53025,7 +53766,7 @@ var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
|
53025
53766
|
this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this), null);
|
|
53026
53767
|
} else {
|
|
53027
53768
|
if (this.stickyTransientFailureMode) {
|
|
53028
|
-
const errorMessage = `No connection established. Last error: ${this.lastError}`;
|
|
53769
|
+
const errorMessage = `No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;
|
|
53029
53770
|
this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({
|
|
53030
53771
|
details: errorMessage
|
|
53031
53772
|
}), errorMessage);
|
|
@@ -53176,23 +53917,34 @@ var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
|
53176
53917
|
this.startNextSubchannelConnecting(0);
|
|
53177
53918
|
this.calculateAndReportNewState();
|
|
53178
53919
|
}
|
|
53179
|
-
updateAddressList(
|
|
53920
|
+
updateAddressList(maybeEndpointList, lbConfig, options, resolutionNote) {
|
|
53180
53921
|
if (!(lbConfig instanceof PickFirstLoadBalancingConfig)) {
|
|
53181
|
-
return;
|
|
53922
|
+
return false;
|
|
53923
|
+
}
|
|
53924
|
+
if (!maybeEndpointList.ok) {
|
|
53925
|
+
if (this.children.length === 0 && this.currentPick === null) {
|
|
53926
|
+
this.channelControlHelper.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker(maybeEndpointList.error), maybeEndpointList.error.details);
|
|
53927
|
+
}
|
|
53928
|
+
return true;
|
|
53182
53929
|
}
|
|
53930
|
+
let endpointList = maybeEndpointList.value;
|
|
53183
53931
|
this.reportHealthStatus = options[REPORT_HEALTH_STATUS_OPTION_NAME];
|
|
53184
53932
|
if (lbConfig.getShuffleAddressList()) {
|
|
53185
53933
|
endpointList = shuffled(endpointList);
|
|
53186
53934
|
}
|
|
53187
53935
|
const rawAddressList = [].concat(...endpointList.map((endpoint) => endpoint.addresses));
|
|
53188
53936
|
trace("updateAddressList([" + rawAddressList.map((address) => (0, subchannel_address_1.subchannelAddressToString)(address)) + "])");
|
|
53189
|
-
if (rawAddressList.length === 0) {
|
|
53190
|
-
this.lastError = "No addresses resolved";
|
|
53191
|
-
}
|
|
53192
53937
|
const addressList = interleaveAddressFamilies(rawAddressList);
|
|
53193
53938
|
this.latestAddressList = addressList;
|
|
53194
53939
|
this.latestOptions = options;
|
|
53195
53940
|
this.connectToAddressList(addressList, options);
|
|
53941
|
+
this.latestResolutionNote = resolutionNote;
|
|
53942
|
+
if (rawAddressList.length > 0) {
|
|
53943
|
+
return true;
|
|
53944
|
+
} else {
|
|
53945
|
+
this.lastError = "No addresses resolved";
|
|
53946
|
+
return false;
|
|
53947
|
+
}
|
|
53196
53948
|
}
|
|
53197
53949
|
exitIdle() {
|
|
53198
53950
|
if (this.currentState === connectivity_state_1.ConnectivityState.IDLE && this.latestAddressList) {
|
|
@@ -53212,9 +53964,10 @@ var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
|
53212
53964
|
var LEAF_CONFIG = new PickFirstLoadBalancingConfig(false);
|
|
53213
53965
|
|
|
53214
53966
|
class LeafLoadBalancer {
|
|
53215
|
-
constructor(endpoint, channelControlHelper, options) {
|
|
53967
|
+
constructor(endpoint, channelControlHelper, options, resolutionNote) {
|
|
53216
53968
|
this.endpoint = endpoint;
|
|
53217
53969
|
this.options = options;
|
|
53970
|
+
this.resolutionNote = resolutionNote;
|
|
53218
53971
|
this.latestState = connectivity_state_1.ConnectivityState.IDLE;
|
|
53219
53972
|
const childChannelControlHelper = (0, load_balancer_1.createChildChannelControlHelper)(channelControlHelper, {
|
|
53220
53973
|
updateState: (connectivityState, picker, errorMessage) => {
|
|
@@ -53227,7 +53980,7 @@ var require_load_balancer_pick_first = __commonJS((exports2) => {
|
|
|
53227
53980
|
this.latestPicker = new picker_1.QueuePicker(this.pickFirstBalancer);
|
|
53228
53981
|
}
|
|
53229
53982
|
startConnecting() {
|
|
53230
|
-
this.pickFirstBalancer.updateAddressList([this.endpoint], LEAF_CONFIG, Object.assign(Object.assign({}, this.options), { [REPORT_HEALTH_STATUS_OPTION_NAME]: true }));
|
|
53983
|
+
this.pickFirstBalancer.updateAddressList((0, call_interface_1.statusOrFromValue)([this.endpoint]), LEAF_CONFIG, Object.assign(Object.assign({}, this.options), { [REPORT_HEALTH_STATUS_OPTION_NAME]: true }), this.resolutionNote);
|
|
53231
53984
|
}
|
|
53232
53985
|
updateEndpoint(newEndpoint, newOptions) {
|
|
53233
53986
|
this.options = newOptions;
|
|
@@ -53383,7 +54136,7 @@ var require_certificate_provider = __commonJS((exports2) => {
|
|
|
53383
54136
|
// ../../node_modules/@grpc/grpc-js/build/src/experimental.js
|
|
53384
54137
|
var require_experimental = __commonJS((exports2) => {
|
|
53385
54138
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
53386
|
-
exports2.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX = exports2.createCertificateProviderChannelCredentials = exports2.FileWatcherCertificateProvider = exports2.createCertificateProviderServerCredentials = exports2.createServerCredentialsWithInterceptors = exports2.BaseSubchannelWrapper = exports2.registerAdminService = exports2.FilterStackFactory = exports2.BaseFilter = exports2.PickResultType = exports2.QueuePicker = exports2.UnavailablePicker = exports2.ChildLoadBalancerHandler = exports2.EndpointMap = exports2.endpointHasAddress = exports2.endpointToString = exports2.subchannelAddressToString = exports2.LeafLoadBalancer = exports2.isLoadBalancerNameRegistered = exports2.parseLoadBalancingConfig = exports2.selectLbConfigFromList = exports2.registerLoadBalancerType = exports2.createChildChannelControlHelper = exports2.BackoffTimeout = exports2.parseDuration = exports2.durationToMs = exports2.splitHostPort = exports2.uriToString = exports2.createResolver = exports2.registerResolver = exports2.log = exports2.trace = undefined;
|
|
54139
|
+
exports2.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX = exports2.createCertificateProviderChannelCredentials = exports2.FileWatcherCertificateProvider = exports2.createCertificateProviderServerCredentials = exports2.createServerCredentialsWithInterceptors = exports2.BaseSubchannelWrapper = exports2.registerAdminService = exports2.FilterStackFactory = exports2.BaseFilter = exports2.statusOrFromError = exports2.statusOrFromValue = exports2.PickResultType = exports2.QueuePicker = exports2.UnavailablePicker = exports2.ChildLoadBalancerHandler = exports2.EndpointMap = exports2.endpointHasAddress = exports2.endpointToString = exports2.subchannelAddressToString = exports2.LeafLoadBalancer = exports2.isLoadBalancerNameRegistered = exports2.parseLoadBalancingConfig = exports2.selectLbConfigFromList = exports2.registerLoadBalancerType = exports2.createChildChannelControlHelper = exports2.BackoffTimeout = exports2.parseDuration = exports2.durationToMs = exports2.splitHostPort = exports2.uriToString = exports2.CHANNEL_ARGS_CONFIG_SELECTOR_KEY = exports2.createResolver = exports2.registerResolver = exports2.log = exports2.trace = undefined;
|
|
53387
54140
|
var logging_1 = require_logging();
|
|
53388
54141
|
Object.defineProperty(exports2, "trace", { enumerable: true, get: function() {
|
|
53389
54142
|
return logging_1.trace;
|
|
@@ -53398,6 +54151,9 @@ var require_experimental = __commonJS((exports2) => {
|
|
|
53398
54151
|
Object.defineProperty(exports2, "createResolver", { enumerable: true, get: function() {
|
|
53399
54152
|
return resolver_1.createResolver;
|
|
53400
54153
|
} });
|
|
54154
|
+
Object.defineProperty(exports2, "CHANNEL_ARGS_CONFIG_SELECTOR_KEY", { enumerable: true, get: function() {
|
|
54155
|
+
return resolver_1.CHANNEL_ARGS_CONFIG_SELECTOR_KEY;
|
|
54156
|
+
} });
|
|
53401
54157
|
var uri_parser_1 = require_uri_parser();
|
|
53402
54158
|
Object.defineProperty(exports2, "uriToString", { enumerable: true, get: function() {
|
|
53403
54159
|
return uri_parser_1.uriToString;
|
|
@@ -53463,6 +54219,13 @@ var require_experimental = __commonJS((exports2) => {
|
|
|
53463
54219
|
Object.defineProperty(exports2, "PickResultType", { enumerable: true, get: function() {
|
|
53464
54220
|
return picker_1.PickResultType;
|
|
53465
54221
|
} });
|
|
54222
|
+
var call_interface_1 = require_call_interface();
|
|
54223
|
+
Object.defineProperty(exports2, "statusOrFromValue", { enumerable: true, get: function() {
|
|
54224
|
+
return call_interface_1.statusOrFromValue;
|
|
54225
|
+
} });
|
|
54226
|
+
Object.defineProperty(exports2, "statusOrFromError", { enumerable: true, get: function() {
|
|
54227
|
+
return call_interface_1.statusOrFromError;
|
|
54228
|
+
} });
|
|
53466
54229
|
var filter_1 = require_filter();
|
|
53467
54230
|
Object.defineProperty(exports2, "BaseFilter", { enumerable: true, get: function() {
|
|
53468
54231
|
return filter_1.BaseFilter;
|
|
@@ -53505,6 +54268,7 @@ var require_resolver_uds = __commonJS((exports2) => {
|
|
|
53505
54268
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
53506
54269
|
exports2.setup = setup;
|
|
53507
54270
|
var resolver_1 = require_resolver();
|
|
54271
|
+
var call_interface_1 = require_call_interface();
|
|
53508
54272
|
|
|
53509
54273
|
class UdsResolver {
|
|
53510
54274
|
constructor(target, listener, channelOptions) {
|
|
@@ -53522,7 +54286,7 @@ var require_resolver_uds = __commonJS((exports2) => {
|
|
|
53522
54286
|
updateResolution() {
|
|
53523
54287
|
if (!this.hasReturnedResult) {
|
|
53524
54288
|
this.hasReturnedResult = true;
|
|
53525
|
-
process.nextTick(this.listener
|
|
54289
|
+
process.nextTick(this.listener, (0, call_interface_1.statusOrFromValue)(this.endpoints), {}, null, "");
|
|
53526
54290
|
}
|
|
53527
54291
|
}
|
|
53528
54292
|
destroy() {
|
|
@@ -53542,9 +54306,11 @@ var require_resolver_ip = __commonJS((exports2) => {
|
|
|
53542
54306
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
53543
54307
|
exports2.setup = setup;
|
|
53544
54308
|
var net_1 = require("net");
|
|
54309
|
+
var call_interface_1 = require_call_interface();
|
|
53545
54310
|
var constants_1 = require_constants6();
|
|
53546
54311
|
var metadata_1 = require_metadata();
|
|
53547
54312
|
var resolver_1 = require_resolver();
|
|
54313
|
+
var subchannel_address_1 = require_subchannel_address();
|
|
53548
54314
|
var uri_parser_1 = require_uri_parser();
|
|
53549
54315
|
var logging = require_logging();
|
|
53550
54316
|
var TRACER_NAME = "ip_resolver";
|
|
@@ -53597,16 +54363,16 @@ var require_resolver_ip = __commonJS((exports2) => {
|
|
|
53597
54363
|
});
|
|
53598
54364
|
}
|
|
53599
54365
|
this.endpoints = addresses.map((address) => ({ addresses: [address] }));
|
|
53600
|
-
trace("Parsed " + target.scheme + " address list " + addresses);
|
|
54366
|
+
trace("Parsed " + target.scheme + " address list " + addresses.map(subchannel_address_1.subchannelAddressToString));
|
|
53601
54367
|
}
|
|
53602
54368
|
updateResolution() {
|
|
53603
54369
|
if (!this.hasReturnedResult) {
|
|
53604
54370
|
this.hasReturnedResult = true;
|
|
53605
54371
|
process.nextTick(() => {
|
|
53606
54372
|
if (this.error) {
|
|
53607
|
-
this.listener.
|
|
54373
|
+
this.listener((0, call_interface_1.statusOrFromError)(this.error), {}, null, "");
|
|
53608
54374
|
} else {
|
|
53609
|
-
this.listener.
|
|
54375
|
+
this.listener((0, call_interface_1.statusOrFromValue)(this.endpoints), {}, null, "");
|
|
53610
54376
|
}
|
|
53611
54377
|
});
|
|
53612
54378
|
}
|
|
@@ -53671,6 +54437,9 @@ var require_load_balancer_round_robin = __commonJS((exports2) => {
|
|
|
53671
54437
|
return this.children[this.nextIndex].endpoint;
|
|
53672
54438
|
}
|
|
53673
54439
|
}
|
|
54440
|
+
function rotateArray(list, startIndex) {
|
|
54441
|
+
return [...list.slice(startIndex), ...list.slice(0, startIndex)];
|
|
54442
|
+
}
|
|
53674
54443
|
|
|
53675
54444
|
class RoundRobinLoadBalancer {
|
|
53676
54445
|
constructor(channelControlHelper) {
|
|
@@ -53743,17 +54512,34 @@ var require_load_balancer_round_robin = __commonJS((exports2) => {
|
|
|
53743
54512
|
for (const child of this.children) {
|
|
53744
54513
|
child.destroy();
|
|
53745
54514
|
}
|
|
54515
|
+
this.children = [];
|
|
53746
54516
|
}
|
|
53747
|
-
updateAddressList(
|
|
54517
|
+
updateAddressList(maybeEndpointList, lbConfig, options, resolutionNote) {
|
|
54518
|
+
if (!(lbConfig instanceof RoundRobinLoadBalancingConfig)) {
|
|
54519
|
+
return false;
|
|
54520
|
+
}
|
|
54521
|
+
if (!maybeEndpointList.ok) {
|
|
54522
|
+
if (this.children.length === 0) {
|
|
54523
|
+
this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker(maybeEndpointList.error), maybeEndpointList.error.details);
|
|
54524
|
+
}
|
|
54525
|
+
return true;
|
|
54526
|
+
}
|
|
54527
|
+
const startIndex = Math.random() * maybeEndpointList.value.length | 0;
|
|
54528
|
+
const endpointList = rotateArray(maybeEndpointList.value, startIndex);
|
|
53748
54529
|
this.resetSubchannelList();
|
|
54530
|
+
if (endpointList.length === 0) {
|
|
54531
|
+
const errorMessage = `No addresses resolved. Resolution note: ${resolutionNote}`;
|
|
54532
|
+
this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({ details: errorMessage }), errorMessage);
|
|
54533
|
+
}
|
|
53749
54534
|
trace("Connect to endpoint list " + endpointList.map(subchannel_address_1.endpointToString));
|
|
53750
54535
|
this.updatesPaused = true;
|
|
53751
|
-
this.children = endpointList.map((endpoint) => new load_balancer_pick_first_1.LeafLoadBalancer(endpoint, this.childChannelControlHelper, options));
|
|
54536
|
+
this.children = endpointList.map((endpoint) => new load_balancer_pick_first_1.LeafLoadBalancer(endpoint, this.childChannelControlHelper, options, resolutionNote));
|
|
53752
54537
|
for (const child of this.children) {
|
|
53753
54538
|
child.startConnecting();
|
|
53754
54539
|
}
|
|
53755
54540
|
this.updatesPaused = false;
|
|
53756
54541
|
this.calculateAndUpdateState();
|
|
54542
|
+
return true;
|
|
53757
54543
|
}
|
|
53758
54544
|
exitIdle() {}
|
|
53759
54545
|
resetBackoff() {}
|
|
@@ -53994,14 +54780,14 @@ var require_load_balancer_outlier_detection = __commonJS((exports2) => {
|
|
|
53994
54780
|
if (mapEntry) {
|
|
53995
54781
|
let onCallEnded = wrappedPick.onCallEnded;
|
|
53996
54782
|
if (this.countCalls) {
|
|
53997
|
-
onCallEnded = (statusCode) => {
|
|
54783
|
+
onCallEnded = (statusCode, details, metadata) => {
|
|
53998
54784
|
var _a2;
|
|
53999
54785
|
if (statusCode === constants_1.Status.OK) {
|
|
54000
54786
|
mapEntry.counter.addSuccess();
|
|
54001
54787
|
} else {
|
|
54002
54788
|
mapEntry.counter.addFailure();
|
|
54003
54789
|
}
|
|
54004
|
-
(_a2 = wrappedPick.onCallEnded) === null || _a2 === undefined || _a2.call(wrappedPick, statusCode);
|
|
54790
|
+
(_a2 = wrappedPick.onCallEnded) === null || _a2 === undefined || _a2.call(wrappedPick, statusCode, details, metadata);
|
|
54005
54791
|
};
|
|
54006
54792
|
}
|
|
54007
54793
|
return Object.assign(Object.assign({}, wrappedPick), { subchannel: subchannelWrapper.getWrappedSubchannel(), onCallEnded });
|
|
@@ -54201,25 +54987,27 @@ var require_load_balancer_outlier_detection = __commonJS((exports2) => {
|
|
|
54201
54987
|
}
|
|
54202
54988
|
}
|
|
54203
54989
|
}
|
|
54204
|
-
updateAddressList(endpointList, lbConfig, options) {
|
|
54990
|
+
updateAddressList(endpointList, lbConfig, options, resolutionNote) {
|
|
54205
54991
|
if (!(lbConfig instanceof OutlierDetectionLoadBalancingConfig)) {
|
|
54206
|
-
return;
|
|
54992
|
+
return false;
|
|
54207
54993
|
}
|
|
54208
54994
|
trace("Received update with config: " + JSON.stringify(lbConfig.toJsonObject(), undefined, 2));
|
|
54209
|
-
|
|
54210
|
-
|
|
54211
|
-
|
|
54212
|
-
|
|
54213
|
-
|
|
54214
|
-
|
|
54215
|
-
|
|
54216
|
-
|
|
54217
|
-
|
|
54995
|
+
if (endpointList.ok) {
|
|
54996
|
+
for (const endpoint of endpointList.value) {
|
|
54997
|
+
if (!this.entryMap.has(endpoint)) {
|
|
54998
|
+
trace("Adding map entry for " + (0, subchannel_address_1.endpointToString)(endpoint));
|
|
54999
|
+
this.entryMap.set(endpoint, {
|
|
55000
|
+
counter: new CallCounter,
|
|
55001
|
+
currentEjectionTimestamp: null,
|
|
55002
|
+
ejectionTimeMultiplier: 0,
|
|
55003
|
+
subchannelWrappers: []
|
|
55004
|
+
});
|
|
55005
|
+
}
|
|
54218
55006
|
}
|
|
55007
|
+
this.entryMap.deleteMissing(endpointList.value);
|
|
54219
55008
|
}
|
|
54220
|
-
this.entryMap.deleteMissing(endpointList);
|
|
54221
55009
|
const childPolicy = lbConfig.getChildPolicy();
|
|
54222
|
-
this.childBalancer.updateAddressList(endpointList, childPolicy, options);
|
|
55010
|
+
this.childBalancer.updateAddressList(endpointList, childPolicy, options, resolutionNote);
|
|
54223
55011
|
if (lbConfig.getSuccessRateEjectionConfig() || lbConfig.getFailurePercentageEjectionConfig()) {
|
|
54224
55012
|
if (this.timerStartTime) {
|
|
54225
55013
|
trace("Previous timer existed. Replacing timer");
|
|
@@ -54242,6 +55030,7 @@ var require_load_balancer_outlier_detection = __commonJS((exports2) => {
|
|
|
54242
55030
|
}
|
|
54243
55031
|
}
|
|
54244
55032
|
this.latestConfig = lbConfig;
|
|
55033
|
+
return true;
|
|
54245
55034
|
}
|
|
54246
55035
|
exitIdle() {
|
|
54247
55036
|
this.childBalancer.exitIdle();
|
|
@@ -54265,10 +55054,431 @@ var require_load_balancer_outlier_detection = __commonJS((exports2) => {
|
|
|
54265
55054
|
}
|
|
54266
55055
|
});
|
|
54267
55056
|
|
|
55057
|
+
// ../../node_modules/@grpc/grpc-js/build/src/priority-queue.js
|
|
55058
|
+
var require_priority_queue = __commonJS((exports2) => {
|
|
55059
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
55060
|
+
exports2.PriorityQueue = undefined;
|
|
55061
|
+
var top = 0;
|
|
55062
|
+
var parent = (i) => Math.floor(i / 2);
|
|
55063
|
+
var left = (i) => i * 2 + 1;
|
|
55064
|
+
var right = (i) => i * 2 + 2;
|
|
55065
|
+
|
|
55066
|
+
class PriorityQueue {
|
|
55067
|
+
constructor(comparator = (a, b) => a > b) {
|
|
55068
|
+
this.comparator = comparator;
|
|
55069
|
+
this.heap = [];
|
|
55070
|
+
}
|
|
55071
|
+
size() {
|
|
55072
|
+
return this.heap.length;
|
|
55073
|
+
}
|
|
55074
|
+
isEmpty() {
|
|
55075
|
+
return this.size() == 0;
|
|
55076
|
+
}
|
|
55077
|
+
peek() {
|
|
55078
|
+
return this.heap[top];
|
|
55079
|
+
}
|
|
55080
|
+
push(...values) {
|
|
55081
|
+
values.forEach((value) => {
|
|
55082
|
+
this.heap.push(value);
|
|
55083
|
+
this.siftUp();
|
|
55084
|
+
});
|
|
55085
|
+
return this.size();
|
|
55086
|
+
}
|
|
55087
|
+
pop() {
|
|
55088
|
+
const poppedValue = this.peek();
|
|
55089
|
+
const bottom = this.size() - 1;
|
|
55090
|
+
if (bottom > top) {
|
|
55091
|
+
this.swap(top, bottom);
|
|
55092
|
+
}
|
|
55093
|
+
this.heap.pop();
|
|
55094
|
+
this.siftDown();
|
|
55095
|
+
return poppedValue;
|
|
55096
|
+
}
|
|
55097
|
+
replace(value) {
|
|
55098
|
+
const replacedValue = this.peek();
|
|
55099
|
+
this.heap[top] = value;
|
|
55100
|
+
this.siftDown();
|
|
55101
|
+
return replacedValue;
|
|
55102
|
+
}
|
|
55103
|
+
greater(i, j) {
|
|
55104
|
+
return this.comparator(this.heap[i], this.heap[j]);
|
|
55105
|
+
}
|
|
55106
|
+
swap(i, j) {
|
|
55107
|
+
[this.heap[i], this.heap[j]] = [this.heap[j], this.heap[i]];
|
|
55108
|
+
}
|
|
55109
|
+
siftUp() {
|
|
55110
|
+
let node = this.size() - 1;
|
|
55111
|
+
while (node > top && this.greater(node, parent(node))) {
|
|
55112
|
+
this.swap(node, parent(node));
|
|
55113
|
+
node = parent(node);
|
|
55114
|
+
}
|
|
55115
|
+
}
|
|
55116
|
+
siftDown() {
|
|
55117
|
+
let node = top;
|
|
55118
|
+
while (left(node) < this.size() && this.greater(left(node), node) || right(node) < this.size() && this.greater(right(node), node)) {
|
|
55119
|
+
let maxChild = right(node) < this.size() && this.greater(right(node), left(node)) ? right(node) : left(node);
|
|
55120
|
+
this.swap(node, maxChild);
|
|
55121
|
+
node = maxChild;
|
|
55122
|
+
}
|
|
55123
|
+
}
|
|
55124
|
+
}
|
|
55125
|
+
exports2.PriorityQueue = PriorityQueue;
|
|
55126
|
+
});
|
|
55127
|
+
|
|
55128
|
+
// ../../node_modules/@grpc/grpc-js/build/src/load-balancer-weighted-round-robin.js
|
|
55129
|
+
var require_load_balancer_weighted_round_robin = __commonJS((exports2) => {
|
|
55130
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
55131
|
+
exports2.WeightedRoundRobinLoadBalancingConfig = undefined;
|
|
55132
|
+
exports2.setup = setup;
|
|
55133
|
+
var connectivity_state_1 = require_connectivity_state();
|
|
55134
|
+
var constants_1 = require_constants6();
|
|
55135
|
+
var duration_1 = require_duration();
|
|
55136
|
+
var load_balancer_1 = require_load_balancer();
|
|
55137
|
+
var load_balancer_pick_first_1 = require_load_balancer_pick_first();
|
|
55138
|
+
var logging = require_logging();
|
|
55139
|
+
var orca_1 = require_orca();
|
|
55140
|
+
var picker_1 = require_picker();
|
|
55141
|
+
var priority_queue_1 = require_priority_queue();
|
|
55142
|
+
var subchannel_address_1 = require_subchannel_address();
|
|
55143
|
+
var TRACER_NAME = "weighted_round_robin";
|
|
55144
|
+
function trace(text) {
|
|
55145
|
+
logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);
|
|
55146
|
+
}
|
|
55147
|
+
var TYPE_NAME = "weighted_round_robin";
|
|
55148
|
+
var DEFAULT_OOB_REPORTING_PERIOD_MS = 1e4;
|
|
55149
|
+
var DEFAULT_BLACKOUT_PERIOD_MS = 1e4;
|
|
55150
|
+
var DEFAULT_WEIGHT_EXPIRATION_PERIOD_MS = 3 * 60000;
|
|
55151
|
+
var DEFAULT_WEIGHT_UPDATE_PERIOD_MS = 1000;
|
|
55152
|
+
var DEFAULT_ERROR_UTILIZATION_PENALTY = 1;
|
|
55153
|
+
function validateFieldType(obj, fieldName, expectedType) {
|
|
55154
|
+
if (fieldName in obj && obj[fieldName] !== undefined && typeof obj[fieldName] !== expectedType) {
|
|
55155
|
+
throw new Error(`weighted round robin config ${fieldName} parse error: expected ${expectedType}, got ${typeof obj[fieldName]}`);
|
|
55156
|
+
}
|
|
55157
|
+
}
|
|
55158
|
+
function parseDurationField(obj, fieldName) {
|
|
55159
|
+
if (fieldName in obj && obj[fieldName] !== undefined && obj[fieldName] !== null) {
|
|
55160
|
+
let durationObject;
|
|
55161
|
+
if ((0, duration_1.isDuration)(obj[fieldName])) {
|
|
55162
|
+
durationObject = obj[fieldName];
|
|
55163
|
+
} else if ((0, duration_1.isDurationMessage)(obj[fieldName])) {
|
|
55164
|
+
durationObject = (0, duration_1.durationMessageToDuration)(obj[fieldName]);
|
|
55165
|
+
} else if (typeof obj[fieldName] === "string") {
|
|
55166
|
+
const parsedDuration = (0, duration_1.parseDuration)(obj[fieldName]);
|
|
55167
|
+
if (!parsedDuration) {
|
|
55168
|
+
throw new Error(`weighted round robin config ${fieldName}: failed to parse duration string ${obj[fieldName]}`);
|
|
55169
|
+
}
|
|
55170
|
+
durationObject = parsedDuration;
|
|
55171
|
+
} else {
|
|
55172
|
+
throw new Error(`weighted round robin config ${fieldName}: expected duration, got ${typeof obj[fieldName]}`);
|
|
55173
|
+
}
|
|
55174
|
+
return (0, duration_1.durationToMs)(durationObject);
|
|
55175
|
+
}
|
|
55176
|
+
return null;
|
|
55177
|
+
}
|
|
55178
|
+
|
|
55179
|
+
class WeightedRoundRobinLoadBalancingConfig {
|
|
55180
|
+
constructor(enableOobLoadReport, oobLoadReportingPeriodMs, blackoutPeriodMs, weightExpirationPeriodMs, weightUpdatePeriodMs, errorUtilizationPenalty) {
|
|
55181
|
+
this.enableOobLoadReport = enableOobLoadReport !== null && enableOobLoadReport !== undefined ? enableOobLoadReport : false;
|
|
55182
|
+
this.oobLoadReportingPeriodMs = oobLoadReportingPeriodMs !== null && oobLoadReportingPeriodMs !== undefined ? oobLoadReportingPeriodMs : DEFAULT_OOB_REPORTING_PERIOD_MS;
|
|
55183
|
+
this.blackoutPeriodMs = blackoutPeriodMs !== null && blackoutPeriodMs !== undefined ? blackoutPeriodMs : DEFAULT_BLACKOUT_PERIOD_MS;
|
|
55184
|
+
this.weightExpirationPeriodMs = weightExpirationPeriodMs !== null && weightExpirationPeriodMs !== undefined ? weightExpirationPeriodMs : DEFAULT_WEIGHT_EXPIRATION_PERIOD_MS;
|
|
55185
|
+
this.weightUpdatePeriodMs = Math.max(weightUpdatePeriodMs !== null && weightUpdatePeriodMs !== undefined ? weightUpdatePeriodMs : DEFAULT_WEIGHT_UPDATE_PERIOD_MS, 100);
|
|
55186
|
+
this.errorUtilizationPenalty = errorUtilizationPenalty !== null && errorUtilizationPenalty !== undefined ? errorUtilizationPenalty : DEFAULT_ERROR_UTILIZATION_PENALTY;
|
|
55187
|
+
}
|
|
55188
|
+
getLoadBalancerName() {
|
|
55189
|
+
return TYPE_NAME;
|
|
55190
|
+
}
|
|
55191
|
+
toJsonObject() {
|
|
55192
|
+
return {
|
|
55193
|
+
enable_oob_load_report: this.enableOobLoadReport,
|
|
55194
|
+
oob_load_reporting_period: (0, duration_1.durationToString)((0, duration_1.msToDuration)(this.oobLoadReportingPeriodMs)),
|
|
55195
|
+
blackout_period: (0, duration_1.durationToString)((0, duration_1.msToDuration)(this.blackoutPeriodMs)),
|
|
55196
|
+
weight_expiration_period: (0, duration_1.durationToString)((0, duration_1.msToDuration)(this.weightExpirationPeriodMs)),
|
|
55197
|
+
weight_update_period: (0, duration_1.durationToString)((0, duration_1.msToDuration)(this.weightUpdatePeriodMs)),
|
|
55198
|
+
error_utilization_penalty: this.errorUtilizationPenalty
|
|
55199
|
+
};
|
|
55200
|
+
}
|
|
55201
|
+
static createFromJson(obj) {
|
|
55202
|
+
validateFieldType(obj, "enable_oob_load_report", "boolean");
|
|
55203
|
+
validateFieldType(obj, "error_utilization_penalty", "number");
|
|
55204
|
+
if (obj.error_utilization_penalty < 0) {
|
|
55205
|
+
throw new Error("weighted round robin config error_utilization_penalty < 0");
|
|
55206
|
+
}
|
|
55207
|
+
return new WeightedRoundRobinLoadBalancingConfig(obj.enable_oob_load_report, parseDurationField(obj, "oob_load_reporting_period"), parseDurationField(obj, "blackout_period"), parseDurationField(obj, "weight_expiration_period"), parseDurationField(obj, "weight_update_period"), obj.error_utilization_penalty);
|
|
55208
|
+
}
|
|
55209
|
+
getEnableOobLoadReport() {
|
|
55210
|
+
return this.enableOobLoadReport;
|
|
55211
|
+
}
|
|
55212
|
+
getOobLoadReportingPeriodMs() {
|
|
55213
|
+
return this.oobLoadReportingPeriodMs;
|
|
55214
|
+
}
|
|
55215
|
+
getBlackoutPeriodMs() {
|
|
55216
|
+
return this.blackoutPeriodMs;
|
|
55217
|
+
}
|
|
55218
|
+
getWeightExpirationPeriodMs() {
|
|
55219
|
+
return this.weightExpirationPeriodMs;
|
|
55220
|
+
}
|
|
55221
|
+
getWeightUpdatePeriodMs() {
|
|
55222
|
+
return this.weightUpdatePeriodMs;
|
|
55223
|
+
}
|
|
55224
|
+
getErrorUtilizationPenalty() {
|
|
55225
|
+
return this.errorUtilizationPenalty;
|
|
55226
|
+
}
|
|
55227
|
+
}
|
|
55228
|
+
exports2.WeightedRoundRobinLoadBalancingConfig = WeightedRoundRobinLoadBalancingConfig;
|
|
55229
|
+
|
|
55230
|
+
class WeightedRoundRobinPicker {
|
|
55231
|
+
constructor(children, metricsHandler) {
|
|
55232
|
+
this.metricsHandler = metricsHandler;
|
|
55233
|
+
this.queue = new priority_queue_1.PriorityQueue((a, b) => a.deadline < b.deadline);
|
|
55234
|
+
const positiveWeight = children.filter((picker) => picker.weight > 0);
|
|
55235
|
+
let averageWeight;
|
|
55236
|
+
if (positiveWeight.length < 2) {
|
|
55237
|
+
averageWeight = 1;
|
|
55238
|
+
} else {
|
|
55239
|
+
let weightSum = 0;
|
|
55240
|
+
for (const { weight } of positiveWeight) {
|
|
55241
|
+
weightSum += weight;
|
|
55242
|
+
}
|
|
55243
|
+
averageWeight = weightSum / positiveWeight.length;
|
|
55244
|
+
}
|
|
55245
|
+
for (const child of children) {
|
|
55246
|
+
const period = child.weight > 0 ? 1 / child.weight : averageWeight;
|
|
55247
|
+
this.queue.push({
|
|
55248
|
+
endpointName: child.endpointName,
|
|
55249
|
+
picker: child.picker,
|
|
55250
|
+
period,
|
|
55251
|
+
deadline: Math.random() * period
|
|
55252
|
+
});
|
|
55253
|
+
}
|
|
55254
|
+
}
|
|
55255
|
+
pick(pickArgs) {
|
|
55256
|
+
const entry = this.queue.pop();
|
|
55257
|
+
this.queue.push(Object.assign(Object.assign({}, entry), { deadline: entry.deadline + entry.period }));
|
|
55258
|
+
const childPick = entry.picker.pick(pickArgs);
|
|
55259
|
+
if (childPick.pickResultType === picker_1.PickResultType.COMPLETE) {
|
|
55260
|
+
if (this.metricsHandler) {
|
|
55261
|
+
return Object.assign(Object.assign({}, childPick), { onCallEnded: (0, orca_1.createMetricsReader)((loadReport) => this.metricsHandler(loadReport, entry.endpointName), childPick.onCallEnded) });
|
|
55262
|
+
} else {
|
|
55263
|
+
const subchannelWrapper = childPick.subchannel;
|
|
55264
|
+
return Object.assign(Object.assign({}, childPick), { subchannel: subchannelWrapper.getWrappedSubchannel() });
|
|
55265
|
+
}
|
|
55266
|
+
} else {
|
|
55267
|
+
return childPick;
|
|
55268
|
+
}
|
|
55269
|
+
}
|
|
55270
|
+
}
|
|
55271
|
+
|
|
55272
|
+
class WeightedRoundRobinLoadBalancer {
|
|
55273
|
+
constructor(channelControlHelper) {
|
|
55274
|
+
this.channelControlHelper = channelControlHelper;
|
|
55275
|
+
this.latestConfig = null;
|
|
55276
|
+
this.children = new Map;
|
|
55277
|
+
this.currentState = connectivity_state_1.ConnectivityState.IDLE;
|
|
55278
|
+
this.updatesPaused = false;
|
|
55279
|
+
this.lastError = null;
|
|
55280
|
+
this.weightUpdateTimer = null;
|
|
55281
|
+
}
|
|
55282
|
+
countChildrenWithState(state) {
|
|
55283
|
+
let count = 0;
|
|
55284
|
+
for (const entry of this.children.values()) {
|
|
55285
|
+
if (entry.child.getConnectivityState() === state) {
|
|
55286
|
+
count += 1;
|
|
55287
|
+
}
|
|
55288
|
+
}
|
|
55289
|
+
return count;
|
|
55290
|
+
}
|
|
55291
|
+
updateWeight(entry, loadReport) {
|
|
55292
|
+
var _a, _b;
|
|
55293
|
+
const qps = loadReport.rps_fractional;
|
|
55294
|
+
let utilization = loadReport.application_utilization;
|
|
55295
|
+
if (utilization > 0 && qps > 0) {
|
|
55296
|
+
utilization += loadReport.eps / qps * ((_b = (_a = this.latestConfig) === null || _a === undefined ? undefined : _a.getErrorUtilizationPenalty()) !== null && _b !== undefined ? _b : 0);
|
|
55297
|
+
}
|
|
55298
|
+
const newWeight = utilization === 0 ? 0 : qps / utilization;
|
|
55299
|
+
if (newWeight === 0) {
|
|
55300
|
+
return;
|
|
55301
|
+
}
|
|
55302
|
+
const now = new Date;
|
|
55303
|
+
if (entry.nonEmptySince === null) {
|
|
55304
|
+
entry.nonEmptySince = now;
|
|
55305
|
+
}
|
|
55306
|
+
entry.lastUpdated = now;
|
|
55307
|
+
entry.weight = newWeight;
|
|
55308
|
+
}
|
|
55309
|
+
getWeight(entry) {
|
|
55310
|
+
if (!this.latestConfig) {
|
|
55311
|
+
return 0;
|
|
55312
|
+
}
|
|
55313
|
+
const now = new Date().getTime();
|
|
55314
|
+
if (now - entry.lastUpdated.getTime() >= this.latestConfig.getWeightExpirationPeriodMs()) {
|
|
55315
|
+
entry.nonEmptySince = null;
|
|
55316
|
+
return 0;
|
|
55317
|
+
}
|
|
55318
|
+
const blackoutPeriod = this.latestConfig.getBlackoutPeriodMs();
|
|
55319
|
+
if (blackoutPeriod > 0 && (entry.nonEmptySince === null || now - entry.nonEmptySince.getTime() < blackoutPeriod)) {
|
|
55320
|
+
return 0;
|
|
55321
|
+
}
|
|
55322
|
+
return entry.weight;
|
|
55323
|
+
}
|
|
55324
|
+
calculateAndUpdateState() {
|
|
55325
|
+
if (this.updatesPaused || !this.latestConfig) {
|
|
55326
|
+
return;
|
|
55327
|
+
}
|
|
55328
|
+
if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.READY) > 0) {
|
|
55329
|
+
const weightedPickers = [];
|
|
55330
|
+
for (const [endpoint, entry] of this.children) {
|
|
55331
|
+
if (entry.child.getConnectivityState() !== connectivity_state_1.ConnectivityState.READY) {
|
|
55332
|
+
continue;
|
|
55333
|
+
}
|
|
55334
|
+
weightedPickers.push({
|
|
55335
|
+
endpointName: endpoint,
|
|
55336
|
+
picker: entry.child.getPicker(),
|
|
55337
|
+
weight: this.getWeight(entry)
|
|
55338
|
+
});
|
|
55339
|
+
}
|
|
55340
|
+
trace("Created picker with weights: " + weightedPickers.map((entry) => entry.endpointName + ":" + entry.weight).join(","));
|
|
55341
|
+
let metricsHandler;
|
|
55342
|
+
if (!this.latestConfig.getEnableOobLoadReport()) {
|
|
55343
|
+
metricsHandler = (loadReport, endpointName) => {
|
|
55344
|
+
const childEntry = this.children.get(endpointName);
|
|
55345
|
+
if (childEntry) {
|
|
55346
|
+
this.updateWeight(childEntry, loadReport);
|
|
55347
|
+
}
|
|
55348
|
+
};
|
|
55349
|
+
} else {
|
|
55350
|
+
metricsHandler = null;
|
|
55351
|
+
}
|
|
55352
|
+
this.updateState(connectivity_state_1.ConnectivityState.READY, new WeightedRoundRobinPicker(weightedPickers, metricsHandler), null);
|
|
55353
|
+
} else if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.CONNECTING) > 0) {
|
|
55354
|
+
this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this), null);
|
|
55355
|
+
} else if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) > 0) {
|
|
55356
|
+
const errorMessage = `weighted_round_robin: No connection established. Last error: ${this.lastError}`;
|
|
55357
|
+
this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({
|
|
55358
|
+
details: errorMessage
|
|
55359
|
+
}), errorMessage);
|
|
55360
|
+
} else {
|
|
55361
|
+
this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this), null);
|
|
55362
|
+
}
|
|
55363
|
+
for (const { child } of this.children.values()) {
|
|
55364
|
+
if (child.getConnectivityState() === connectivity_state_1.ConnectivityState.IDLE) {
|
|
55365
|
+
child.exitIdle();
|
|
55366
|
+
}
|
|
55367
|
+
}
|
|
55368
|
+
}
|
|
55369
|
+
updateState(newState, picker, errorMessage) {
|
|
55370
|
+
trace(connectivity_state_1.ConnectivityState[this.currentState] + " -> " + connectivity_state_1.ConnectivityState[newState]);
|
|
55371
|
+
this.currentState = newState;
|
|
55372
|
+
this.channelControlHelper.updateState(newState, picker, errorMessage);
|
|
55373
|
+
}
|
|
55374
|
+
updateAddressList(maybeEndpointList, lbConfig, options, resolutionNote) {
|
|
55375
|
+
var _a, _b;
|
|
55376
|
+
if (!(lbConfig instanceof WeightedRoundRobinLoadBalancingConfig)) {
|
|
55377
|
+
return false;
|
|
55378
|
+
}
|
|
55379
|
+
if (!maybeEndpointList.ok) {
|
|
55380
|
+
if (this.children.size === 0) {
|
|
55381
|
+
this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker(maybeEndpointList.error), maybeEndpointList.error.details);
|
|
55382
|
+
}
|
|
55383
|
+
return true;
|
|
55384
|
+
}
|
|
55385
|
+
if (maybeEndpointList.value.length === 0) {
|
|
55386
|
+
const errorMessage = `No addresses resolved. Resolution note: ${resolutionNote}`;
|
|
55387
|
+
this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({ details: errorMessage }), errorMessage);
|
|
55388
|
+
return false;
|
|
55389
|
+
}
|
|
55390
|
+
trace("Connect to endpoint list " + maybeEndpointList.value.map(subchannel_address_1.endpointToString));
|
|
55391
|
+
const now = new Date;
|
|
55392
|
+
const seenEndpointNames = new Set;
|
|
55393
|
+
this.updatesPaused = true;
|
|
55394
|
+
this.latestConfig = lbConfig;
|
|
55395
|
+
for (const endpoint of maybeEndpointList.value) {
|
|
55396
|
+
const name = (0, subchannel_address_1.endpointToString)(endpoint);
|
|
55397
|
+
seenEndpointNames.add(name);
|
|
55398
|
+
let entry = this.children.get(name);
|
|
55399
|
+
if (!entry) {
|
|
55400
|
+
entry = {
|
|
55401
|
+
child: new load_balancer_pick_first_1.LeafLoadBalancer(endpoint, (0, load_balancer_1.createChildChannelControlHelper)(this.channelControlHelper, {
|
|
55402
|
+
updateState: (connectivityState, picker, errorMessage) => {
|
|
55403
|
+
if (this.currentState === connectivity_state_1.ConnectivityState.READY && connectivityState !== connectivity_state_1.ConnectivityState.READY) {
|
|
55404
|
+
this.channelControlHelper.requestReresolution();
|
|
55405
|
+
}
|
|
55406
|
+
if (connectivityState === connectivity_state_1.ConnectivityState.READY) {
|
|
55407
|
+
entry.nonEmptySince = null;
|
|
55408
|
+
}
|
|
55409
|
+
if (errorMessage) {
|
|
55410
|
+
this.lastError = errorMessage;
|
|
55411
|
+
}
|
|
55412
|
+
this.calculateAndUpdateState();
|
|
55413
|
+
},
|
|
55414
|
+
createSubchannel: (subchannelAddress, subchannelArgs) => {
|
|
55415
|
+
const subchannel = this.channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs);
|
|
55416
|
+
if (entry === null || entry === undefined ? undefined : entry.oobMetricsListener) {
|
|
55417
|
+
return new orca_1.OrcaOobMetricsSubchannelWrapper(subchannel, entry.oobMetricsListener, this.latestConfig.getOobLoadReportingPeriodMs());
|
|
55418
|
+
} else {
|
|
55419
|
+
return subchannel;
|
|
55420
|
+
}
|
|
55421
|
+
}
|
|
55422
|
+
}), options, resolutionNote),
|
|
55423
|
+
lastUpdated: now,
|
|
55424
|
+
nonEmptySince: null,
|
|
55425
|
+
weight: 0,
|
|
55426
|
+
oobMetricsListener: null
|
|
55427
|
+
};
|
|
55428
|
+
this.children.set(name, entry);
|
|
55429
|
+
}
|
|
55430
|
+
if (lbConfig.getEnableOobLoadReport()) {
|
|
55431
|
+
entry.oobMetricsListener = (loadReport) => {
|
|
55432
|
+
this.updateWeight(entry, loadReport);
|
|
55433
|
+
};
|
|
55434
|
+
} else {
|
|
55435
|
+
entry.oobMetricsListener = null;
|
|
55436
|
+
}
|
|
55437
|
+
}
|
|
55438
|
+
for (const [endpointName, entry] of this.children) {
|
|
55439
|
+
if (seenEndpointNames.has(endpointName)) {
|
|
55440
|
+
entry.child.startConnecting();
|
|
55441
|
+
} else {
|
|
55442
|
+
entry.child.destroy();
|
|
55443
|
+
this.children.delete(endpointName);
|
|
55444
|
+
}
|
|
55445
|
+
}
|
|
55446
|
+
this.updatesPaused = false;
|
|
55447
|
+
this.calculateAndUpdateState();
|
|
55448
|
+
if (this.weightUpdateTimer) {
|
|
55449
|
+
clearInterval(this.weightUpdateTimer);
|
|
55450
|
+
}
|
|
55451
|
+
this.weightUpdateTimer = (_b = (_a = setInterval(() => {
|
|
55452
|
+
if (this.currentState === connectivity_state_1.ConnectivityState.READY) {
|
|
55453
|
+
this.calculateAndUpdateState();
|
|
55454
|
+
}
|
|
55455
|
+
}, lbConfig.getWeightUpdatePeriodMs())).unref) === null || _b === undefined ? undefined : _b.call(_a);
|
|
55456
|
+
return true;
|
|
55457
|
+
}
|
|
55458
|
+
exitIdle() {}
|
|
55459
|
+
resetBackoff() {}
|
|
55460
|
+
destroy() {
|
|
55461
|
+
for (const entry of this.children.values()) {
|
|
55462
|
+
entry.child.destroy();
|
|
55463
|
+
}
|
|
55464
|
+
this.children.clear();
|
|
55465
|
+
if (this.weightUpdateTimer) {
|
|
55466
|
+
clearInterval(this.weightUpdateTimer);
|
|
55467
|
+
}
|
|
55468
|
+
}
|
|
55469
|
+
getTypeName() {
|
|
55470
|
+
return TYPE_NAME;
|
|
55471
|
+
}
|
|
55472
|
+
}
|
|
55473
|
+
function setup() {
|
|
55474
|
+
(0, load_balancer_1.registerLoadBalancerType)(TYPE_NAME, WeightedRoundRobinLoadBalancer, WeightedRoundRobinLoadBalancingConfig);
|
|
55475
|
+
}
|
|
55476
|
+
});
|
|
55477
|
+
|
|
54268
55478
|
// ../../node_modules/@grpc/grpc-js/build/src/index.js
|
|
54269
55479
|
var require_src26 = __commonJS((exports2) => {
|
|
54270
55480
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
54271
|
-
exports2.experimental = exports2.ServerInterceptingCall = exports2.ResponderBuilder = exports2.ServerListenerBuilder = exports2.addAdminServicesToServer = exports2.getChannelzHandlers = exports2.getChannelzServiceDefinition = exports2.InterceptorConfigurationError = exports2.InterceptingCall = exports2.RequesterBuilder = exports2.ListenerBuilder = exports2.StatusBuilder = exports2.getClientChannel = exports2.ServerCredentials = exports2.Server = exports2.setLogVerbosity = exports2.setLogger = exports2.load = exports2.loadObject = exports2.CallCredentials = exports2.ChannelCredentials = exports2.waitForClientReady = exports2.closeClient = exports2.Channel = exports2.makeGenericClientConstructor = exports2.makeClientConstructor = exports2.loadPackageDefinition = exports2.Client = exports2.compressionAlgorithms = exports2.propagate = exports2.connectivityState = exports2.status = exports2.logVerbosity = exports2.Metadata = exports2.credentials = undefined;
|
|
55481
|
+
exports2.experimental = exports2.ServerMetricRecorder = exports2.ServerInterceptingCall = exports2.ResponderBuilder = exports2.ServerListenerBuilder = exports2.addAdminServicesToServer = exports2.getChannelzHandlers = exports2.getChannelzServiceDefinition = exports2.InterceptorConfigurationError = exports2.InterceptingCall = exports2.RequesterBuilder = exports2.ListenerBuilder = exports2.StatusBuilder = exports2.getClientChannel = exports2.ServerCredentials = exports2.Server = exports2.setLogVerbosity = exports2.setLogger = exports2.load = exports2.loadObject = exports2.CallCredentials = exports2.ChannelCredentials = exports2.waitForClientReady = exports2.closeClient = exports2.Channel = exports2.makeGenericClientConstructor = exports2.makeClientConstructor = exports2.loadPackageDefinition = exports2.Client = exports2.compressionAlgorithms = exports2.propagate = exports2.connectivityState = exports2.status = exports2.logVerbosity = exports2.Metadata = exports2.credentials = undefined;
|
|
54272
55482
|
var call_credentials_1 = require_call_credentials();
|
|
54273
55483
|
Object.defineProperty(exports2, "CallCredentials", { enumerable: true, get: function() {
|
|
54274
55484
|
return call_credentials_1.CallCredentials;
|
|
@@ -54402,6 +55612,10 @@ var require_src26 = __commonJS((exports2) => {
|
|
|
54402
55612
|
Object.defineProperty(exports2, "ServerInterceptingCall", { enumerable: true, get: function() {
|
|
54403
55613
|
return server_interceptors_1.ServerInterceptingCall;
|
|
54404
55614
|
} });
|
|
55615
|
+
var orca_1 = require_orca();
|
|
55616
|
+
Object.defineProperty(exports2, "ServerMetricRecorder", { enumerable: true, get: function() {
|
|
55617
|
+
return orca_1.ServerMetricRecorder;
|
|
55618
|
+
} });
|
|
54405
55619
|
var experimental = require_experimental();
|
|
54406
55620
|
exports2.experimental = experimental;
|
|
54407
55621
|
var resolver_dns = require_resolver_dns();
|
|
@@ -54410,6 +55624,7 @@ var require_src26 = __commonJS((exports2) => {
|
|
|
54410
55624
|
var load_balancer_pick_first = require_load_balancer_pick_first();
|
|
54411
55625
|
var load_balancer_round_robin = require_load_balancer_round_robin();
|
|
54412
55626
|
var load_balancer_outlier_detection = require_load_balancer_outlier_detection();
|
|
55627
|
+
var load_balancer_weighted_round_robin = require_load_balancer_weighted_round_robin();
|
|
54413
55628
|
var channelz = require_channelz();
|
|
54414
55629
|
(() => {
|
|
54415
55630
|
resolver_dns.setup();
|
|
@@ -54418,6 +55633,7 @@ var require_src26 = __commonJS((exports2) => {
|
|
|
54418
55633
|
load_balancer_pick_first.setup();
|
|
54419
55634
|
load_balancer_round_robin.setup();
|
|
54420
55635
|
load_balancer_outlier_detection.setup();
|
|
55636
|
+
load_balancer_weighted_round_robin.setup();
|
|
54421
55637
|
channelz.setup();
|
|
54422
55638
|
})();
|
|
54423
55639
|
});
|
|
@@ -72271,7 +73487,7 @@ var require_performance12 = __commonJS((exports2) => {
|
|
|
72271
73487
|
var require_version20 = __commonJS((exports2) => {
|
|
72272
73488
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
72273
73489
|
exports2.VERSION = undefined;
|
|
72274
|
-
exports2.VERSION = "2.0
|
|
73490
|
+
exports2.VERSION = "2.1.0";
|
|
72275
73491
|
});
|
|
72276
73492
|
|
|
72277
73493
|
// ../../node_modules/@opentelemetry/core/build/src/semconv.js
|
|
@@ -72738,7 +73954,7 @@ var require_lodash_merge12 = __commonJS((exports2) => {
|
|
|
72738
73954
|
try {
|
|
72739
73955
|
value[symToStringTag] = undefined;
|
|
72740
73956
|
unmasked = true;
|
|
72741
|
-
} catch
|
|
73957
|
+
} catch {}
|
|
72742
73958
|
const result = nativeObjectToString.call(value);
|
|
72743
73959
|
if (unmasked) {
|
|
72744
73960
|
if (isOwn) {
|
|
@@ -89298,6 +90514,7 @@ var require_AwsEcsDetector = __commonJS((exports2) => {
|
|
|
89298
90514
|
|
|
89299
90515
|
class AwsEcsDetector {
|
|
89300
90516
|
static CONTAINER_ID_LENGTH = 64;
|
|
90517
|
+
static CONTAINER_ID_LENGTH_MIN = 32;
|
|
89301
90518
|
static DEFAULT_CGROUP_PATH = "/proc/self/cgroup";
|
|
89302
90519
|
static readFileAsync = util.promisify(fs.readFile);
|
|
89303
90520
|
detect() {
|
|
@@ -89359,21 +90576,53 @@ var require_AwsEcsDetector = __commonJS((exports2) => {
|
|
|
89359
90576
|
}
|
|
89360
90577
|
}
|
|
89361
90578
|
async _getContainerId() {
|
|
89362
|
-
let containerId = undefined;
|
|
89363
90579
|
try {
|
|
89364
90580
|
const rawData = await AwsEcsDetector.readFileAsync(AwsEcsDetector.DEFAULT_CGROUP_PATH, "utf8");
|
|
89365
|
-
const
|
|
89366
|
-
`);
|
|
89367
|
-
for (const
|
|
89368
|
-
|
|
89369
|
-
|
|
89370
|
-
|
|
89371
|
-
|
|
90581
|
+
const lines = rawData.split(`
|
|
90582
|
+
`).map((s) => s.trim()).filter(Boolean);
|
|
90583
|
+
for (const line of lines) {
|
|
90584
|
+
const id = this._extractPrimaryEcsContainerId(line);
|
|
90585
|
+
if (id)
|
|
90586
|
+
return id;
|
|
90587
|
+
}
|
|
90588
|
+
for (const line of lines) {
|
|
90589
|
+
const id = this._extractLastSegmentContainerId(line);
|
|
90590
|
+
if (id)
|
|
90591
|
+
return id;
|
|
90592
|
+
}
|
|
90593
|
+
for (const line of lines) {
|
|
90594
|
+
const id = this._extractLegacyContainerId(line);
|
|
90595
|
+
if (id)
|
|
90596
|
+
return id;
|
|
89372
90597
|
}
|
|
89373
90598
|
} catch (e) {
|
|
89374
90599
|
api_1.diag.debug("AwsEcsDetector failed to read container ID", e);
|
|
89375
90600
|
}
|
|
89376
|
-
return
|
|
90601
|
+
return;
|
|
90602
|
+
}
|
|
90603
|
+
_extractPrimaryEcsContainerId(line) {
|
|
90604
|
+
const ecsPattern = /\/ecs\/[a-fA-F0-9-]+\/([a-fA-F0-9-]+)$/;
|
|
90605
|
+
const match = line.match(ecsPattern);
|
|
90606
|
+
if (match && match[1] && match[1].length >= AwsEcsDetector.CONTAINER_ID_LENGTH_MIN && match[1].length <= AwsEcsDetector.CONTAINER_ID_LENGTH) {
|
|
90607
|
+
return match[1];
|
|
90608
|
+
}
|
|
90609
|
+
return;
|
|
90610
|
+
}
|
|
90611
|
+
_extractLastSegmentContainerId(line) {
|
|
90612
|
+
const parts = line.split("/");
|
|
90613
|
+
if (parts.length <= 1)
|
|
90614
|
+
return;
|
|
90615
|
+
const last = parts[parts.length - 1];
|
|
90616
|
+
if (last && last.length >= AwsEcsDetector.CONTAINER_ID_LENGTH_MIN && last.length <= AwsEcsDetector.CONTAINER_ID_LENGTH && /^[a-fA-F0-9-]+$/.test(last)) {
|
|
90617
|
+
return last;
|
|
90618
|
+
}
|
|
90619
|
+
return;
|
|
90620
|
+
}
|
|
90621
|
+
_extractLegacyContainerId(line) {
|
|
90622
|
+
if (line.length > AwsEcsDetector.CONTAINER_ID_LENGTH) {
|
|
90623
|
+
return line.substring(line.length - AwsEcsDetector.CONTAINER_ID_LENGTH);
|
|
90624
|
+
}
|
|
90625
|
+
return;
|
|
89377
90626
|
}
|
|
89378
90627
|
static _addMetadataV4Attrs(data, containerMetadata, taskMetadata) {
|
|
89379
90628
|
const launchType = taskMetadata["LaunchType"];
|
|
@@ -100726,14 +101975,15 @@ var require_ResourceImpl7 = __commonJS((exports2) => {
|
|
|
100726
101975
|
class ResourceImpl {
|
|
100727
101976
|
_rawAttributes;
|
|
100728
101977
|
_asyncAttributesPending = false;
|
|
101978
|
+
_schemaUrl;
|
|
100729
101979
|
_memoizedAttributes;
|
|
100730
|
-
static FromAttributeList(attributes) {
|
|
100731
|
-
const res = new ResourceImpl({});
|
|
101980
|
+
static FromAttributeList(attributes, options) {
|
|
101981
|
+
const res = new ResourceImpl({}, options);
|
|
100732
101982
|
res._rawAttributes = guardedRawAttributes(attributes);
|
|
100733
101983
|
res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0;
|
|
100734
101984
|
return res;
|
|
100735
101985
|
}
|
|
100736
|
-
constructor(resource) {
|
|
101986
|
+
constructor(resource, options) {
|
|
100737
101987
|
const attributes = resource.attributes ?? {};
|
|
100738
101988
|
this._rawAttributes = Object.entries(attributes).map(([k, v]) => {
|
|
100739
101989
|
if ((0, utils_1.isPromiseLike)(v)) {
|
|
@@ -100742,6 +101992,7 @@ var require_ResourceImpl7 = __commonJS((exports2) => {
|
|
|
100742
101992
|
return [k, v];
|
|
100743
101993
|
});
|
|
100744
101994
|
this._rawAttributes = guardedRawAttributes(this._rawAttributes);
|
|
101995
|
+
this._schemaUrl = validateSchemaUrl(options?.schemaUrl);
|
|
100745
101996
|
}
|
|
100746
101997
|
get asyncAttributesPending() {
|
|
100747
101998
|
return this._asyncAttributesPending;
|
|
@@ -100781,21 +102032,23 @@ var require_ResourceImpl7 = __commonJS((exports2) => {
|
|
|
100781
102032
|
getRawAttributes() {
|
|
100782
102033
|
return this._rawAttributes;
|
|
100783
102034
|
}
|
|
102035
|
+
get schemaUrl() {
|
|
102036
|
+
return this._schemaUrl;
|
|
102037
|
+
}
|
|
100784
102038
|
merge(resource) {
|
|
100785
102039
|
if (resource == null)
|
|
100786
102040
|
return this;
|
|
100787
|
-
|
|
100788
|
-
|
|
100789
|
-
|
|
100790
|
-
]);
|
|
102041
|
+
const mergedSchemaUrl = mergeSchemaUrl(this, resource);
|
|
102042
|
+
const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : undefined;
|
|
102043
|
+
return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions);
|
|
100791
102044
|
}
|
|
100792
102045
|
}
|
|
100793
|
-
function resourceFromAttributes(attributes) {
|
|
100794
|
-
return ResourceImpl.FromAttributeList(Object.entries(attributes));
|
|
102046
|
+
function resourceFromAttributes(attributes, options) {
|
|
102047
|
+
return ResourceImpl.FromAttributeList(Object.entries(attributes), options);
|
|
100795
102048
|
}
|
|
100796
102049
|
exports2.resourceFromAttributes = resourceFromAttributes;
|
|
100797
|
-
function resourceFromDetectedResource(detectedResource) {
|
|
100798
|
-
return new ResourceImpl(detectedResource);
|
|
102050
|
+
function resourceFromDetectedResource(detectedResource, options) {
|
|
102051
|
+
return new ResourceImpl(detectedResource, options);
|
|
100799
102052
|
}
|
|
100800
102053
|
exports2.resourceFromDetectedResource = resourceFromDetectedResource;
|
|
100801
102054
|
function emptyResource() {
|
|
@@ -100825,6 +102078,30 @@ var require_ResourceImpl7 = __commonJS((exports2) => {
|
|
|
100825
102078
|
return [k, v];
|
|
100826
102079
|
});
|
|
100827
102080
|
}
|
|
102081
|
+
function validateSchemaUrl(schemaUrl) {
|
|
102082
|
+
if (typeof schemaUrl === "string" || schemaUrl === undefined) {
|
|
102083
|
+
return schemaUrl;
|
|
102084
|
+
}
|
|
102085
|
+
api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl);
|
|
102086
|
+
return;
|
|
102087
|
+
}
|
|
102088
|
+
function mergeSchemaUrl(old, updating) {
|
|
102089
|
+
const oldSchemaUrl = old?.schemaUrl;
|
|
102090
|
+
const updatingSchemaUrl = updating?.schemaUrl;
|
|
102091
|
+
const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === "";
|
|
102092
|
+
const isUpdatingEmpty = updatingSchemaUrl === undefined || updatingSchemaUrl === "";
|
|
102093
|
+
if (isOldEmpty) {
|
|
102094
|
+
return updatingSchemaUrl;
|
|
102095
|
+
}
|
|
102096
|
+
if (isUpdatingEmpty) {
|
|
102097
|
+
return oldSchemaUrl;
|
|
102098
|
+
}
|
|
102099
|
+
if (oldSchemaUrl === updatingSchemaUrl) {
|
|
102100
|
+
return oldSchemaUrl;
|
|
102101
|
+
}
|
|
102102
|
+
api_1.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.', oldSchemaUrl, updatingSchemaUrl);
|
|
102103
|
+
return;
|
|
102104
|
+
}
|
|
100828
102105
|
});
|
|
100829
102106
|
|
|
100830
102107
|
// ../../node_modules/@opentelemetry/resources/build/src/detect-resources.js
|
|
@@ -102602,7 +103879,7 @@ var require_ExponentialHistogram5 = __commonJS((exports2) => {
|
|
|
102602
103879
|
_positive;
|
|
102603
103880
|
_negative;
|
|
102604
103881
|
_mapping;
|
|
102605
|
-
constructor(startTime
|
|
103882
|
+
constructor(startTime, _maxSize = DEFAULT_MAX_SIZE, _recordMinMax = true, _sum = 0, _count = 0, _zeroCount = 0, _min = Number.POSITIVE_INFINITY, _max = Number.NEGATIVE_INFINITY, _positive = new Buckets_1.Buckets, _negative = new Buckets_1.Buckets, _mapping = (0, getMapping_1.getMapping)(MAX_SCALE)) {
|
|
102606
103883
|
this.startTime = startTime;
|
|
102607
103884
|
this._maxSize = _maxSize;
|
|
102608
103885
|
this._recordMinMax = _recordMinMax;
|