@koda-sl/baker-cli 0.470.0 → 0.471.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -5
- package/dist/{account-GIZWP5QF.js → account-SP2RA2XD.js} +4 -4
- package/dist/{accounts-CQUW36ZY.js → accounts-R2ZLSJEW.js} +3 -3
- package/dist/{accounts-5KDBVRJ2.js → accounts-XG5W4JC4.js} +5 -5
- package/dist/{actions-BDC7CQ3R.js → actions-LZE7K24U.js} +18 -18
- package/dist/activecampaign-RKTIWG4U.js +935 -0
- package/dist/activecampaign-RKTIWG4U.js.map +1 -0
- package/dist/{add-3M6T5MLO.js → add-7LC2XDIE.js} +3 -3
- package/dist/{add-2N3G4EUY.js → add-XKSQMOFC.js} +2 -2
- package/dist/{ads-626CEAXU.js → ads-AEQPHUOB.js} +4 -4
- package/dist/{advertisers-XHIAWVLX.js → advertisers-FFRP4SQ3.js} +3 -3
- package/dist/{analytics-JK53QUDI.js → analytics-PQSMY2BS.js} +3 -3
- package/dist/{analytics-L4UTJ5RA.js → analytics-SETCYHRK.js} +15 -15
- package/dist/{assign-SH76OUMA.js → assign-3UKKZ3Q3.js} +3 -3
- package/dist/{audience-size-RXOBSRN5.js → audience-size-YBLT324O.js} +3 -3
- package/dist/{audit-RLYCO6Q6.js → audit-C6HEPG2Z.js} +3 -3
- package/dist/{autocomplete-QQ56I5YS.js → autocomplete-EYIWA7PG.js} +3 -3
- package/dist/{avatars-T66JDLVN.js → avatars-YDGM27UP.js} +4 -4
- package/dist/{bid-pricing-6UD42SON.js → bid-pricing-KSREYT6M.js} +3 -3
- package/dist/{brand-CRNZCOV2.js → brand-46IADVGO.js} +2 -2
- package/dist/{brief-NU5FLVPY.js → brief-54ZL3EXF.js} +7 -7
- package/dist/{campaign-groups-5HMTK5J5.js → campaign-groups-KT3BNDFJ.js} +8 -8
- package/dist/{campaign-writes-BGAS7L64.js → campaign-writes-FQJD4DWV.js} +3 -3
- package/dist/{campaigns-OM5FQIR6.js → campaigns-2PQHW6SO.js} +5 -5
- package/dist/{campaigns-R624HC75.js → campaigns-XQVYFSZG.js} +11 -11
- package/dist/{canvas-XOOXIOIM.js → canvas-YOO4IHGS.js} +12 -12
- package/dist/{capabilities-AH763WSY.js → capabilities-6QWU3ZJH.js} +3 -3
- package/dist/{chats-DNLK6TTQ.js → chats-VTM5S5Q5.js} +3 -3
- package/dist/{chunk-DBAO7JLW.js → chunk-2CMRJQY7.js} +3 -3
- package/dist/{chunk-WNTVBUVI.js → chunk-2KACEWPN.js} +4 -4
- package/dist/{chunk-HM25R6XJ.js → chunk-3BXQSDMJ.js} +2 -2
- package/dist/{chunk-2EINLGUZ.js → chunk-44TCHDXM.js} +3 -3
- package/dist/{chunk-ME6PYW77.js → chunk-4C7SIRHL.js} +2 -2
- package/dist/{chunk-HHOKZCIL.js → chunk-4I4UB4ZE.js} +3 -3
- package/dist/{chunk-V6GKEKPX.js → chunk-4LIYWGQL.js} +2 -2
- package/dist/{chunk-ZZMP35QD.js → chunk-4LXKCSWY.js} +2 -2
- package/dist/{chunk-PYPILVCC.js → chunk-53DV3HBZ.js} +2 -2
- package/dist/{chunk-XASW5FLO.js → chunk-6A2X5MPY.js} +2 -2
- package/dist/{chunk-XSFBGHGG.js → chunk-6EEYWFD5.js} +2 -2
- package/dist/{chunk-WWCQBHDC.js → chunk-6S44QXXI.js} +2 -2
- package/dist/{chunk-7MQVCSA7.js → chunk-6USNEQZT.js} +182 -100
- package/dist/chunk-6USNEQZT.js.map +1 -0
- package/dist/{chunk-XQ2FGDOQ.js → chunk-7NWOGEAW.js} +2 -2
- package/dist/{chunk-CAA32DMC.js → chunk-7SLEBQIM.js} +5 -5
- package/dist/{chunk-KBHXLOYJ.js → chunk-7ZSLXBOS.js} +2 -2
- package/dist/{chunk-WB77W2ST.js → chunk-BAEXXBRM.js} +293 -12
- package/dist/chunk-BAEXXBRM.js.map +1 -0
- package/dist/{chunk-SSJK7FEV.js → chunk-BC2BXRXY.js} +3 -2
- package/dist/{chunk-SSJK7FEV.js.map → chunk-BC2BXRXY.js.map} +1 -1
- package/dist/{chunk-MPXDQWYI.js → chunk-BMD3HCSI.js} +3 -3
- package/dist/{chunk-ACDS7T57.js → chunk-CS4NPJ2M.js} +13 -7
- package/dist/chunk-CS4NPJ2M.js.map +1 -0
- package/dist/{chunk-VXRGAUZK.js → chunk-D536MQC6.js} +3 -3
- package/dist/{chunk-YT74ZEVP.js → chunk-GFX3BZRA.js} +2 -2
- package/dist/{chunk-T4V6KQY2.js → chunk-IPWXGR65.js} +2 -2
- package/dist/{chunk-DA2ANVMG.js → chunk-IWE7WFHI.js} +3 -3
- package/dist/{chunk-4XZSZRCG.js → chunk-KLPCKKBZ.js} +2 -2
- package/dist/{chunk-M55JELFT.js → chunk-MM6QFNHV.js} +2 -2
- package/dist/{chunk-EPZNFXI2.js → chunk-NBXFSSCW.js} +3 -3
- package/dist/{chunk-IL7PZKQN.js → chunk-OCFYRZQW.js} +2 -2
- package/dist/{chunk-RPUSTYHL.js → chunk-PAJJXZ3Z.js} +2 -2
- package/dist/{chunk-F6G3RECD.js → chunk-PB4RAOBC.js} +3 -3
- package/dist/{chunk-T6USZ3EO.js → chunk-QHNHW76K.js} +2 -2
- package/dist/{chunk-BAXURR55.js → chunk-QNDZNMUS.js} +5 -5
- package/dist/{chunk-CTLAIMJP.js → chunk-QO6QHZTW.js} +2 -2
- package/dist/{chunk-ISDCUB2Q.js → chunk-TCQFIUKQ.js} +2 -2
- package/dist/{chunk-MSJKALUF.js → chunk-WTL5RI2J.js} +2 -2
- package/dist/{chunk-WXC3I4CT.js → chunk-XABVEMC3.js} +37 -11
- package/dist/chunk-XABVEMC3.js.map +1 -0
- package/dist/{chunk-A3VUXG5G.js → chunk-YRERFQ7Z.js} +2 -2
- package/dist/{claim-YXL2HUFU.js → claim-KPJXAUQW.js} +3 -3
- package/dist/cli.js +28 -27
- package/dist/cli.js.map +1 -1
- package/dist/{companies-U55HX5JN.js → companies-SD36QDTM.js} +3 -3
- package/dist/{complete-VABZEJTL.js → complete-Y3M6OXPA.js} +3 -3
- package/dist/{connect-6KS42I3C.js → connect-QNPBSMWK.js} +6 -6
- package/dist/{conversation-UEIXBJ32.js → conversation-EEL3AY6B.js} +3 -3
- package/dist/{conversions-V7ZPJ5T7.js → conversions-7A34JRO4.js} +7 -7
- package/dist/{create-5NLAAJE4.js → create-4H273ZGZ.js} +3 -3
- package/dist/{create-7L6SXSPH.js → create-6NJRTWYT.js} +3 -3
- package/dist/{create-UMVQNYZF.js → create-GKC3DLQK.js} +2 -2
- package/dist/{create-NZIFE6O7.js → create-JTTFEJZE.js} +3 -3
- package/dist/{creatives-5V3ZGVO6.js → creatives-FNHTRAAH.js} +8 -8
- package/dist/{creatives-4A4HJKD3.js → creatives-IFAOJHLW.js} +10 -10
- package/dist/{credentials-PB3RFZOC.js → credentials-7L3K6QFN.js} +3 -3
- package/dist/{critique-SZRPZU2P.js → critique-BZLL3N37.js} +5 -5
- package/dist/{critique-FRBVRWVL.js → critique-GEBGDHWB.js} +3 -3
- package/dist/{crm-SVQ22Q6N.js → crm-4IGMD5QF.js} +4 -4
- package/dist/{crm-I6E2FACM.js → crm-J3HX3ZT6.js} +4 -4
- package/dist/{customers-ZB6EYQEH.js → customers-TSJH2AUE.js} +5 -5
- package/dist/{delete-I7MTK63S.js → delete-56HFQZCX.js} +2 -2
- package/dist/{delete-7MNFMQ6X.js → delete-JZUAO6LZ.js} +3 -3
- package/dist/{delete-HE2ACICZ.js → delete-XTCS5H6L.js} +3 -3
- package/dist/{demographics-BLL7UL26.js → demographics-DKT2UN4S.js} +3 -3
- package/dist/{discard-6GTJKV37.js → discard-2357VMCI.js} +3 -3
- package/dist/{domain-FHJKL6ZC.js → domain-NM553OX2.js} +3 -3
- package/dist/{draft-3GZ3RTYT.js → draft-FDJK7FLI.js} +3 -3
- package/dist/{draft-4W5CP2R7.js → draft-NEXKT5HF.js} +4 -4
- package/dist/{draft-REIQ6JCS.js → draft-UDDLC7YZ.js} +3 -3
- package/dist/{facets-HCI6JP4Q.js → facets-6R4DOSZJ.js} +3 -3
- package/dist/{feedback-CM63S3ME.js → feedback-WW6YQQJA.js} +2 -2
- package/dist/{feedback-record-4EPVZ6BQ.js → feedback-record-KGYP2IUQ.js} +7 -7
- package/dist/{fetch-2ZONBBKW.js → fetch-JGUKB6R7.js} +3 -3
- package/dist/{flows-HXJXVGLU.js → flows-MI2FZJU2.js} +11 -11
- package/dist/{flows-HXJXVGLU.js.map → flows-MI2FZJU2.js.map} +1 -1
- package/dist/{fonts-T6BDCPSZ.js → fonts-JRQFPSS6.js} +5 -5
- package/dist/{forecast-EKOVQJ4F.js → forecast-72GMGD64.js} +3 -3
- package/dist/{funnel-ISMIHL3P.js → funnel-BJJQI72Z.js} +5 -5
- package/dist/{get-X5B6VCSC.js → get-DC3WBYJD.js} +3 -3
- package/dist/{get-LSIYBPPA.js → get-HTAU7NQU.js} +3 -3
- package/dist/{google-S7AQ7KOJ.js → google-UC5RRXF3.js} +2 -2
- package/dist/{google-ads-VYRPY3FQ.js → google-ads-OLFRVBP6.js} +3 -3
- package/dist/{history-2F3IPVQU.js → history-IFJKE65W.js} +3 -3
- package/dist/{hubspot-VFGBXW2X.js → hubspot-AT4E52RB.js} +7 -7
- package/dist/{ideas-FYW4XSSC.js → ideas-BUJVMRQF.js} +2 -2
- package/dist/{images-3EHPQRQD.js → images-MWG3CNPG.js} +4 -4
- package/dist/{ingest-SREMQAWS.js → ingest-F7XSH47V.js} +2 -2
- package/dist/{ingest-OFVANVIF.js → ingest-XIX4CZ2P.js} +3 -3
- package/dist/{inspect-PWUKLRNZ.js → inspect-4O2SAWNX.js} +3 -3
- package/dist/{keyword-metrics-SGOGGYHN.js → keyword-metrics-4UDAJAQJ.js} +3 -3
- package/dist/{keywords-for-site-NAZSCVQR.js → keywords-for-site-HZCZK3EI.js} +3 -3
- package/dist/{landing-33KYCXXA.js → landing-2L325EK3.js} +2 -2
- package/dist/{leads-Y3PFOEGM.js → leads-TNZW3RTA.js} +3 -3
- package/dist/{learn-WQ2QQ77L.js → learn-KNTDSDPX.js} +4 -4
- package/dist/{line-item-writes-S4JLVWTU.js → line-item-writes-6BWPQSOY.js} +3 -3
- package/dist/{line-items-DMXOAXFU.js → line-items-525PQOI3.js} +5 -5
- package/dist/{link-4DNY5OSY.js → link-SJQFQLTY.js} +3 -3
- package/dist/{linkedin-D22GQOKW.js → linkedin-OD36IRJS.js} +26 -26
- package/dist/{list-YFET6MM3.js → list-DKA4BDKT.js} +2 -2
- package/dist/{list-H7V6MUUV.js → list-QEPDSHHY.js} +3 -3
- package/dist/{list-CQXOFLNY.js → list-X3Q5MSYK.js} +3 -3
- package/dist/{log-SA4GFECI.js → log-S4U4JQ77.js} +3 -3
- package/dist/{lookup-32HPES25.js → lookup-CMB2JELV.js} +4 -4
- package/dist/{make-T2JR6IA5.js → make-ZKG6IKEL.js} +10 -10
- package/dist/{map-OMWTKH4J.js → map-DOGBZT3Y.js} +40 -11
- package/dist/map-DOGBZT3Y.js.map +1 -0
- package/dist/{mcp-OM6JLDQ6.js → mcp-ACBDK6UV.js} +2 -2
- package/dist/{media-sources-JHTGT6FF.js → media-sources-LCIPLOTF.js} +2 -2
- package/dist/{members-KDJBWRU5.js → members-3B43WCMP.js} +3 -3
- package/dist/{normalize-JEXAJD4K.js → normalize-QFKNYVLR.js} +3 -3
- package/dist/{options-CL2VJ26D.js → options-434QB4V6.js} +9 -8
- package/dist/options-434QB4V6.js.map +1 -0
- package/dist/{performance-SI2ZRX5D.js → performance-ZOWSMCZF.js} +4 -4
- package/dist/{plan-UEYS6CHL.js → plan-PZVXAECA.js} +3 -3
- package/dist/{promoted-tweet-writes-ADZNQUNV.js → promoted-tweet-writes-UBK3GPXT.js} +3 -3
- package/dist/{promoted-tweets-CNREPMPQ.js → promoted-tweets-MTZ7SSVK.js} +3 -3
- package/dist/{publish-2MQNUKLF.js → publish-N7WR2HAO.js} +3 -3
- package/dist/{questionnaire-4HSUNNNC.js → questionnaire-SGHGA4AZ.js} +3 -3
- package/dist/{reddit-C73WD45T.js → reddit-LWV2OILV.js} +4 -4
- package/dist/{refresh-FYOCED4T.js → refresh-GGMYGGUW.js} +2 -2
- package/dist/{release-HJZCWKY6.js → release-B5B7TWMA.js} +3 -3
- package/dist/{remove-WB6LFXWK.js → remove-EWZMAYUI.js} +2 -2
- package/dist/{reopen-3VQ4NYZ5.js → reopen-BAE4WPC6.js} +3 -3
- package/dist/{rerun-OV3TEE6P.js → rerun-KHHPDTLP.js} +10 -10
- package/dist/{research-6WRKGPRC.js → research-GR27TIGA.js} +2 -2
- package/dist/{research-7JKXF6BI.js → research-KMKYFBWF.js} +10 -10
- package/dist/{reset-5BMABGUG.js → reset-6XVTFUBM.js} +2 -2
- package/dist/{reset-F4BDAHUI.js → reset-BU6IJGOR.js} +2 -2
- package/dist/{resolve-QRATNPWX.js → resolve-3EPJNPRF.js} +3 -3
- package/dist/{retry-B4JRFPPF.js → retry-SWTQWKJM.js} +2 -2
- package/dist/{retry-SQSIAX33.js → retry-U4XMO7PA.js} +2 -2
- package/dist/{run-FU3UF4YV.js → run-EXER4CJ5.js} +10 -10
- package/dist/{run-6NXPDWRP.js → run-YVWGH5C5.js} +3 -3
- package/dist/{scaffold-ad-4VTZB4JH.js → scaffold-ad-HKGKQUR7.js} +8 -8
- package/dist/{scaffold-static-ad-AB2RG3SH.js → scaffold-static-ad-Q3AU7QQ4.js} +12 -12
- package/dist/{scaffold-video-RSGJWHHT.js → scaffold-video-M63JFOPT.js} +7 -7
- package/dist/{schedule-WZF3BQSX.js → schedule-RILFJJ2P.js} +2 -2
- package/dist/{scheduled-agents-J75TOVGN.js → scheduled-agents-CUSH7BI5.js} +11 -11
- package/dist/{schema-O5PX4O4J.js → schema-JASSX36C.js} +4 -4
- package/dist/{search-WYO77TIF.js → search-PP5PH3NM.js} +2 -2
- package/dist/{select-G5W6WGRB.js → select-O4NQK5A4.js} +7 -7
- package/dist/{sends-E5NSPLNS.js → sends-ZOT5WPVC.js} +3 -3
- package/dist/{set-prompt-PJA7LUUJ.js → set-prompt-SHMGN6KR.js} +5 -5
- package/dist/{setup-links-HFWMDF6E.js → setup-links-6THA2YOJ.js} +3 -3
- package/dist/{site-YJJBAS7M.js → site-JRCQUJOE.js} +4 -4
- package/dist/{sources-MCAH4GWS.js → sources-M7VWKKCP.js} +48 -15
- package/dist/sources-M7VWKKCP.js.map +1 -0
- package/dist/{sources-VRRDVWZC.js → sources-WRC3LAZQ.js} +6 -6
- package/dist/{stale-I6UGM3MO.js → stale-ZBXHYQ6Z.js} +6 -6
- package/dist/{status-TCOUMPJS.js → status-GG6UTBWM.js} +3 -3
- package/dist/{sync-TWV4HUHZ.js → sync-6R64PGCZ.js} +2 -2
- package/dist/{sync-definition-K6UMLDZF.js → sync-definition-YTTTJMV4.js} +7 -7
- package/dist/{tags-AWO5FFGM.js → tags-4CEVGCMN.js} +2 -2
- package/dist/{tags-NBUNSN5L.js → tags-7CGYLMST.js} +3 -3
- package/dist/{tags-NBVQWFS2.js → tags-H6MESAFQ.js} +4 -4
- package/dist/{tags-ZOK7CY4V.js → tags-PAEIW2UI.js} +3 -3
- package/dist/{tags-DGLT344J.js → tags-PLB6UT4U.js} +3 -3
- package/dist/{targeting-criteria-MG7RLBOG.js → targeting-criteria-G2BAM34G.js} +3 -3
- package/dist/{targets-2B5AG4E4.js → targets-HE2LJCHE.js} +3 -3
- package/dist/{templates-IXF2C2LD.js → templates-OSMHAXLI.js} +3 -3
- package/dist/{testimonials-WNNC5PKQ.js → testimonials-7LPKA54Y.js} +6 -6
- package/dist/{top-companies-B2IZYN4T.js → top-companies-QYBVUFSB.js} +3 -3
- package/dist/{translate-MGMGQ27R.js → translate-67D6PBVJ.js} +10 -10
- package/dist/{triggers-3DDV3OJ3.js → triggers-BEJHXIRZ.js} +3 -3
- package/dist/{unlink-6M577LT6.js → unlink-ANZSGHCG.js} +3 -3
- package/dist/{unstage-KNCIQR4E.js → unstage-HU7G23ZL.js} +3 -3
- package/dist/{unstage-4EJNGWUT.js → unstage-JDC2HBEI.js} +3 -3
- package/dist/{update-7SK6PHDL.js → update-2QJ2F43N.js} +2 -2
- package/dist/{update-4NHLEM64.js → update-4DATQZGJ.js} +3 -3
- package/dist/{update-U3GEUFNY.js → update-7226ZVPC.js} +3 -3
- package/dist/{update-PMFYYMFX.js → update-K7EJ45LU.js} +3 -3
- package/dist/{upload-ITKCCYOQ.js → upload-42A6MAS3.js} +3 -3
- package/dist/{url-options-UFRD42MD.js → url-options-3XRKJSFA.js} +2 -2
- package/dist/{url-params-GAEQM2MQ.js → url-params-EHUS5YG5.js} +3 -3
- package/dist/{validate-4P2L4AXG.js → validate-KBPZX2H7.js} +5 -5
- package/dist/{videos-YVGJ3WO5.js → videos-FILPMPRL.js} +5 -5
- package/dist/{web-M7EYV5DF.js → web-KZFJIKDU.js} +3 -3
- package/dist/{winning-ads-4SU5DBEY.js → winning-ads-NLHGB3GX.js} +2 -2
- package/dist/{write-commands-7FT3MTOZ.js → write-commands-JCM6ZMUJ.js} +4 -4
- package/dist/{x-ESEGQ3W2.js → x-GVNB2MV2.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-7MQVCSA7.js.map +0 -1
- package/dist/chunk-ACDS7T57.js.map +0 -1
- package/dist/chunk-WB77W2ST.js.map +0 -1
- package/dist/chunk-WXC3I4CT.js.map +0 -1
- package/dist/map-OMWTKH4J.js.map +0 -1
- package/dist/options-CL2VJ26D.js.map +0 -1
- package/dist/sources-MCAH4GWS.js.map +0 -1
- /package/dist/{account-GIZWP5QF.js.map → account-SP2RA2XD.js.map} +0 -0
- /package/dist/{accounts-CQUW36ZY.js.map → accounts-R2ZLSJEW.js.map} +0 -0
- /package/dist/{accounts-5KDBVRJ2.js.map → accounts-XG5W4JC4.js.map} +0 -0
- /package/dist/{actions-BDC7CQ3R.js.map → actions-LZE7K24U.js.map} +0 -0
- /package/dist/{add-3M6T5MLO.js.map → add-7LC2XDIE.js.map} +0 -0
- /package/dist/{add-2N3G4EUY.js.map → add-XKSQMOFC.js.map} +0 -0
- /package/dist/{ads-626CEAXU.js.map → ads-AEQPHUOB.js.map} +0 -0
- /package/dist/{advertisers-XHIAWVLX.js.map → advertisers-FFRP4SQ3.js.map} +0 -0
- /package/dist/{analytics-JK53QUDI.js.map → analytics-PQSMY2BS.js.map} +0 -0
- /package/dist/{analytics-L4UTJ5RA.js.map → analytics-SETCYHRK.js.map} +0 -0
- /package/dist/{assign-SH76OUMA.js.map → assign-3UKKZ3Q3.js.map} +0 -0
- /package/dist/{audience-size-RXOBSRN5.js.map → audience-size-YBLT324O.js.map} +0 -0
- /package/dist/{audit-RLYCO6Q6.js.map → audit-C6HEPG2Z.js.map} +0 -0
- /package/dist/{autocomplete-QQ56I5YS.js.map → autocomplete-EYIWA7PG.js.map} +0 -0
- /package/dist/{avatars-T66JDLVN.js.map → avatars-YDGM27UP.js.map} +0 -0
- /package/dist/{bid-pricing-6UD42SON.js.map → bid-pricing-KSREYT6M.js.map} +0 -0
- /package/dist/{brand-CRNZCOV2.js.map → brand-46IADVGO.js.map} +0 -0
- /package/dist/{brief-NU5FLVPY.js.map → brief-54ZL3EXF.js.map} +0 -0
- /package/dist/{campaign-groups-5HMTK5J5.js.map → campaign-groups-KT3BNDFJ.js.map} +0 -0
- /package/dist/{campaign-writes-BGAS7L64.js.map → campaign-writes-FQJD4DWV.js.map} +0 -0
- /package/dist/{campaigns-OM5FQIR6.js.map → campaigns-2PQHW6SO.js.map} +0 -0
- /package/dist/{campaigns-R624HC75.js.map → campaigns-XQVYFSZG.js.map} +0 -0
- /package/dist/{canvas-XOOXIOIM.js.map → canvas-YOO4IHGS.js.map} +0 -0
- /package/dist/{capabilities-AH763WSY.js.map → capabilities-6QWU3ZJH.js.map} +0 -0
- /package/dist/{chats-DNLK6TTQ.js.map → chats-VTM5S5Q5.js.map} +0 -0
- /package/dist/{chunk-DBAO7JLW.js.map → chunk-2CMRJQY7.js.map} +0 -0
- /package/dist/{chunk-WNTVBUVI.js.map → chunk-2KACEWPN.js.map} +0 -0
- /package/dist/{chunk-HM25R6XJ.js.map → chunk-3BXQSDMJ.js.map} +0 -0
- /package/dist/{chunk-2EINLGUZ.js.map → chunk-44TCHDXM.js.map} +0 -0
- /package/dist/{chunk-ME6PYW77.js.map → chunk-4C7SIRHL.js.map} +0 -0
- /package/dist/{chunk-HHOKZCIL.js.map → chunk-4I4UB4ZE.js.map} +0 -0
- /package/dist/{chunk-V6GKEKPX.js.map → chunk-4LIYWGQL.js.map} +0 -0
- /package/dist/{chunk-ZZMP35QD.js.map → chunk-4LXKCSWY.js.map} +0 -0
- /package/dist/{chunk-PYPILVCC.js.map → chunk-53DV3HBZ.js.map} +0 -0
- /package/dist/{chunk-XASW5FLO.js.map → chunk-6A2X5MPY.js.map} +0 -0
- /package/dist/{chunk-XSFBGHGG.js.map → chunk-6EEYWFD5.js.map} +0 -0
- /package/dist/{chunk-WWCQBHDC.js.map → chunk-6S44QXXI.js.map} +0 -0
- /package/dist/{chunk-XQ2FGDOQ.js.map → chunk-7NWOGEAW.js.map} +0 -0
- /package/dist/{chunk-CAA32DMC.js.map → chunk-7SLEBQIM.js.map} +0 -0
- /package/dist/{chunk-KBHXLOYJ.js.map → chunk-7ZSLXBOS.js.map} +0 -0
- /package/dist/{chunk-MPXDQWYI.js.map → chunk-BMD3HCSI.js.map} +0 -0
- /package/dist/{chunk-VXRGAUZK.js.map → chunk-D536MQC6.js.map} +0 -0
- /package/dist/{chunk-YT74ZEVP.js.map → chunk-GFX3BZRA.js.map} +0 -0
- /package/dist/{chunk-T4V6KQY2.js.map → chunk-IPWXGR65.js.map} +0 -0
- /package/dist/{chunk-DA2ANVMG.js.map → chunk-IWE7WFHI.js.map} +0 -0
- /package/dist/{chunk-4XZSZRCG.js.map → chunk-KLPCKKBZ.js.map} +0 -0
- /package/dist/{chunk-M55JELFT.js.map → chunk-MM6QFNHV.js.map} +0 -0
- /package/dist/{chunk-EPZNFXI2.js.map → chunk-NBXFSSCW.js.map} +0 -0
- /package/dist/{chunk-IL7PZKQN.js.map → chunk-OCFYRZQW.js.map} +0 -0
- /package/dist/{chunk-RPUSTYHL.js.map → chunk-PAJJXZ3Z.js.map} +0 -0
- /package/dist/{chunk-F6G3RECD.js.map → chunk-PB4RAOBC.js.map} +0 -0
- /package/dist/{chunk-T6USZ3EO.js.map → chunk-QHNHW76K.js.map} +0 -0
- /package/dist/{chunk-BAXURR55.js.map → chunk-QNDZNMUS.js.map} +0 -0
- /package/dist/{chunk-CTLAIMJP.js.map → chunk-QO6QHZTW.js.map} +0 -0
- /package/dist/{chunk-ISDCUB2Q.js.map → chunk-TCQFIUKQ.js.map} +0 -0
- /package/dist/{chunk-MSJKALUF.js.map → chunk-WTL5RI2J.js.map} +0 -0
- /package/dist/{chunk-A3VUXG5G.js.map → chunk-YRERFQ7Z.js.map} +0 -0
- /package/dist/{claim-YXL2HUFU.js.map → claim-KPJXAUQW.js.map} +0 -0
- /package/dist/{companies-U55HX5JN.js.map → companies-SD36QDTM.js.map} +0 -0
- /package/dist/{complete-VABZEJTL.js.map → complete-Y3M6OXPA.js.map} +0 -0
- /package/dist/{connect-6KS42I3C.js.map → connect-QNPBSMWK.js.map} +0 -0
- /package/dist/{conversation-UEIXBJ32.js.map → conversation-EEL3AY6B.js.map} +0 -0
- /package/dist/{conversions-V7ZPJ5T7.js.map → conversions-7A34JRO4.js.map} +0 -0
- /package/dist/{create-5NLAAJE4.js.map → create-4H273ZGZ.js.map} +0 -0
- /package/dist/{create-7L6SXSPH.js.map → create-6NJRTWYT.js.map} +0 -0
- /package/dist/{create-UMVQNYZF.js.map → create-GKC3DLQK.js.map} +0 -0
- /package/dist/{create-NZIFE6O7.js.map → create-JTTFEJZE.js.map} +0 -0
- /package/dist/{creatives-5V3ZGVO6.js.map → creatives-FNHTRAAH.js.map} +0 -0
- /package/dist/{creatives-4A4HJKD3.js.map → creatives-IFAOJHLW.js.map} +0 -0
- /package/dist/{credentials-PB3RFZOC.js.map → credentials-7L3K6QFN.js.map} +0 -0
- /package/dist/{critique-SZRPZU2P.js.map → critique-BZLL3N37.js.map} +0 -0
- /package/dist/{critique-FRBVRWVL.js.map → critique-GEBGDHWB.js.map} +0 -0
- /package/dist/{crm-SVQ22Q6N.js.map → crm-4IGMD5QF.js.map} +0 -0
- /package/dist/{crm-I6E2FACM.js.map → crm-J3HX3ZT6.js.map} +0 -0
- /package/dist/{customers-ZB6EYQEH.js.map → customers-TSJH2AUE.js.map} +0 -0
- /package/dist/{delete-I7MTK63S.js.map → delete-56HFQZCX.js.map} +0 -0
- /package/dist/{delete-7MNFMQ6X.js.map → delete-JZUAO6LZ.js.map} +0 -0
- /package/dist/{delete-HE2ACICZ.js.map → delete-XTCS5H6L.js.map} +0 -0
- /package/dist/{demographics-BLL7UL26.js.map → demographics-DKT2UN4S.js.map} +0 -0
- /package/dist/{discard-6GTJKV37.js.map → discard-2357VMCI.js.map} +0 -0
- /package/dist/{domain-FHJKL6ZC.js.map → domain-NM553OX2.js.map} +0 -0
- /package/dist/{draft-3GZ3RTYT.js.map → draft-FDJK7FLI.js.map} +0 -0
- /package/dist/{draft-4W5CP2R7.js.map → draft-NEXKT5HF.js.map} +0 -0
- /package/dist/{draft-REIQ6JCS.js.map → draft-UDDLC7YZ.js.map} +0 -0
- /package/dist/{facets-HCI6JP4Q.js.map → facets-6R4DOSZJ.js.map} +0 -0
- /package/dist/{feedback-CM63S3ME.js.map → feedback-WW6YQQJA.js.map} +0 -0
- /package/dist/{feedback-record-4EPVZ6BQ.js.map → feedback-record-KGYP2IUQ.js.map} +0 -0
- /package/dist/{fetch-2ZONBBKW.js.map → fetch-JGUKB6R7.js.map} +0 -0
- /package/dist/{fonts-T6BDCPSZ.js.map → fonts-JRQFPSS6.js.map} +0 -0
- /package/dist/{forecast-EKOVQJ4F.js.map → forecast-72GMGD64.js.map} +0 -0
- /package/dist/{funnel-ISMIHL3P.js.map → funnel-BJJQI72Z.js.map} +0 -0
- /package/dist/{get-X5B6VCSC.js.map → get-DC3WBYJD.js.map} +0 -0
- /package/dist/{get-LSIYBPPA.js.map → get-HTAU7NQU.js.map} +0 -0
- /package/dist/{google-S7AQ7KOJ.js.map → google-UC5RRXF3.js.map} +0 -0
- /package/dist/{google-ads-VYRPY3FQ.js.map → google-ads-OLFRVBP6.js.map} +0 -0
- /package/dist/{history-2F3IPVQU.js.map → history-IFJKE65W.js.map} +0 -0
- /package/dist/{hubspot-VFGBXW2X.js.map → hubspot-AT4E52RB.js.map} +0 -0
- /package/dist/{ideas-FYW4XSSC.js.map → ideas-BUJVMRQF.js.map} +0 -0
- /package/dist/{images-3EHPQRQD.js.map → images-MWG3CNPG.js.map} +0 -0
- /package/dist/{ingest-SREMQAWS.js.map → ingest-F7XSH47V.js.map} +0 -0
- /package/dist/{ingest-OFVANVIF.js.map → ingest-XIX4CZ2P.js.map} +0 -0
- /package/dist/{inspect-PWUKLRNZ.js.map → inspect-4O2SAWNX.js.map} +0 -0
- /package/dist/{keyword-metrics-SGOGGYHN.js.map → keyword-metrics-4UDAJAQJ.js.map} +0 -0
- /package/dist/{keywords-for-site-NAZSCVQR.js.map → keywords-for-site-HZCZK3EI.js.map} +0 -0
- /package/dist/{landing-33KYCXXA.js.map → landing-2L325EK3.js.map} +0 -0
- /package/dist/{leads-Y3PFOEGM.js.map → leads-TNZW3RTA.js.map} +0 -0
- /package/dist/{learn-WQ2QQ77L.js.map → learn-KNTDSDPX.js.map} +0 -0
- /package/dist/{line-item-writes-S4JLVWTU.js.map → line-item-writes-6BWPQSOY.js.map} +0 -0
- /package/dist/{line-items-DMXOAXFU.js.map → line-items-525PQOI3.js.map} +0 -0
- /package/dist/{link-4DNY5OSY.js.map → link-SJQFQLTY.js.map} +0 -0
- /package/dist/{linkedin-D22GQOKW.js.map → linkedin-OD36IRJS.js.map} +0 -0
- /package/dist/{list-YFET6MM3.js.map → list-DKA4BDKT.js.map} +0 -0
- /package/dist/{list-H7V6MUUV.js.map → list-QEPDSHHY.js.map} +0 -0
- /package/dist/{list-CQXOFLNY.js.map → list-X3Q5MSYK.js.map} +0 -0
- /package/dist/{log-SA4GFECI.js.map → log-S4U4JQ77.js.map} +0 -0
- /package/dist/{lookup-32HPES25.js.map → lookup-CMB2JELV.js.map} +0 -0
- /package/dist/{make-T2JR6IA5.js.map → make-ZKG6IKEL.js.map} +0 -0
- /package/dist/{mcp-OM6JLDQ6.js.map → mcp-ACBDK6UV.js.map} +0 -0
- /package/dist/{media-sources-JHTGT6FF.js.map → media-sources-LCIPLOTF.js.map} +0 -0
- /package/dist/{members-KDJBWRU5.js.map → members-3B43WCMP.js.map} +0 -0
- /package/dist/{normalize-JEXAJD4K.js.map → normalize-QFKNYVLR.js.map} +0 -0
- /package/dist/{performance-SI2ZRX5D.js.map → performance-ZOWSMCZF.js.map} +0 -0
- /package/dist/{plan-UEYS6CHL.js.map → plan-PZVXAECA.js.map} +0 -0
- /package/dist/{promoted-tweet-writes-ADZNQUNV.js.map → promoted-tweet-writes-UBK3GPXT.js.map} +0 -0
- /package/dist/{promoted-tweets-CNREPMPQ.js.map → promoted-tweets-MTZ7SSVK.js.map} +0 -0
- /package/dist/{publish-2MQNUKLF.js.map → publish-N7WR2HAO.js.map} +0 -0
- /package/dist/{questionnaire-4HSUNNNC.js.map → questionnaire-SGHGA4AZ.js.map} +0 -0
- /package/dist/{reddit-C73WD45T.js.map → reddit-LWV2OILV.js.map} +0 -0
- /package/dist/{refresh-FYOCED4T.js.map → refresh-GGMYGGUW.js.map} +0 -0
- /package/dist/{release-HJZCWKY6.js.map → release-B5B7TWMA.js.map} +0 -0
- /package/dist/{remove-WB6LFXWK.js.map → remove-EWZMAYUI.js.map} +0 -0
- /package/dist/{reopen-3VQ4NYZ5.js.map → reopen-BAE4WPC6.js.map} +0 -0
- /package/dist/{rerun-OV3TEE6P.js.map → rerun-KHHPDTLP.js.map} +0 -0
- /package/dist/{research-6WRKGPRC.js.map → research-GR27TIGA.js.map} +0 -0
- /package/dist/{research-7JKXF6BI.js.map → research-KMKYFBWF.js.map} +0 -0
- /package/dist/{reset-5BMABGUG.js.map → reset-6XVTFUBM.js.map} +0 -0
- /package/dist/{reset-F4BDAHUI.js.map → reset-BU6IJGOR.js.map} +0 -0
- /package/dist/{resolve-QRATNPWX.js.map → resolve-3EPJNPRF.js.map} +0 -0
- /package/dist/{retry-B4JRFPPF.js.map → retry-SWTQWKJM.js.map} +0 -0
- /package/dist/{retry-SQSIAX33.js.map → retry-U4XMO7PA.js.map} +0 -0
- /package/dist/{run-FU3UF4YV.js.map → run-EXER4CJ5.js.map} +0 -0
- /package/dist/{run-6NXPDWRP.js.map → run-YVWGH5C5.js.map} +0 -0
- /package/dist/{scaffold-ad-4VTZB4JH.js.map → scaffold-ad-HKGKQUR7.js.map} +0 -0
- /package/dist/{scaffold-static-ad-AB2RG3SH.js.map → scaffold-static-ad-Q3AU7QQ4.js.map} +0 -0
- /package/dist/{scaffold-video-RSGJWHHT.js.map → scaffold-video-M63JFOPT.js.map} +0 -0
- /package/dist/{schedule-WZF3BQSX.js.map → schedule-RILFJJ2P.js.map} +0 -0
- /package/dist/{scheduled-agents-J75TOVGN.js.map → scheduled-agents-CUSH7BI5.js.map} +0 -0
- /package/dist/{schema-O5PX4O4J.js.map → schema-JASSX36C.js.map} +0 -0
- /package/dist/{search-WYO77TIF.js.map → search-PP5PH3NM.js.map} +0 -0
- /package/dist/{select-G5W6WGRB.js.map → select-O4NQK5A4.js.map} +0 -0
- /package/dist/{sends-E5NSPLNS.js.map → sends-ZOT5WPVC.js.map} +0 -0
- /package/dist/{set-prompt-PJA7LUUJ.js.map → set-prompt-SHMGN6KR.js.map} +0 -0
- /package/dist/{setup-links-HFWMDF6E.js.map → setup-links-6THA2YOJ.js.map} +0 -0
- /package/dist/{site-YJJBAS7M.js.map → site-JRCQUJOE.js.map} +0 -0
- /package/dist/{sources-VRRDVWZC.js.map → sources-WRC3LAZQ.js.map} +0 -0
- /package/dist/{stale-I6UGM3MO.js.map → stale-ZBXHYQ6Z.js.map} +0 -0
- /package/dist/{status-TCOUMPJS.js.map → status-GG6UTBWM.js.map} +0 -0
- /package/dist/{sync-TWV4HUHZ.js.map → sync-6R64PGCZ.js.map} +0 -0
- /package/dist/{sync-definition-K6UMLDZF.js.map → sync-definition-YTTTJMV4.js.map} +0 -0
- /package/dist/{tags-AWO5FFGM.js.map → tags-4CEVGCMN.js.map} +0 -0
- /package/dist/{tags-NBUNSN5L.js.map → tags-7CGYLMST.js.map} +0 -0
- /package/dist/{tags-NBVQWFS2.js.map → tags-H6MESAFQ.js.map} +0 -0
- /package/dist/{tags-ZOK7CY4V.js.map → tags-PAEIW2UI.js.map} +0 -0
- /package/dist/{tags-DGLT344J.js.map → tags-PLB6UT4U.js.map} +0 -0
- /package/dist/{targeting-criteria-MG7RLBOG.js.map → targeting-criteria-G2BAM34G.js.map} +0 -0
- /package/dist/{targets-2B5AG4E4.js.map → targets-HE2LJCHE.js.map} +0 -0
- /package/dist/{templates-IXF2C2LD.js.map → templates-OSMHAXLI.js.map} +0 -0
- /package/dist/{testimonials-WNNC5PKQ.js.map → testimonials-7LPKA54Y.js.map} +0 -0
- /package/dist/{top-companies-B2IZYN4T.js.map → top-companies-QYBVUFSB.js.map} +0 -0
- /package/dist/{translate-MGMGQ27R.js.map → translate-67D6PBVJ.js.map} +0 -0
- /package/dist/{triggers-3DDV3OJ3.js.map → triggers-BEJHXIRZ.js.map} +0 -0
- /package/dist/{unlink-6M577LT6.js.map → unlink-ANZSGHCG.js.map} +0 -0
- /package/dist/{unstage-KNCIQR4E.js.map → unstage-HU7G23ZL.js.map} +0 -0
- /package/dist/{unstage-4EJNGWUT.js.map → unstage-JDC2HBEI.js.map} +0 -0
- /package/dist/{update-7SK6PHDL.js.map → update-2QJ2F43N.js.map} +0 -0
- /package/dist/{update-4NHLEM64.js.map → update-4DATQZGJ.js.map} +0 -0
- /package/dist/{update-U3GEUFNY.js.map → update-7226ZVPC.js.map} +0 -0
- /package/dist/{update-PMFYYMFX.js.map → update-K7EJ45LU.js.map} +0 -0
- /package/dist/{upload-ITKCCYOQ.js.map → upload-42A6MAS3.js.map} +0 -0
- /package/dist/{url-options-UFRD42MD.js.map → url-options-3XRKJSFA.js.map} +0 -0
- /package/dist/{url-params-GAEQM2MQ.js.map → url-params-EHUS5YG5.js.map} +0 -0
- /package/dist/{validate-4P2L4AXG.js.map → validate-KBPZX2H7.js.map} +0 -0
- /package/dist/{videos-YVGJ3WO5.js.map → videos-FILPMPRL.js.map} +0 -0
- /package/dist/{web-M7EYV5DF.js.map → web-KZFJIKDU.js.map} +0 -0
- /package/dist/{winning-ads-4SU5DBEY.js.map → winning-ads-NLHGB3GX.js.map} +0 -0
- /package/dist/{write-commands-7FT3MTOZ.js.map → write-commands-JCM6ZMUJ.js.map} +0 -0
- /package/dist/{x-ESEGQ3W2.js.map → x-GVNB2MV2.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mappingCommandFor,
|
|
3
3
|
proposeMappingFromTemplate
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BC2BXRXY.js";
|
|
5
5
|
import "./chunk-EDLZGTGN.js";
|
|
6
6
|
import {
|
|
7
7
|
parseApiError
|
|
@@ -127,4 +127,4 @@ Examples:
|
|
|
127
127
|
export {
|
|
128
128
|
urlOptionsCommand
|
|
129
129
|
};
|
|
130
|
-
//# sourceMappingURL=url-options-
|
|
130
|
+
//# sourceMappingURL=url-options-3XRKJSFA.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleLinkedinError,
|
|
3
3
|
resolveAccountIdArg
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7NWOGEAW.js";
|
|
5
5
|
import {
|
|
6
6
|
writeAdsJson
|
|
7
7
|
} from "./chunk-JM7C6OHU.js";
|
|
8
8
|
import {
|
|
9
9
|
LINKEDIN_TRACKING_PARAMS_AD_SET_MAX
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XABVEMC3.js";
|
|
11
11
|
import "./chunk-GXDLWBOY.js";
|
|
12
12
|
import "./chunk-GIWHHCD6.js";
|
|
13
13
|
import "./chunk-XQIOCIDO.js";
|
|
@@ -95,4 +95,4 @@ export {
|
|
|
95
95
|
hints,
|
|
96
96
|
urlParamsCommand
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=url-params-
|
|
98
|
+
//# sourceMappingURL=url-params-EHUS5YG5.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
exitOnPrepareError,
|
|
6
6
|
prepareCanvas
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2KACEWPN.js";
|
|
8
8
|
import "./chunk-377O74GF.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-4LXKCSWY.js";
|
|
10
|
+
import "./chunk-4C7SIRHL.js";
|
|
11
11
|
import "./chunk-FUHGPB4S.js";
|
|
12
12
|
import "./chunk-SKZW5R2C.js";
|
|
13
13
|
import "./chunk-XIWPSGSG.js";
|
|
@@ -27,7 +27,7 @@ import "./chunk-X5FJVZF4.js";
|
|
|
27
27
|
import "./chunk-W6ZA67TV.js";
|
|
28
28
|
import "./chunk-PP3IOXY3.js";
|
|
29
29
|
import "./chunk-A7VSSDMJ.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-XABVEMC3.js";
|
|
31
31
|
import "./chunk-GXDLWBOY.js";
|
|
32
32
|
import "./chunk-GIWHHCD6.js";
|
|
33
33
|
import "./chunk-XQIOCIDO.js";
|
|
@@ -85,4 +85,4 @@ var validateCommand = defineCommand({
|
|
|
85
85
|
export {
|
|
86
86
|
validateCommand
|
|
87
87
|
};
|
|
88
|
-
//# sourceMappingURL=validate-
|
|
88
|
+
//# sourceMappingURL=validate-KBPZX2H7.js.map
|
|
@@ -24,16 +24,16 @@ Full guide: __tooling__/docs/tools/baker/videos.md`
|
|
|
24
24
|
get: () => import("./get-ICJLOPDY.js").then((m) => m.getCommand),
|
|
25
25
|
group: () => import("./group-IFEHO2V7.js").then((m) => m.groupCommand),
|
|
26
26
|
search: () => import("./search-JLJYGEWB.js").then((m) => m.searchCommand),
|
|
27
|
-
upload: () => import("./upload-
|
|
28
|
-
ingest: () => import("./ingest-
|
|
27
|
+
upload: () => import("./upload-42A6MAS3.js").then((m) => m.uploadCommand),
|
|
28
|
+
ingest: () => import("./ingest-XIX4CZ2P.js").then((m) => m.ingestCommand),
|
|
29
29
|
fetch: () => import("./fetch-AAC3G6NB.js").then((m) => m.fetchCommand),
|
|
30
30
|
describe: () => import("./describe-OOHGJ7TB.js").then((m) => m.describeCommand),
|
|
31
31
|
delete: () => import("./delete-7PQXXA4Q.js").then((m) => m.deleteCommand),
|
|
32
|
-
retry: () => import("./retry-
|
|
33
|
-
tags: () => import("./tags-
|
|
32
|
+
retry: () => import("./retry-SWTQWKJM.js").then((m) => m.retryCommand),
|
|
33
|
+
tags: () => import("./tags-PAEIW2UI.js").then((m) => m.tagsCommand)
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
export {
|
|
37
37
|
videosCommand
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=videos-
|
|
39
|
+
//# sourceMappingURL=videos-FILPMPRL.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
webDepthHints
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GFX3BZRA.js";
|
|
4
4
|
import {
|
|
5
5
|
handleResearchError,
|
|
6
6
|
writeResearchHints,
|
|
7
7
|
writeResearchJson
|
|
8
8
|
} from "./chunk-LKSJVVIN.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-XABVEMC3.js";
|
|
10
10
|
import "./chunk-GXDLWBOY.js";
|
|
11
11
|
import "./chunk-GIWHHCD6.js";
|
|
12
12
|
import "./chunk-XQIOCIDO.js";
|
|
@@ -137,4 +137,4 @@ Examples:
|
|
|
137
137
|
export {
|
|
138
138
|
webCommand
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=web-
|
|
140
|
+
//# sourceMappingURL=web-KZFJIKDU.js.map
|
|
@@ -72,7 +72,7 @@ Full guide: __tooling__/docs/tools/baker/winning-ads.md`
|
|
|
72
72
|
content: () => import("./content-K3LYN5E3.js").then((m) => m.contentCommand),
|
|
73
73
|
fit: () => import("./fit-HDFGC3LZ.js").then((m) => m.fitCommand),
|
|
74
74
|
unfollow: () => import("./unfollow-XMEFEAGB.js").then((m) => m.unfollowCommand),
|
|
75
|
-
refresh: () => import("./refresh-
|
|
75
|
+
refresh: () => import("./refresh-GGMYGGUW.js").then((m) => m.refreshCommand),
|
|
76
76
|
hooks: () => import("./seeds-5MB67XGX.js").then((m) => m.hooksCommand),
|
|
77
77
|
mechanisms: () => import("./seeds-5MB67XGX.js").then((m) => m.mechanismsCommand),
|
|
78
78
|
formats: () => import("./seeds-5MB67XGX.js").then((m) => m.formatsCommand)
|
|
@@ -81,4 +81,4 @@ Full guide: __tooling__/docs/tools/baker/winning-ads.md`
|
|
|
81
81
|
export {
|
|
82
82
|
winningAdsCommand
|
|
83
83
|
};
|
|
84
|
-
//# sourceMappingURL=winning-ads-
|
|
84
|
+
//# sourceMappingURL=winning-ads-NLHGB3GX.js.map
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
stageLinkedinOps,
|
|
16
16
|
stageOp,
|
|
17
17
|
stageStatusChange
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-PB4RAOBC.js";
|
|
19
19
|
import {
|
|
20
20
|
handleLinkedinError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7NWOGEAW.js";
|
|
22
22
|
import {
|
|
23
23
|
repeatedValues
|
|
24
24
|
} from "./chunk-ERSX3MKH.js";
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
TEMP_REF_PREFIX,
|
|
40
40
|
TRACKING_PARAM_DYNAMIC_VALUES,
|
|
41
41
|
campaignExcludeCompaniesSchema
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-XABVEMC3.js";
|
|
43
43
|
import "./chunk-GXDLWBOY.js";
|
|
44
44
|
import "./chunk-GIWHHCD6.js";
|
|
45
45
|
import "./chunk-XQIOCIDO.js";
|
|
@@ -1012,4 +1012,4 @@ export {
|
|
|
1012
1012
|
leadFormsCommand,
|
|
1013
1013
|
trackingParamsPayload
|
|
1014
1014
|
};
|
|
1015
|
-
//# sourceMappingURL=write-commands-
|
|
1015
|
+
//# sourceMappingURL=write-commands-JCM6ZMUJ.js.map
|
|
@@ -27,15 +27,15 @@ Full guide: __tooling__/docs/tools/baker/ads-x.md`
|
|
|
27
27
|
subCommands: {
|
|
28
28
|
accounts: () => import("./accounts-5YQ4YNKS.js").then((m) => m.accountsCommand),
|
|
29
29
|
funding: () => import("./funding-6Y3I75ED.js").then((m) => m.fundingCommand),
|
|
30
|
-
campaigns: () => import("./campaigns-
|
|
31
|
-
"line-items": () => import("./line-items-
|
|
32
|
-
"promoted-tweets": () => import("./promoted-tweets-
|
|
30
|
+
campaigns: () => import("./campaigns-2PQHW6SO.js").then((m) => m.campaignsCommand),
|
|
31
|
+
"line-items": () => import("./line-items-525PQOI3.js").then((m) => m.lineItemsCommand),
|
|
32
|
+
"promoted-tweets": () => import("./promoted-tweets-MTZ7SSVK.js").then((m) => m.promotedTweetsCommand),
|
|
33
33
|
tweets: () => import("./tweets-AH3WXZ3J.js").then((m) => m.tweetsCommand),
|
|
34
34
|
cards: () => import("./cards-I7GHO3F7.js").then((m) => m.cardsCommand),
|
|
35
|
-
draft: () => import("./draft-
|
|
35
|
+
draft: () => import("./draft-FDJK7FLI.js").then((m) => m.draftCommand),
|
|
36
36
|
media: () => import("./media-VZBNY6WN.js").then((m) => m.mediaCommand),
|
|
37
37
|
audiences: () => import("./audiences-ZALQNLUT.js").then((m) => m.audiencesCommand),
|
|
38
|
-
"targeting-criteria": () => import("./targeting-criteria-
|
|
38
|
+
"targeting-criteria": () => import("./targeting-criteria-G2BAM34G.js").then((m) => m.targetingCriteriaCommand),
|
|
39
39
|
"targeting-constants": () => import("./targeting-constants-YMQIKT6B.js").then((m) => m.targetingConstantsCommand),
|
|
40
40
|
"active-entities": () => import("./active-entities-ZOS2FRRM.js").then((m) => m.activeEntitiesCommand),
|
|
41
41
|
stats: () => import("./stats-ANYHAOFH.js").then((m) => m.statsCommand)
|
|
@@ -44,4 +44,4 @@ Full guide: __tooling__/docs/tools/baker/ads-x.md`
|
|
|
44
44
|
export {
|
|
45
45
|
xCommand
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=x-
|
|
47
|
+
//# sourceMappingURL=x-GVNB2MV2.js.map
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../api/src/event-sources/hubspot.ts","../../api/src/event-sources/wire.ts"],"sourcesContent":["/**\n * What a HubSpot event reads by default, spelled as the same templates an\n * address's mapping uses — so the sheet shows one table for both, and a row\n * can be repointed at any property, or typed.\n *\n * ## Why defaults and not a fixed read\n *\n * The read used to be hard-wired: email from `email`, the Google click from\n * `hs_google_click_id`, and nothing anybody could change. Real accounts keep\n * the email under `work_email`, the deal value under a custom number\n * property, and a click id under whatever the tracking template wrote. The\n * defaults are HubSpot's standard names, which is where most accounts keep\n * them; every row is a template a person or the agent can change, and the\n * picker is the account's own property list, read live — never this table.\n *\n * An empty stored mapping means these — the same rule as an address, where\n * empty means \"the guess\".\n *\n * ## Three objects, one spelling\n *\n * A mention names a property of the object watched: `{{email}}` on a\n * contact source, `{{amount}}` on a deal source, `{{hs_pipeline_stage}}` on\n * a lead source, `{{id}}` the record's own id on any of them. A deal or a\n * lead source also reads the contact its record is about, through the\n * `contact.` namespace: `{{contact.email}}`, `{{contact.id}}`. The namespace\n * is what keeps the objects' properties apart in one table, and it is\n * spelled the way the Forms builder spells a nested field.\n */\n\nimport type { SourceField } from \"./fields\";\nimport type { HubspotObject } from \"./hubspotTrigger\";\nimport { mentionOf } from \"./template\";\n\n/** The variable that is the record's own id rather than a property: `{{id}}`. */\nexport const HUBSPOT_CONTACT_ID_VARIABLE = \"id\";\n\n/** On a deal source, the associated contact's properties are read as `{{contact.<property>}}`. */\nexport const HUBSPOT_CONTACT_PREFIX = \"contact.\";\n\n/** The path for a property of a deal's contact: `contact.email`. */\nexport function contactPath(property: string): string {\n return `${HUBSPOT_CONTACT_PREFIX}${property}`;\n}\n\n/** The contact property a `contact.<property>` path names, or null for a path of the record itself. */\nexport function contactPropertyOf(path: string): string | null {\n return path.startsWith(HUBSPOT_CONTACT_PREFIX) ? path.slice(HUBSPOT_CONTACT_PREFIX.length) : null;\n}\n\n/** HubSpot's standard contact property behind each field, where one exists. */\nexport const HUBSPOT_DEFAULT_PROPERTIES: Readonly<Partial<Record<SourceField, string>>> = {\n email: \"email\",\n phone: \"phone\",\n external_id: HUBSPOT_CONTACT_ID_VARIABLE,\n first_name: \"firstname\",\n last_name: \"lastname\",\n city: \"city\",\n postal_code: \"zip\",\n country: \"country\",\n gclid: \"hs_google_click_id\",\n fbclid: \"hs_facebook_click_id\",\n};\n\n/**\n * The person's rows read off the record's associated contact, for an object\n * that is about somebody rather than being them.\n */\nconst throughContact: Readonly<Partial<Record<SourceField, string>>> = Object.fromEntries(\n Object.entries(HUBSPOT_DEFAULT_PROPERTIES).map(([field, property]) => [field, contactPath(property)]),\n);\n\n/**\n * The same for a deal: the person is the deal's contact, the amount is the\n * deal's own — HubSpot keeps it as `amount` in `deal_currency_code`, on\n * every account, which is the one row a contact source could never fill by\n * default.\n */\nexport const HUBSPOT_DEAL_DEFAULT_PROPERTIES: Readonly<Partial<Record<SourceField, string>>> = {\n ...throughContact,\n value: \"amount\",\n currency: \"deal_currency_code\",\n};\n\n/**\n * The same for a lead. A lead is an interest in somebody, not an amount: it\n * has no `amount` and no currency of its own, so the value rows stay empty\n * and the funnel counts the step rather than money. Anyone who keeps a figure\n * on a custom lead property can still point `value` at it by hand.\n */\nexport const HUBSPOT_LEAD_DEFAULT_PROPERTIES: Readonly<Partial<Record<SourceField, string>>> = throughContact;\n\nconst DEFAULTS: Readonly<Record<HubspotObject, Readonly<Partial<Record<SourceField, string>>>>> = {\n contact: HUBSPOT_DEFAULT_PROPERTIES,\n deal: HUBSPOT_DEAL_DEFAULT_PROPERTIES,\n lead: HUBSPOT_LEAD_DEFAULT_PROPERTIES,\n};\n\n/** The mapping a HubSpot event starts with: its name as the event, the standard properties for the rest. */\nexport function hubspotDefaultMapping(\n sourceName: string,\n object: HubspotObject = \"contact\",\n): Partial<Record<SourceField, string>> {\n const mapping: Partial<Record<SourceField, string>> = { event_name: sourceName };\n for (const [field, property] of Object.entries(DEFAULTS[object])) {\n mapping[field as SourceField] = mentionOf(property);\n }\n return mapping;\n}\n\n/**\n * The mapping in force for a HubSpot event: what was saved, else the defaults.\n * Keyed by field, or by `properties.<key>` for an extra property of the event.\n */\nexport function hubspotMappingInForce(\n sourceName: string,\n stored: Readonly<Record<string, string>>,\n object: HubspotObject = \"contact\",\n): Record<string, string> {\n const explicit = Object.entries(stored).filter(([, template]) => template.trim() !== \"\");\n if (explicit.length > 0) return Object.fromEntries(explicit);\n return hubspotDefaultMapping(sourceName, object);\n}\n","/**\n * The contract between `baker analytics sources` and `POST /api/analytics/sources`,\n * and the address a source is given.\n *\n * One request shape with one optional operation in it, and every call answers\n * with the full list afterwards — the CLI never has to make a second request\n * to see what it just did, and the \"what arrived\" question is answered by the\n * same read that answers \"what exists\".\n */\nimport { z } from \"zod\";\nimport { REJECTION_MESSAGES, validateEventName } from \"../event-ingest/validation\";\nimport { mappingRowProblem } from \"./fields\";\nimport {\n CONDITION_LOGICS,\n HUBSPOT_DEAL_CONTACTS,\n HUBSPOT_OBJECTS,\n HUBSPOT_PROPERTY_KINDS,\n type HubspotTriggerInput,\n onlyCondition,\n TRIGGER_CONDITIONS_MAX,\n triggerProblem,\n} from \"./hubspotTrigger\";\n\n/** Mirrors `EVENT_SOURCE_KINDS` / the status validator in the backend schema; this package must not depend on convex. */\nexport const SOURCE_KINDS = [\"webhook\", \"hubspot\"] as const;\nexport type SourceKind = (typeof SOURCE_KINDS)[number];\nexport const SOURCE_STATUSES = [\"learning\", \"counting\", \"paused\"] as const;\nexport type SourceStatus = (typeof SOURCE_STATUSES)[number];\n\nexport const SOURCE_NAME_MAX = 80;\n\n/**\n * What a source may be called — which is the ingest door's own rule, because a\n * source's name IS the `event_name` every event it raises carries.\n *\n * Held here rather than at each door, and that is the whole point of it being\n * here. A name this refuses is not a bad label, it is a **source that can\n * never count anything**: every arrival is rejected `invalid_name`, the card\n * goes on reading \"Counting\", and the only trace is one red line per event on\n * a feed somebody has to think to open. That happened — a HubSpot source\n * called \"Matrícula Realizada\", refused for ever by a rule that was ASCII-only\n * — and the reason it could happen is that three doors took a name and none of\n * them knew the rule.\n *\n * `MAX_EVENT_NAME` is the same 80 as {@link SOURCE_NAME_MAX} and\n * `validateEventName` checks it, so the bound is stated once even though both\n * constants exist.\n */\nexport const sourceNameSchema = z\n .string()\n .trim()\n .min(1)\n .max(SOURCE_NAME_MAX)\n .refine((name) => validateEventName(name) === null, REJECTION_MESSAGES.invalid_name);\n\n/** Where a source's arrivals go: the token is the whole path after this. */\nexport const EVENT_SOURCE_PATH_PREFIX = \"/v1/sources/\";\n\n/**\n * The address to hand a tool, given the branded host published for this\n * environment — the same fallback rule as `eventIngestUrl`.\n */\nexport function eventSourceUrl(brandedUrl: string | undefined, convexSiteUrl: string, token: string): string {\n const base = (brandedUrl || convexSiteUrl).replace(/\\/$/, \"\");\n return `${base}${EVENT_SOURCE_PATH_PREFIX}${token}`;\n}\n\nconst sourceIdSchema = z.string().min(1);\n\n/**\n * Canonical field → template (`template.ts`): literal text with `{{path}}`\n * mentions, or a bare path. A `properties.<key>` row is an extra property of\n * the event (`fields.ts`). Anything else is refused so a typo cannot become a\n * silent no-op.\n */\nexport const sourceMappingSchema = z.record(z.string(), z.string().min(1)).superRefine((mapping, ctx) => {\n for (const row of Object.keys(mapping)) {\n const problem = mappingRowProblem(row);\n if (problem !== null) ctx.addIssue({ code: \"custom\", message: problem, path: [row] });\n }\n});\n\n/** ISO 4217, upper case: what `POST /v1/events` accepts as `currency`. */\nexport const currencyCodeSchema = z\n .string()\n .trim()\n .toUpperCase()\n .regex(/^[A-Z]{3}$/, \"A currency is a three-letter code, like EUR or USD.\");\n\n/** What a HubSpot source is a trigger on: a contact (the default), a deal or a lead. */\nexport const hubspotObjectSchema = z.enum(HUBSPOT_OBJECTS);\n/** For a deal: whose event it is — the deal's first contact, or every contact on it. */\nexport const hubspotDealContactsSchema = z.enum(HUBSPOT_DEAL_CONTACTS);\n\n/**\n * One condition of a HubSpot trigger — *when a contact's* (or *a deal's*)\n * [property] [operator] [values] (`hubspotTrigger.ts`).\n */\nexport const hubspotConditionInputSchema = z.strictObject({\n property: z.string().trim().min(1),\n /** One of the property's kind's operators (`baker hubspot contacts properties` lists them); `is` when unsaid. */\n operator: z.string().trim().min(1).default(\"is\"),\n /** As HubSpot spells them: an option's internal value, a number, a `YYYY-MM-DD`, `true`/`false`. None for an empty check, two for a between, several for a list. */\n values: z.array(z.string().trim().min(1)).max(50).default([]),\n});\n\nconst conditionLogicSchema = z.enum(CONDITION_LOGICS);\n\nconst conditionGroupInputSchema = z.strictObject({\n logic: conditionLogicSchema,\n conditions: z.array(hubspotConditionInputSchema).min(1).max(TRIGGER_CONDITIONS_MAX),\n});\n\nconst combinedInputSchema = z\n .strictObject({\n /** How the rows combine: `And` (every one) or `Or` (any one) — a Form's filter's \"Match AND / OR\". */\n logic: conditionLogicSchema.default(\"And\"),\n /** Conditions, and groups of conditions with their own logic, one level deep. */\n conditions: z\n .array(z.union([hubspotConditionInputSchema, conditionGroupInputSchema]))\n .min(1)\n .max(TRIGGER_CONDITIONS_MAX),\n })\n .superRefine((trigger, context) => {\n const problem = triggerProblem(trigger);\n if (problem !== null) context.addIssue({ code: \"custom\", message: problem });\n });\n\n/**\n * What a HubSpot source watches: one condition, or several combined — the\n * way a Form's filter combines them. A single condition is the short\n * spelling, and is read as a trigger of that one condition.\n */\nexport const hubspotTriggerInputSchema = z\n .union([combinedInputSchema, hubspotConditionInputSchema])\n .transform((input): HubspotTriggerInput => (\"conditions\" in input ? input : onlyCondition(input)));\n\nconst hubspotConditionSchema = hubspotConditionInputSchema.extend({\n propertyLabel: z.string(),\n kind: z.enum(HUBSPOT_PROPERTY_KINDS),\n /** A select that holds several values at once (`a;b`); decides what HubSpot may filter on. */\n multiple: z.boolean().optional(),\n valueLabels: z.array(z.string()),\n});\n\nconst hubspotTriggerFields = {\n logic: conditionLogicSchema,\n conditions: z.array(\n z.union([\n hubspotConditionSchema,\n z.strictObject({ logic: conditionLogicSchema, conditions: z.array(hubspotConditionSchema) }),\n ]),\n ),\n};\n\n/** The trigger as stored on a source: every condition resolved, and on its object. */\nexport const hubspotWatchSchema = z.strictObject({\n ...hubspotTriggerFields,\n object: hubspotObjectSchema,\n contacts: hubspotDealContactsSchema.optional(),\n});\nexport type HubspotWatchView = z.infer<typeof hubspotWatchSchema>;\n\n/** A sample record as the preview shows it: its id and the properties it holds, empty ones dropped. */\nconst sampleRecordSchema = z.strictObject({ id: z.string(), properties: z.record(z.string(), z.string()) });\n\n/** What a HubSpot event would count today, asked before it is made: the trigger and the properties to read off the sample. */\nexport const hubspotPreviewRequestSchema = z.strictObject({\n object: hubspotObjectSchema.default(\"contact\"),\n trigger: hubspotTriggerInputSchema,\n /** Property names to read off the sample; `id` is always there. On a deal or a lead, `contact.<name>` reads its first contact. */\n properties: z.array(z.string().trim().min(1)).max(60).optional(),\n /** The record to draw the preview from — an id, or text to search (an email or a name for a contact, a deal's or a lead's name). The one most recently at the trigger when unsaid. */\n contact: z.string().trim().min(1).max(200).optional(),\n});\nexport type HubspotPreviewRequest = z.infer<typeof hubspotPreviewRequestSchema>;\n\nexport const hubspotPreviewSchema = z.strictObject({\n /** Records satisfying the trigger today — the ones that will NOT be counted. */\n total: z.number(),\n /** False when the trigger has more combinations than HubSpot's search takes, so `total` is only near. */\n exact: z.boolean().optional(),\n /**\n * The sample record the trigger is on, with the properties asked for and\n * the contacts behind it, first first; none when nothing fits.\n *\n * One field rather than one per object: a contact source's record *is* the\n * person and its `contacts` is empty, while a deal's and a lead's carry the\n * people the event is about. Three parallel nullable fields, exactly one of\n * them ever set, would say the same thing and let a caller read the wrong one.\n */\n record: sampleRecordSchema.extend({ contacts: z.array(sampleRecordSchema) }).nullable(),\n});\nexport type HubspotPreview = z.infer<typeof hubspotPreviewSchema>;\n\nexport const sourcesRequestSchema = z.strictObject({\n /** The company's own server door: made once, `counting` from the start, the same address for ever after. */\n server: z.strictObject({}).optional(),\n create: z.strictObject({ name: sourceNameSchema }).optional(),\n /** A HubSpot event: read every five minutes, counting from now. The labels are looked up server-side. */\n createHubspot: z\n .strictObject({\n name: sourceNameSchema.optional(),\n /** A contact, a deal or a lead. A deal's and a lead's event is about its contact, read through `contact.<property>` rows. */\n object: hubspotObjectSchema.default(\"contact\"),\n trigger: hubspotTriggerInputSchema,\n /** On a deal: the deal's first contact (the default), or every contact on it, each its own event. */\n contacts: hubspotDealContactsSchema.optional(),\n /** Rows to read off the record, over the defaults; the same table `map` writes. */\n mapping: sourceMappingSchema.optional(),\n /** A number property on the record to read as the amount; needs `currency` beside it. Sugar over the mapping's `value` and `currency` rows. */\n amountProperty: z.string().trim().min(1).optional(),\n currency: currencyCodeSchema.optional(),\n })\n .optional(),\n /** Change what a HubSpot event watches. It counts from now on under the new trigger; the rows stay. The object cannot change: the rows read it. */\n setTrigger: z\n .strictObject({\n sourceId: sourceIdSchema,\n trigger: hubspotTriggerInputSchema,\n contacts: hubspotDealContactsSchema.optional(),\n })\n .optional(),\n /** Ask HubSpot what a trigger would count today, and read one real record, without making anything. */\n preview: hubspotPreviewRequestSchema.optional(),\n /** Change where a HubSpot-read source takes its amount from; no `amountProperty` clears it. Sugar over `map`. */\n setAmount: z\n .strictObject({\n sourceId: sourceIdSchema,\n amountProperty: z.string().trim().min(1).optional(),\n currency: currencyCodeSchema.optional(),\n })\n .optional(),\n /**\n * Count a HubSpot event's history: every moment its trigger came to hold\n * since `since`, read out of HubSpot's own property history.\n *\n * Not the thing a source deliberately refuses to do. A source never\n * backfills the **present state** — somebody who already satisfies a\n * condition is not an event today — and this reports only moments HubSpot\n * has a timestamp for, so nothing is invented. Dry unless `write`.\n */\n backfill: z\n .strictObject({\n sourceId: sourceIdSchema,\n /** ISO instant, or Unix milliseconds. Bounded by the 400 days the store keeps. */\n since: z.union([z.string().trim().min(1), z.number()]),\n /**\n * Where a capped run carries on from: only records last changed at or\n * before this instant are read.\n *\n * The **read** is what it bounds, never the history. Records are chosen\n * most-recently-changed first, so a run that reaches its cap has covered\n * the newest of them and the rest are the ones nearest `since` — which\n * no shorter window can reach, because shortening one only drops\n * candidates from the old end and hands back the same newest records\n * again. `reachedBack` is the value to pass here, and the moments each\n * record is then judged on are still the whole of `since` to now.\n */\n before: z.union([z.string().trim().min(1), z.number()]).optional(),\n /** Without it, nothing is counted and the answer says what would be. */\n write: z.boolean().optional(),\n })\n .optional(),\n map: z.strictObject({ sourceId: sourceIdSchema, mapping: sourceMappingSchema }).optional(),\n pause: z.strictObject({ sourceId: sourceIdSchema }).optional(),\n resume: z.strictObject({ sourceId: sourceIdSchema }).optional(),\n remove: z.strictObject({ sourceId: sourceIdSchema }).optional(),\n});\nexport type SourcesRequest = z.infer<typeof sourcesRequestSchema>;\n/** The request as a caller writes it, before the schema fills its defaults — what the CLI builds. */\nexport type SourcesRequestInput = z.input<typeof sourcesRequestSchema>;\n\n/** A delivery that arrived and was refused — mirrors `sourceRefusalValidator` in the backend schema. */\nexport const sourceRefusalSchema = z.strictObject({\n at: z.number(),\n count: z.number(),\n code: z.string(),\n reason: z.string(),\n});\n\nexport const detectedFieldSchema = z.strictObject({\n path: z.string(),\n confidence: z.enum([\"key\", \"value\"]),\n});\n\n/** Whether HubSpot's journal is being told to keep the changes a source watches. */\nexport const HUBSPOT_LISTENING_STATES = [\"listening\", \"not_configured\", \"failed\"] as const;\nexport type HubspotListeningState = (typeof HUBSPOT_LISTENING_STATES)[number];\n\nexport const sourceViewSchema = z.strictObject({\n id: z.string(),\n kind: z.enum(SOURCE_KINDS),\n name: z.string(),\n status: z.enum(SOURCE_STATUSES),\n /** The address a tool posts to. A HubSpot source has none: Baker calls HubSpot. */\n url: z.string().optional(),\n /** What a HubSpot source watches, and on which object. */\n hubspot: hubspotWatchSchema.optional(),\n /** A HubSpot source counts changes from here on; one HubSpot reports from before it is dropped. Moves when the trigger changes. */\n countingSince: z.number().optional(),\n /**\n * Whether HubSpot is keeping this source's changes for Baker, as last\n * checked: `listening` when the app's journal subscription on the account\n * names the property; `not_configured` when the app has not been told yet\n * (or cannot be, with no credentials); `failed` when HubSpot refused the\n * subscription. `detail` says what to do.\n */\n listening: z.strictObject({ state: z.enum(HUBSPOT_LISTENING_STATES), detail: z.string().optional() }).optional(),\n /** Why the last delivery could not be counted, in product words; absent when the last one was. */\n lastError: z.string().optional(),\n lastArrivalAt: z.number().optional(),\n /**\n * What its last delivery **refused, event by event** — which `lastError` is\n * not and `lastArrivalAt` cannot be. A source refusing everything it\n * receives has no arrival and no read failure, so without this it reads as\n * one nobody has sent anything to. `refusalWords` turns it into the\n * sentence a person is shown. Cleared by the next delivery that counts.\n */\n lastRefusal: sourceRefusalSchema.optional(),\n /** The first send, masked, while learning. Kept once confirmed. */\n sample: z.strictObject({ receivedAt: z.number(), body: z.string() }).optional(),\n /** Field → template; empty means the guess (an address) or the defaults (a HubSpot read). */\n mapping: z.record(z.string(), z.string()),\n /** The guess over the sample, for the sheet to prefill and the CLI to suggest. */\n detected: z.record(z.string(), detectedFieldSchema).optional(),\n /** Every path the sample's first item holds, with its masked value — what the picker offers. */\n paths: z.array(z.strictObject({ path: z.string(), value: z.string() })).optional(),\n /** `baker` when the sample already parses as the `POST /v1/events` contract and needs no mapping. */\n format: z.enum([\"baker\", \"foreign\"]).optional(),\n});\nexport type SourceView = z.infer<typeof sourceViewSchema>;\n\n/**\n * One change to the company's sources, staged inside a chat and applied when\n * it is published. `ref` is the source's id, or a `src_temp_*` for one the\n * chat makes.\n */\nexport const stagedSourceOpSchema = z.strictObject({\n kind: z.enum([\"create\", \"setTrigger\", \"map\", \"status\", \"remove\"]),\n ref: z.string(),\n name: z.string(),\n summary: z.string(),\n /** On a create: what the source will watch and read. */\n hubspot: hubspotWatchSchema.optional(),\n mapping: z.record(z.string(), z.string()).optional(),\n status: z.enum([\"paused\", \"counting\"]).optional(),\n});\nexport type StagedSourceOp = z.infer<typeof stagedSourceOpSchema>;\n\n/** What a backfill found, and — on a `write` run — what became of it. */\nexport const backfillResultSchema = z.strictObject({\n sourceId: z.string(),\n name: z.string(),\n since: z.number(),\n /** Records whose history was read. */\n examined: z.number(),\n /** Moments the trigger came to hold, across them. */\n entries: z.number(),\n /** Of those, already counted — the journal got there first, or a previous run did. */\n alreadyCounted: z.number(),\n /** What a `write` run would hand over, or did. */\n pending: z.number(),\n /** Whether the read stopped at its cap; {@link BackfillResult.reachedBack} is where to carry on from. */\n capped: z.boolean(),\n /**\n * How far back the read got: the instant the oldest record it examined was\n * last changed. Only on a capped run, and it is the next run's `before`.\n */\n reachedBack: z.number().optional(),\n counted: z.number().optional(),\n refused: z.number().optional(),\n refusedReason: z.string().optional(),\n});\nexport type BackfillResult = z.infer<typeof backfillResultSchema>;\n\nexport const sourcesResponseSchema = z.strictObject({\n ok: z.literal(true),\n data: z.strictObject({\n sources: z.array(sourceViewSchema),\n /** Only when the request carried `preview`. */\n preview: hubspotPreviewSchema.optional(),\n /** Only when the request carried `backfill`. */\n backfill: backfillResultSchema.optional(),\n /** What this chat has staged, when one is attached: applied at Publish, dropped with a discard. */\n staged: z.array(stagedSourceOpSchema).optional(),\n }),\n hints: z.array(z.string()).optional(),\n});\nexport type SourcesResponse = z.infer<typeof sourcesResponseSchema>;\n"],"mappings":";;;;;;;;;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U,UAAU,CAAC,EAAE,SAAS;AAClD,CAAC;AAIM,IAAM,uBAAuB,EAAE,aAAa;AAAA,EACjD,UAAU,EAAE,OAAO;AAAA,EACnB,MAAM,EAAE,OAAO;AAAA,EACf,OAAO,EAAE,OAAO;AAAA;AAAA,EAEhB,UAAU,EAAE,OAAO;AAAA;AAAA,EAEnB,SAAS,EAAE,OAAO;AAAA;AAAA,EAElB,gBAAgB,EAAE,OAAO;AAAA;AAAA,EAEzB,SAAS,EAAE,OAAO;AAAA;AAAA,EAElB,QAAQ,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,eAAe,EAAE,OAAO,EAAE,SAAS;AACrC,CAAC;AAGM,IAAM,wBAAwB,EAAE,aAAa;AAAA,EAClD,IAAI,EAAE,QAAQ,IAAI;AAAA,EAClB,MAAM,EAAE,aAAa;AAAA,IACnB,SAAS,EAAE,MAAM,gBAAgB;AAAA;AAAA,IAEjC,SAAS,qBAAqB,SAAS;AAAA;AAAA,IAEvC,UAAU,qBAAqB,SAAS;AAAA;AAAA,IAExC,QAAQ,EAAE,MAAM,oBAAoB,EAAE,SAAS;AAAA,EACjD,CAAC;AAAA,EACD,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AACtC,CAAC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/flows/connect.ts"],"sourcesContent":["/**\n * `connect`: fill a Form's step or destination yourself once you know which\n * resource is meant, instead of parking the turn on the chat's picker card.\n *\n * Three sources, one write:\n * - `--hubspot-form <id>` — a HubSpot form as a `hubspotForm` destination.\n * - `--resource <id>` / `--new-sheet <title>` / nothing — Calendly, SavvyCal\n * and GoHighLevel steps; Google Sheets, Pipedrive and GoHighLevel\n * destinations. The backend reads the resource through the company's\n * connected account and answers with exactly what the card would write,\n * sealed under the flow key where it is a destination — so this command\n * writes ciphertext it cannot read.\n * - `--same-as <slug>:<id>` — the destination or step another Form already\n * has, copied as-is. No platform is asked anything.\n *\n * `request_flow_input` stays the path when nothing is connected, when a\n * spreadsheet has never been chosen, or when the agent cannot tell which\n * resource is meant.\n */\n\nimport {\n FLOW_AGENT_DESTINATION_KINDS,\n FLOW_PROVIDER_TYPE,\n type FlowAgentDestinationKind,\n type FlowsResolveResponse,\n type FlowsSealRequest,\n type FlowsSealResponse,\n type HubspotFormsDestinationResponse,\n} from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiPost } from \"../../client.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { failApi } from \"../actions/shared.ts\";\nimport { hubspotRefusal } from \"../hubspot/refusal.ts\";\nimport { collectSideEffects, readFlowTree, readSettings, walkNodes, writeFlowTree } from \"./shared.ts\";\n\ntype AnyRecord = Record<string, unknown>;\n\ntype Sealed = { oauthProviderId: string; encryptedConfig: string };\n\ntype Attached = { ok: true; nodeId: string; sideEffectId: string } | { ok: false; message: string; fix: string };\n\ntype Target = { kind: string; on: \"node\" | \"sideEffect\"; ids: string[] };\n\ntype Stepped = { ok: true; nodeId: string; type: string } | { ok: false; message: string; fix: string };\n\nconst STEP_KINDS = new Set([\"calendly\", \"savvycal\", \"highlevel\", \"highlevelForm\", \"hubspot\", \"hubspotMeeting\"]);\nconst OAUTH_SIDE_EFFECTS = new Set([\"hubspotForm\", \"googleSpreadsheet\", \"pipedrive\", \"goHighlevelContact\"]);\n\n/**\n * Put the sealed destination on the side effect `named` picks — or, with no\n * name, on the form's only one of `type`. Mutates `tree`; the caller writes it.\n */\nexport function attachDestination(\n tree: AnyRecord,\n named: string | undefined,\n sealed: Sealed,\n type = \"hubspotForm\",\n): Attached {\n const ofType = collectSideEffects(tree).filter((entry) => entry.sideEffect.type === type);\n const inventory = ofType.map((entry) => String(entry.sideEffect.id)).join(\", \") || \"none\";\n const chosen = named\n ? collectSideEffects(tree).find((entry) => entry.sideEffect.id === named)\n : ofType.length === 1\n ? ofType[0]\n : undefined;\n if (!chosen) {\n return {\n ok: false,\n message: named\n ? `No side effect with id \"${named}\" in this form.`\n : `This form has ${ofType.length} ${type} side effects — name one with --side-effect <id>.`,\n fix:\n ofType.length === 0\n ? `Add one first: baker flows add-side-effect <slug> --node <stepId> --type ${type}`\n : `${type} side effects in this form: ${inventory}`,\n };\n }\n if (chosen.sideEffect.type !== type) {\n return {\n ok: false,\n message: `Side effect \"${named}\" is a ${String(chosen.sideEffect.type)}, not a ${type}.`,\n fix: `${type} side effects in this form: ${inventory}`,\n };\n }\n chosen.sideEffect.oauthProviderId = sealed.oauthProviderId;\n chosen.sideEffect.encryptedConfig = sealed.encryptedConfig;\n return { ok: true, nodeId: String(chosen.node.id), sideEffectId: String(chosen.sideEffect.id) };\n}\n\nfunction isSet(value: unknown): boolean {\n return typeof value === \"string\" && value.length > 0;\n}\n\n/**\n * Every side effect of `type` that still lacks its account or its config — what\n * `--all` wires. One already wired is left alone, so re-running after a partial\n * setup never repoints a destination someone chose.\n */\nexport function unwiredSideEffects(tree: AnyRecord, type: string): string[] {\n return collectSideEffects(tree)\n .filter(({ sideEffect }) => sideEffect.type === type)\n .filter(\n ({ sideEffect }) =>\n (OAUTH_SIDE_EFFECTS.has(type) && !isSet(sideEffect.oauthProviderId)) || !isSet(sideEffect.encryptedConfig),\n )\n .map(({ sideEffect }) => String(sideEffect.id));\n}\n\nexport function unwiredHubspotForms(tree: AnyRecord): string[] {\n return unwiredSideEffects(tree, \"hubspotForm\");\n}\n\n/** Destinations with nothing confidential in them: the agent states them, no card. */\nconst STATED_KINDS = new Set([\"email\", \"httpWebhook\"]);\n\n/** The stated kind an `--email` / `--subject` / `--url` call is about. */\nfunction statedKind(args: AnyRecord): string | undefined {\n if (typeof args.email === \"string\" || typeof args.subject === \"string\") return \"email\";\n if (typeof args.url === \"string\") return \"httpWebhook\";\n return undefined;\n}\n\ntype SealPlan = { ok: true; request: FlowsSealRequest } | { ok: false; message: string; fix: string };\n\n/** What `--email/--subject` or `--url` say, as the request the backend seals — or why not. */\nexport function sealRequestFor(kind: string, args: AnyRecord): SealPlan {\n const text = (key: string) => (typeof args[key] === \"string\" && args[key].trim() ? args[key].trim() : undefined);\n if (kind === \"email\") {\n const email = text(\"email\");\n const subject = text(\"subject\");\n if (!email || !subject) {\n return {\n ok: false,\n message: \"An email destination needs both who receives it and its subject.\",\n fix: 'Pass --email \"a@x.com, b@x.com\" --subject \"New lead — <Form name>\". Write the subject yourself from the Form; ask the user only for an address you were not given.',\n };\n }\n return { ok: true, request: { type: \"email\", email, subject } };\n }\n if (kind === \"httpWebhook\") {\n const apiUrl = text(\"url\");\n if (!apiUrl) {\n return { ok: false, message: \"A webhook destination needs its address.\", fix: \"Pass --url https://…\" };\n }\n return { ok: true, request: { type: \"httpWebhook\", apiUrl } };\n }\n return {\n ok: false,\n message: `A ${kind} destination holds a credential, so it is not one you can state.`,\n fix: \"Its token or URL is the user's to enter: request_flow_input.\",\n };\n}\n\ntype Restatable = { ok: true; ids: string[]; skipped: string[] } | { ok: false; message: string; fix: string };\n\n/** Why a stated value must not replace what `settings` holds, or undefined when it may. */\nconst UNREADABLE = \"holds settings this chat cannot read\";\n\nfunction keepsWhatTheAgentCannotState(kind: string, settings: AnyRecord | null | undefined): string | undefined {\n if (settings === null) return UNREADABLE;\n if (kind === \"httpWebhook\" && typeof settings?.auth === \"string\" && settings.auth !== \"noAuth\") {\n return \"sends a credential the user entered\";\n }\n if (kind === \"email\" && settings !== undefined && \"email\" in settings && typeof settings.email !== \"string\") {\n return \"replies to the visitor's own email answer\";\n }\n return undefined;\n}\n\n/**\n * Which of `target`'s destinations a stated `--email` / `--url` may overwrite.\n * The sealed value is replaced whole, so a webhook's credential or a reply to\n * the visitor's own address would be lost and nothing the agent can say puts it\n * back. One whose settings came back unreadable (null) is treated the same:\n * unknown is not empty. `--all` passes over those. An unreadable email may be\n * replaced explicitly with a complete recipient list and subject, without\n * reading the old value or claiming ownership of its ciphertext.\n */\nexport function restatableTargets(\n target: Target,\n settingsById: Record<string, AnyRecord | null>,\n all: boolean,\n replaceUnreadableEmail = false,\n): Restatable {\n const kept = target.ids.flatMap((id) => {\n if (\n target.kind === \"email\" &&\n settingsById[id] === null &&\n replaceUnreadableEmail &&\n !all &&\n target.ids.length === 1\n ) {\n return [];\n }\n const why = keepsWhatTheAgentCannotState(target.kind, settingsById[id]);\n return why ? [{ id, why }] : [];\n });\n const ids = target.ids.filter((id) => !kept.some((entry) => entry.id === id));\n if (kept.length > 0 && (!all || ids.length === 0)) {\n const [first] = kept;\n return {\n ok: false,\n message: `\"${first?.id}\" ${first?.why}; restating it would replace that.`,\n fix:\n first?.why === UNREADABLE\n ? target.kind === \"email\"\n ? `Baker cannot read the old recipients or tell whether this replies to a visitor. If the user wants to replace this destination, pass --side-effect ${first?.id} --replace-unreadable --email <complete recipient list> --subject <subject>. This replaces its entire previous setup; never use it to add a recipient to an unknown list. Otherwise leave it as it is and add a separate team email destination.`\n : \"Have the user restate the webhook address and any credential once with request_flow_input; after that this command can change a webhook with no credential.\"\n : target.kind === \"httpWebhook\"\n ? \"A new address for a webhook with a credential is the user's to enter with it: request_flow_input.\"\n : \"Leave it as it is. Add a separate email destination for the team: baker flows add-side-effect.\",\n };\n }\n return { ok: true, ids, skipped: kept.map((entry) => entry.id) };\n}\n\n/** Write sealed settings onto a destination that has no account (email, webhook). Mutates `tree`. */\nexport function attachSettings(tree: AnyRecord, id: string, encryptedConfig: string, type: string): Attached {\n const chosen = collectSideEffects(tree).find((entry) => entry.sideEffect.id === id);\n if (!chosen || chosen.sideEffect.type !== type) {\n const ofType = collectSideEffects(tree).filter((entry) => entry.sideEffect.type === type);\n return {\n ok: false,\n message: chosen\n ? `Side effect \"${id}\" is a ${String(chosen.sideEffect.type)}, not a ${type}.`\n : `No side effect with id \"${id}\" in this form.`,\n fix: `${type} side effects in this form: ${ofType.map((entry) => String(entry.sideEffect.id)).join(\", \") || \"none\"}`,\n };\n }\n chosen.sideEffect.encryptedConfig = encryptedConfig;\n return { ok: true, nodeId: String(chosen.node.id), sideEffectId: id };\n}\n\nfunction stepType(node: AnyRecord | undefined): string | undefined {\n const type = (node?.nodeData as AnyRecord | undefined)?.type;\n return typeof type === \"string\" ? type : undefined;\n}\n\nfunction findStep(tree: AnyRecord, nodeId: string): AnyRecord | undefined {\n return walkNodes(tree).find((node) => node.id === nodeId);\n}\n\n/** Write a picked resource into a step's `form.external`, keeping what the step autofills. */\nexport function attachStep(tree: AnyRecord, nodeId: string, external: AnyRecord): Stepped {\n const node = findStep(tree, nodeId);\n const type = stepType(node);\n if (!node || !type) {\n return {\n ok: false,\n message: `No step with id \"${nodeId}\" in this form.`,\n fix: \"Step ids: baker flows show <slug>\",\n };\n }\n if (!STEP_KINDS.has(type)) {\n return {\n ok: false,\n message: `Step \"${nodeId}\" is a ${type}, which embeds nothing from another platform.`,\n fix: \"Only calendly, savvycal, highlevel, highlevelForm, hubspot and hubspotMeeting steps take a resource.\",\n };\n }\n const nodeData = node.nodeData as AnyRecord;\n const form = (nodeData.form as AnyRecord | undefined) ?? {};\n nodeData.form = { autofilledFields: {}, ...form, external };\n return { ok: true, nodeId, type };\n}\n\n/** Steps of `type` with nothing picked yet — what `--all` fills for a step kind. */\nexport function unpickedSteps(tree: AnyRecord, type: string): string[] {\n return walkNodes(tree)\n .filter((node) => stepType(node) === type)\n .filter((node) => ((node.nodeData as AnyRecord).form as AnyRecord | undefined)?.external == null)\n .map((node) => String(node.id));\n}\n\n/**\n * Give `targetId` exactly the destination (or picked resource) `sourceId`\n * already has in another Form. Only between the same type: a sheet's sealed\n * config means nothing to Pipedrive.\n */\nexport function copyDestination(source: AnyRecord, sourceId: string, target: AnyRecord, targetId: string): Stepped {\n const from = collectSideEffects(source).find((entry) => entry.sideEffect.id === sourceId);\n if (from) {\n const type = String(from.sideEffect.type);\n if (!isSet(from.sideEffect.oauthProviderId) || !isSet(from.sideEffect.encryptedConfig)) {\n return {\n ok: false,\n message: `\"${sourceId}\" is not wired itself — nothing to copy.`,\n fix: \"Copy from one that is.\",\n };\n }\n const attached = attachDestination(\n target,\n targetId,\n {\n oauthProviderId: String(from.sideEffect.oauthProviderId),\n encryptedConfig: String(from.sideEffect.encryptedConfig),\n },\n type,\n );\n return attached.ok ? { ok: true, nodeId: attached.nodeId, type } : attached;\n }\n const step = findStep(source, sourceId);\n const external = ((step?.nodeData as AnyRecord | undefined)?.form as AnyRecord | undefined)?.external;\n if (!step || external == null || typeof external !== \"object\") {\n return {\n ok: false,\n message: `No wired side effect or picked step \"${sourceId}\" in the source form.`,\n fix: \"Ids: baker flows show <slug>\",\n };\n }\n const targetType = stepType(findStep(target, targetId));\n if (targetType !== stepType(step)) {\n return {\n ok: false,\n message: `\"${sourceId}\" is a ${String(stepType(step))} and \"${targetId}\" a ${String(targetType)} — copy only between the same type.`,\n fix: \"Pick a source of the same type.\",\n };\n }\n return attachStep(target, targetId, structuredClone(external as AnyRecord));\n}\n\nfunction refuse(\n message: string,\n fix: string | { action: string; explanation: string },\n code = \"VALIDATION_ERROR\",\n): never {\n writeJson({ ok: false, error: { code, message, fix } });\n process.exit(1);\n}\n\nfunction allTargets(tree: AnyRecord, kind: string | undefined): Target {\n if (!kind) refuse(\"--all needs --type <kind> to know what to wire.\", \"e.g. --all --type googleSpreadsheet\");\n const on = STEP_KINDS.has(kind) ? \"node\" : \"sideEffect\";\n // A stated destination is restated whole (\"every lead to Vicente and Fran\"), set or not.\n const ids = STATED_KINDS.has(kind)\n ? collectSideEffects(tree)\n .filter(({ sideEffect }) => sideEffect.type === kind)\n .map(({ sideEffect }) => String(sideEffect.id))\n : on === \"node\"\n ? unpickedSteps(tree, kind)\n : unwiredSideEffects(tree, kind);\n if (ids.length === 0 && STATED_KINDS.has(kind)) {\n refuse(\n `This Form has no ${kind} destination.`,\n `Add one: baker flows add-side-effect <slug> --node <stepId> --type ${kind}`,\n );\n }\n if (ids.length === 0) {\n refuse(\n `Every ${kind} in this Form is already wired.`,\n \"Repoint one by naming it with --node / --side-effect instead of --all.\",\n );\n }\n return { kind, on, ids };\n}\n\nfunction onlyOfType(tree: AnyRecord, type: string): string {\n const probe = attachDestination(tree, undefined, { oauthProviderId: \"\", encryptedConfig: \"\" }, type);\n if (!probe.ok) refuse(probe.message, probe.fix);\n return probe.sideEffectId;\n}\n\nfunction stepTarget(tree: AnyRecord, node: string): Target {\n const type = stepType(findStep(tree, node));\n if (!type) refuse(`No step with id \"${node}\" in this form.`, \"Step ids: baker flows show <slug>\");\n return { kind: type, on: \"node\", ids: [node] };\n}\n\nfunction sideEffectTarget(tree: AnyRecord, named: string): Target {\n const found = collectSideEffects(tree).find((entry) => entry.sideEffect.id === named);\n if (!found) refuse(`No side effect with id \"${named}\" in this form.`, \"Side-effect ids: baker flows show <slug>\");\n return { kind: String(found.sideEffect.type), on: \"sideEffect\", ids: [named] };\n}\n\n/** Which steps or side effects this call fills, resolved before any platform is asked anything. */\nexport function targetsFor(tree: AnyRecord, args: AnyRecord): Target {\n const node = typeof args.node === \"string\" ? args.node : undefined;\n const named = typeof args[\"side-effect\"] === \"string\" ? args[\"side-effect\"] : undefined;\n if ([node, named, args.all === true ? \"all\" : undefined].filter(Boolean).length > 1) {\n refuse(\"Pass one of --node, --side-effect or --all.\", \"One target per call; --all for every unwired one.\");\n }\n if (args.all === true) {\n const kind = typeof args.type === \"string\" ? args.type : args[\"hubspot-form\"] ? \"hubspotForm\" : statedKind(args);\n return allTargets(tree, kind);\n }\n if (node) return stepTarget(tree, node);\n if (named) return sideEffectTarget(tree, named);\n if (args[\"hubspot-form\"]) return { kind: \"hubspotForm\", on: \"sideEffect\", ids: [onlyOfType(tree, \"hubspotForm\")] };\n const stated = statedKind(args);\n if (stated) return { kind: stated, on: \"sideEffect\", ids: [onlyOfType(tree, stated)] };\n return refuse(\n \"Name what to fill: --node <stepId>, --side-effect <id>, or --all --type <kind>.\",\n \"Ids: baker flows show <slug>\",\n );\n}\n\nasync function sealHubspotForm(formId: string): Promise<HubspotFormsDestinationResponse[\"data\"]> {\n try {\n return (await apiPost<HubspotFormsDestinationResponse>(\"/api/hubspot/forms/destination\", { formId })).data;\n } catch (err) {\n const refusal = err instanceof ApiError ? hubspotRefusal(err.code, err.message) : null;\n if (err instanceof ApiError && refusal !== null) refuse(err.message, refusal.fix, refusal.code);\n failApi(err);\n }\n}\n\nfunction isAgentKind(kind: string): kind is FlowAgentDestinationKind {\n return (FLOW_AGENT_DESTINATION_KINDS as readonly string[]).includes(kind);\n}\n\n/**\n * The refusals only the user can clear, as the call that clears them: nothing\n * connected is the connect card; two accounts is a question only when the\n * agent cannot tell which one the user means.\n */\nexport function destinationRefusal(\n kind: FlowAgentDestinationKind,\n err: ApiError,\n): { code: string; fix: string } | null {\n if (err.code === \"NOT_FOUND\" && err.message.includes(\"is connected to this company\")) {\n return {\n code: \"NOT_CONNECTED\",\n fix: `AGENT INSTRUCTION: only the user can connect it. Call request_connection with { platform: \"${FLOW_PROVIDER_TYPE[kind]}\", reason } — reason in their words — then run this again. Keep going with the rest of the task meanwhile.`,\n };\n }\n if (err.code === \"CONFLICT\" && err.message.includes(\"--account\")) {\n return {\n code: \"SEVERAL_ACCOUNTS\",\n fix: \"Pass --account <id> when the user or the brief makes clear which one; otherwise ask them which (AskUserQuestion), naming the accounts above.\",\n };\n }\n return null;\n}\n\nfunction resolveBody(kind: FlowAgentDestinationKind, args: AnyRecord): AnyRecord {\n const columns =\n typeof args.columns === \"string\"\n ? args.columns\n .split(\",\")\n .map((column) => column.trim())\n .filter(Boolean)\n : undefined;\n return {\n kind,\n ...(typeof args.account === \"string\" ? { account: args.account } : {}),\n ...(typeof args.resource === \"string\" ? { resourceId: args.resource } : {}),\n ...(typeof args.tab === \"string\" ? { tab: args.tab } : {}),\n ...(typeof args[\"new-sheet\"] === \"string\" ? { newSheet: { title: args[\"new-sheet\"], columns } } : {}),\n };\n}\n\nasync function resolveDestination(\n kind: FlowAgentDestinationKind,\n args: AnyRecord,\n): Promise<FlowsResolveResponse[\"data\"]> {\n try {\n return (await apiPost<FlowsResolveResponse>(\"/api/flows/destinations/resolve\", resolveBody(kind, args))).data;\n } catch (err) {\n const refusal = err instanceof ApiError ? destinationRefusal(kind, err) : null;\n if (err instanceof ApiError && refusal !== null) refuse(err.message, refusal.fix, refusal.code);\n failApi(err);\n }\n}\n\ntype Wired = { wired: { nodeId: string; sideEffectId?: string }[]; destination: unknown; hints: string[] };\n\nfunction applyAll(target: Target, apply: (id: string) => Stepped | Attached): Wired[\"wired\"] {\n return target.ids.map((id) => {\n const done = apply(id);\n if (!done.ok) refuse(done.message, done.fix);\n return \"sideEffectId\" in done ? { nodeId: done.nodeId, sideEffectId: done.sideEffectId } : { nodeId: done.nodeId };\n });\n}\n\nfunction sameAs(tree: AnyRecord, target: Target, ref: string): Wired {\n const [slug, id] = ref.split(\":\");\n if (!slug || !id) refuse(`--same-as takes <slug>:<id>, got \"${ref}\".`, \"e.g. --same-as madrid:se-gsheet-1\");\n const source = readFlowTree(slug);\n const wired = applyAll(target, (targetId) => copyDestination(source, id, tree, targetId));\n return { wired, destination: { sameAs: ref }, hints: [] };\n}\n\nasync function fromHubspot(tree: AnyRecord, target: Target, formId: string, slug: string): Promise<Wired> {\n if (target.kind !== \"hubspotForm\") {\n refuse(\n `--hubspot-form wires a hubspotForm side effect, not a ${target.kind}.`,\n \"A HubSpot step takes `baker hubspot forms view <id> --as-node` (or `meetings view <slug> --as-node`).\",\n );\n }\n const sealed = await sealHubspotForm(formId);\n const wired = applyAll(target, (id) => attachDestination(tree, id, sealed));\n return {\n wired,\n destination: { formGuid: sealed.formGuid, formName: sealed.formName, portalId: sealed.portalId },\n hints: [\n `Now map each step's answers onto it: baker flows map ${slug} --side-effect <id> --hubspot-form ${sealed.formGuid} --map email=<value> … --write. Field names come from \\`baker hubspot forms view ${sealed.formGuid}\\`.`,\n ],\n };\n}\n\nfunction sheetHints(slug: string, data: Extract<FlowsResolveResponse[\"data\"], { target: \"sideEffect\" }>): string[] {\n const sheet = data.destination;\n if (!sheet)\n return [`Now map the fields: baker flows map ${slug} --side-effect <id> --map <fieldKey>=<value> … --write.`];\n const columns = sheet.columns.map((column) => `${column.letter}=${column.header}`).join(\", \");\n return [\n ...(sheet.created\n ? [\n `Created \"${sheet.name}\" in the connected Google account${sheet.url ? ` (${sheet.url})` : \"\"} — tell the user where their leads will land.`,\n ]\n : []),\n columns\n ? `Columns: ${columns}. Map by letter: baker flows map ${slug} --side-effect <id> --map A=<value> … --write.`\n : `The \"${sheet.tab}\" tab has no header row. Map by letter anyway, and say which column holds what.`,\n ];\n}\n\nasync function fromStated(tree: AnyRecord, target: Target, args: AnyRecord): Promise<Wired> {\n const plan = sealRequestFor(target.kind, args);\n if (!plan.ok) refuse(plan.message, plan.fix);\n const current = await readSettings(tree);\n if (current === null) {\n refuse(\n \"Could not read what this Form's destinations hold now, so nothing was overwritten.\",\n \"Try again in a moment; if it keeps failing, carry on with the rest and tell the user this one is not set.\",\n \"NETWORK_ERROR\",\n );\n }\n const restatable = restatableTargets(target, current, args.all === true, args[\"replace-unreadable\"] === true);\n if (!restatable.ok) refuse(restatable.message, restatable.fix);\n const kept = restatable.skipped.length\n ? [`Left as it was: ${restatable.skipped.join(\", \")} (it holds what only the user can set).`]\n : [];\n let sealed: FlowsSealResponse[\"data\"];\n try {\n sealed = (await apiPost<FlowsSealResponse>(\"/api/flows/destinations/seal\", plan.request)).data;\n } catch (err) {\n failApi(err);\n }\n const wired = applyAll({ ...target, ids: restatable.ids }, (id) =>\n attachSettings(tree, id, sealed.encryptedConfig, target.kind),\n );\n return {\n wired,\n destination: sealed.settings,\n hints: [\n ...kept,\n target.kind === \"email\"\n ? `Leads from these steps now go to ${String(sealed.settings.email)} with the subject \"${String(sealed.settings.subject)}\". Tell the user in those words.`\n : `Submissions now go to ${String(sealed.settings.apiUrl)}.`,\n ],\n };\n}\n\nasync function fromPlatform(tree: AnyRecord, target: Target, args: AnyRecord, slug: string): Promise<Wired> {\n const kind = target.kind;\n if (!isAgentKind(kind)) {\n const hubspotStep = kind === \"hubspot\" || kind === \"hubspotMeeting\";\n refuse(\n `A ${kind} ${target.on === \"node\" ? \"step\" : \"side effect\"} is not something this command can fill from a platform.`,\n hubspotStep\n ? \"Write the blob from `baker hubspot forms view <id> --as-node` (or `meetings view <slug> --as-node`) into the step's form.external.\"\n : OAUTH_SIDE_EFFECTS.has(kind)\n ? \"Pass --hubspot-form <formId>.\"\n : \"It takes typed credentials only the user has: request_flow_input.\",\n );\n }\n const data = await resolveDestination(kind, args);\n if (data.target === \"node\") {\n const wired = applyAll(target, (id) => attachStep(tree, id, data.external));\n return {\n wired,\n destination: { name: data.name, account: data.account },\n hints: [`Picked \"${data.name}\". Autofill its fields from earlier answers in the step's form.autofilledFields.`],\n };\n }\n const sealed = { oauthProviderId: data.oauthProviderId, encryptedConfig: data.encryptedConfig };\n const wired = applyAll(target, (id) => attachDestination(tree, id, sealed, kind));\n return {\n wired,\n destination: data.destination ? { ...data.destination, account: data.account } : { account: data.account },\n hints: sheetHints(slug, data),\n };\n}\n\nregisterSchema({\n command: \"flows.connect\",\n description:\n 'Fill a Form\\'s step or destination yourself — no card for the user. Steps: Calendly, SavvyCal, GoHighLevel calendar/form (`--node <id> --resource <id>`). Destinations: HubSpot form (`--hubspot-form <id>`), Google Sheets (`--resource <spreadsheetId>` or `--new-sheet <title> --columns …`), Pipedrive and GoHighLevel contact (no resource: the connected account is the destination), email (`--email \"a@x.com, b@x.com\" --subject \"New lead — <Form>\"`, never a card), webhook without a credential (`--url`). `--same-as <slug>:<id>` copies what another Form already has. `--all --type <kind>` fills every unwired one of that kind at once. Ids come from `baker flows options <kind>`. Fall back to request_flow_input only when nothing is connected, the sheet was never chosen, or several resources plausibly match.',\n args: {\n slug: { type: \"positional\", description: \"Form slug\", required: true },\n node: {\n type: \"string\",\n description: \"Step id to fill (calendly, savvycal, highlevel, highlevelForm)\",\n required: false,\n },\n \"side-effect\": { type: \"string\", description: \"Side-effect id to wire\", required: false },\n all: { type: \"boolean\", description: \"Every unwired one of --type in this Form\", required: false, default: false },\n type: { type: \"string\", description: \"The kind --all wires (e.g. googleSpreadsheet, calendly)\", required: false },\n resource: { type: \"string\", description: \"Option id from `baker flows options <kind>`\", required: false },\n \"hubspot-form\": {\n type: \"string\",\n description: \"HubSpot form id (from `baker hubspot forms list`)\",\n required: false,\n },\n \"new-sheet\": {\n type: \"string\",\n description: \"Create a Google spreadsheet with this title and wire it\",\n required: false,\n },\n columns: {\n type: \"string\",\n description: \"With --new-sheet: header row, comma-separated, from column A\",\n required: false,\n },\n tab: { type: \"string\", description: \"Google Sheets tab to append to (default: the first)\", required: false },\n \"same-as\": {\n type: \"string\",\n description: \"<slug>:<id> — copy another Form's wired destination or picked step\",\n required: false,\n },\n account: {\n type: \"string\",\n description: \"Connection id, when more than one account of the platform is connected\",\n required: false,\n },\n email: {\n type: \"string\",\n description:\n 'Email destination: who receives each lead, comma-separated for several (--email \"ana@x.com, luis@x.com\"). Never a card: you state it.',\n required: false,\n },\n subject: {\n type: \"string\",\n description:\n 'Email destination: the subject line. Write it yourself from the Form (\"New lead — Private events\").',\n required: false,\n },\n \"replace-unreadable\": {\n type: \"boolean\",\n description:\n \"Email only, one destination: replace unreadable old settings with the complete --email and --subject. Use only when the user intends replacement, never to add to an unknown recipient list. Does not apply with --all.\",\n required: false,\n default: false,\n },\n url: {\n type: \"string\",\n description:\n \"Webhook destination with no credential: its https address. One that needs a token goes to request_flow_input.\",\n required: false,\n },\n },\n});\n\nexport const connectCommand = defineCommand({\n meta: {\n name: \"connect\",\n description:\n 'Fill a step or destination yourself. Start here: baker flows options calendly, then baker flows connect contact --node book --resource <id>. Email: --side-effect se-email-1 --email \"ana@x.com, luis@x.com\" --subject \"New lead — Contact\". Sheets: --side-effect se-gsheet-1 --new-sheet \"Leads\" --columns \"Name,Email\". Same as another Form: --same-as madrid:se-gsheet-1',\n },\n args: {\n slug: { type: \"positional\", description: \"Form slug\", required: true },\n node: { type: \"string\", description: \"Step id to fill\" },\n \"side-effect\": { type: \"string\", description: \"Side-effect id to wire\" },\n all: { type: \"boolean\", description: \"Every unwired one of --type\" },\n type: { type: \"string\", description: \"The kind --all wires\" },\n resource: { type: \"string\", description: \"Option id from baker flows options <kind>\" },\n \"hubspot-form\": { type: \"string\", description: \"HubSpot form id (from baker hubspot forms list)\" },\n \"new-sheet\": { type: \"string\", description: \"Create a spreadsheet with this title\" },\n columns: { type: \"string\", description: \"Header row for --new-sheet, comma-separated\" },\n tab: { type: \"string\", description: \"Sheet tab (default: the first)\" },\n \"same-as\": { type: \"string\", description: \"<slug>:<id> to copy\" },\n account: { type: \"string\", description: \"Connection id when several are connected\" },\n email: { type: \"string\", description: \"Email destination: recipients, comma-separated\" },\n subject: { type: \"string\", description: \"Email destination: subject line\" },\n \"replace-unreadable\": {\n type: \"boolean\",\n description: \"Replace one unreadable email's entire setup with --email and --subject\",\n },\n url: { type: \"string\", description: \"Webhook destination with no credential: its address\" },\n },\n run: async ({ args }) => {\n const slug = String(args.slug);\n const target = targetsFor(readFlowTree(slug), args);\n\n const tree = readFlowTree(slug);\n const result =\n typeof args[\"same-as\"] === \"string\"\n ? sameAs(tree, target, args[\"same-as\"])\n : typeof args[\"hubspot-form\"] === \"string\"\n ? await fromHubspot(tree, target, args[\"hubspot-form\"], slug)\n : STATED_KINDS.has(target.kind)\n ? await fromStated(tree, target, args)\n : await fromPlatform(tree, target, args, slug);\n writeFlowTree(slug, tree);\n\n writeJson({\n ok: true,\n data: {\n slug,\n kind: target.kind,\n [target.on === \"node\" ? \"steps\" : \"sideEffects\"]: result.wired,\n destination: result.destination,\n connected: true,\n },\n hints: [...result.hints, \"Staged like any other edit in this chat: it goes live when the chat is published.\"],\n });\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,qBAAqB;AAkB9B,IAAM,aA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,MAAM,UAAU,aAAa,iDAAiD;AAAA,IACvF,SAAS,EAAE,MAAM,UAAU,aAAa,kCAAkC;AAAA,IAC1E,sBAAsB;AAAA,MACpB,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA,KAAK,EAAE,MAAM,UAAU,aAAa,sDAAsD;AAAA,EAC5F;AAAA,EACA,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,UAAM,OAAO,OAAO,KAAK,IAAI;AAC7B,UAAM,SAAS,WAAW,aAAa,IAAI,GAAG,IAAI;AAElD,UAAM,OAAO,aAAa,IAAI;AAC9B,UAAM,SACJ,OAAO,KAAK,SAAS,MAAM,WACvB,OAAO,MAAM,QAAQ,KAAK,SAAS,CAAC,IACpC,OAAO,KAAK,cAAc,MAAM,WAC9B,MAAM,YAAY,MAAM,QAAQ,KAAK,cAAc,GAAG,IAAI,IAC1D,aAAa,IAAI,OAAO,IAAI,IAC1B,MAAM,WAAW,MAAM,QAAQ,IAAI,IACnC,MAAM,aAAa,MAAM,QAAQ,MAAM,IAAI;AACrD,kBAAc,MAAM,IAAI;AAExB,cAAU;AAAA,MACR,IAAI;AAAA,MACJ,MAAM;AAAA,QACJ;AAAA,QACA,MAAM,OAAO;AAAA,QACb,CAAC,OAAO,OAAO,SAAS,UAAU,aAAa,GAAG,OAAO;AAAA,QACzD,aAAa,OAAO;AAAA,QACpB,WAAW;AAAA,MACb;AAAA,MACA,OAAO,CAAC,GAAG,OAAO,OAAO,mFAAmF;AAAA,IAC9G,CAAC;AAAA,EACH;AACF,CAAC;","names":["wired"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/flows/value-expression.ts","../src/commands/flows/mapping.ts"],"sourcesContent":["/**\n * What goes on the RIGHT of a `--map`, and how it becomes an AutofillDoc.\n *\n * The first version of this command could only map a plain form field, which\n * left out most of what a real CRM mapping is made of. `lead_source` almost\n * always wants `tracking.utm_source`; a \"full name\" column wants two fields and\n * a space between them; a Pipedrive owner field wants a literal. None of that\n * was expressible, so the command that exists to stop the agent hand-writing\n * ProseMirror sent it straight back to hand-writing ProseMirror for the most\n * common mapping in paid marketing.\n *\n * The grammar is four prefixes, a quoted literal, and `+`:\n *\n * nombre a form field (shorthand for field:nombre)\n * field:nombre …the same, explicit\n * field:Contact Info.nombre …disambiguated when two steps share a name\n * tracking:utm_source a built-in tracking variable\n * global:UserEmail a global variable, by the name it was given\n * code:total_score a codeExecution exposed value\n * \"Paid Search\" literal text\n * field:first + \" \" + field:last concatenation\n * {{<stepId>.customForm.nombre}} a mention as the flow file stores it\n * (also .codeExecution., tracking., global.)\n *\n * A value never runs code: `.split(\" \")[0]` and the like are refused, because\n * the engine substitutes a mention and nothing evaluates what follows it.\n *\n * Every reference is resolved against the flow's own tree — a name that is not\n * there is refused with the names that are. That is the whole point: `attrs.id`\n * is not checked by anything downstream, so a mapping with a subtly wrong id is\n * valid, ships, and sends an empty value forever.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { MappingError } from \"./mapping.ts\";\nimport { flowsDir, walkNodes } from \"./shared.ts\";\n\ntype AnyRecord = Record<string, unknown>;\n\nexport type ValuePart =\n | { kind: \"text\"; text: string }\n | { kind: \"field\"; ref: string }\n | { kind: \"tracking\"; name: string }\n | { kind: \"global\"; name: string }\n | { kind: \"code\"; ref: string };\n\nconst PREFIXES = [\"field\", \"tracking\", \"global\", \"code\"] as const;\n\n/**\n * Split on `+` at the top level, keeping quoted segments intact.\n *\n * Hand-rolled rather than a regex because a literal may contain `+` — a mapping\n * that emits `\"A + B\"` as text is legitimate, and a regex split would tear it in\n * half silently.\n */\nfunction splitParts(raw: string): string[] {\n const parts: string[] = [];\n let current = \"\";\n let inQuotes = false;\n for (let i = 0; i < raw.length; i++) {\n const char = raw[i];\n if (char === '\"') {\n inQuotes = !inQuotes;\n current += char;\n } else if (char === \"+\" && !inQuotes) {\n parts.push(current);\n current = \"\";\n } else {\n current += char;\n }\n }\n parts.push(current);\n if (inQuotes) {\n throw new MappingError(`Unclosed quote in value \\`${raw}\\`.`, 'A literal is written \"like this\".');\n }\n return parts.map((part) => part.trim()).filter((part) => part.length > 0);\n}\n\nconst TRANSFORM_REFUSAL =\n \"A value cannot run code. Map the field as it is (firstname=full_name), or split it in the step with a codeExecution that exposes first_name and last_name and map code:first_name.\";\n\n/** `.split(`, `.slice(`, `.toUpperCase()` — a method call, which no mapping can run. */\nconst METHOD_CALL = /\\.\\s*[A-Za-z_$][\\w$]*\\s*\\(/;\n/** `[0]` on the end of a reference — an index, which no mapping can run either. */\nconst TRAILING_INDEX = /\\[[^\\]]*\\]$/;\n\n/**\n * A reference in the spelling the flow file itself stores it in —\n * `{{<stepId>.customForm.<field>}}` — and the one every refusal's inventory\n * prints the step id for. Refusing it sent the agent back to hand-writing the\n * ProseMirror doc for a field the command had just listed.\n */\nfunction mentionPart(inner: string): ValuePart {\n if (inner.startsWith(\"tracking.\")) return { kind: \"tracking\", name: inner.slice(\"tracking.\".length) };\n if (inner.startsWith(\"global.\")) return { kind: \"global\", name: inner.slice(\"global.\".length) };\n return referencePart(inner);\n}\n\n/** A bare reference: `<stepId>.codeExecution.<name>` is an exposed value, anything else a form field. */\nfunction referencePart(ref: string): ValuePart {\n return /\\.codeExecution\\.[^.]+$/.test(ref) ? { kind: \"code\", ref } : { kind: \"field\", ref };\n}\n\n/** One `+`-separated segment: a quoted literal, a prefixed reference, or a bare field name. */\nfunction parsePart(part: string): ValuePart {\n if (part.startsWith('\"') && part.endsWith('\"') && part.length >= 2) {\n return { kind: \"text\", text: part.slice(1, -1) };\n }\n if (METHOD_CALL.test(part) || TRAILING_INDEX.test(part)) {\n throw new MappingError(TRANSFORM_REFUSAL);\n }\n\n if (part.startsWith(\"{{\")) {\n const close = part.indexOf(\"}}\");\n if (close < 0) {\n throw new MappingError(\n `Unclosed \\`{{\\` in value \\`${part}\\`.`,\n \"A mention is written {{<stepId>.customForm.<field>}}.\",\n );\n }\n if (part.slice(close + 2).trim()) throw new MappingError(TRANSFORM_REFUSAL);\n return mentionPart(part.slice(2, close).trim());\n }\n\n const colon = part.indexOf(\":\");\n if (colon <= 0) return referencePart(part);\n\n const prefix = part.slice(0, colon);\n const rest = part.slice(colon + 1).trim();\n if (!(PREFIXES as readonly string[]).includes(prefix)) {\n throw new MappingError(\n `\\`${prefix}:\\` is not a value kind.`,\n `Use one of ${PREFIXES.map((candidate) => `${candidate}:`).join(\" \")}, a bare form field name, or a \"quoted literal\".`,\n );\n }\n if (!rest) throw new MappingError(`\\`${part}\\` names no ${prefix}.`);\n\n switch (prefix) {\n case \"tracking\":\n return { kind: \"tracking\", name: rest.replace(/^tracking\\./, \"\") };\n case \"global\":\n return { kind: \"global\", name: rest };\n case \"code\":\n return { kind: \"code\", ref: rest };\n default:\n return { kind: \"field\", ref: rest };\n }\n}\n\nexport function parseValueExpression(raw: string): ValuePart[] {\n const parts = splitParts(raw);\n if (parts.length === 0) {\n throw new MappingError(\"A --map needs a value on the right of the `=`.\");\n }\n return parts.map(parsePart);\n}\n\n/**\n * The tracking vocabulary, read out of the workspace the command is running in\n * rather than copied here. `TRACKING_FIELD_IDS` is the engine's own list, so\n * reading it is the only way this cannot drift — and there are already four\n * hand-copies of the flow taxonomy in this repo without adding a fifth.\n *\n * Returns null when the file is not there (the CLI run outside a client repo),\n * which skips validation rather than refusing a mapping that is probably fine.\n */\nexport function trackingFieldIds(): Set<string> | null {\n const path = join(flowsDir(), \"..\", \"tracking.ts\");\n if (!existsSync(path)) return null;\n try {\n const source = readFileSync(path, \"utf-8\");\n const block = source.match(/TRACKING_FIELD_IDS\\s*=\\s*\\[([\\s\\S]*?)\\]\\s*as const/)?.[1];\n if (!block) return null;\n const ids = [...block.matchAll(/\"(tracking\\.[a-z0-9_]+)\"/g)].map((match) => match[1] as string);\n return ids.length > 0 ? new Set(ids) : null;\n } catch {\n return null;\n }\n}\n\n/**\n * A step's `nodeData.form.external` — the one place the engine keeps both a\n * step's fields and its `codeExecution`.\n *\n * Read through here rather than off `nodeData` directly. `codeExecution` is\n * nested one level deeper than it looks (`CustomFormData` in `types.ts`, and\n * both readers — `store.ts` `applyCodeExecution` and `code-normalize.ts`\n * `pushCustomFormExposedNames` — go through `form.external`), and reading it\n * from the wrong level is invisible: the lookup simply finds nothing and every\n * `code:` reference is refused as if the form exposed no values at all.\n */\nfunction externalOf(node: AnyRecord): AnyRecord {\n const nodeData = (node.nodeData ?? {}) as AnyRecord;\n return ((nodeData.form as AnyRecord | undefined)?.external ?? {}) as AnyRecord;\n}\n\ntype FieldOwner = { id: string; name: string; fields: string[] };\n\n/** Steps that collect data, with the fields each one owns. */\nfunction fieldOwners(tree: AnyRecord): FieldOwner[] {\n return walkNodes(tree).flatMap((node) => {\n const external = externalOf(node);\n if (!Array.isArray(external.fields)) return [];\n return [\n {\n id: String(node.id ?? \"\"),\n name: typeof node.name === \"string\" && node.name ? node.name : \"Form\",\n fields: (external.fields as AnyRecord[])\n .map((field) => field?.fieldName)\n .filter((name): name is string => typeof name === \"string\"),\n },\n ];\n });\n}\n\n/**\n * `Contact Info.email` → the step called \"Contact Info\"; `email` → whichever step\n * owns it; `<stepId>.customForm.email` → that step, spelled as the flow file\n * stores the mention (`segment` is `customForm` for a field, `codeExecution`\n * for an exposed value).\n */\nfunction splitRef(ref: string, segment: \"customForm\" | \"codeExecution\"): { step?: string; name: string } {\n const marker = `.${segment}.`;\n const at = ref.lastIndexOf(marker);\n if (at > 0 && !ref.slice(at + marker.length).includes(\".\")) {\n return { step: ref.slice(0, at), name: ref.slice(at + marker.length) };\n }\n const dot = ref.lastIndexOf(\".\");\n if (dot <= 0) return { name: ref };\n return { step: ref.slice(0, dot), name: ref.slice(dot + 1) };\n}\n\nfunction mention(id: string, label: string): AnyRecord {\n return { type: \"VariablesMention\", attrs: { id, label, mentionSuggestionChar: \"{{\" } };\n}\n\n/** \"servicio_deseado\" → \"Servicio Deseado\" — the dashboard's display convention. */\nfunction titleize(value: string): string {\n return value\n .split(/[_-]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}\n\nfunction resolveField(tree: AnyRecord, ref: string): AnyRecord {\n const { step, name } = splitRef(ref, \"customForm\");\n const owners = fieldOwners(tree);\n const inventory = owners\n .map((owner) => ` ${owner.name} (${owner.id}): ${owner.fields.join(\", \") || \"(no fields)\"}`)\n .join(\"\\n\");\n\n const candidates = owners.filter(\n (owner) => owner.fields.includes(name) && (!step || owner.name === step || owner.id === step),\n );\n if (candidates.length === 0) {\n throw new MappingError(`Form field \"${ref}\" does not exist in this form.`, inventory);\n }\n // Two steps can legitimately own a field with the same name. Picking one would\n // wire the mapping to whichever happened to come first in the tree.\n if (candidates.length > 1) {\n throw new MappingError(\n `Form field \"${name}\" exists on ${candidates.length} steps — say which: field:<step>.${name}`,\n candidates.map((owner) => ` field:${owner.name}.${name}`).join(\"\\n\"),\n );\n }\n const owner = candidates[0] as FieldOwner;\n // The engine stores every node type's submission under `.customForm.`\n // (`controller.ts`, `wire.ts`), so this prefix is not the node's type.\n return mention(`${owner.id}.customForm.${name}`, `${owner.name} => ${titleize(name)}`);\n}\n\nfunction resolveTracking(name: string): AnyRecord {\n const id = `tracking.${name}`;\n const known = trackingFieldIds();\n if (known && !known.has(id)) {\n const near = [...known].filter((candidate) => candidate.includes(name.split(\"_\")[0] ?? name)).slice(0, 8);\n throw new MappingError(\n `\\`${id}\\` is not a tracking variable.`,\n near.length > 0\n ? `Close matches: ${near.join(\", \")}`\n : \"See references/autofill-and-variables.md § Built-in Tracking Variables.\",\n );\n }\n // Tracking and global mentions carry the id as their own label — that is what\n // the dashboard editor writes, and what the renderer displays.\n return mention(id, id);\n}\n\nfunction resolveGlobal(tree: AnyRecord, name: string): AnyRecord {\n const globals = (tree.globalVariables as AnyRecord[] | undefined) ?? [];\n const match = globals.find((variable) => variable?.name === name || variable?.id === name);\n if (!match) {\n throw new MappingError(\n `No global variable named \"${name}\" on this form.`,\n globals.length > 0\n ? `Defined: ${globals.map((variable) => String(variable.name)).join(\", \")}`\n : \"This form defines none. Globals live on the first node only — see references/autofill-and-variables.md § Global Variables.\",\n );\n }\n const id = `global.${String(match.id)}`;\n return mention(id, id);\n}\n\nfunction resolveCode(tree: AnyRecord, ref: string): AnyRecord {\n const { step, name } = splitRef(ref, \"codeExecution\");\n const owners = walkNodes(tree).flatMap((node) => {\n const exposed = ((externalOf(node).codeExecution as AnyRecord | undefined)?.exposedValues ?? []) as AnyRecord[];\n const names = exposed.map((value) => value?.name).filter((value): value is string => typeof value === \"string\");\n return names.length > 0 ? [{ id: String(node.id ?? \"\"), name: String(node.name ?? \"step\"), names }] : [];\n });\n\n const candidates = owners.filter(\n (owner) => owner.names.includes(name) && (!step || owner.name === step || owner.id === step),\n );\n if (candidates.length !== 1) {\n throw new MappingError(\n candidates.length === 0\n ? `No codeExecution exposes \"${ref}\" on this form.`\n : `\"${name}\" is exposed by ${candidates.length} steps — say which: code:<step>.${name}`,\n owners.length > 0\n ? owners.map((owner) => ` ${owner.name} (${owner.id}): ${owner.names.join(\", \")}`).join(\"\\n\")\n : \"No step on this form exposes any codeExecution value.\",\n );\n }\n const owner = candidates[0] as { id: string; name: string };\n // Exposed values live under `.codeExecution.`, NOT `.customForm.` — the same\n // id under the wrong segment resolves to empty in every CRM payload.\n return mention(`${owner.id}.codeExecution.${name}`, `${owner.name} => ${titleize(name)}`);\n}\n\n/**\n * Build the AutofillDoc a mapping's `value` holds.\n *\n * A single mention keeps its trailing space: that is byte-for-byte what the\n * dashboard's editor produces, and matching it means a mapping written here and\n * one written there are indistinguishable. A multi-part expression emits exactly\n * the parts given, because an injected space would corrupt `first + last`.\n */\nexport function buildValueDoc(tree: AnyRecord, expression: string): AnyRecord {\n const parts = parseValueExpression(expression);\n const content = parts.map((part) => {\n switch (part.kind) {\n case \"text\":\n return { type: \"text\", text: part.text };\n case \"tracking\":\n return resolveTracking(part.name);\n case \"global\":\n return resolveGlobal(tree, part.name);\n case \"code\":\n return resolveCode(tree, part.ref);\n default:\n return resolveField(tree, part.ref);\n }\n });\n\n const single = content.length === 1 && parts[0]?.kind !== \"text\";\n return {\n type: \"doc\",\n content: [{ type: \"paragraph\", content: single ? [...content, { type: \"text\", text: \" \" }] : content }],\n };\n}\n","/**\n * Build a side effect's `fieldMapping` / `columnMapping` from a short spec.\n *\n * Why this exists. A single mapped field is a ~28-line ProseMirror document:\n *\n * { \"objectTypeId\": \"0-1\", \"fieldType\": \"email\", \"fieldName\": \"email\",\n * \"value\": { \"type\": \"doc\", \"content\": [ { \"type\": \"paragraph\", \"content\": [\n * { \"type\": \"VariablesMention\", \"attrs\": {\n * \"id\": \"<nodeId>.customForm.<formField>\",\n * \"label\": \"<Node Name> => <Form Field>\",\n * \"mentionSuggestionChar\": \"{{\" } },\n * { \"type\": \"text\", \"text\": \" \" } ] } ] } }\n *\n * An eight-field CRM mapping is ~230 lines of hand-emitted JSON per form, in\n * which the only information is eight pairs of names. In one real session two\n * forms cost ~460 lines — written once, lost, and written again by hand.\n *\n * It also removes the failure mode those lines invite. `attrs.id` is\n * `<owning node's id>.customForm.<field>`: get the node wrong, or the field name\n * subtly wrong, and the mapping is structurally valid, ships, and silently sends\n * an empty value forever. This resolves the node id from the tree and refuses a\n * form field that does not exist.\n *\n * What it deliberately does NOT do: choose the destination. The CRM-side names\n * (`firstname`, a sheet column) describe an account only `request_flow_input`\n * can see. Configure the side effect first, read the real names back off that\n * call's own result, then map.\n *\n * This file owns the DESTINATION half — which record shape each side-effect type\n * reads, and what it refuses to guess. What goes in `value` is the other half,\n * and it lives in `value-expression.ts`.\n *\n * ## A mapping accumulates, so a write merges\n *\n * Every slot merges with what is already in it, addressed by destination name:\n * re-mapping a name overwrites it in place, a new name is appended, and a name\n * this call did not mention is left alone. `MapOptions.replace` is the opt-in\n * for the other reading, and it is the only way to remove a mapping.\n *\n * Merging is the default because building a mapping is not one act. The\n * documented order is configure the destination, read the real field names back,\n * then map — and in practice that means several calls, because the names arrive\n * in batches and some of them need a field type the first call did not have.\n * Replacing on every call turned \"add the ninth field\" into \"delete the other\n * eight\", with nothing said. That is this file's own failure mode, one level up:\n * a mapping that is structurally valid, ships, and delivers nothing.\n *\n * ## Destination metadata is derived, never defaulted\n *\n * A CRM mapping carries more than a pair of names: `fieldType`, `objectTypeId`,\n * `entityType`, `isCustomField`. Every one of them is a fact about the connected\n * account, and every one is required by the record the engine reads — so there\n * are exactly two honest ways to fill them, and inventing a plausible value is\n * not one. Either the caller hands over the destination's own field catalog\n * (`MapOptions.destinationFields`, which `map.ts` reads off the account) and\n * they are DERIVED, or the mapping states them and they are declared. Anything\n * else is refused.\n *\n * That order matters for how much work the agent does. Deriving is both less\n * work and more accurate than being told, so a caller that can read the\n * destination should: the agent then writes `firstname=nombre` and the types\n * take care of themselves.\n *\n * Pure — every function here takes a decoded tree and returns data, so the\n * refusals are unit-tested without a filesystem. Reading a destination's\n * catalog is I/O and therefore lives in `map.ts`.\n */\n\nimport { buildValueDoc } from \"./value-expression.ts\";\n\ntype AnyRecord = Record<string, unknown>;\n\n/** A refusal the caller turns into a `{ ok: false }` envelope with a `fix`. */\nexport class MappingError extends Error {\n readonly fix: string | undefined;\n constructor(message: string, fix?: string) {\n super(message);\n this.name = \"MappingError\";\n this.fix = fix;\n }\n}\n\n/**\n * A destination addressed by a list of records: one entry per mapped field.\n *\n * Two families share it. The CRM/sheet family (`fieldMapping`, `columnMapping`)\n * carries destination metadata alongside the value; the `PayloadKey` family\n * (`payloadKeys`, `eventParams`, `eventProperties`, `dataLayerParams`,\n * `goalParams`) is just `{ key, value }`.\n */\ntype ListShape = {\n kind: \"list\";\n key: string;\n /**\n * The object the list hangs off, when it is not the side effect itself.\n *\n * Only `email` needs it — its keys live at `body.fields`, and only while\n * `body.format` is `\"json\"`. That one level of nesting is why this command\n * used to refuse `email` outright, which left the single most common\n * notification side effect as the one place an agent still hand-wrote a\n * ProseMirror document per field.\n */\n under?: string;\n addressedBy: string;\n entities?: readonly string[];\n needsFieldType?: boolean;\n needsIsCustom?: boolean;\n /** Where the per-mapping field types come from, for the refusal that asks for one. */\n fieldTypeSource?: string;\n};\n\n/**\n * A destination addressed by a fixed set of named slots, each an AutofillDoc.\n *\n * Meta advanced matching, Google Ads enhanced conversions, TikTok identify,\n * LinkedIn/X user matching, Pinterest enhanced matching. The key set is closed\n * and defined by the platform, so a name outside it is a typo, not a field.\n */\ntype RecordShape = { kind: \"record\"; key: string; allowed: readonly string[] };\n\n/** A single AutofillDoc sitting directly on the side effect (`value`, `currency`, …). */\ntype ScalarShape = { kind: \"scalar\"; keys: readonly string[] };\n\ntype MappingShape = ListShape | RecordShape | ScalarShape;\n\nconst PAYLOAD = (key: string): ListShape => ({ kind: \"list\", key, addressedBy: \"key\" });\n\nconst META_MATCHING = [\"em\", \"fn\", \"ln\", \"ph\", \"external_id\", \"ge\", \"db\", \"ct\", \"st\", \"zp\", \"country\"] as const;\nconst ADS_MATCHING = [\n \"email\",\n \"phone_number\",\n \"first_name\",\n \"last_name\",\n \"street\",\n \"city\",\n \"region\",\n \"postal_code\",\n \"country\",\n] as const;\n\n/**\n * Every slot each side-effect type can have a value mapped into, in the order\n * `--map` defaults to.\n *\n * This started as five CRM entries, which meant `baker flows map` refused\n * eleven of the sixteen mappable types — including the two most common things\n * in a real workspace: a webhook body and a Meta pixel's parameters. Its\n * refusal also said, in as many words, that `httpWebhook` and `zapier` \"carry\n * the whole submission and do not address individual destination fields\", which\n * is not true of either: both have `payloadKeys`, and a real form was already\n * using fourteen of them.\n *\n * A type with more than one slot takes `--into <key>` to pick; without it the\n * first is used, and the response names the others.\n */\nexport const MAPPING_SLOTS: Record<string, readonly MappingShape[]> = {\n googleSpreadsheet: [{ kind: \"list\", key: \"columnMapping\", addressedBy: \"column\" }],\n hubspotForm: [\n {\n kind: \"list\",\n key: \"fieldMapping\",\n addressedBy: \"fieldName\",\n needsFieldType: true,\n fieldTypeSource:\n \"Pass --hubspot-form <formGuid> and this command reads every property's type off the form itself — the guid is the `formGuid` in the `destination` request_flow_input returned. `baker hubspot forms view <formGuid>` prints the same list if you want to see it.\",\n },\n ],\n pipedrive: [\n {\n kind: \"list\",\n key: \"fieldMapping\",\n addressedBy: \"fieldKey\",\n entities: [\"person\", \"organization\", \"lead\"],\n needsFieldType: true,\n needsIsCustom: true,\n },\n ],\n goHighlevelContact: [\n {\n kind: \"list\",\n key: \"fieldMapping\",\n addressedBy: \"fieldKey\",\n entities: [\"business\", \"contact\", \"opportunity\"],\n needsFieldType: true,\n needsIsCustom: true,\n },\n ],\n crmble: [\n { kind: \"list\", key: \"fieldMapping\", addressedBy: \"fieldId\", entities: [\"contact\", \"lead\"], needsFieldType: true },\n ],\n\n email: [{ ...PAYLOAD(\"fields\"), under: \"body\" }],\n zapier: [PAYLOAD(\"payloadKeys\")],\n httpWebhook: [PAYLOAD(\"payloadKeys\")],\n googleTagManager: [PAYLOAD(\"dataLayerParams\")],\n googleAnalytics: [PAYLOAD(\"eventParams\")],\n posthog: [PAYLOAD(\"eventParams\")],\n amplitude: [PAYLOAD(\"eventProperties\")],\n hubspot: [PAYLOAD(\"eventProperties\")],\n vwo: [PAYLOAD(\"eventProperties\")],\n code: [PAYLOAD(\"eventProperties\")],\n datafast: [PAYLOAD(\"goalParams\")],\n\n meta: [PAYLOAD(\"eventParams\"), { kind: \"record\", key: \"advancedMatching\", allowed: META_MATCHING }],\n chatgptAds: [\n PAYLOAD(\"eventParams\"),\n {\n kind: \"record\",\n key: \"advancedMatching\",\n allowed: [\"em\", \"ph\", \"fn\", \"ln\", \"external_id\", \"ct\", \"st\", \"zp\", \"country\"],\n },\n ],\n tiktok: [\n PAYLOAD(\"eventParams\"),\n { kind: \"record\", key: \"identify\", allowed: [\"email\", \"phone_number\", \"external_id\"] },\n ],\n pinterest: [PAYLOAD(\"eventParams\"), { kind: \"record\", key: \"enhancedMatching\", allowed: [\"em\", \"hashed_maids\"] }],\n googleAds: [\n { kind: \"record\", key: \"enhancedConversions\", allowed: ADS_MATCHING },\n { kind: \"scalar\", keys: [\"value\", \"currency\", \"transactionId\"] },\n ],\n linkedinInsightTag: [\n { kind: \"record\", key: \"userMatching\", allowed: [\"em\", \"fn\", \"ln\", \"title\", \"companyName\", \"country\"] },\n { kind: \"scalar\", keys: [\"value\", \"currency\"] },\n ],\n twitterAds: [\n { kind: \"record\", key: \"userMatching\", allowed: [\"em\", \"ph\"] },\n { kind: \"scalar\", keys: [\"value\", \"currency\"] },\n ],\n};\n\n/**\n * The types that genuinely address nothing, and why — so the refusal can say it.\n *\n * Exported for `flow-catalog-coverage.test.ts`, which asserts that this and\n * `MAPPING_SLOTS` between them classify EVERY side-effect type the catalog\n * defines, exactly once. That gate is the reason a claim about this file can be\n * trusted: `email` used to live here, moved to `MAPPING_SLOTS` when `body.fields`\n * became mappable, and left behind prose elsewhere still describing it as\n * unmappable. A type in neither list refuses with \"not a side-effect type this\n * workspace's flow engine defines\" — which is false, and unanswerable.\n */\nexport const UNMAPPABLE: Record<string, string> = {\n hotjar: \"A Hotjar event carries only its name.\",\n clarity: \"A Clarity custom tag carries only its name.\",\n};\n\n/** How a slot is named everywhere the agent sees it — qualified when it is nested. */\nfunction slotName(shape: MappingShape): string {\n if (shape.kind === \"scalar\") return shape.keys.join(\"/\");\n if (shape.kind === \"list\" && shape.under) return `${shape.under}.${shape.key}`;\n return shape.key;\n}\n\n/**\n * The slot to map into: the one named by `--into`, or the first.\n * Refuses rather than guessing between a real slot and a name that is not one.\n */\nexport function shapeFor(type: string, into?: string): MappingShape {\n const slots = MAPPING_SLOTS[type];\n if (!slots) {\n const why = UNMAPPABLE[type];\n throw new MappingError(\n `Side effect \"${type}\" has no mappable field.`,\n why ?? `\"${type}\" is not a side-effect type this workspace's flow engine defines.`,\n );\n }\n if (!into) return slots[0] as MappingShape;\n const chosen = slots.find((slot) =>\n slot.kind === \"scalar\"\n ? slot.keys.includes(into) || into === \"scalar\"\n : slot.key === into || slotName(slot) === into,\n );\n if (!chosen) {\n throw new MappingError(\n `\"${into}\" is not a mappable slot on a ${type} side effect.`,\n `Slots on ${type}: ${slots.map(slotName).join(\", \")}`,\n );\n }\n return chosen;\n}\n\n/**\n * Whether this slot's names come from the connected account, or from the agent.\n *\n * The distinction decides what an unconfigured destination means. A sheet\n * column, a HubSpot property, a Pipedrive field key — those exist only in an\n * account the agent cannot see, so writing them before `request_flow_input` has\n * run means inventing them, and an invented destination is valid JSON that\n * ships and drops every submission. A webhook's `payloadKeys` and a pixel's\n * `eventParams` are the opposite: the agent picks those names (or the platform\n * fixes them), so they are perfectly authorable before the endpoint is set.\n */\nexport function namesComeFromAccount(shape: MappingShape): boolean {\n return shape.kind === \"list\" && shape.addressedBy !== \"key\";\n}\n\n/**\n * What can be mapped into a side effect, and — the part that is not guessable —\n * where the legal keys on the LEFT of each mapping come from.\n *\n * There are three different answers, and reading the wrong one produces a\n * mapping that is valid JSON and silently delivers nothing:\n *\n * closed the platform fixes the names (`em`, `ph`, `postal_code`). Anything\n * else is a typo, and they are listed here in full.\n * yours the keys are whatever the receiving system expects — a Make\n * scenario's field names, a GA4 parameter. Nobody but the user knows\n * them, but nothing validates them either, so you write what you were told.\n * account a sheet column, a HubSpot property, a Pipedrive field key. These\n * exist only in the connected account, so they come back from\n * `request_flow_input` and cannot be known before it runs.\n *\n * Exposed so the discovery path is a plain read rather than a wrong guess: the\n * agent used to learn a closed set only by naming a key outside it.\n */\nexport type SlotDescription = {\n slot: string;\n addressedBy: string;\n keysFrom: \"closed\" | \"yours\" | \"account\";\n keys?: readonly string[];\n note: string;\n /** How to get the per-mapping field types, for a slot that stores one. */\n fieldTypes?: string;\n};\n\nexport function describeSlots(type: string): SlotDescription[] {\n return (MAPPING_SLOTS[type] ?? []).map((shape) => {\n if (shape.kind === \"record\") {\n return {\n slot: shape.key,\n addressedBy: \"one of a closed set\",\n keysFrom: \"closed\" as const,\n keys: shape.allowed,\n note: `${type} defines these names; any other is refused.`,\n };\n }\n if (shape.kind === \"scalar\") {\n return {\n slot: shape.keys.join(\"/\"),\n addressedBy: \"the field's own name\",\n keysFrom: \"closed\" as const,\n keys: shape.keys,\n note: \"Each is a single value on the side effect, mapped like any other.\",\n };\n }\n if (shape.addressedBy === \"key\") {\n return {\n slot: slotName(shape),\n addressedBy: \"key\",\n keysFrom: \"yours\" as const,\n note: \"You name these — they are what the receiving system expects. Ask the user if you do not know them.\",\n };\n }\n return {\n slot: slotName(shape),\n addressedBy: shape.addressedBy,\n keysFrom: \"account\" as const,\n note: \"These live in the connected account. Read them off the request_flow_input result; they cannot be guessed.\",\n ...(shape.needsFieldType ? { fieldTypes: shape.fieldTypeSource ?? FIELD_TYPE_FROM_INPUT } : {}),\n };\n });\n}\n\n/** Where a per-mapping field type comes from when the shape names no better source. */\nconst FIELD_TYPE_FROM_INPUT =\n \"Each mapping stores a field type. They come back from request_flow_input with the field list — write one on the LEFT: <field>:<fieldType>=<value>.\";\n\n/** Every slot a type offers, for the hint that tells the agent what else it could map. */\nexport function otherSlots(type: string, used: MappingShape): string[] {\n return (MAPPING_SLOTS[type] ?? []).filter((slot) => slot !== used).map(slotName);\n}\n\n/**\n * One destination property as the connected account describes it.\n *\n * The point of carrying this is that `fieldType` stops being something the agent\n * has to know. It is a destination-side fact — HubSpot's own answer for that\n * property — so the only two honest ways to fill it are to read it off the\n * account or to be told it explicitly. Guessing a plausible-looking one is the\n * third option, and it is the one that ships: the key the engine builds is\n * `<objectTypeId>.<fieldType>.<fieldName>`, and a wrong `fieldType` on a date\n * property silently skips the YYYY-MM-DD coercion HubSpot requires.\n */\nexport type DestinationField = { fieldType: string; objectTypeId?: string };\n\nexport type MapOptions = {\n /** Which slot to map into, when the type has more than one. */\n into?: string | undefined;\n entity?: string | undefined;\n isCustomField?: boolean | undefined;\n objectType?: string | undefined;\n /**\n * The destination's own field catalog, keyed by destination field name, when\n * the caller was able to read it. Present ⇒ a per-mapping field type is\n * derived rather than demanded, and a name that is not on the destination is\n * refused with the ones that are.\n */\n destinationFields?: ReadonlyMap<string, DestinationField> | undefined;\n /**\n * Drop the mappings whose destination field is no longer on the account.\n *\n * The repair for a deleted CRM property, and the reason it is not `--replace`:\n * HubSpot refuses the WHOLE submission when it names a field it does not\n * have, so a Form with one dead mapping delivers nothing — and the only tool\n * for removing one was `--replace`, which drops everything the call does not\n * name. Repairing seven dead mappings that way meant first reconstructing the\n * other twenty correctly, from a file the agent had to read and re-emit, or\n * silently deleting them.\n *\n * This removes exactly the entries the destination cannot accept and touches\n * nothing else, so the safe move and the small move are the same move.\n * Requires `destinationFields`: without the account's own catalog \"missing\n * from the destination\" has no answer, and the available wrong answer is\n * \"drop them all\".\n */\n pruneMissing?: boolean | undefined;\n /**\n * Write the slot exactly as given, dropping every mapping already in it.\n *\n * Off by default, because the default has to be the one that cannot lose\n * work. A mapping accumulates — read a destination, map what you can name,\n * come back for the rest — and a call that quietly replaced the slot turned\n * \"add a ninth field\" into \"delete eight\". The reverse mistake is visible\n * the moment you look: an entry you meant to remove is still listed.\n *\n * `--from` is the one place replacing is the natural reading, since a\n * mapping file states the whole mapping — so it can set `\"replace\": true`.\n */\n replace?: boolean | undefined;\n};\n\ntype Spec = { raw: string; destField: string; fieldType?: string | undefined; expression: string };\n\n/**\n * `<destField>[:<fieldType>]=<value expression>`\n *\n * The field type sits with the destination rather than the value, for two\n * reasons: it IS a destination-side property (a HubSpot `single_line_text`, a\n * Pipedrive `varchar`), and on the right it would collide with the value\n * grammar's `field:` / `tracking:` / `global:` / `code:` prefixes.\n */\nexport function parseMapSpec(raw: string): Spec {\n const eq = raw.indexOf(\"=\");\n if (eq <= 0 || eq === raw.length - 1) {\n throw new MappingError(\n `--map \"${raw}\" must be <destField>[:<fieldType>]=<value>`,\n 'Value: a form field (`nombre`), `tracking:utm_source`, `global:Name`, `code:name`, a \"literal\", or those joined with `+`.',\n );\n }\n const left = raw.slice(0, eq).trim();\n const expression = raw.slice(eq + 1).trim();\n const colon = left.indexOf(\":\");\n const destField = (colon > 0 ? left.slice(0, colon) : left).trim();\n const fieldType = colon > 0 ? left.slice(colon + 1).trim() : \"\";\n if (!destField) throw new MappingError(`--map \"${raw}\" names no destination field.`);\n return { raw, destField, fieldType: fieldType || undefined, expression };\n}\n\nfunction sheetEntry(spec: Spec, value: AnyRecord): AnyRecord {\n if (!/^[A-Z]{1,3}$/.test(spec.destField)) {\n throw new MappingError(\n `--map \"${spec.raw}\": a Google Sheet is addressed by COLUMN, so the left side must be a column letter (A, B, … AA), got \"${spec.destField}\".`,\n \"Read the real destination back from the configured side effect first — a column letter is a guess until a spreadsheet is picked.\",\n );\n }\n return { column: spec.destField, value };\n}\n\n/**\n * The destination property this mapping addresses, when the caller read the\n * destination's own catalog.\n *\n * Refusing an unknown name is the whole reason to carry the catalog at all. A\n * destination field nothing validates is the same failure as a wrong `attrs.id`\n * on the value side: structurally valid, ships, delivers nothing forever.\n */\nfunction destinationField(spec: Spec, options: MapOptions): DestinationField | undefined {\n const catalog = options.destinationFields;\n if (!catalog) return undefined;\n const match = catalog.get(spec.destField);\n if (match) return match;\n throw new MappingError(\n `--map \"${spec.raw}\": the destination has no field called \"${spec.destField}\".`,\n `Fields on it: ${[...catalog.keys()].join(\", \") || \"(none)\"}`,\n );\n}\n\n/**\n * The per-mapping field type: taken from the destination when we can read it,\n * from the spec when we were told, and refused when neither.\n *\n * Derived first, on purpose. The type is a destination-side fact, so reading it\n * off the account is both less work for the caller and MORE accurate than being\n * told — an explicit `:type` is kept as the override for a destination this\n * command cannot reach.\n */\nfunction fieldTypeFor(type: string, shape: ListShape, spec: Spec, known: DestinationField | undefined): string {\n const resolved = spec.fieldType ?? known?.fieldType;\n if (resolved) return resolved;\n throw new MappingError(\n `--map \"${spec.raw}\": ${type} stores a field type per mapping, and \"${spec.destField}\" has none — write it on the left: <field>:<fieldType>=<value>.`,\n shape.fieldTypeSource ?? FIELD_TYPE_FROM_INPUT,\n );\n}\n\n/**\n * The two answers a CRM shape needs beyond the field type, and will not default.\n *\n * Each decides whether the write lands or is accepted and dropped: which object\n * it lands on, and whether the key is looked up as a custom field. Both are\n * destination-side facts that come back from `request_flow_input`, so refusing\n * is the only honest response to their absence.\n *\n * The entity check is skipped for a shape that declares no `entities` —\n * `hubspotForm` addresses its object through `objectTypeId`, which rides on each\n * mapping rather than on the call.\n */\nfunction assertCrmOptions(type: string, shape: ListShape, options: MapOptions): void {\n const entities = shape.entities;\n if (entities) {\n if (!options.entity) {\n throw new MappingError(\n `${type} addresses a specific object, so --entity is required (one of: ${entities.join(\", \")}).`,\n \"Which object a value lands on is a destination-side fact — read it back from the configured side effect, do not assume.\",\n );\n }\n if (!entities.includes(options.entity)) {\n throw new MappingError(\n `--entity \"${options.entity}\" is not valid for ${type} — expected one of: ${entities.join(\", \")}.`,\n );\n }\n }\n if (shape.needsIsCustom && options.isCustomField === undefined) {\n throw new MappingError(\n `${type} looks a key up differently for custom and standard fields, so pass --custom or --standard.`,\n \"Mapping a custom field as standard (or the reverse) is accepted and then dropped. The field list from request_flow_input says which each one is.\",\n );\n }\n}\n\nfunction buildEntry(type: string, shape: ListShape, spec: Spec, value: AnyRecord, options: MapOptions): AnyRecord {\n if (shape.key === \"columnMapping\") {\n return sheetEntry(spec, value);\n }\n\n // The PayloadKey family is the plain shape: a name and a value, nothing else\n // to get wrong. Refuse the CRM flags here rather than writing a record with\n // keys the engine does not read.\n if (shape.addressedBy === \"key\") {\n if (spec.fieldType) {\n throw new MappingError(\n `--map \"${spec.raw}\": a ${type} ${shape.key} entry is just a name and a value — it takes no field type.`,\n `Write it as ${spec.destField}=${spec.expression}`,\n );\n }\n return { key: spec.destField, value };\n }\n\n const known = destinationField(spec, options);\n\n if (type === \"hubspotForm\") {\n // `objectTypeId` and `fieldType` are both HubSpot's answer, not ours. The\n // engine concatenates them into `<objectTypeId>.<fieldType>.<fieldName>`,\n // which is the key the dashboard's own picker writes — so a mapping built\n // here and one built there have to be indistinguishable, or HubSpot's\n // \"add the required fields\" list offers a field that is already mapped.\n // `0-1` (contact) is the fallback the engine itself uses for a key it\n // cannot split, so it is the one default that changes no behaviour.\n return {\n objectTypeId: options.objectType ?? known?.objectTypeId ?? \"0-1\",\n fieldType: fieldTypeFor(type, shape, spec, known),\n fieldName: spec.destField,\n value,\n };\n }\n\n // Everything left is the CRM `fieldMapping` family, and every one of those\n // records types `fieldType` as required — so it is resolved, never optional.\n assertCrmOptions(type, shape, options);\n return {\n entityType: options.entity,\n fieldType: fieldTypeFor(type, shape, spec, known),\n ...(shape.needsIsCustom ? { isCustomField: options.isCustomField } : {}),\n [shape.addressedBy]: spec.destField,\n value,\n };\n}\n\n/**\n * What a built mapping is, and where it goes.\n *\n * `patch` is spliced onto the side effect as-is, so a list slot yields\n * `{ payloadKeys: [...] }` and a record slot yields the whole record with the\n * mapped slots filled and the rest left `null`. Merging rather than replacing\n * matters for a record: every key is required by the engine, so writing only\n * the mapped ones would produce a side effect that no longer typechecks.\n *\n * `kept` is how many mappings were already in the slot and survive this call.\n * It exists so the response can say so out loud — a number that moves without\n * being named is the shape of every silent-loss bug this file is about.\n */\nexport type BuiltMapping = {\n key: string;\n count: number;\n kept: number;\n /** Destination names removed by `pruneMissing`, named so the caller can print each. */\n dropped: string[];\n patch: AnyRecord;\n};\n\n/**\n * Splice a list into the object that owns it, keeping that object's other keys.\n *\n * `email` is the one nested case, and the key it must not lose is `body.format`:\n * the engine reads `{ format: \"json\", fields }` as a discriminated union, so a\n * patch that replaced `body` wholesale would drop the discriminator and the\n * side effect would stop typechecking.\n */\nfunction listPatch(shape: ListShape, sideEffect: AnyRecord, entries: AnyRecord[]): AnyRecord {\n if (!shape.under) return { [shape.key]: entries };\n const owner = (sideEffect[shape.under] ?? {}) as AnyRecord;\n return { [shape.under]: { ...owner, [shape.key]: entries } };\n}\n\n/** The list already in a slot, skipping anything that is not a record to merge with. */\nfunction existingEntries(shape: ListShape, sideEffect: AnyRecord): AnyRecord[] {\n const owner = shape.under ? sideEffect[shape.under] : sideEffect;\n if (!owner || typeof owner !== \"object\") return [];\n const list = (owner as AnyRecord)[shape.key];\n if (!Array.isArray(list)) return [];\n return list.filter((entry): entry is AnyRecord => Boolean(entry) && typeof entry === \"object\");\n}\n\n/**\n * Merge new mappings into the ones already in the slot, addressed by name.\n *\n * A mapping is built up over several calls in practice — you configure the\n * destination, map the fields you can name, read the rest back, map those —\n * so replacing the slot on every call deleted the earlier ones with nothing\n * said. That is the same failure the whole command exists to prevent\n * (a mapping that is valid, ships, and delivers nothing), one level up.\n *\n * Address, not position: `shape.addressedBy` is the key that names the\n * destination (`key`, `column`, `fieldName`, `fieldKey`, `fieldId`), so\n * re-mapping the same destination overwrites it IN PLACE and a new one is\n * appended. Order therefore stays stable across calls, which matters for a\n * Google Sheet, where the column order is the row the client reads.\n *\n * An existing entry with no address at all is kept as-is: it is not something\n * this call can be addressing, and dropping it would be the silent loss again.\n *\n * `kept` counts the entries that were already there and this call did not touch,\n * so it is derived from what happened rather than from the spec count — two\n * `--map` flags naming one destination are one written mapping, not two.\n */\nfunction mergeEntries(\n shape: ListShape,\n existing: AnyRecord[],\n incoming: AnyRecord[],\n): { entries: AnyRecord[]; written: number; kept: number } {\n const address = (entry: AnyRecord) => {\n const value = entry[shape.addressedBy];\n return typeof value === \"string\" ? value : null;\n };\n const entries = [...existing];\n const overwritten = new Set<number>();\n for (const entry of incoming) {\n const name = address(entry);\n const at = name === null ? -1 : entries.findIndex((candidate) => address(candidate) === name);\n if (at === -1) {\n entries.push(entry);\n continue;\n }\n entries[at] = entry;\n if (at < existing.length) overwritten.add(at);\n }\n const kept = existing.length - overwritten.size;\n return { entries, written: entries.length - kept, kept };\n}\n\n/**\n * An email's mapped keys exist only in its JSON body shape.\n *\n * `{ format: \"body\", content: <AutofillDoc> }` is one written message, not named\n * keys — mapping into it would produce a `fields` array the engine never reads.\n * Refuse rather than switch the format: which of the two an email sends is the\n * agent's decision about the notification, not this command's to make.\n */\nfunction assertMappableOwner(type: string, shape: ListShape, sideEffect: AnyRecord): void {\n if (shape.under !== \"body\") return;\n const format = ((sideEffect.body ?? {}) as AnyRecord).format;\n if (format !== undefined && format !== \"json\") {\n throw new MappingError(\n `This ${type} side effect sends \\`body.format: \"${String(format)}\"\\`, which is one written message rather than named keys.`,\n 'Set `body` to `{ \"format\": \"json\", \"fields\": [] }` first if you want mapped keys, or write the message in `body.content` and map nothing.',\n );\n }\n}\n\nfunction buildList(\n tree: AnyRecord,\n type: string,\n shape: ListShape,\n sideEffect: AnyRecord,\n specs: string[],\n options: MapOptions,\n): BuiltMapping {\n assertMappableOwner(type, shape, sideEffect);\n const incoming = specs.map((raw) => {\n const spec = parseMapSpec(raw);\n return buildEntry(type, shape, spec, buildValueDoc(tree, spec.expression), options);\n });\n const present = options.replace === true ? [] : existingEntries(shape, sideEffect);\n const { kept: existing, dropped } = pruneAbsent(shape, present, options);\n const { entries, written, kept } = mergeEntries(shape, existing, incoming);\n return { key: slotName(shape), count: written, kept, dropped, patch: listPatch(shape, sideEffect, entries) };\n}\n\n/**\n * Split the mappings already in the slot into the ones the destination still\n * has and the ones it does not.\n *\n * An entry with no address at all is kept, for the same reason `mergeEntries`\n * keeps it: it is not something this call can be addressing, and dropping it\n * would be the silent loss the whole module exists to prevent.\n */\nfunction pruneAbsent(\n shape: ListShape,\n existing: AnyRecord[],\n options: MapOptions,\n): { kept: AnyRecord[]; dropped: string[] } {\n if (options.pruneMissing !== true) return { kept: existing, dropped: [] };\n\n const catalog = options.destinationFields;\n if (!catalog) {\n throw new MappingError(\n \"--prune-missing needs the destination's own field list, and it could not be read.\",\n \"Name the destination so its fields can be read — today that is --hubspot-form <formGuid>, the only destination whose catalog this command can fetch. `baker flows show <slug>` names the side effect and returns the request_flow_input call that carries the guid.\",\n );\n }\n\n const kept: AnyRecord[] = [];\n const dropped: string[] = [];\n for (const entry of existing) {\n const name = entry[shape.addressedBy];\n if (typeof name !== \"string\" || catalog.has(name)) {\n kept.push(entry);\n continue;\n }\n dropped.push(name);\n }\n return { kept, dropped };\n}\n\nfunction buildRecord(\n tree: AnyRecord,\n type: string,\n shape: RecordShape,\n sideEffect: AnyRecord,\n specs: string[],\n options: MapOptions,\n): BuiltMapping {\n const existing = (options.replace === true ? {} : (sideEffect[shape.key] ?? {})) as AnyRecord;\n const record: AnyRecord = Object.fromEntries(shape.allowed.map((slot) => [slot, existing[slot] ?? null]));\n const filledBefore = shape.allowed.filter((slot) => record[slot] != null);\n const written = new Set<string>();\n for (const raw of specs) {\n const spec = parseMapSpec(raw);\n if (!shape.allowed.includes(spec.destField)) {\n throw new MappingError(\n `\"${spec.destField}\" is not a slot in ${shape.key} on a ${type} side effect.`,\n `${shape.key} slots: ${shape.allowed.join(\", \")}`,\n );\n }\n if (spec.fieldType) {\n throw new MappingError(`--map \"${spec.raw}\": a ${shape.key} slot takes no field type.`);\n }\n record[spec.destField] = buildValueDoc(tree, spec.expression);\n written.add(spec.destField);\n }\n return {\n key: shape.key,\n count: written.size,\n kept: filledBefore.filter((slot) => !written.has(slot)).length,\n dropped: [],\n patch: { [shape.key]: record },\n };\n}\n\nfunction buildScalar(\n tree: AnyRecord,\n type: string,\n shape: ScalarShape,\n sideEffect: AnyRecord,\n specs: string[],\n options: MapOptions,\n): BuiltMapping {\n // `--replace` means the same thing here as everywhere else: the slot ends up\n // exactly what was passed. Each key is typed `AutofillDoc | null`, so the\n // ones this call did not name are cleared rather than left standing.\n const patch: AnyRecord = options.replace === true ? Object.fromEntries(shape.keys.map((key) => [key, null])) : {};\n const written = new Set<string>();\n for (const raw of specs) {\n const spec = parseMapSpec(raw);\n if (!shape.keys.includes(spec.destField)) {\n throw new MappingError(\n `\"${spec.destField}\" is not a mappable field on a ${type} side effect.`,\n `Mappable directly: ${shape.keys.join(\", \")}`,\n );\n }\n if (spec.fieldType) {\n throw new MappingError(`--map \"${spec.raw}\": ${spec.destField} takes no field type.`);\n }\n patch[spec.destField] = buildValueDoc(tree, spec.expression);\n written.add(spec.destField);\n }\n const kept =\n options.replace === true ? 0 : shape.keys.filter((key) => !written.has(key) && sideEffect[key] != null).length;\n return { key: shape.keys.join(\"/\"), count: written.size, kept, dropped: [], patch };\n}\n\n/**\n * Build the mapping a side effect reads, from the form's own tree.\n * Throws `MappingError` for every refusal — nothing is guessed.\n */\nexport function buildFieldMapping(\n tree: AnyRecord,\n sideEffect: AnyRecord,\n specs: string[],\n options: MapOptions = {},\n): BuiltMapping {\n const type = String(sideEffect.type ?? \"\");\n const shape = shapeFor(type, options.into);\n if (shape.kind === \"record\") return buildRecord(tree, type, shape, sideEffect, specs, options);\n if (shape.kind === \"scalar\") return buildScalar(tree, type, shape, sideEffect, specs, options);\n return buildList(tree, type, shape, sideEffect, specs, options);\n}\n"],"mappings":";;;;;;AAiCA,SAAS,YAAY,oBAAoB;AACzC,SAAS,YAAY;AAarB,IAAM,WAAW,CAAC,SAAS,YAAY,UAAU,MAAM;AASvD,SAAS,WAAW,KAAuB;AACzC,QAAM,QAAkB,CAAC;AACzB,MAAI,UAAU;AACd,MAAI,WAAW;AACf,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAM,OAAO,IAAI,CAAC;AAClB,QAAI,SAAS,KAAK;AAChB,iBAAW,CAAC;AACZ,iBAAW;AAAA,IACb,WAAW,SAAS,OAAO,CAAC,UAAU;AACpC,YAAM,KAAK,OAAO;AAClB,gBAAU;AAAA,IACZ,OAAO;AACL,iBAAW;AAAA,IACb;AAAA,EACF;AACA,QAAM,KAAK,OAAO;AAClB,MAAI,UAAU;AACZ,UAAM,IAAI,aAAa,6BAA6B,GAAG,OAAO,mCAAmC;AAAA,EACnG;AACA,SAAO,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC;AAC1E;AAEA,IAAM,oBACJ;AAGF,IAAM,cAAc;AAEpB,IAAM,iBAAiB;AAQvB,SAAS,YAAY,OAA0B;AAC7C,MAAI,MAAM,WAAW,WAAW,EAAG,QAAO,EAAE,MAAM,YAAY,MAAM,MAAM,MAAM,YAAY,MAAM,EAAE;AACpG,MAAI,MAAM,WAAW,SAAS,E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