@wirecat/hubspot-cli 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +204 -0
  3. package/README.md +280 -2
  4. package/contracts/wirecat.json +3270 -0
  5. package/dist/bin/hubspot.d.ts +3 -0
  6. package/dist/bin/hubspot.d.ts.map +1 -0
  7. package/dist/bin/hubspot.js +40 -0
  8. package/dist/bin/hubspot.js.map +1 -0
  9. package/dist/bundle/all-profiles-64JAUYW4.js +279 -0
  10. package/dist/bundle/anthropic-VJOS4OUM.js +91 -0
  11. package/dist/bundle/app-server-GXV2OFML.js +245 -0
  12. package/dist/bundle/bun-M3J2QTR3.js +169 -0
  13. package/dist/bundle/bun-sqlite-IX3XYA5F.js +76 -0
  14. package/dist/bundle/chunk-24ERVFJP.js +73 -0
  15. package/dist/bundle/chunk-2QZK5BEP.js +392 -0
  16. package/dist/bundle/chunk-2UOJ7DLZ.js +46 -0
  17. package/dist/bundle/chunk-2VGD63G6.js +604 -0
  18. package/dist/bundle/chunk-2VGZRYEH.js +334 -0
  19. package/dist/bundle/chunk-36ITRDYY.js +63116 -0
  20. package/dist/bundle/chunk-3WLYWRGG.js +1395 -0
  21. package/dist/bundle/chunk-43EKCUBJ.js +72 -0
  22. package/dist/bundle/chunk-4W6BMH45.js +731 -0
  23. package/dist/bundle/chunk-5A6ZYNAQ.js +2003 -0
  24. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  25. package/dist/bundle/chunk-5GBUCHRU.js +274 -0
  26. package/dist/bundle/chunk-5K7QLJMM.js +4072 -0
  27. package/dist/bundle/chunk-65TWQ7BV.js +54 -0
  28. package/dist/bundle/chunk-7ELMWE3P.js +12066 -0
  29. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  30. package/dist/bundle/chunk-B3MANLNK.js +602 -0
  31. package/dist/bundle/chunk-C32AKHTY.js +2310 -0
  32. package/dist/bundle/chunk-CLAN3FES.js +1246 -0
  33. package/dist/bundle/chunk-CWXOXIWS.js +46 -0
  34. package/dist/bundle/chunk-D72URWJE.js +532 -0
  35. package/dist/bundle/chunk-DB2XKHI4.js +72 -0
  36. package/dist/bundle/chunk-DBEQI5YM.js +100 -0
  37. package/dist/bundle/chunk-DFCHHR5M.js +38 -0
  38. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  39. package/dist/bundle/chunk-DRWWJLI6.js +188 -0
  40. package/dist/bundle/chunk-DSP36YHQ.js +29 -0
  41. package/dist/bundle/chunk-E52JAS35.js +1028 -0
  42. package/dist/bundle/chunk-E5WLE7BM.js +78 -0
  43. package/dist/bundle/chunk-ECEZOLOD.js +230 -0
  44. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  45. package/dist/bundle/chunk-FBCCBCFH.js +288 -0
  46. package/dist/bundle/chunk-FKA7DOCK.js +53 -0
  47. package/dist/bundle/chunk-FOZYMDRL.js +259 -0
  48. package/dist/bundle/chunk-FPUGMDJV.js +7 -0
  49. package/dist/bundle/chunk-FTFV3HFW.js +721 -0
  50. package/dist/bundle/chunk-GPYCBYX5.js +218 -0
  51. package/dist/bundle/chunk-H3TNVEQX.js +782 -0
  52. package/dist/bundle/chunk-HC5ZWE5X.js +193 -0
  53. package/dist/bundle/chunk-HCAZV5NP.js +95 -0
  54. package/dist/bundle/chunk-HZRQLAHO.js +16 -0
  55. package/dist/bundle/chunk-IJADZW42.js +195 -0
  56. package/dist/bundle/chunk-IMJQRPLN.js +92 -0
  57. package/dist/bundle/chunk-JLDBMEKZ.js +106 -0
  58. package/dist/bundle/chunk-LOBVOGOE.js +66 -0
  59. package/dist/bundle/chunk-LXZ66MCH.js +1328 -0
  60. package/dist/bundle/chunk-MFNMKHML.js +26462 -0
  61. package/dist/bundle/chunk-MVA5HVKL.js +1392 -0
  62. package/dist/bundle/chunk-N2XADGL4.js +76 -0
  63. package/dist/bundle/chunk-NHHJHXMQ.js +58 -0
  64. package/dist/bundle/chunk-NUU4WZVL.js +52 -0
  65. package/dist/bundle/chunk-NWHEHV3K.js +133 -0
  66. package/dist/bundle/chunk-NXERIDPJ.js +319 -0
  67. package/dist/bundle/chunk-O3DYRCIT.js +23 -0
  68. package/dist/bundle/chunk-O55RWNSH.js +161 -0
  69. package/dist/bundle/chunk-P5BHKKBI.js +206 -0
  70. package/dist/bundle/chunk-PPHBRESD.js +82 -0
  71. package/dist/bundle/chunk-PVKF24ZW.js +364 -0
  72. package/dist/bundle/chunk-Q2OLOMHL.js +4045 -0
  73. package/dist/bundle/chunk-QGFX5MXL.js +460 -0
  74. package/dist/bundle/chunk-QJW35N5V.js +761 -0
  75. package/dist/bundle/chunk-QU25DA5N.js +360 -0
  76. package/dist/bundle/chunk-RMIYKDUL.js +1068 -0
  77. package/dist/bundle/chunk-RR5MX5TM.js +142 -0
  78. package/dist/bundle/chunk-SDQGB4KB.js +185 -0
  79. package/dist/bundle/chunk-TBJYLC5K.js +2788 -0
  80. package/dist/bundle/chunk-TI46WQXQ.js +1197 -0
  81. package/dist/bundle/chunk-TKVL2C3B.js +170 -0
  82. package/dist/bundle/chunk-TLKEPUAV.js +786 -0
  83. package/dist/bundle/chunk-TOSCB4SO.js +1227 -0
  84. package/dist/bundle/chunk-TP7GDWVF.js +6848 -0
  85. package/dist/bundle/chunk-URX6YDUL.js +9393 -0
  86. package/dist/bundle/chunk-UUMUL4L3.js +72 -0
  87. package/dist/bundle/chunk-VOH7S5M4.js +40963 -0
  88. package/dist/bundle/chunk-W53EJOFQ.js +63 -0
  89. package/dist/bundle/chunk-W7HM2VGO.js +24 -0
  90. package/dist/bundle/chunk-WE4UFASG.js +88 -0
  91. package/dist/bundle/chunk-X2M6NIQG.js +18 -0
  92. package/dist/bundle/chunk-XRREFEIW.js +372 -0
  93. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  94. package/dist/bundle/chunk-YMCY7VRE.js +1846 -0
  95. package/dist/bundle/chunk-Z73OL5HV.js +41 -0
  96. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  97. package/dist/bundle/command-contract-C6CBFXZF.js +40 -0
  98. package/dist/bundle/command-server-entry-DJKVVZCQ.js +169 -0
  99. package/dist/bundle/decode-FC65Y4IV.js +297 -0
  100. package/dist/bundle/definitions-MVPICAWV.js +2991 -0
  101. package/dist/bundle/dispatch-KOISQ5QJ.js +411 -0
  102. package/dist/bundle/dist-7TGU56B2.js +7577 -0
  103. package/dist/bundle/echarts-FVTUDXDU.js +42501 -0
  104. package/dist/bundle/embed-VNBZFPYH.js +38 -0
  105. package/dist/bundle/embedder-6U4NOFRO.js +111 -0
  106. package/dist/bundle/failure-FZ6VYKEQ.js +25 -0
  107. package/dist/bundle/first-run-UWAFSINQ.js +29 -0
  108. package/dist/bundle/first-screen-RTVMGHAE.js +40 -0
  109. package/dist/bundle/hubspot.js +198 -0
  110. package/dist/bundle/instructions-HET7BCYK.js +11 -0
  111. package/dist/bundle/mcp-RGNRW77S.js +167 -0
  112. package/dist/bundle/meeting-combined-L5AGBPYX.js +25 -0
  113. package/dist/bundle/meeting-model-NTB4RK3F.js +25 -0
  114. package/dist/bundle/meeting-semantic-JY3OGCBS.js +22 -0
  115. package/dist/bundle/node-CXZIFHZC.js +176 -0
  116. package/dist/bundle/node-P4E63KXA.js +2340 -0
  117. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  118. package/dist/bundle/node-sqlite-P3O7XN7Q.js +74 -0
  119. package/dist/bundle/oauth-HNCY4B2S.js +20 -0
  120. package/dist/bundle/open-F4P6YV54.js +23 -0
  121. package/dist/bundle/openai-4AICLIK3.js +238 -0
  122. package/dist/bundle/process-5RUXWGYS.js +91 -0
  123. package/dist/bundle/program-XA4C44Z4.js +9374 -0
  124. package/dist/bundle/prompt-NFMDVBZ4.js +17 -0
  125. package/dist/bundle/recognize-DKN3RY4V.js +26 -0
  126. package/dist/bundle/remote-6QHAGQWY.js +31 -0
  127. package/dist/bundle/rerank-M4KHEHUZ.js +52 -0
  128. package/dist/bundle/schemas-JRL3DLMP.js +952 -0
  129. package/dist/bundle/serve-DNU43ND6.js +199 -0
  130. package/dist/bundle/server-ATG5KY7K.js +207 -0
  131. package/dist/bundle/server-VNWVVH7A.js +77 -0
  132. package/dist/bundle/source-54HR4IWG.js +661 -0
  133. package/dist/bundle/sqlite-runtime-EMQAC63N.js +20 -0
  134. package/dist/bundle/state-T45CX7VY.js +36 -0
  135. package/dist/bundle/store-6LCEVBAZ.js +176 -0
  136. package/dist/bundle/store-6TZ2FCVA.js +295 -0
  137. package/dist/bundle/store-DXWYNVVB.js +32 -0
  138. package/dist/bundle/store-maintenance-command-J57HCJYY.js +68 -0
  139. package/dist/bundle/writer-NLLI5YRM.js +79 -0
  140. package/dist/commands/account.d.ts +3 -0
  141. package/dist/commands/account.d.ts.map +1 -0
  142. package/dist/commands/account.js +87 -0
  143. package/dist/commands/account.js.map +1 -0
  144. package/dist/commands/api.d.ts +9 -0
  145. package/dist/commands/api.d.ts.map +1 -0
  146. package/dist/commands/api.js +70 -0
  147. package/dist/commands/api.js.map +1 -0
  148. package/dist/commands/crm-shared.d.ts +8 -0
  149. package/dist/commands/crm-shared.d.ts.map +1 -0
  150. package/dist/commands/crm-shared.js +109 -0
  151. package/dist/commands/crm-shared.js.map +1 -0
  152. package/dist/commands/schedule.d.ts +3 -0
  153. package/dist/commands/schedule.d.ts.map +1 -0
  154. package/dist/commands/schedule.js +9 -0
  155. package/dist/commands/schedule.js.map +1 -0
  156. package/dist/commands/session.d.ts +14 -0
  157. package/dist/commands/session.d.ts.map +1 -0
  158. package/dist/commands/session.js +164 -0
  159. package/dist/commands/session.js.map +1 -0
  160. package/dist/config.d.ts +60 -0
  161. package/dist/config.d.ts.map +1 -0
  162. package/dist/config.js +153 -0
  163. package/dist/config.js.map +1 -0
  164. package/dist/context.d.ts +88 -0
  165. package/dist/context.d.ts.map +1 -0
  166. package/dist/context.js +137 -0
  167. package/dist/context.js.map +1 -0
  168. package/dist/crm/activities.d.ts +24 -0
  169. package/dist/crm/activities.d.ts.map +1 -0
  170. package/dist/crm/activities.js +214 -0
  171. package/dist/crm/activities.js.map +1 -0
  172. package/dist/crm/associations.d.ts +20 -0
  173. package/dist/crm/associations.d.ts.map +1 -0
  174. package/dist/crm/associations.js +47 -0
  175. package/dist/crm/associations.js.map +1 -0
  176. package/dist/crm/records.d.ts +63 -0
  177. package/dist/crm/records.d.ts.map +1 -0
  178. package/dist/crm/records.js +333 -0
  179. package/dist/crm/records.js.map +1 -0
  180. package/dist/crm/search.d.ts +57 -0
  181. package/dist/crm/search.d.ts.map +1 -0
  182. package/dist/crm/search.js +47 -0
  183. package/dist/crm/search.js.map +1 -0
  184. package/dist/crm/source.d.ts +37 -0
  185. package/dist/crm/source.d.ts.map +1 -0
  186. package/dist/crm/source.js +366 -0
  187. package/dist/crm/source.js.map +1 -0
  188. package/dist/crm/writer.d.ts +15 -0
  189. package/dist/crm/writer.d.ts.map +1 -0
  190. package/dist/crm/writer.js +199 -0
  191. package/dist/crm/writer.js.map +1 -0
  192. package/dist/generated/definitions.d.ts +3 -0
  193. package/dist/generated/definitions.d.ts.map +1 -0
  194. package/dist/generated/definitions.js +2987 -0
  195. package/dist/generated/definitions.js.map +1 -0
  196. package/dist/generated/manifest.d.ts +6 -0
  197. package/dist/generated/manifest.d.ts.map +1 -0
  198. package/dist/generated/manifest.js +6504 -0
  199. package/dist/generated/manifest.js.map +1 -0
  200. package/dist/generated/schemas.d.ts +205 -0
  201. package/dist/generated/schemas.d.ts.map +1 -0
  202. package/dist/generated/schemas.js +810 -0
  203. package/dist/generated/schemas.js.map +1 -0
  204. package/dist/generated/types.d.ts +1114 -0
  205. package/dist/generated/types.d.ts.map +1 -0
  206. package/dist/generated/types.js +5 -0
  207. package/dist/generated/types.js.map +1 -0
  208. package/dist/hubspot/account.d.ts +12 -0
  209. package/dist/hubspot/account.d.ts.map +1 -0
  210. package/dist/hubspot/account.js +23 -0
  211. package/dist/hubspot/account.js.map +1 -0
  212. package/dist/hubspot/transport.d.ts +81 -0
  213. package/dist/hubspot/transport.d.ts.map +1 -0
  214. package/dist/hubspot/transport.js +354 -0
  215. package/dist/hubspot/transport.js.map +1 -0
  216. package/dist/identity.d.ts +7 -0
  217. package/dist/identity.d.ts.map +1 -0
  218. package/dist/identity.js +32 -0
  219. package/dist/identity.js.map +1 -0
  220. package/dist/index.d.ts +3 -0
  221. package/dist/index.d.ts.map +1 -0
  222. package/dist/index.js +3 -0
  223. package/dist/index.js.map +1 -0
  224. package/dist/program.d.ts +6 -0
  225. package/dist/program.d.ts.map +1 -0
  226. package/dist/program.js +78 -0
  227. package/dist/program.js.map +1 -0
  228. package/dist/reasons.d.ts +10 -0
  229. package/dist/reasons.d.ts.map +1 -0
  230. package/dist/reasons.js +33 -0
  231. package/dist/reasons.js.map +1 -0
  232. package/dist/setup/flow.d.ts +2 -0
  233. package/dist/setup/flow.d.ts.map +1 -0
  234. package/dist/setup/flow.js +97 -0
  235. package/dist/setup/flow.js.map +1 -0
  236. package/dist/setup/texts.en.json +19 -0
  237. package/dist/setup/texts.es.json +19 -0
  238. package/dist/setup/texts.ru.json +19 -0
  239. package/dist/store.d.ts +16 -0
  240. package/dist/store.d.ts.map +1 -0
  241. package/dist/store.js +34 -0
  242. package/dist/store.js.map +1 -0
  243. package/dist/version.d.ts +2 -0
  244. package/dist/version.d.ts.map +1 -0
  245. package/dist/version.js +2 -0
  246. package/dist/version.js.map +1 -0
  247. package/dist/wcat.d.ts +3 -0
  248. package/dist/wcat.d.ts.map +1 -0
  249. package/dist/wcat.js +4 -0
  250. package/dist/wcat.js.map +1 -0
  251. package/dist/whoami.d.ts +19 -0
  252. package/dist/whoami.d.ts.map +1 -0
  253. package/dist/whoami.js +15 -0
  254. package/dist/whoami.js.map +1 -0
  255. package/package.json +98 -4
  256. package/skills/hubspot-cli/SKILL.md +102 -0
  257. package/skills/hubspot-cli/references/api/api-advanced.md +51 -0
  258. package/skills/hubspot-cli/references/api/api-basic.md +1064 -0
  259. package/skills/hubspot-cli/references/api/api-batch.md +724 -0
  260. package/skills/hubspot-cli/references/api/api-search.md +147 -0
  261. package/skills/hubspot-cli/references/api.md +16 -0
@@ -0,0 +1,199 @@
1
+ import { CliError, isCliError } from "@wirecat/cli-base";
2
+ import { crmValues, foldFieldName, } from "@wirecat/cli-core/crm";
3
+ import { SERVICE, segment } from "../hubspot/transport.js";
4
+ import { OBJECTS } from "./records.js";
5
+ /**
6
+ * Deals, contacts and companies; leads need Sales Hub Professional, which no account this was checked on has. HubSpot
7
+ * takes no idempotency key on a create (objects guide), so a repeated write makes a second record.
8
+ */
9
+ export const HUBSPOT_WRITES = {
10
+ kinds: ["deal", "person", "organization"],
11
+ verbs: ["create", "update", "move", "close", "remove"],
12
+ idempotent: false,
13
+ };
14
+ /** HubSpot's own properties each named option sets: never through `--field`, which would skip the option's keys. */
15
+ const OWN = {
16
+ deal: new Set(["dealname", "pipeline", "dealstage", "amount", "deal_currency_code", "closedate", "hubspot_owner_id"].map(foldFieldName)),
17
+ person: new Set(["firstname", "lastname", "email", "phone", "mobilephone", "jobtitle", "hubspot_owner_id"].map(foldFieldName)),
18
+ organization: new Set(["name", "phone", "hubspot_owner_id"].map(foldFieldName)),
19
+ };
20
+ const refused = (message, param) => new CliError("validation_error", message, { reason: "crm.record-field", sent: false, ...(param ? { param } : {}) });
21
+ const ID = /^\d{1,20}$/;
22
+ const idOf = (value, param) => {
23
+ if (!ID.test(value))
24
+ throw refused(`${param} takes ${SERVICE}'s numeric id`, param);
25
+ return value;
26
+ };
27
+ /** HubSpot clears a property set to the empty string (objects guide, "Update records"). */
28
+ const cleared = (value) => value ?? "";
29
+ /** A multiple checkbox's values are one string, `;` between them (properties guide). */
30
+ const customOf = (kind, custom) => {
31
+ const properties = {};
32
+ for (const [code, value] of Object.entries(custom ?? {})) {
33
+ if (OWN[kind].has(foldFieldName(code)))
34
+ throw refused(`${code} is one of ${SERVICE}'s own properties; set it with its own option, not --field`, "--field");
35
+ properties[code] = Array.isArray(value) ? value.join(";") : cleared(value);
36
+ }
37
+ return properties;
38
+ };
39
+ /** One empty value clears the list. */
40
+ const listOf = (values) => values?.map((one) => one.trim()).filter(Boolean);
41
+ const dealOf = (given) => {
42
+ if (given.people !== undefined || given.organization !== undefined)
43
+ throw refused(`set a deal's contacts and company with ${SERVICE}'s associations, through api`);
44
+ const properties = customOf("deal", given.custom);
45
+ if (given.title !== undefined)
46
+ properties.dealname = given.title;
47
+ if (given.pipeline !== undefined)
48
+ properties.pipeline = given.pipeline;
49
+ if (given.stage !== undefined)
50
+ properties.dealstage = given.stage;
51
+ if (given.amount !== undefined)
52
+ properties.amount = cleared(given.amount);
53
+ if (given.currency !== undefined)
54
+ properties.deal_currency_code = cleared(given.currency);
55
+ // A date-time property, shown in each user's time zone: noon UTC stays the same day from UTC-11 to UTC+11, and the
56
+ // copy reads the UTC day back.
57
+ if (given.closeDate !== undefined)
58
+ properties.closedate = given.closeDate ? `${given.closeDate}T12:00:00.000Z` : "";
59
+ if (given.owner !== undefined)
60
+ properties.hubspot_owner_id = given.owner === null ? "" : idOf(given.owner, "--owner");
61
+ return properties;
62
+ };
63
+ /**
64
+ * A contact keeps one e-mail in `email` (more go to secondary addresses, which another API sets) and two numbers,
65
+ * `phone` and `mobilephone`; a longer list is refused, never cut.
66
+ */
67
+ const personOf = (given) => {
68
+ const properties = customOf("person", given.custom);
69
+ if (given.name !== undefined && given.firstName === undefined && given.lastName === undefined) {
70
+ const [first, ...rest] = given.name.trim().split(/\s+/);
71
+ properties.firstname = first ?? "";
72
+ properties.lastname = rest.join(" ");
73
+ }
74
+ if (given.firstName !== undefined)
75
+ properties.firstname = cleared(given.firstName);
76
+ if (given.lastName !== undefined)
77
+ properties.lastname = cleared(given.lastName);
78
+ if (given.position !== undefined)
79
+ properties.jobtitle = cleared(given.position);
80
+ const emails = listOf(given.emails);
81
+ if (emails) {
82
+ if (emails.length > 1)
83
+ throw refused(`${SERVICE} keeps one e-mail per contact here; give one --email`, "--email");
84
+ properties.email = emails[0] ?? "";
85
+ }
86
+ const phones = listOf(given.phones);
87
+ if (phones) {
88
+ if (phones.length > 2)
89
+ throw refused(`${SERVICE} keeps two numbers per contact, phone and mobile; give at most two --phone`, "--phone");
90
+ properties.phone = phones[0] ?? "";
91
+ properties.mobilephone = phones[1] ?? "";
92
+ }
93
+ if (given.owner !== undefined)
94
+ properties.hubspot_owner_id = given.owner === null ? "" : idOf(given.owner, "--owner");
95
+ return properties;
96
+ };
97
+ const organizationOf = (given) => {
98
+ const properties = customOf("organization", given.custom);
99
+ if (given.name !== undefined)
100
+ properties.name = given.name;
101
+ if (listOf(given.emails)?.length)
102
+ throw refused(`a ${SERVICE} company has no e-mail property; set the contacts' e-mails instead`, "--email");
103
+ const phones = listOf(given.phones);
104
+ if (phones) {
105
+ if (phones.length > 1)
106
+ throw refused(`a ${SERVICE} company keeps one number; give one --phone`, "--phone");
107
+ properties.phone = phones[0] ?? "";
108
+ }
109
+ if (given.owner !== undefined)
110
+ properties.hubspot_owner_id = given.owner === null ? "" : idOf(given.owner, "--owner");
111
+ return properties;
112
+ };
113
+ const propertiesFor = (kind, given) => {
114
+ if (kind === "deal")
115
+ return dealOf(given);
116
+ if (kind === "person")
117
+ return personOf(given);
118
+ if (kind === "organization")
119
+ return organizationOf(given);
120
+ throw new CliError("validation_error", `${SERVICE} leads are written through api leads-create and leads-update`, {
121
+ reason: "crm.write-unsupported",
122
+ sent: false,
123
+ });
124
+ };
125
+ const pathOf = (kind, externalId) => `/crm/objects/2026-03/${OBJECTS[kind].path}${externalId === undefined ? "" : `/${segment(idOf(externalId, `<${kind}>`))}`}`;
126
+ /**
127
+ * Core's write port over HubSpot's object APIs (https://developers.hubspot.com/docs/api-reference/latest/crm/using-object-apis):
128
+ * a POST to create, a PATCH of the properties given, a DELETE that archives. Each is sent once, then the record is read
129
+ * back whole with its associations, as core's store wants it.
130
+ */
131
+ export const hubspotCrmWriter = (hub, source) => {
132
+ /** The write went through: a failed read-back must never read as a failed write, or the owner repeats it. */
133
+ const readBack = async (kind, externalId, options) => {
134
+ try {
135
+ const found = await source().record(kind, externalId);
136
+ if (!found)
137
+ throw new CliError("not_found", `${SERVICE} has no ${kind} ${externalId}`);
138
+ return found;
139
+ }
140
+ catch (error) {
141
+ throw new CliError("invalid_response", `${SERVICE} made the change to ${kind} ${externalId}, but reading it back failed` +
142
+ `${isCliError(error) ? ` (${error.code})` : ""}; run sync to store it — do not write it again`, { operation_id: options.operationId, external_id: externalId, sent: true });
143
+ }
144
+ };
145
+ const update = async (kind, externalId, properties, options) => {
146
+ if (Object.keys(properties).length === 0)
147
+ throw refused("nothing to change: name a field");
148
+ await hub().patch(pathOf(kind, externalId), { properties });
149
+ return readBack(kind, externalId, options);
150
+ };
151
+ /** The deal's own pipeline's first stage with that outcome: HubSpot closes a deal by its stage (pipelines guide). */
152
+ const closingStage = async (externalId, outcome) => {
153
+ const deal = await source().record("deal", externalId);
154
+ if (!deal)
155
+ throw new CliError("not_found", `${SERVICE} has no deal ${externalId}`, { sent: false });
156
+ const pipeline = (await source().pipelines("deal")).find((one) => one.externalId === deal.pipeline);
157
+ const stage = pipeline?.stages.find((one) => one.outcome === outcome);
158
+ if (!stage)
159
+ throw refused(`the deal's pipeline ${deal.pipeline} has no closed ${outcome} stage in ${SERVICE}`, "<outcome>");
160
+ return stage.externalId;
161
+ };
162
+ return {
163
+ provider: "hubspot",
164
+ capabilities: HUBSPOT_WRITES,
165
+ async create(kind, draft, options) {
166
+ const properties = propertiesFor(kind, draft);
167
+ // The 2026-03 spec makes `associations` required on a create, an empty list included.
168
+ const answer = await hub().post(pathOf(kind), { properties, associations: [] });
169
+ const externalId = crmValues.id(crmValues.fieldOf(answer, "id"));
170
+ if (externalId === null)
171
+ throw new CliError("invalid_response", `${SERVICE} answered the new ${kind} without its id; run sync first`, {
172
+ operation_id: options.operationId,
173
+ sent: true,
174
+ });
175
+ return readBack(kind, externalId, options);
176
+ },
177
+ async update(kind, externalId, patch, options) {
178
+ return update(kind, externalId, propertiesFor(kind, patch), options);
179
+ },
180
+ async move(kind, externalId, stage, options) {
181
+ return update(kind, externalId, propertiesFor(kind, { stage }), options);
182
+ },
183
+ async close(kind, externalId, outcome, options) {
184
+ const properties = propertiesFor(kind, { stage: await closingStage(externalId, outcome) });
185
+ if (options.reason !== undefined)
186
+ properties[`closed_${outcome}_reason`] = options.reason;
187
+ return update(kind, externalId, properties, options);
188
+ },
189
+ async remove(kind, externalId) {
190
+ if (kind !== "deal")
191
+ throw new CliError("validation_error", `${SERVICE} ${kind}s are deleted through api`, {
192
+ reason: "crm.write-unsupported",
193
+ sent: false,
194
+ });
195
+ await hub().delete(pathOf(kind, externalId));
196
+ },
197
+ };
198
+ };
199
+ //# sourceMappingURL=writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/crm/writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAOL,SAAS,EACT,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAA8B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC;IACzC,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;IACtD,UAAU,EAAE,KAAK;CAClB,CAAA;AAKD,oHAAoH;AACpH,MAAM,GAAG,GAA2C;IAClD,IAAI,EAAE,IAAI,GAAG,CACX,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC,GAAG,CACxG,aAAa,CAC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,CAAC,GAAG,OAAO,CAAC,MAAM,CAAA;YACzF,OAAO,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QACtD,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU;YAC3B,IAAI,IAAI,KAAK,MAAM;gBACjB,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,GAAG,OAAO,IAAI,IAAI,2BAA2B,EAAE;oBACpF,MAAM,EAAE,uBAAuB;oBAC/B,IAAI,EAAE,KAAK;iBACZ,CAAC,CAAA;YACJ,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAA;QAC9C,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { SchemaNode } from "@wirecat/cli-base/codegen";
2
+ export declare const definitions: Readonly<Record<string, SchemaNode>>;
3
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/generated/definitions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAuiG5D,CAAA"}