@wirecat/hubspot-cli 0.1.0 → 0.3.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/CHANGELOG.md +41 -0
- package/README.md +40 -16
- package/contracts/wirecat.json +1516 -173
- package/dist/bin/hubspot.js +2 -2
- package/dist/bundle/agent-A7ARC3QB.js +40 -0
- package/dist/bundle/{all-profiles-64JAUYW4.js → all-profiles-6452VSJB.js} +64 -22
- package/dist/bundle/{anthropic-VJOS4OUM.js → anthropic-VQUOVYOW.js} +6 -6
- package/dist/bundle/{app-server-422MCA7S.js → app-server-FFYKM37G.js} +79 -68
- package/dist/bundle/{bun-M3J2QTR3.js → bun-AJPJ4ZUN.js} +2 -2
- package/dist/bundle/{bun-sqlite-IX3XYA5F.js → bun-sqlite-AGXGSF6D.js} +7 -7
- package/dist/bundle/{chunk-N2XADGL4.js → chunk-2A64XS22.js} +4 -4
- package/dist/bundle/{chunk-HTAN663T.js → chunk-2HYGCLKN.js} +93 -565
- package/dist/bundle/{chunk-FOZYMDRL.js → chunk-2NCO4E4T.js} +6 -6
- package/dist/bundle/{chunk-FBCCBCFH.js → chunk-2PRVWEJC.js} +3 -3
- package/dist/bundle/{chunk-LOBVOGOE.js → chunk-3DIXAEGH.js} +4 -4
- package/dist/bundle/{chunk-O3DYRCIT.js → chunk-3I2FGNWO.js} +1 -1
- package/dist/bundle/{chunk-65TWQ7BV.js → chunk-3PEKYGZ3.js} +2 -2
- package/dist/bundle/{chunk-DRWWJLI6.js → chunk-3R4KRNUZ.js} +8 -8
- package/dist/bundle/{chunk-2VGD63G6.js → chunk-3TEFE6YU.js} +7 -7
- package/dist/bundle/{chunk-BKXDHU3G.js → chunk-3WIVJJNB.js} +19 -17
- package/dist/bundle/{chunk-TI46WQXQ.js → chunk-4DNHXRCJ.js} +7 -7
- package/dist/bundle/{chunk-QU25DA5N.js → chunk-5AYKCKSE.js} +11 -11
- package/dist/bundle/chunk-5HD64ETI.js +561 -0
- package/dist/bundle/{chunk-CWXOXIWS.js → chunk-5K3FGXZH.js} +1 -1
- package/dist/bundle/{chunk-24ERVFJP.js → chunk-5YNAVVCW.js} +3 -3
- package/dist/bundle/chunk-77CUE3VX.js +46 -0
- package/dist/bundle/{chunk-36ITRDYY.js → chunk-7LQRXVQ3.js} +783 -482
- package/dist/bundle/{chunk-E5WLE7BM.js → chunk-7NZT7Y55.js} +1 -1
- package/dist/bundle/{chunk-C32AKHTY.js → chunk-7UEL65GQ.js} +35 -12
- package/dist/bundle/chunk-7VHBS5BJ.js +108 -0
- package/dist/bundle/{chunk-O55RWNSH.js → chunk-A6UFH3QU.js} +4 -4
- package/dist/bundle/{chunk-WE4UFASG.js → chunk-ABXVU5O4.js} +8 -1
- package/dist/bundle/{chunk-4W6BMH45.js → chunk-AF7DANIR.js} +2 -100
- package/dist/bundle/{chunk-LNV33FDC.js → chunk-AFL2C4JR.js} +60 -50
- package/dist/bundle/{chunk-2VGZRYEH.js → chunk-ARTJLL7W.js} +6 -6
- package/dist/bundle/chunk-AVUMH42T.js +194 -0
- package/dist/bundle/chunk-B2W3C4N6.js +338 -0
- package/dist/bundle/{chunk-FKA7DOCK.js → chunk-B3EH22CO.js} +1 -1
- package/dist/bundle/{chunk-E52JAS35.js → chunk-BAUK2MD5.js} +6 -6
- package/dist/bundle/{chunk-JLDBMEKZ.js → chunk-BN22EKQQ.js} +2 -2
- package/dist/bundle/{chunk-DB2XKHI4.js → chunk-BUGROVF3.js} +2 -2
- package/dist/bundle/{chunk-DSP36YHQ.js → chunk-CBCEMFCF.js} +2 -2
- package/dist/bundle/{chunk-WQBX7XYP.js → chunk-CYADK744.js} +1559 -1888
- package/dist/bundle/{chunk-HZRQLAHO.js → chunk-DQB5JMTY.js} +1 -1
- package/dist/bundle/{chunk-JRCPCVPI.js → chunk-DQP2GAAO.js} +75 -66
- package/dist/bundle/{chunk-FPUGMDJV.js → chunk-DSRXCLPO.js} +1 -1
- package/dist/bundle/{chunk-UUMUL4L3.js → chunk-DW23LM47.js} +2 -2
- package/dist/bundle/{chunk-TKVL2C3B.js → chunk-E4X7JAFC.js} +3 -3
- package/dist/bundle/{chunk-NUU4WZVL.js → chunk-EE4JSYGZ.js} +3 -3
- package/dist/bundle/{chunk-NWHEHV3K.js → chunk-EMOVVERN.js} +5 -5
- package/dist/bundle/{chunk-PVKF24ZW.js → chunk-FIVD4HM4.js} +8 -8
- package/dist/bundle/{chunk-QJW35N5V.js → chunk-GC6FLHZF.js} +12 -12
- package/dist/bundle/{chunk-TP7GDWVF.js → chunk-GRFICQTZ.js} +1 -1
- package/dist/bundle/{chunk-X2M6NIQG.js → chunk-HPZRUY6S.js} +1 -1
- package/dist/bundle/{chunk-CLAN3FES.js → chunk-IBTMK5KD.js} +54 -34
- package/dist/bundle/{chunk-5A6ZYNAQ.js → chunk-IQ2XZ62J.js} +18 -18
- package/dist/bundle/{chunk-DBEQI5YM.js → chunk-ITGNDZRR.js} +3 -3
- package/dist/bundle/{chunk-W53EJOFQ.js → chunk-IXZLMFPO.js} +1 -1
- package/dist/bundle/{chunk-TOSCB4SO.js → chunk-J5P5VSRG.js} +16 -10
- package/dist/bundle/{chunk-VIEYMDBR.js → chunk-J6C2QWL5.js} +3 -3
- package/dist/bundle/{chunk-ZBDSHFG4.js → chunk-JG7YMHNB.js} +3427 -3284
- package/dist/bundle/{chunk-RMIYKDUL.js → chunk-JK2SNLU5.js} +17 -17
- package/dist/bundle/{chunk-43EKCUBJ.js → chunk-JP2HJXFO.js} +3 -3
- package/dist/bundle/{chunk-DFCHHR5M.js → chunk-JUKAIXKY.js} +1 -1
- package/dist/bundle/{chunk-5GBUCHRU.js → chunk-KO4VR5NK.js} +4 -4
- package/dist/bundle/{chunk-PPHBRESD.js → chunk-KVXEEKBB.js} +2 -2
- package/dist/bundle/{chunk-SDQGB4KB.js → chunk-L433IDOX.js} +9 -9
- package/dist/bundle/chunk-LA3YU4K7.js +40 -0
- package/dist/bundle/{chunk-ECEZOLOD.js → chunk-LKSNISYV.js} +4 -4
- package/dist/bundle/{chunk-5K7QLJMM.js → chunk-LT5KE44Q.js} +226 -226
- package/dist/bundle/chunk-M763RNWP.js +733 -0
- package/dist/bundle/chunk-M7XLG6AN.js +353 -0
- package/dist/bundle/{chunk-IMJQRPLN.js → chunk-NNMU2TDU.js} +1 -1
- package/dist/bundle/chunk-NTQBS2JL.js +52 -0
- package/dist/bundle/{chunk-HCAZV5NP.js → chunk-NZGI74GS.js} +6 -6
- package/dist/bundle/{chunk-W7HM2VGO.js → chunk-O3VM5PTJ.js} +1 -1
- package/dist/bundle/chunk-OPVNUI4M.js +195 -0
- package/dist/bundle/{chunk-7ELMWE3P.js → chunk-PHXOL5HZ.js} +176 -160
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-B3MANLNK.js → chunk-PLRUUXK7.js} +19 -233
- package/dist/bundle/{chunk-RR5MX5TM.js → chunk-PMP37KLR.js} +4 -4
- package/dist/bundle/{chunk-FTFV3HFW.js → chunk-Q27QAB4X.js} +9 -9
- package/dist/bundle/{chunk-2TWQIWWG.js → chunk-QFZD6MTF.js} +35 -29
- package/dist/bundle/{chunk-2QZK5BEP.js → chunk-RVWGFD32.js} +30 -15
- package/dist/bundle/{chunk-MVA5HVKL.js → chunk-S4UUN6LD.js} +18 -0
- package/dist/bundle/{chunk-QGFX5MXL.js → chunk-SEELWPRD.js} +9 -9
- package/dist/bundle/{chunk-SAKK2YRU.js → chunk-SMTTIKZ5.js} +12 -12
- package/dist/bundle/{chunk-X7XUX7A4.js → chunk-TDQJS3JG.js} +10 -10
- package/dist/bundle/{chunk-HC5ZWE5X.js → chunk-TIHDBKA7.js} +2 -2
- package/dist/bundle/{chunk-NHHJHXMQ.js → chunk-U6XA3OOM.js} +2 -2
- package/dist/bundle/{chunk-NXERIDPJ.js → chunk-VQEAZXTV.js} +7 -7
- package/dist/bundle/{chunk-P5BHKKBI.js → chunk-VW5F6FK3.js} +4 -4
- package/dist/bundle/{chunk-XRREFEIW.js → chunk-WCQW4GYO.js} +7 -7
- package/dist/bundle/{chunk-H3TNVEQX.js → chunk-WGBVRDY3.js} +29 -4
- package/dist/bundle/chunk-WRCKE5ND.js +80 -0
- package/dist/bundle/{chunk-TBJYLC5K.js → chunk-X5S5KUSU.js} +75 -75
- package/dist/bundle/command-contract-R2FGN7CQ.js +40 -0
- package/dist/bundle/{command-server-entry-DJKVVZCQ.js → command-server-entry-GJSMDSNE.js} +29 -29
- package/dist/bundle/{decode-FC65Y4IV.js → decode-6PLXHVHW.js} +6 -6
- package/dist/bundle/{dispatch-KOISQ5QJ.js → dispatch-TAQ7635E.js} +8 -8
- package/dist/bundle/{dist-MYZZKZJ7.js → dist-7TGU56B2.js} +1 -1
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-FVTUDXDU.js → echarts-UZ7QLRE2.js} +2 -2
- package/dist/bundle/{embed-VNBZFPYH.js → embed-AWLL4EBF.js} +7 -7
- package/dist/bundle/{embedder-6U4NOFRO.js → embedder-MM225YJ6.js} +10 -10
- package/dist/bundle/{failure-FZ6VYKEQ.js → failure-MR2XVHFP.js} +3 -3
- package/dist/bundle/first-run-MAUI6QJ7.js +29 -0
- package/dist/bundle/first-screen-SCDV7TXT.js +40 -0
- package/dist/bundle/hubspot.js +26 -26
- package/dist/bundle/{instructions-HET7BCYK.js → instructions-ZJ7U3QUE.js} +1 -1
- package/dist/bundle/{mcp-RGNRW77S.js → mcp-CNV7F2XZ.js} +2 -2
- package/dist/bundle/meeting-combined-EL5XZIJ5.js +25 -0
- package/dist/bundle/meeting-model-OYXB2NOE.js +25 -0
- package/dist/bundle/{meeting-semantic-JY3OGCBS.js → meeting-semantic-S3DBB7XD.js} +7 -7
- package/dist/bundle/{node-CXZIFHZC.js → node-HGCZGZ4R.js} +2 -2
- package/dist/bundle/{node-sqlite-P3O7XN7Q.js → node-sqlite-RKYSRKEB.js} +8 -8
- package/dist/bundle/oauth-PYDCAQ7Y.js +20 -0
- package/dist/bundle/{open-F4P6YV54.js → open-UCDSQUN2.js} +6 -6
- package/dist/bundle/{openai-4AICLIK3.js → openai-Y4F5ZC7O.js} +16 -16
- package/dist/bundle/{process-5RUXWGYS.js → process-P7FB7YO7.js} +1 -1
- package/dist/bundle/{program-POG5GHUQ.js → program-2D5D32HK.js} +835 -261
- package/dist/bundle/{prompt-NFMDVBZ4.js → prompt-E5TKZ37Q.js} +6 -6
- package/dist/bundle/{recognize-DKN3RY4V.js → recognize-5NYPTSLT.js} +5 -5
- package/dist/bundle/{remote-6QHAGQWY.js → remote-U4LUAHF2.js} +10 -10
- package/dist/bundle/{rerank-M4KHEHUZ.js → rerank-AJAVKK5L.js} +8 -8
- package/dist/bundle/{schemas-JRL3DLMP.js → schemas-QLQ2K6DL.js} +7 -33
- package/dist/bundle/{serve-DNU43ND6.js → serve-4UJ3R5IP.js} +11 -11
- package/dist/bundle/server-CN6VQNNF.js +86 -0
- package/dist/bundle/{server-XJSNF3K5.js → server-OJPCTV77.js} +73 -61
- package/dist/bundle/{source-A3SBLHC4.js → source-VHDK74YS.js} +133 -399
- package/dist/bundle/{sqlite-runtime-EMQAC63N.js → sqlite-runtime-KLEA4XAU.js} +7 -7
- package/dist/bundle/{state-T45CX7VY.js → state-COGSYMVH.js} +7 -7
- package/dist/bundle/{store-6TZ2FCVA.js → store-BJXCSP26.js} +25 -24
- package/dist/bundle/store-HXA2MRWI.js +32 -0
- package/dist/bundle/{store-6LCEVBAZ.js → store-V5UMSWK4.js} +27 -22
- package/dist/bundle/store-maintenance-command-AC7GGLYC.js +73 -0
- package/dist/bundle/surface-ZZNG3OW2.js +72 -0
- package/dist/bundle/writer-CZYA657G.js +86 -0
- package/dist/commands/api.d.ts +4 -4
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +12 -7
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/crm-shared.d.ts +2 -2
- package/dist/commands/crm-shared.d.ts.map +1 -1
- package/dist/commands/crm-shared.js +20 -4
- package/dist/commands/crm-shared.js.map +1 -1
- package/dist/config.d.ts +46 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +133 -12
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +2 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/context.js.map +1 -1
- package/dist/crm/source.d.ts +7 -2
- package/dist/crm/source.d.ts.map +1 -1
- package/dist/crm/source.js +26 -29
- package/dist/crm/source.js.map +1 -1
- package/dist/crm/writer.d.ts +15 -0
- package/dist/crm/writer.d.ts.map +1 -0
- package/dist/crm/writer.js +199 -0
- package/dist/crm/writer.js.map +1 -0
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +6 -116
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/types.d.ts +160 -0
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/hubspot/transport.d.ts +6 -1
- package/dist/hubspot/transport.d.ts.map +1 -1
- package/dist/hubspot/transport.js +13 -5
- package/dist/hubspot/transport.js.map +1 -1
- package/dist/identity.js +3 -3
- package/dist/identity.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +2 -1
- package/dist/program.js.map +1 -1
- package/dist/setup/texts.en.json +3 -3
- package/dist/setup/texts.es.json +3 -3
- package/dist/setup/texts.ru.json +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/skills/hubspot-cli/SKILL.md +13 -8
- package/skills/hubspot-cli/references/api/api-advanced.md +51 -0
- package/skills/hubspot-cli/references/api/api-basic.md +602 -0
- package/skills/hubspot-cli/references/api/api-batch.md +575 -0
- package/skills/hubspot-cli/references/api.md +3 -2
- package/dist/bundle/command-contract-C6CBFXZF.js +0 -40
- package/dist/bundle/first-run-RPIJZEDT.js +0 -29
- package/dist/bundle/first-screen-RTVMGHAE.js +0 -40
- package/dist/bundle/meeting-combined-L5AGBPYX.js +0 -25
- package/dist/bundle/meeting-model-NTB4RK3F.js +0 -25
- package/dist/bundle/oauth-HNCY4B2S.js +0 -20
- package/dist/bundle/server-C3ZHA7AZ.js +0 -77
- package/dist/bundle/store-CCDNUB6A.js +0 -32
- package/dist/bundle/store-maintenance-command-BRCG6MNA.js +0 -68
- package/dist/commands/comments.d.ts +0 -3
- package/dist/commands/comments.d.ts.map +0 -1
- package/dist/commands/comments.js +0 -114
- package/dist/commands/comments.js.map +0 -1
- package/dist/sample/comments.d.ts +0 -61
- package/dist/sample/comments.d.ts.map +0 -1
- package/dist/sample/comments.js +0 -39
- package/dist/sample/comments.js.map +0 -1
- package/dist/sample/records.d.ts +0 -16
- package/dist/sample/records.d.ts.map +0 -1
- package/dist/sample/records.js +0 -22
- package/dist/sample/records.js.map +0 -1
- package/dist/sample/transport.d.ts +0 -42
- package/dist/sample/transport.d.ts.map +0 -1
- package/dist/sample/transport.js +0 -153
- package/dist/sample/transport.js.map +0 -1
|
@@ -1,84 +1,105 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
+
accountDetails
|
|
5
|
+
} from "./chunk-77CUE3VX.js";
|
|
6
|
+
import {
|
|
7
|
+
OBJECTS,
|
|
4
8
|
SERVICE,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
msOf,
|
|
10
|
+
nextOf,
|
|
11
|
+
propertiesOf,
|
|
12
|
+
resultsOf,
|
|
13
|
+
segment,
|
|
14
|
+
toDeal,
|
|
15
|
+
toField,
|
|
16
|
+
toLead,
|
|
17
|
+
toOrganization,
|
|
18
|
+
toPerson,
|
|
19
|
+
toPipeline,
|
|
20
|
+
toUser
|
|
21
|
+
} from "./chunk-CYADK744.js";
|
|
22
|
+
import "./chunk-O3VM5PTJ.js";
|
|
23
|
+
import "./chunk-7NZT7Y55.js";
|
|
24
|
+
import "./chunk-QFZD6MTF.js";
|
|
25
|
+
import "./chunk-PLRUUXK7.js";
|
|
26
|
+
import "./chunk-3R4KRNUZ.js";
|
|
27
|
+
import "./chunk-HPZRUY6S.js";
|
|
28
|
+
import "./chunk-DQP2GAAO.js";
|
|
29
|
+
import "./chunk-3WIVJJNB.js";
|
|
30
|
+
import "./chunk-M7XLG6AN.js";
|
|
31
|
+
import "./chunk-VQEAZXTV.js";
|
|
32
|
+
import "./chunk-SMTTIKZ5.js";
|
|
33
|
+
import "./chunk-BN22EKQQ.js";
|
|
34
|
+
import "./chunk-NTQBS2JL.js";
|
|
35
|
+
import "./chunk-B2W3C4N6.js";
|
|
36
|
+
import "./chunk-AVUMH42T.js";
|
|
15
37
|
import {
|
|
16
38
|
crmWindowOf,
|
|
17
39
|
values_exports,
|
|
18
40
|
walk
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-H3TNVEQX.js";
|
|
54
|
-
import "./chunk-HC5ZWE5X.js";
|
|
55
|
-
import "./chunk-QGFX5MXL.js";
|
|
41
|
+
} from "./chunk-JG7YMHNB.js";
|
|
42
|
+
import "./chunk-RVWGFD32.js";
|
|
43
|
+
import "./chunk-LA3YU4K7.js";
|
|
44
|
+
import "./chunk-ABXVU5O4.js";
|
|
45
|
+
import "./chunk-PMP37KLR.js";
|
|
46
|
+
import "./chunk-5K3FGXZH.js";
|
|
47
|
+
import "./chunk-M763RNWP.js";
|
|
48
|
+
import "./chunk-2A64XS22.js";
|
|
49
|
+
import "./chunk-2NCO4E4T.js";
|
|
50
|
+
import "./chunk-5AYKCKSE.js";
|
|
51
|
+
import "./chunk-E4X7JAFC.js";
|
|
52
|
+
import "./chunk-A6UFH3QU.js";
|
|
53
|
+
import "./chunk-5YNAVVCW.js";
|
|
54
|
+
import "./chunk-EMOVVERN.js";
|
|
55
|
+
import "./chunk-PHXOL5HZ.js";
|
|
56
|
+
import "./chunk-FIVD4HM4.js";
|
|
57
|
+
import "./chunk-EE4JSYGZ.js";
|
|
58
|
+
import "./chunk-ARTJLL7W.js";
|
|
59
|
+
import "./chunk-IXZLMFPO.js";
|
|
60
|
+
import "./chunk-JK2SNLU5.js";
|
|
61
|
+
import "./chunk-3DIXAEGH.js";
|
|
62
|
+
import "./chunk-7LQRXVQ3.js";
|
|
63
|
+
import "./chunk-7UEL65GQ.js";
|
|
64
|
+
import "./chunk-WRCKE5ND.js";
|
|
65
|
+
import "./chunk-Q27QAB4X.js";
|
|
66
|
+
import "./chunk-IBTMK5KD.js";
|
|
67
|
+
import "./chunk-DW23LM47.js";
|
|
68
|
+
import "./chunk-L433IDOX.js";
|
|
69
|
+
import "./chunk-WCQW4GYO.js";
|
|
70
|
+
import "./chunk-4DNHXRCJ.js";
|
|
71
|
+
import "./chunk-BAUK2MD5.js";
|
|
72
|
+
import "./chunk-KO4VR5NK.js";
|
|
73
|
+
import "./chunk-TDQJS3JG.js";
|
|
74
|
+
import "./chunk-TIHDBKA7.js";
|
|
56
75
|
import "./chunk-EH6ZEJGT.js";
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
66
|
-
import "./chunk-
|
|
76
|
+
import "./chunk-WGBVRDY3.js";
|
|
77
|
+
import "./chunk-SEELWPRD.js";
|
|
78
|
+
import "./chunk-3I2FGNWO.js";
|
|
79
|
+
import "./chunk-3TEFE6YU.js";
|
|
80
|
+
import "./chunk-IQ2XZ62J.js";
|
|
81
|
+
import "./chunk-JP2HJXFO.js";
|
|
82
|
+
import "./chunk-DQB5JMTY.js";
|
|
83
|
+
import "./chunk-GC6FLHZF.js";
|
|
84
|
+
import "./chunk-NNMU2TDU.js";
|
|
85
|
+
import "./chunk-CBCEMFCF.js";
|
|
86
|
+
import "./chunk-LT5KE44Q.js";
|
|
87
|
+
import "./chunk-DSRXCLPO.js";
|
|
67
88
|
import "./chunk-D72URWJE.js";
|
|
68
|
-
import "./chunk-
|
|
69
|
-
import "./chunk-
|
|
70
|
-
import "./chunk-
|
|
71
|
-
import "./chunk-
|
|
72
|
-
import "./chunk-
|
|
73
|
-
import "./chunk-
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
89
|
+
import "./chunk-ITGNDZRR.js";
|
|
90
|
+
import "./chunk-KVXEEKBB.js";
|
|
91
|
+
import "./chunk-3PEKYGZ3.js";
|
|
92
|
+
import "./chunk-NZGI74GS.js";
|
|
93
|
+
import "./chunk-JUKAIXKY.js";
|
|
94
|
+
import "./chunk-X5S5KUSU.js";
|
|
95
|
+
import "./chunk-J5P5VSRG.js";
|
|
96
|
+
import "./chunk-S4UUN6LD.js";
|
|
76
97
|
import "./chunk-Y5E2WNWB.js";
|
|
77
98
|
import {
|
|
78
99
|
CliError,
|
|
79
100
|
isCliError
|
|
80
|
-
} from "./chunk-
|
|
81
|
-
import "./chunk-
|
|
101
|
+
} from "./chunk-BUGROVF3.js";
|
|
102
|
+
import "./chunk-GRFICQTZ.js";
|
|
82
103
|
import {
|
|
83
104
|
__name
|
|
84
105
|
} from "./chunk-ZVVMGPBJ.js";
|
|
@@ -121,296 +142,6 @@ var withAssociations = /* @__PURE__ */ __name((rows, to, found) => rows.map((raw
|
|
|
121
142
|
}
|
|
122
143
|
})), "withAssociations");
|
|
123
144
|
|
|
124
|
-
// dist/crm/records.js
|
|
125
|
-
var { amountOf, crmValuesOf, epoch, fieldOf: fieldOf2, fullName, id: id2, isRaw, rawsOf: rawsOf2, text: text2 } = values_exports;
|
|
126
|
-
var OBJECTS = {
|
|
127
|
-
organization: {
|
|
128
|
-
path: "companies",
|
|
129
|
-
name: "companies",
|
|
130
|
-
modified: "hs_lastmodifieddate",
|
|
131
|
-
created: "createdate",
|
|
132
|
-
properties: ["name", "domain", "website", "phone", "hubspot_owner_id", "createdate", "hs_lastmodifieddate"],
|
|
133
|
-
associations: [],
|
|
134
|
-
linked: [],
|
|
135
|
-
scope: "crm.objects.companies.read"
|
|
136
|
-
},
|
|
137
|
-
person: {
|
|
138
|
-
path: "contacts",
|
|
139
|
-
name: "contacts",
|
|
140
|
-
modified: "lastmodifieddate",
|
|
141
|
-
created: "createdate",
|
|
142
|
-
properties: [
|
|
143
|
-
"firstname",
|
|
144
|
-
"lastname",
|
|
145
|
-
"email",
|
|
146
|
-
"hs_additional_emails",
|
|
147
|
-
"phone",
|
|
148
|
-
"mobilephone",
|
|
149
|
-
"jobtitle",
|
|
150
|
-
"associatedcompanyid",
|
|
151
|
-
"hubspot_owner_id",
|
|
152
|
-
"createdate",
|
|
153
|
-
"lastmodifieddate"
|
|
154
|
-
],
|
|
155
|
-
associations: ["companies"],
|
|
156
|
-
linked: [],
|
|
157
|
-
scope: "crm.objects.contacts.read"
|
|
158
|
-
},
|
|
159
|
-
deal: {
|
|
160
|
-
path: "0-3",
|
|
161
|
-
name: "deals",
|
|
162
|
-
modified: "hs_lastmodifieddate",
|
|
163
|
-
created: "createdate",
|
|
164
|
-
properties: [
|
|
165
|
-
"dealname",
|
|
166
|
-
"pipeline",
|
|
167
|
-
"dealstage",
|
|
168
|
-
"amount",
|
|
169
|
-
"deal_currency_code",
|
|
170
|
-
"closedate",
|
|
171
|
-
"closed_lost_reason",
|
|
172
|
-
"closed_won_reason",
|
|
173
|
-
"hubspot_owner_id",
|
|
174
|
-
"createdate",
|
|
175
|
-
"hs_lastmodifieddate"
|
|
176
|
-
],
|
|
177
|
-
associations: ["contacts"],
|
|
178
|
-
linked: ["companies"],
|
|
179
|
-
scope: "crm.objects.deals.read"
|
|
180
|
-
},
|
|
181
|
-
lead: {
|
|
182
|
-
path: "leads",
|
|
183
|
-
name: "leads",
|
|
184
|
-
modified: "hs_lastmodifieddate",
|
|
185
|
-
// The leads guide names no created-time property (https://developers.hubspot.com/docs/api-reference/latest/crm/objects/leads/guide);
|
|
186
|
-
// HubSpot's other objects use `hs_createdate` or `createdate`, so both are asked and either is read.
|
|
187
|
-
created: "hs_createdate",
|
|
188
|
-
properties: [
|
|
189
|
-
"hs_lead_name",
|
|
190
|
-
"hs_pipeline",
|
|
191
|
-
"hs_pipeline_stage",
|
|
192
|
-
"hubspot_owner_id",
|
|
193
|
-
"hs_createdate",
|
|
194
|
-
"createdate",
|
|
195
|
-
"hs_lastmodifieddate"
|
|
196
|
-
],
|
|
197
|
-
associations: ["contacts"],
|
|
198
|
-
linked: ["companies"],
|
|
199
|
-
scope: "crm.objects.leads.read"
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
var resultsOf = /* @__PURE__ */ __name((body) => {
|
|
203
|
-
const results = fieldOf2(body, "results");
|
|
204
|
-
if (!Array.isArray(results))
|
|
205
|
-
throw new CliError("invalid_response", `${SERVICE} answered a list without its results`);
|
|
206
|
-
return results.filter(isRaw);
|
|
207
|
-
}, "resultsOf");
|
|
208
|
-
var nextOf = /* @__PURE__ */ __name((body) => text2(fieldOf2(fieldOf2(fieldOf2(body, "paging"), "next"), "after")), "nextOf");
|
|
209
|
-
var propertiesOf = /* @__PURE__ */ __name((raw) => isRaw(raw.properties) ? raw.properties : {}, "propertiesOf");
|
|
210
|
-
var msOf = /* @__PURE__ */ __name((value) => {
|
|
211
|
-
if (typeof value === "string" && /^\d{10,16}$/.test(value))
|
|
212
|
-
return Number(value);
|
|
213
|
-
return epoch(value);
|
|
214
|
-
}, "msOf");
|
|
215
|
-
var PRIMARY_COMPANY = { deals: 5, contacts: 1, leads: 580 };
|
|
216
|
-
var primaryCompanyOf = /* @__PURE__ */ __name((raw, from) => {
|
|
217
|
-
const results = rawsOf2(fieldOf2(fieldOf2(raw.associations, "companies"), "results"));
|
|
218
|
-
const marked = results.find((one) => Array.isArray(one.typeIds) && one.typeIds.includes(PRIMARY_COMPANY[from] ?? Number.NaN));
|
|
219
|
-
return id2(marked?.id) ?? id2(results[0]?.id);
|
|
220
|
-
}, "primaryCompanyOf");
|
|
221
|
-
var associatedOf = /* @__PURE__ */ __name((raw, type) => {
|
|
222
|
-
const group = fieldOf2(raw.associations, type);
|
|
223
|
-
if (group === void 0)
|
|
224
|
-
return void 0;
|
|
225
|
-
return [...new Set(rawsOf2(fieldOf2(group, "results")).flatMap((one) => id2(one.id) ?? []))];
|
|
226
|
-
}, "associatedOf");
|
|
227
|
-
var siteOf = /* @__PURE__ */ __name((properties) => {
|
|
228
|
-
for (const value of [properties.website, properties.domain]) {
|
|
229
|
-
const raw = text2(value);
|
|
230
|
-
if (!raw)
|
|
231
|
-
continue;
|
|
232
|
-
try {
|
|
233
|
-
const url = new URL(/^https?:\/\//i.test(raw) ? raw : `https://${raw}`);
|
|
234
|
-
if ((url.protocol === "https:" || url.protocol === "http:") && !url.username && !url.password)
|
|
235
|
-
return `${url.protocol}//${url.host}`;
|
|
236
|
-
} catch {
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return null;
|
|
240
|
-
}, "siteOf");
|
|
241
|
-
var DAY = /^(\d{4}-\d{2}-\d{2})/;
|
|
242
|
-
var dayOf = /* @__PURE__ */ __name((value) => {
|
|
243
|
-
const ms = msOf(value);
|
|
244
|
-
if (ms !== null)
|
|
245
|
-
return new Date(ms).toISOString().slice(0, 10);
|
|
246
|
-
return DAY.exec(text2(value) ?? "")?.[1] ?? null;
|
|
247
|
-
}, "dayOf");
|
|
248
|
-
var uniq = /* @__PURE__ */ __name((values) => [...new Set(values.filter((one) => !!one))], "uniq");
|
|
249
|
-
var valuesOf = /* @__PURE__ */ __name((properties, defined) => {
|
|
250
|
-
const values = {};
|
|
251
|
-
for (const field of defined) {
|
|
252
|
-
const value = properties[field.code];
|
|
253
|
-
if (value === null || value === void 0 || value === "")
|
|
254
|
-
continue;
|
|
255
|
-
values[field.code] = field.multiple && typeof value === "string" ? value.split(";") : value;
|
|
256
|
-
}
|
|
257
|
-
return Object.keys(values).length ? crmValuesOf(values, defined) : void 0;
|
|
258
|
-
}, "valuesOf");
|
|
259
|
-
var timesOf = /* @__PURE__ */ __name((raw, type) => {
|
|
260
|
-
const properties = propertiesOf(raw);
|
|
261
|
-
return {
|
|
262
|
-
createdAt: msOf(properties[type.created]) ?? msOf(properties.createdate) ?? msOf(raw.createdAt),
|
|
263
|
-
updatedAt: msOf(properties[type.modified]) ?? msOf(raw.updatedAt)
|
|
264
|
-
};
|
|
265
|
-
}, "timesOf");
|
|
266
|
-
var toPerson = /* @__PURE__ */ __name((raw, defined = []) => {
|
|
267
|
-
const properties = propertiesOf(raw);
|
|
268
|
-
const phones = uniq([text2(properties.phone), text2(properties.mobilephone)]);
|
|
269
|
-
const emails = uniq([
|
|
270
|
-
text2(properties.email),
|
|
271
|
-
...(text2(properties.hs_additional_emails) ?? "").split(";").map((one) => text2(one))
|
|
272
|
-
]);
|
|
273
|
-
const companies = associatedOf(raw, "companies");
|
|
274
|
-
const primary = id2(properties.associatedcompanyid) ?? (companies?.length ? primaryCompanyOf(raw, "contacts") : null);
|
|
275
|
-
const metadata = valuesOf(properties, defined);
|
|
276
|
-
return {
|
|
277
|
-
externalId: id2(raw.id) ?? "",
|
|
278
|
-
name: fullName(properties.firstname, properties.lastname),
|
|
279
|
-
firstName: text2(properties.firstname),
|
|
280
|
-
lastName: text2(properties.lastname),
|
|
281
|
-
email: emails[0] ?? null,
|
|
282
|
-
phone: phones[0] ?? null,
|
|
283
|
-
phones,
|
|
284
|
-
emails,
|
|
285
|
-
position: text2(properties.jobtitle),
|
|
286
|
-
assignee: id2(properties.hubspot_owner_id),
|
|
287
|
-
...timesOf(raw, OBJECTS.person),
|
|
288
|
-
...companies ? {
|
|
289
|
-
organizations: uniq([primary && companies.includes(primary) ? primary : null, ...companies]).map((externalId) => ({ externalId, primary: externalId === primary }))
|
|
290
|
-
} : {},
|
|
291
|
-
...metadata ? { metadata } : {}
|
|
292
|
-
};
|
|
293
|
-
}, "toPerson");
|
|
294
|
-
var toOrganization = /* @__PURE__ */ __name((raw, defined = []) => {
|
|
295
|
-
const properties = propertiesOf(raw);
|
|
296
|
-
const metadata = valuesOf(properties, defined);
|
|
297
|
-
const phones = uniq([text2(properties.phone)]);
|
|
298
|
-
return {
|
|
299
|
-
externalId: id2(raw.id) ?? "",
|
|
300
|
-
name: text2(properties.name) ?? text2(properties.domain) ?? "",
|
|
301
|
-
url: siteOf(properties),
|
|
302
|
-
phones,
|
|
303
|
-
assignee: id2(properties.hubspot_owner_id),
|
|
304
|
-
...timesOf(raw, OBJECTS.organization),
|
|
305
|
-
...metadata ? { metadata } : {}
|
|
306
|
-
};
|
|
307
|
-
}, "toOrganization");
|
|
308
|
-
var linksOf = /* @__PURE__ */ __name((raw, from) => {
|
|
309
|
-
const contacts = associatedOf(raw, "contacts");
|
|
310
|
-
const companies = associatedOf(raw, "companies");
|
|
311
|
-
return {
|
|
312
|
-
...contacts ? { people: contacts.map((externalId) => ({ externalId, role: "contact" })) } : {},
|
|
313
|
-
...companies ? { organization: primaryCompanyOf(raw, from) } : {}
|
|
314
|
-
};
|
|
315
|
-
}, "linksOf");
|
|
316
|
-
var toDeal = /* @__PURE__ */ __name((raw, defined = [], currency = null) => {
|
|
317
|
-
const properties = propertiesOf(raw);
|
|
318
|
-
const money = amountOf(properties.amount, text2(properties.deal_currency_code) ?? currency);
|
|
319
|
-
const metadata = valuesOf(properties, defined);
|
|
320
|
-
return {
|
|
321
|
-
externalId: id2(raw.id) ?? "",
|
|
322
|
-
title: text2(properties.dealname) ?? "",
|
|
323
|
-
pipeline: text2(properties.pipeline) ?? "",
|
|
324
|
-
stage: text2(properties.dealstage) ?? "",
|
|
325
|
-
...money,
|
|
326
|
-
closeDate: dayOf(properties.closedate),
|
|
327
|
-
closedReason: text2(properties.closed_won_reason) ?? text2(properties.closed_lost_reason),
|
|
328
|
-
assignee: id2(properties.hubspot_owner_id),
|
|
329
|
-
...timesOf(raw, OBJECTS.deal),
|
|
330
|
-
...linksOf(raw, "deals"),
|
|
331
|
-
...metadata ? { metadata } : {}
|
|
332
|
-
};
|
|
333
|
-
}, "toDeal");
|
|
334
|
-
var toLead = /* @__PURE__ */ __name((raw, defined = []) => {
|
|
335
|
-
const properties = propertiesOf(raw);
|
|
336
|
-
const metadata = valuesOf(properties, defined);
|
|
337
|
-
return {
|
|
338
|
-
externalId: id2(raw.id) ?? "",
|
|
339
|
-
title: text2(properties.hs_lead_name) ?? "",
|
|
340
|
-
pipeline: text2(properties.hs_pipeline) ?? "",
|
|
341
|
-
stage: text2(properties.hs_pipeline_stage) ?? "",
|
|
342
|
-
assignee: id2(properties.hubspot_owner_id),
|
|
343
|
-
...timesOf(raw, OBJECTS.lead),
|
|
344
|
-
...linksOf(raw, "leads"),
|
|
345
|
-
...metadata ? { metadata } : {}
|
|
346
|
-
};
|
|
347
|
-
}, "toLead");
|
|
348
|
-
var LEAD_STAGE_IDS = { "qualified-stage-id": "won", "unqualified-stage-id": "lost" };
|
|
349
|
-
var LEAD_STAGE_LABELS = { qualified: "won", disqualified: "lost" };
|
|
350
|
-
var outcomeOf = /* @__PURE__ */ __name((metadata, kind = "deal", stage = {}) => {
|
|
351
|
-
if (text2(fieldOf2(metadata, "isClosed")) !== "true")
|
|
352
|
-
return { outcome: "open" };
|
|
353
|
-
const probability = text2(fieldOf2(metadata, "probability"));
|
|
354
|
-
if (kind === "deal" || probability !== null)
|
|
355
|
-
return { outcome: Number(probability) === 1 ? "won" : "lost" };
|
|
356
|
-
const known = LEAD_STAGE_IDS[stage.id ?? ""] ?? LEAD_STAGE_LABELS[stage.label?.trim().toLowerCase() ?? ""];
|
|
357
|
-
return known ? { outcome: known } : { outcome: "lost", unknown: true };
|
|
358
|
-
}, "outcomeOf");
|
|
359
|
-
var toPipeline = /* @__PURE__ */ __name((raw, kind = "deal", unknown = () => {
|
|
360
|
-
}) => {
|
|
361
|
-
const externalId = id2(raw.id);
|
|
362
|
-
if (!externalId)
|
|
363
|
-
return null;
|
|
364
|
-
return {
|
|
365
|
-
externalId,
|
|
366
|
-
name: text2(raw.label) ?? externalId,
|
|
367
|
-
stages: rawsOf2(raw.stages).flatMap((stage, at) => {
|
|
368
|
-
const stageId = id2(stage.id);
|
|
369
|
-
if (!stageId)
|
|
370
|
-
return [];
|
|
371
|
-
const order = Number(stage.displayOrder);
|
|
372
|
-
const name = text2(stage.label) ?? stageId;
|
|
373
|
-
const { outcome, unknown: guessed } = outcomeOf(stage.metadata, kind, { id: stageId, label: text2(stage.label) });
|
|
374
|
-
if (guessed)
|
|
375
|
-
unknown(name);
|
|
376
|
-
return [{ externalId: stageId, name, position: Number.isFinite(order) ? order : at, outcome }];
|
|
377
|
-
})
|
|
378
|
-
};
|
|
379
|
-
}, "toPipeline");
|
|
380
|
-
var toUser = /* @__PURE__ */ __name((raw) => {
|
|
381
|
-
const externalId = id2(raw.id);
|
|
382
|
-
if (!externalId)
|
|
383
|
-
return null;
|
|
384
|
-
return {
|
|
385
|
-
externalId,
|
|
386
|
-
name: fullName(raw.firstName, raw.lastName) ?? text2(raw.email),
|
|
387
|
-
email: text2(raw.email),
|
|
388
|
-
active: raw.archived !== true
|
|
389
|
-
};
|
|
390
|
-
}, "toUser");
|
|
391
|
-
var toField = /* @__PURE__ */ __name((raw) => {
|
|
392
|
-
const code = text2(raw.name);
|
|
393
|
-
if (!code || raw.hubspotDefined === true || raw.archived === true)
|
|
394
|
-
return null;
|
|
395
|
-
const type = text2(raw.type) ?? "string";
|
|
396
|
-
const fieldType = text2(raw.fieldType);
|
|
397
|
-
const options = type === "enumeration" && fieldType !== "booleancheckbox" ? [
|
|
398
|
-
...new Map(rawsOf2(raw.options).filter((one) => one.hidden !== true).flatMap((one) => {
|
|
399
|
-
const value = text2(one.value);
|
|
400
|
-
return value ? [[value, { id: value, label: text2(one.label) ?? value }]] : [];
|
|
401
|
-
})).values()
|
|
402
|
-
] : void 0;
|
|
403
|
-
return {
|
|
404
|
-
code,
|
|
405
|
-
label: text2(raw.label),
|
|
406
|
-
type,
|
|
407
|
-
multiple: type === "enumeration" && fieldType === "checkbox",
|
|
408
|
-
filterable: true,
|
|
409
|
-
...options ? { options } : {},
|
|
410
|
-
...fieldType === "phonenumber" ? { holds: "phone" } : {}
|
|
411
|
-
};
|
|
412
|
-
}, "toField");
|
|
413
|
-
|
|
414
145
|
// dist/crm/search.js
|
|
415
146
|
var SEARCH_PAGE = 200;
|
|
416
147
|
var SEARCH_CAP = 1e4;
|
|
@@ -447,16 +178,16 @@ var modifiedSince = /* @__PURE__ */ __name((modified, spot, limit, properties) =
|
|
|
447
178
|
}), "modifiedSince");
|
|
448
179
|
|
|
449
180
|
// dist/crm/activities.js
|
|
450
|
-
var { id:
|
|
181
|
+
var { id: id2, text: text2 } = values_exports;
|
|
451
182
|
var OVERLAP_MS = 10 * 6e4;
|
|
452
183
|
var CALL_OPEN = ["CALLING_CRM_USER", "CONNECTING", "IN_PROGRESS", "QUEUED", "RINGING"];
|
|
453
184
|
var EMAIL_OPEN = ["SCHEDULED", "SENDING"];
|
|
454
185
|
var COMMON = ["hubspot_owner_id", "hs_timestamp", "hs_createdate", "hs_lastmodifieddate"];
|
|
455
186
|
var plain = /* @__PURE__ */ __name((value) => {
|
|
456
|
-
const html =
|
|
187
|
+
const html = text2(value);
|
|
457
188
|
if (html === null)
|
|
458
189
|
return null;
|
|
459
|
-
return
|
|
190
|
+
return text2(html.replace(/<br\s*\/?>|<\/p>|<\/div>|<\/li>/gi, "\n").replace(/<[^>]*>/g, "").replace(/ /g, " ").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&"));
|
|
460
191
|
}, "plain");
|
|
461
192
|
var CONTACTS_SCOPE = "crm.objects.contacts.read";
|
|
462
193
|
var ENGAGEMENTS = [
|
|
@@ -475,43 +206,43 @@ var ENGAGEMENTS = [
|
|
|
475
206
|
kind: "call",
|
|
476
207
|
scope: CONTACTS_SCOPE,
|
|
477
208
|
properties: ["hs_call_title", "hs_call_direction", "hs_call_status", ...COMMON],
|
|
478
|
-
subject: /* @__PURE__ */ __name((properties) =>
|
|
209
|
+
subject: /* @__PURE__ */ __name((properties) => text2(properties.hs_call_title) ?? (text2(properties.hs_call_direction) === "INBOUND" ? "incoming call" : "outgoing call"), "subject"),
|
|
479
210
|
body: /* @__PURE__ */ __name(() => null, "body"),
|
|
480
211
|
dueAt: /* @__PURE__ */ __name(() => null, "dueAt"),
|
|
481
|
-
done: /* @__PURE__ */ __name((properties) => !CALL_OPEN.includes(
|
|
212
|
+
done: /* @__PURE__ */ __name((properties) => !CALL_OPEN.includes(text2(properties.hs_call_status) ?? ""), "done")
|
|
482
213
|
},
|
|
483
214
|
{
|
|
484
215
|
type: "emails",
|
|
485
216
|
kind: "email",
|
|
486
217
|
scope: "sales-email-read",
|
|
487
218
|
properties: ["hs_email_subject", "hs_email_text", "hs_email_direction", "hs_email_status", ...COMMON],
|
|
488
|
-
subject: /* @__PURE__ */ __name((properties) =>
|
|
489
|
-
body: /* @__PURE__ */ __name((properties) =>
|
|
219
|
+
subject: /* @__PURE__ */ __name((properties) => text2(properties.hs_email_subject), "subject"),
|
|
220
|
+
body: /* @__PURE__ */ __name((properties) => text2(properties.hs_email_text), "body"),
|
|
490
221
|
dueAt: /* @__PURE__ */ __name(() => null, "dueAt"),
|
|
491
|
-
done: /* @__PURE__ */ __name((properties) => !EMAIL_OPEN.includes(
|
|
222
|
+
done: /* @__PURE__ */ __name((properties) => !EMAIL_OPEN.includes(text2(properties.hs_email_status) ?? ""), "done")
|
|
492
223
|
},
|
|
493
224
|
{
|
|
494
225
|
type: "meetings",
|
|
495
226
|
kind: "meeting",
|
|
496
227
|
scope: CONTACTS_SCOPE,
|
|
497
228
|
properties: ["hs_meeting_title", "hs_meeting_body", "hs_meeting_start_time", "hs_meeting_outcome", ...COMMON],
|
|
498
|
-
subject: /* @__PURE__ */ __name((properties) =>
|
|
229
|
+
subject: /* @__PURE__ */ __name((properties) => text2(properties.hs_meeting_title), "subject"),
|
|
499
230
|
body: /* @__PURE__ */ __name((properties) => plain(properties.hs_meeting_body), "body"),
|
|
500
231
|
dueAt: /* @__PURE__ */ __name((properties) => msOf(properties.hs_meeting_start_time), "dueAt"),
|
|
501
232
|
// "scheduled, completed, rescheduled, no show, and canceled", in prose and lower case
|
|
502
233
|
// (https://developers.hubspot.com/docs/api-reference/latest/crm/activities/meetings/guide).
|
|
503
|
-
done: /* @__PURE__ */ __name((properties) =>
|
|
234
|
+
done: /* @__PURE__ */ __name((properties) => text2(properties.hs_meeting_outcome)?.toUpperCase() === "COMPLETED", "done")
|
|
504
235
|
},
|
|
505
236
|
{
|
|
506
237
|
type: "tasks",
|
|
507
238
|
kind: "task",
|
|
508
239
|
scope: CONTACTS_SCOPE,
|
|
509
240
|
properties: ["hs_task_subject", "hs_task_body", "hs_task_status", ...COMMON],
|
|
510
|
-
subject: /* @__PURE__ */ __name((properties) =>
|
|
241
|
+
subject: /* @__PURE__ */ __name((properties) => text2(properties.hs_task_subject), "subject"),
|
|
511
242
|
body: /* @__PURE__ */ __name((properties) => plain(properties.hs_task_body), "body"),
|
|
512
243
|
dueAt: /* @__PURE__ */ __name((properties) => msOf(properties.hs_timestamp), "dueAt"),
|
|
513
244
|
// COMPLETED or NOT_STARTED (https://developers.hubspot.com/docs/api-reference/latest/crm/activities/tasks/guide).
|
|
514
|
-
done: /* @__PURE__ */ __name((properties) =>
|
|
245
|
+
done: /* @__PURE__ */ __name((properties) => text2(properties.hs_task_status) === "COMPLETED", "done")
|
|
515
246
|
}
|
|
516
247
|
];
|
|
517
248
|
var ON = [
|
|
@@ -521,7 +252,7 @@ var ON = [
|
|
|
521
252
|
["companies", "organization"]
|
|
522
253
|
];
|
|
523
254
|
var toActivity = /* @__PURE__ */ __name((engagement, raw, on) => {
|
|
524
|
-
const externalId =
|
|
255
|
+
const externalId = id2(raw.id);
|
|
525
256
|
const properties = propertiesOf(raw);
|
|
526
257
|
const updatedAt = msOf(properties.hs_lastmodifieddate) ?? msOf(raw.updatedAt);
|
|
527
258
|
if (!externalId || updatedAt === null)
|
|
@@ -534,7 +265,7 @@ var toActivity = /* @__PURE__ */ __name((engagement, raw, on) => {
|
|
|
534
265
|
body: engagement.body(properties),
|
|
535
266
|
dueAt: engagement.dueAt(properties),
|
|
536
267
|
done: engagement.done(properties),
|
|
537
|
-
assignee:
|
|
268
|
+
assignee: id2(properties.hubspot_owner_id),
|
|
538
269
|
createdAt: msOf(properties.hs_createdate) ?? msOf(raw.createdAt) ?? updatedAt,
|
|
539
270
|
updatedAt,
|
|
540
271
|
on
|
|
@@ -597,7 +328,7 @@ var readActivities = /* @__PURE__ */ __name(async (caller, since, page, context,
|
|
|
597
328
|
});
|
|
598
329
|
return following([]);
|
|
599
330
|
}
|
|
600
|
-
const ids = rows.flatMap((raw) =>
|
|
331
|
+
const ids = rows.flatMap((raw) => id2(raw.id) ?? []);
|
|
601
332
|
const on = /* @__PURE__ */ new Map();
|
|
602
333
|
for (const [to, kind] of ON) {
|
|
603
334
|
let found;
|
|
@@ -621,7 +352,7 @@ var readActivities = /* @__PURE__ */ __name(async (caller, since, page, context,
|
|
|
621
352
|
}, "readActivities");
|
|
622
353
|
|
|
623
354
|
// dist/crm/source.js
|
|
624
|
-
var { id:
|
|
355
|
+
var { id: id3, text: text3 } = values_exports;
|
|
625
356
|
var OVERLAP_MS2 = 10 * 6e4;
|
|
626
357
|
var LIST_PAGE = 100;
|
|
627
358
|
var PIPELINES = { deal: "deals", lead: "leads" };
|
|
@@ -739,7 +470,7 @@ var hubspotCrmSource = /* @__PURE__ */ __name((hub, options = {}) => {
|
|
|
739
470
|
if (kind === "deal") {
|
|
740
471
|
const bare = rows.some((raw) => {
|
|
741
472
|
const properties = propertiesOf(raw);
|
|
742
|
-
return
|
|
473
|
+
return text3(properties.amount) !== null && text3(properties.deal_currency_code) === null;
|
|
743
474
|
});
|
|
744
475
|
const fallback = bare ? await currencyOf(caller) : null;
|
|
745
476
|
return rows.map((raw) => toDeal(raw, defined, fallback));
|
|
@@ -753,7 +484,7 @@ var hubspotCrmSource = /* @__PURE__ */ __name((hub, options = {}) => {
|
|
|
753
484
|
], "propertiesFor");
|
|
754
485
|
const associate = /* @__PURE__ */ __name(async (type, rows, caller, types) => {
|
|
755
486
|
let linked = rows;
|
|
756
|
-
const ids = rows.flatMap((raw) =>
|
|
487
|
+
const ids = rows.flatMap((raw) => id3(raw.id) ?? []);
|
|
757
488
|
for (const to of types)
|
|
758
489
|
linked = withAssociations(linked, to, await associationsOf(caller.post, type.name, to, ids));
|
|
759
490
|
return linked;
|
|
@@ -846,7 +577,7 @@ var hubspotCrmSource = /* @__PURE__ */ __name((hub, options = {}) => {
|
|
|
846
577
|
archived: false,
|
|
847
578
|
...page ? { after: page } : {}
|
|
848
579
|
});
|
|
849
|
-
const items = resultsOf(body).flatMap((raw) =>
|
|
580
|
+
const items = resultsOf(body).flatMap((raw) => id3(raw.id) ?? []);
|
|
850
581
|
const next = nextOf(body);
|
|
851
582
|
return next ? { items, hasMore: true, nextCursor: next } : { items, hasMore: false };
|
|
852
583
|
} catch (error) {
|
|
@@ -899,31 +630,34 @@ var hubspotCrmSource = /* @__PURE__ */ __name((hub, options = {}) => {
|
|
|
899
630
|
});
|
|
900
631
|
return { items: await mapped(kind, page.items, defined, caller), hasMore: page.hasMore };
|
|
901
632
|
},
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
return null;
|
|
905
|
-
const caller = metered(context);
|
|
906
|
-
const type = OBJECTS[kind];
|
|
907
|
-
const defined = await known(kind, caller);
|
|
908
|
-
let body;
|
|
909
|
-
try {
|
|
910
|
-
body = await caller.get(`/crm/objects/2026-03/${type.path}/${segment(externalId)}`, {
|
|
911
|
-
properties: getProperties(kind, defined, context),
|
|
912
|
-
...type.associations.length ? { associations: type.associations.join(",") } : {}
|
|
913
|
-
});
|
|
914
|
-
} catch (error) {
|
|
915
|
-
if (unseen(error))
|
|
916
|
-
return null;
|
|
917
|
-
throw error;
|
|
918
|
-
}
|
|
919
|
-
if (typeof body !== "object" || body === null)
|
|
920
|
-
return null;
|
|
921
|
-
const rows = await associate(type, [asked(body, type.associations)], caller, type.linked);
|
|
922
|
-
const [record] = await mapped(kind, rows, defined, caller);
|
|
923
|
-
return record ?? null;
|
|
924
|
-
},
|
|
633
|
+
get: /* @__PURE__ */ __name((kind, externalId, context) => record(kind, externalId, context), "get"),
|
|
634
|
+
record,
|
|
925
635
|
activities: /* @__PURE__ */ __name((since, page, context) => readActivities(metered(context), since, page, context, now, { search: searchPage, list: listPage }), "activities")
|
|
926
636
|
};
|
|
637
|
+
async function record(kind, externalId, context) {
|
|
638
|
+
if (!/^\d{1,20}$/.test(externalId))
|
|
639
|
+
return null;
|
|
640
|
+
const caller = metered(context);
|
|
641
|
+
const type = OBJECTS[kind];
|
|
642
|
+
const defined = await fields(kind, caller);
|
|
643
|
+
let body;
|
|
644
|
+
try {
|
|
645
|
+
body = await caller.get(`/crm/objects/2026-03/${type.path}/${segment(externalId)}`, {
|
|
646
|
+
properties: getProperties(kind, defined, context),
|
|
647
|
+
...type.associations.length ? { associations: type.associations.join(",") } : {}
|
|
648
|
+
});
|
|
649
|
+
} catch (error) {
|
|
650
|
+
if (unseen(error))
|
|
651
|
+
return null;
|
|
652
|
+
throw error;
|
|
653
|
+
}
|
|
654
|
+
if (typeof body !== "object" || body === null)
|
|
655
|
+
return null;
|
|
656
|
+
const rows = await associate(type, [asked(body, type.associations)], caller, type.linked);
|
|
657
|
+
const [found] = await mapped(kind, rows, defined, caller);
|
|
658
|
+
return found ?? null;
|
|
659
|
+
}
|
|
660
|
+
__name(record, "record");
|
|
927
661
|
}, "hubspotCrmSource");
|
|
928
662
|
var leadsRefused = "HubSpot refused the leads: they need Sales Hub Professional or Enterprise and the crm.objects.leads.read scope; deals, contacts and companies are copied without them";
|
|
929
663
|
export {
|