@wirecat/hubspot-cli 0.2.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.
Files changed (158) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/contracts/wirecat.json +40 -2
  3. package/dist/bin/hubspot.js +2 -2
  4. package/dist/bundle/agent-A7ARC3QB.js +40 -0
  5. package/dist/bundle/{all-profiles-64JAUYW4.js → all-profiles-6452VSJB.js} +64 -22
  6. package/dist/bundle/{anthropic-VJOS4OUM.js → anthropic-VQUOVYOW.js} +6 -6
  7. package/dist/bundle/{app-server-GXV2OFML.js → app-server-FFYKM37G.js} +79 -68
  8. package/dist/bundle/{bun-M3J2QTR3.js → bun-AJPJ4ZUN.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-IX3XYA5F.js → bun-sqlite-AGXGSF6D.js} +7 -7
  10. package/dist/bundle/{chunk-N2XADGL4.js → chunk-2A64XS22.js} +4 -4
  11. package/dist/bundle/{chunk-Q2OLOMHL.js → chunk-2HYGCLKN.js} +93 -565
  12. package/dist/bundle/{chunk-FOZYMDRL.js → chunk-2NCO4E4T.js} +6 -6
  13. package/dist/bundle/{chunk-FBCCBCFH.js → chunk-2PRVWEJC.js} +3 -3
  14. package/dist/bundle/{chunk-LOBVOGOE.js → chunk-3DIXAEGH.js} +4 -4
  15. package/dist/bundle/{chunk-O3DYRCIT.js → chunk-3I2FGNWO.js} +1 -1
  16. package/dist/bundle/{chunk-65TWQ7BV.js → chunk-3PEKYGZ3.js} +2 -2
  17. package/dist/bundle/{chunk-DRWWJLI6.js → chunk-3R4KRNUZ.js} +8 -8
  18. package/dist/bundle/{chunk-2VGD63G6.js → chunk-3TEFE6YU.js} +7 -7
  19. package/dist/bundle/{chunk-3WLYWRGG.js → chunk-3WIVJJNB.js} +19 -17
  20. package/dist/bundle/{chunk-TI46WQXQ.js → chunk-4DNHXRCJ.js} +7 -7
  21. package/dist/bundle/{chunk-QU25DA5N.js → chunk-5AYKCKSE.js} +11 -11
  22. package/dist/bundle/chunk-5HD64ETI.js +561 -0
  23. package/dist/bundle/{chunk-CWXOXIWS.js → chunk-5K3FGXZH.js} +1 -1
  24. package/dist/bundle/{chunk-24ERVFJP.js → chunk-5YNAVVCW.js} +3 -3
  25. package/dist/bundle/{chunk-2UOJ7DLZ.js → chunk-77CUE3VX.js} +3 -3
  26. package/dist/bundle/{chunk-36ITRDYY.js → chunk-7LQRXVQ3.js} +783 -482
  27. package/dist/bundle/{chunk-E5WLE7BM.js → chunk-7NZT7Y55.js} +1 -1
  28. package/dist/bundle/{chunk-C32AKHTY.js → chunk-7UEL65GQ.js} +35 -12
  29. package/dist/bundle/chunk-7VHBS5BJ.js +108 -0
  30. package/dist/bundle/{chunk-O55RWNSH.js → chunk-A6UFH3QU.js} +4 -4
  31. package/dist/bundle/{chunk-WE4UFASG.js → chunk-ABXVU5O4.js} +8 -1
  32. package/dist/bundle/{chunk-4W6BMH45.js → chunk-AF7DANIR.js} +2 -100
  33. package/dist/bundle/{chunk-TLKEPUAV.js → chunk-AFL2C4JR.js} +60 -50
  34. package/dist/bundle/{chunk-2VGZRYEH.js → chunk-ARTJLL7W.js} +6 -6
  35. package/dist/bundle/chunk-AVUMH42T.js +194 -0
  36. package/dist/bundle/chunk-B2W3C4N6.js +338 -0
  37. package/dist/bundle/{chunk-FKA7DOCK.js → chunk-B3EH22CO.js} +1 -1
  38. package/dist/bundle/{chunk-E52JAS35.js → chunk-BAUK2MD5.js} +6 -6
  39. package/dist/bundle/{chunk-JLDBMEKZ.js → chunk-BN22EKQQ.js} +2 -2
  40. package/dist/bundle/{chunk-DB2XKHI4.js → chunk-BUGROVF3.js} +2 -2
  41. package/dist/bundle/{chunk-DSP36YHQ.js → chunk-CBCEMFCF.js} +2 -2
  42. package/dist/bundle/{chunk-MFNMKHML.js → chunk-CYADK744.js} +1020 -1637
  43. package/dist/bundle/{chunk-HZRQLAHO.js → chunk-DQB5JMTY.js} +1 -1
  44. package/dist/bundle/{chunk-URX6YDUL.js → chunk-DQP2GAAO.js} +75 -66
  45. package/dist/bundle/{chunk-FPUGMDJV.js → chunk-DSRXCLPO.js} +1 -1
  46. package/dist/bundle/{chunk-UUMUL4L3.js → chunk-DW23LM47.js} +2 -2
  47. package/dist/bundle/{chunk-TKVL2C3B.js → chunk-E4X7JAFC.js} +3 -3
  48. package/dist/bundle/{chunk-NUU4WZVL.js → chunk-EE4JSYGZ.js} +3 -3
  49. package/dist/bundle/{chunk-NWHEHV3K.js → chunk-EMOVVERN.js} +5 -5
  50. package/dist/bundle/{chunk-PVKF24ZW.js → chunk-FIVD4HM4.js} +8 -8
  51. package/dist/bundle/{chunk-QJW35N5V.js → chunk-GC6FLHZF.js} +12 -12
  52. package/dist/bundle/{chunk-TP7GDWVF.js → chunk-GRFICQTZ.js} +1 -1
  53. package/dist/bundle/{chunk-X2M6NIQG.js → chunk-HPZRUY6S.js} +1 -1
  54. package/dist/bundle/{chunk-CLAN3FES.js → chunk-IBTMK5KD.js} +54 -34
  55. package/dist/bundle/{chunk-5A6ZYNAQ.js → chunk-IQ2XZ62J.js} +18 -18
  56. package/dist/bundle/{chunk-DBEQI5YM.js → chunk-ITGNDZRR.js} +3 -3
  57. package/dist/bundle/{chunk-W53EJOFQ.js → chunk-IXZLMFPO.js} +1 -1
  58. package/dist/bundle/{chunk-TOSCB4SO.js → chunk-J5P5VSRG.js} +16 -10
  59. package/dist/bundle/{chunk-Z73OL5HV.js → chunk-J6C2QWL5.js} +3 -3
  60. package/dist/bundle/{chunk-VOH7S5M4.js → chunk-JG7YMHNB.js} +3229 -3116
  61. package/dist/bundle/{chunk-RMIYKDUL.js → chunk-JK2SNLU5.js} +17 -17
  62. package/dist/bundle/{chunk-43EKCUBJ.js → chunk-JP2HJXFO.js} +3 -3
  63. package/dist/bundle/{chunk-DFCHHR5M.js → chunk-JUKAIXKY.js} +1 -1
  64. package/dist/bundle/{chunk-5GBUCHRU.js → chunk-KO4VR5NK.js} +4 -4
  65. package/dist/bundle/{chunk-PPHBRESD.js → chunk-KVXEEKBB.js} +2 -2
  66. package/dist/bundle/{chunk-SDQGB4KB.js → chunk-L433IDOX.js} +9 -9
  67. package/dist/bundle/chunk-LA3YU4K7.js +40 -0
  68. package/dist/bundle/{chunk-ECEZOLOD.js → chunk-LKSNISYV.js} +4 -4
  69. package/dist/bundle/{chunk-5K7QLJMM.js → chunk-LT5KE44Q.js} +226 -226
  70. package/dist/bundle/chunk-M763RNWP.js +733 -0
  71. package/dist/bundle/chunk-M7XLG6AN.js +353 -0
  72. package/dist/bundle/{chunk-IMJQRPLN.js → chunk-NNMU2TDU.js} +1 -1
  73. package/dist/bundle/chunk-NTQBS2JL.js +52 -0
  74. package/dist/bundle/{chunk-HCAZV5NP.js → chunk-NZGI74GS.js} +6 -6
  75. package/dist/bundle/{chunk-W7HM2VGO.js → chunk-O3VM5PTJ.js} +1 -1
  76. package/dist/bundle/{chunk-IJADZW42.js → chunk-OPVNUI4M.js} +3 -3
  77. package/dist/bundle/{chunk-7ELMWE3P.js → chunk-PHXOL5HZ.js} +176 -160
  78. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  79. package/dist/bundle/{chunk-B3MANLNK.js → chunk-PLRUUXK7.js} +19 -233
  80. package/dist/bundle/{chunk-RR5MX5TM.js → chunk-PMP37KLR.js} +4 -4
  81. package/dist/bundle/{chunk-FTFV3HFW.js → chunk-Q27QAB4X.js} +9 -9
  82. package/dist/bundle/{chunk-LXZ66MCH.js → chunk-QFZD6MTF.js} +35 -29
  83. package/dist/bundle/{chunk-2QZK5BEP.js → chunk-RVWGFD32.js} +30 -15
  84. package/dist/bundle/{chunk-MVA5HVKL.js → chunk-S4UUN6LD.js} +18 -0
  85. package/dist/bundle/{chunk-QGFX5MXL.js → chunk-SEELWPRD.js} +9 -9
  86. package/dist/bundle/{chunk-GPYCBYX5.js → chunk-SMTTIKZ5.js} +12 -12
  87. package/dist/bundle/{chunk-YMCY7VRE.js → chunk-TDQJS3JG.js} +7 -7
  88. package/dist/bundle/{chunk-HC5ZWE5X.js → chunk-TIHDBKA7.js} +2 -2
  89. package/dist/bundle/{chunk-NHHJHXMQ.js → chunk-U6XA3OOM.js} +2 -2
  90. package/dist/bundle/{chunk-NXERIDPJ.js → chunk-VQEAZXTV.js} +7 -7
  91. package/dist/bundle/{chunk-P5BHKKBI.js → chunk-VW5F6FK3.js} +4 -4
  92. package/dist/bundle/{chunk-XRREFEIW.js → chunk-WCQW4GYO.js} +7 -7
  93. package/dist/bundle/{chunk-H3TNVEQX.js → chunk-WGBVRDY3.js} +29 -4
  94. package/dist/bundle/chunk-WRCKE5ND.js +80 -0
  95. package/dist/bundle/{chunk-TBJYLC5K.js → chunk-X5S5KUSU.js} +75 -75
  96. package/dist/bundle/command-contract-R2FGN7CQ.js +40 -0
  97. package/dist/bundle/{command-server-entry-DJKVVZCQ.js → command-server-entry-GJSMDSNE.js} +29 -29
  98. package/dist/bundle/{decode-FC65Y4IV.js → decode-6PLXHVHW.js} +6 -6
  99. package/dist/bundle/{dispatch-KOISQ5QJ.js → dispatch-TAQ7635E.js} +8 -8
  100. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  101. package/dist/bundle/{echarts-FVTUDXDU.js → echarts-UZ7QLRE2.js} +2 -2
  102. package/dist/bundle/{embed-VNBZFPYH.js → embed-AWLL4EBF.js} +7 -7
  103. package/dist/bundle/{embedder-6U4NOFRO.js → embedder-MM225YJ6.js} +10 -10
  104. package/dist/bundle/{failure-FZ6VYKEQ.js → failure-MR2XVHFP.js} +3 -3
  105. package/dist/bundle/first-run-MAUI6QJ7.js +29 -0
  106. package/dist/bundle/first-screen-SCDV7TXT.js +40 -0
  107. package/dist/bundle/hubspot.js +26 -26
  108. package/dist/bundle/{instructions-HET7BCYK.js → instructions-ZJ7U3QUE.js} +1 -1
  109. package/dist/bundle/{mcp-RGNRW77S.js → mcp-CNV7F2XZ.js} +2 -2
  110. package/dist/bundle/meeting-combined-EL5XZIJ5.js +25 -0
  111. package/dist/bundle/meeting-model-OYXB2NOE.js +25 -0
  112. package/dist/bundle/{meeting-semantic-JY3OGCBS.js → meeting-semantic-S3DBB7XD.js} +7 -7
  113. package/dist/bundle/{node-CXZIFHZC.js → node-HGCZGZ4R.js} +2 -2
  114. package/dist/bundle/{node-sqlite-P3O7XN7Q.js → node-sqlite-RKYSRKEB.js} +8 -8
  115. package/dist/bundle/oauth-PYDCAQ7Y.js +20 -0
  116. package/dist/bundle/{open-F4P6YV54.js → open-UCDSQUN2.js} +6 -6
  117. package/dist/bundle/{openai-4AICLIK3.js → openai-Y4F5ZC7O.js} +16 -16
  118. package/dist/bundle/{process-5RUXWGYS.js → process-P7FB7YO7.js} +1 -1
  119. package/dist/bundle/{program-XA4C44Z4.js → program-2D5D32HK.js} +682 -241
  120. package/dist/bundle/{prompt-NFMDVBZ4.js → prompt-E5TKZ37Q.js} +6 -6
  121. package/dist/bundle/{recognize-DKN3RY4V.js → recognize-5NYPTSLT.js} +5 -5
  122. package/dist/bundle/{remote-6QHAGQWY.js → remote-U4LUAHF2.js} +10 -10
  123. package/dist/bundle/{rerank-M4KHEHUZ.js → rerank-AJAVKK5L.js} +8 -8
  124. package/dist/bundle/{schemas-JRL3DLMP.js → schemas-QLQ2K6DL.js} +7 -33
  125. package/dist/bundle/{serve-DNU43ND6.js → serve-4UJ3R5IP.js} +11 -11
  126. package/dist/bundle/server-CN6VQNNF.js +86 -0
  127. package/dist/bundle/{server-ATG5KY7K.js → server-OJPCTV77.js} +73 -61
  128. package/dist/bundle/{source-54HR4IWG.js → source-VHDK74YS.js} +73 -66
  129. package/dist/bundle/{sqlite-runtime-EMQAC63N.js → sqlite-runtime-KLEA4XAU.js} +7 -7
  130. package/dist/bundle/{state-T45CX7VY.js → state-COGSYMVH.js} +7 -7
  131. package/dist/bundle/{store-6TZ2FCVA.js → store-BJXCSP26.js} +25 -24
  132. package/dist/bundle/store-HXA2MRWI.js +32 -0
  133. package/dist/bundle/{store-6LCEVBAZ.js → store-V5UMSWK4.js} +27 -22
  134. package/dist/bundle/store-maintenance-command-AC7GGLYC.js +73 -0
  135. package/dist/bundle/surface-ZZNG3OW2.js +72 -0
  136. package/dist/bundle/writer-CZYA657G.js +86 -0
  137. package/dist/config.d.ts +1 -1
  138. package/dist/config.d.ts.map +1 -1
  139. package/dist/config.js +1 -5
  140. package/dist/config.js.map +1 -1
  141. package/dist/generated/manifest.d.ts.map +1 -1
  142. package/dist/generated/manifest.js +0 -115
  143. package/dist/generated/manifest.js.map +1 -1
  144. package/dist/generated/types.d.ts +160 -0
  145. package/dist/generated/types.d.ts.map +1 -1
  146. package/dist/version.d.ts +1 -1
  147. package/dist/version.js +1 -1
  148. package/package.json +3 -3
  149. package/dist/bundle/command-contract-C6CBFXZF.js +0 -40
  150. package/dist/bundle/first-run-UWAFSINQ.js +0 -29
  151. package/dist/bundle/first-screen-RTVMGHAE.js +0 -40
  152. package/dist/bundle/meeting-combined-L5AGBPYX.js +0 -25
  153. package/dist/bundle/meeting-model-NTB4RK3F.js +0 -25
  154. package/dist/bundle/oauth-HNCY4B2S.js +0 -20
  155. package/dist/bundle/server-VNWVVH7A.js +0 -77
  156. package/dist/bundle/store-DXWYNVVB.js +0 -32
  157. package/dist/bundle/store-maintenance-command-J57HCJYY.js +0 -68
  158. package/dist/bundle/writer-NLLI5YRM.js +0 -79
@@ -1,14 +1,11 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
- import {
4
- PROVIDER
5
- } from "./chunk-Z73OL5HV.js";
6
3
  import {
7
4
  HUBSPOT_WRITES
8
- } from "./chunk-IJADZW42.js";
5
+ } from "./chunk-OPVNUI4M.js";
9
6
  import {
10
7
  accountDetails
11
- } from "./chunk-2UOJ7DLZ.js";
8
+ } from "./chunk-77CUE3VX.js";
12
9
  import {
13
10
  LONGEST_PACE_WAIT_MS,
14
11
  PACE,
@@ -19,6 +16,7 @@ import {
19
16
  accountRemoveCommand,
20
17
  appDoctorCommand,
21
18
  appMcpCommand,
19
+ commandLevel,
22
20
  commandsCommand,
23
21
  configCommand,
24
22
  createProgram,
@@ -39,26 +37,37 @@ import {
39
37
  skillCommand,
40
38
  upgradeCommand,
41
39
  writeCsv
42
- } from "./chunk-MFNMKHML.js";
43
- import "./chunk-DRWWJLI6.js";
40
+ } from "./chunk-CYADK744.js";
41
+ import "./chunk-O3VM5PTJ.js";
42
+ import {
43
+ PROVIDER
44
+ } from "./chunk-J6C2QWL5.js";
45
+ import "./chunk-7NZT7Y55.js";
44
46
  import {
45
47
  SOURCE_SEARCHED,
46
48
  allAnswer,
47
49
  historySkipsOf,
48
50
  offsetOf,
49
51
  refuseOffline
50
- } from "./chunk-LXZ66MCH.js";
51
- import "./chunk-X2M6NIQG.js";
52
- import "./chunk-W7HM2VGO.js";
53
- import "./chunk-B3MANLNK.js";
52
+ } from "./chunk-QFZD6MTF.js";
53
+ import "./chunk-PLRUUXK7.js";
54
+ import "./chunk-3R4KRNUZ.js";
55
+ import "./chunk-HPZRUY6S.js";
54
56
  import {
55
57
  addStoreMaintenanceCommands
56
- } from "./chunk-URX6YDUL.js";
58
+ } from "./chunk-DQP2GAAO.js";
57
59
  import {
58
60
  commandPathKey,
59
61
  commandPermissions,
60
62
  terminalAsker
61
- } from "./chunk-3WLYWRGG.js";
63
+ } from "./chunk-3WIVJJNB.js";
64
+ import "./chunk-M7XLG6AN.js";
65
+ import "./chunk-VQEAZXTV.js";
66
+ import "./chunk-SMTTIKZ5.js";
67
+ import "./chunk-BN22EKQQ.js";
68
+ import "./chunk-NTQBS2JL.js";
69
+ import "./chunk-B2W3C4N6.js";
70
+ import "./chunk-AVUMH42T.js";
62
71
  import {
63
72
  CRM_ASSIGN_OTHERS_KEY,
64
73
  CRM_WRITE_DEFAULTS,
@@ -68,7 +77,6 @@ import {
68
77
  SYNCED_FROM,
69
78
  SYNC_FAILED,
70
79
  closeCrmItem,
71
- commandPath,
72
80
  conditionsOf,
73
81
  createCrmItem,
74
82
  createCrmRecord,
@@ -78,60 +86,65 @@ import {
78
86
  crmViewerOf,
79
87
  customConditions,
80
88
  customNames,
81
- dateWindow,
89
+ extractText,
82
90
  fieldPairsOf,
83
91
  filterableFields,
84
92
  foreignContacts,
85
93
  foreignContactsPathFor,
86
- listQuery,
94
+ importEngine,
87
95
  meaningLane,
88
96
  moveCrmItem,
89
- nativeField,
90
- nativeTerms,
91
97
  ownerOf,
92
98
  pacePathFor,
99
+ parseCrmFileId,
93
100
  personMeetings,
94
101
  pipelineOf,
95
- queryTerms,
96
102
  readableAccounts,
97
103
  removeCrmItem,
98
104
  searchAll,
99
- searchText,
100
105
  selectedCodes,
101
106
  shortened,
102
107
  syncRecorded,
103
108
  taskAccount,
104
- termField,
105
- timeBounds,
106
- typedQuery,
107
- unfilteredQuery,
108
109
  updateCrmItem,
109
110
  updateCrmRecord,
110
111
  viewerOf,
111
112
  wantedCodes,
112
113
  withCustomFields,
113
- withQuery,
114
114
  withReadableDeal
115
- } from "./chunk-VOH7S5M4.js";
116
- import "./chunk-2QZK5BEP.js";
117
- import "./chunk-NXERIDPJ.js";
118
- import "./chunk-WE4UFASG.js";
119
- import "./chunk-GPYCBYX5.js";
115
+ } from "./chunk-JG7YMHNB.js";
116
+ import {
117
+ safeName
118
+ } from "./chunk-RVWGFD32.js";
119
+ import "./chunk-LA3YU4K7.js";
120
+ import "./chunk-ABXVU5O4.js";
120
121
  import {
121
122
  latestVersion,
122
123
  runUpdate,
123
124
  updateNotice
124
- } from "./chunk-RR5MX5TM.js";
125
- import "./chunk-CWXOXIWS.js";
126
- import "./chunk-JLDBMEKZ.js";
127
- import "./chunk-E5WLE7BM.js";
128
- import "./chunk-N2XADGL4.js";
129
- import "./chunk-FOZYMDRL.js";
130
- import "./chunk-QU25DA5N.js";
131
- import "./chunk-TKVL2C3B.js";
132
- import "./chunk-O55RWNSH.js";
133
- import "./chunk-24ERVFJP.js";
134
- import "./chunk-NWHEHV3K.js";
125
+ } from "./chunk-PMP37KLR.js";
126
+ import "./chunk-5K3FGXZH.js";
127
+ import {
128
+ commandPath,
129
+ dateWindow,
130
+ listQuery,
131
+ nativeField,
132
+ nativeTerms,
133
+ queryTerms,
134
+ searchText,
135
+ termField,
136
+ timeBounds,
137
+ typedQuery,
138
+ unfilteredQuery,
139
+ withQuery
140
+ } from "./chunk-M763RNWP.js";
141
+ import "./chunk-2A64XS22.js";
142
+ import "./chunk-2NCO4E4T.js";
143
+ import "./chunk-5AYKCKSE.js";
144
+ import "./chunk-E4X7JAFC.js";
145
+ import "./chunk-A6UFH3QU.js";
146
+ import "./chunk-5YNAVVCW.js";
147
+ import "./chunk-EMOVVERN.js";
135
148
  import {
136
149
  Argument,
137
150
  Command,
@@ -175,59 +188,64 @@ import {
175
188
  sharedCommand,
176
189
  snakeKeys,
177
190
  snakeKeysKeeping
178
- } from "./chunk-7ELMWE3P.js";
179
- import "./chunk-PVKF24ZW.js";
180
- import "./chunk-NUU4WZVL.js";
181
- import "./chunk-2VGZRYEH.js";
182
- import "./chunk-W53EJOFQ.js";
183
- import "./chunk-RMIYKDUL.js";
184
- import "./chunk-LOBVOGOE.js";
191
+ } from "./chunk-PHXOL5HZ.js";
192
+ import "./chunk-FIVD4HM4.js";
193
+ import "./chunk-EE4JSYGZ.js";
194
+ import "./chunk-ARTJLL7W.js";
195
+ import "./chunk-IXZLMFPO.js";
196
+ import "./chunk-JK2SNLU5.js";
197
+ import "./chunk-3DIXAEGH.js";
185
198
  import {
186
199
  CRM_CHANGES,
187
200
  CRM_SCOPES,
201
+ MAX_TEXT_CHARS,
202
+ attachmentMaxBytes,
203
+ crmIdentityId,
188
204
  crmSettingKey,
189
- dayIn,
190
205
  seenBy,
191
206
  viewerSql
192
- } from "./chunk-36ITRDYY.js";
193
- import "./chunk-C32AKHTY.js";
194
- import "./chunk-FTFV3HFW.js";
207
+ } from "./chunk-7LQRXVQ3.js";
208
+ import "./chunk-7UEL65GQ.js";
209
+ import {
210
+ dayIn
211
+ } from "./chunk-WRCKE5ND.js";
212
+ import "./chunk-Q27QAB4X.js";
195
213
  import {
196
214
  count,
197
215
  createTaskService,
198
216
  text,
199
217
  time
200
- } from "./chunk-CLAN3FES.js";
201
- import "./chunk-UUMUL4L3.js";
202
- import "./chunk-SDQGB4KB.js";
218
+ } from "./chunk-IBTMK5KD.js";
219
+ import "./chunk-DW23LM47.js";
220
+ import "./chunk-L433IDOX.js";
203
221
  import {
204
222
  hostFetch,
205
223
  retrying
206
- } from "./chunk-XRREFEIW.js";
207
- import "./chunk-TI46WQXQ.js";
208
- import "./chunk-E52JAS35.js";
209
- import "./chunk-5GBUCHRU.js";
224
+ } from "./chunk-WCQW4GYO.js";
225
+ import "./chunk-4DNHXRCJ.js";
226
+ import "./chunk-BAUK2MD5.js";
227
+ import "./chunk-KO4VR5NK.js";
210
228
  import {
211
229
  DESKTOP,
212
230
  IDENTITY,
213
231
  PACKAGE,
214
232
  SKILL
215
- } from "./chunk-YMCY7VRE.js";
216
- import "./chunk-H3TNVEQX.js";
217
- import "./chunk-HC5ZWE5X.js";
218
- import "./chunk-QGFX5MXL.js";
233
+ } from "./chunk-TDQJS3JG.js";
234
+ import "./chunk-TIHDBKA7.js";
219
235
  import "./chunk-EH6ZEJGT.js";
236
+ import "./chunk-WGBVRDY3.js";
237
+ import "./chunk-SEELWPRD.js";
220
238
  import {
221
239
  installerOf
222
- } from "./chunk-O3DYRCIT.js";
240
+ } from "./chunk-3I2FGNWO.js";
223
241
  import {
224
242
  fieldsOf
225
- } from "./chunk-2VGD63G6.js";
243
+ } from "./chunk-3TEFE6YU.js";
226
244
  import {
227
245
  foldName
228
- } from "./chunk-5A6ZYNAQ.js";
229
- import "./chunk-43EKCUBJ.js";
230
- import "./chunk-HZRQLAHO.js";
246
+ } from "./chunk-IQ2XZ62J.js";
247
+ import "./chunk-JP2HJXFO.js";
248
+ import "./chunk-DQB5JMTY.js";
231
249
  import {
232
250
  CRM_ACTIVITY_KINDS,
233
251
  CRM_KINDS,
@@ -235,39 +253,41 @@ import {
235
253
  DEAL_STATUSES,
236
254
  formatDecimal,
237
255
  groupDigits,
256
+ normalCrmUserId,
238
257
  parseDecimal,
239
258
  scaleOf
240
- } from "./chunk-QJW35N5V.js";
241
- import "./chunk-IMJQRPLN.js";
242
- import "./chunk-DSP36YHQ.js";
259
+ } from "./chunk-GC6FLHZF.js";
260
+ import "./chunk-NNMU2TDU.js";
261
+ import "./chunk-CBCEMFCF.js";
243
262
  import {
244
263
  SAVE_HELP,
245
264
  defineQuery,
246
265
  queryFieldsOf,
247
266
  timezoneOf,
248
267
  zonedMoment
249
- } from "./chunk-5K7QLJMM.js";
250
- import "./chunk-FPUGMDJV.js";
268
+ } from "./chunk-LT5KE44Q.js";
269
+ import "./chunk-DSRXCLPO.js";
251
270
  import "./chunk-D72URWJE.js";
252
271
  import {
253
272
  readSecret
254
- } from "./chunk-DBEQI5YM.js";
255
- import "./chunk-PPHBRESD.js";
256
- import "./chunk-65TWQ7BV.js";
257
- import "./chunk-HCAZV5NP.js";
258
- import "./chunk-DFCHHR5M.js";
273
+ } from "./chunk-ITGNDZRR.js";
274
+ import "./chunk-KVXEEKBB.js";
275
+ import "./chunk-3PEKYGZ3.js";
276
+ import "./chunk-NZGI74GS.js";
277
+ import "./chunk-JUKAIXKY.js";
259
278
  import {
260
279
  renderPretty,
261
280
  resolvePaths
262
- } from "./chunk-TBJYLC5K.js";
281
+ } from "./chunk-X5S5KUSU.js";
263
282
  import {
264
283
  isoTime
265
- } from "./chunk-TOSCB4SO.js";
284
+ } from "./chunk-J5P5VSRG.js";
266
285
  import {
267
286
  array,
268
287
  boolean,
269
288
  literal,
270
289
  nullable,
290
+ number,
271
291
  optional,
272
292
  picklist,
273
293
  record,
@@ -276,22 +296,22 @@ import {
276
296
  union,
277
297
  unknown,
278
298
  variant
279
- } from "./chunk-MVA5HVKL.js";
299
+ } from "./chunk-S4UUN6LD.js";
280
300
  import "./chunk-Y5E2WNWB.js";
281
301
  import {
282
302
  CliError,
283
303
  isCliError
284
- } from "./chunk-DB2XKHI4.js";
285
- import "./chunk-TP7GDWVF.js";
304
+ } from "./chunk-BUGROVF3.js";
305
+ import "./chunk-GRFICQTZ.js";
286
306
  import {
287
307
  __export,
288
308
  __name
289
309
  } from "./chunk-ZVVMGPBJ.js";
290
310
 
291
311
  // dist/program.js
292
- import { join as join3 } from "node:path";
312
+ import { join as join4 } from "node:path";
293
313
 
294
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/update/index.js
314
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/update/index.js
295
315
  import { realpathSync } from "node:fs";
296
316
  import { fileURLToPath } from "node:url";
297
317
  var npmRegistry = /* @__PURE__ */ __name(() => hostFetch({ hosts: ["registry.npmjs.org"] }), "npmRegistry");
@@ -381,7 +401,6 @@ var operations = [
381
401
  summary: "Retrieve contacts",
382
402
  description: "Retrieve all contacts, using query parameters to specify the information that gets returned.",
383
403
  tags: ["Basic"],
384
- security: [],
385
404
  pagination: {
386
405
  style: "cursor",
387
406
  cursor: {
@@ -480,7 +499,6 @@ var operations = [
480
499
  summary: "Create a contact",
481
500
  description: "Create a single contact. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the contact, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.",
482
501
  tags: ["Basic"],
483
- security: [],
484
502
  parameters: [],
485
503
  request: {
486
504
  required: true,
@@ -504,7 +522,6 @@ var operations = [
504
522
  summary: "Archive a batch of contacts",
505
523
  description: "Archive a batch of contacts by ID. Archived contacts can be restored within 90 days of deletion. Learn more about the [data impacted by contact deletions](https://knowledge.hubspot.com/privacy-and-consent/understand-restorable-and-permanent-contact-deletions) and how to [restore archived records](https://knowledge.hubspot.com/records/restore-deleted-records).",
506
524
  tags: ["Batch"],
507
- security: [],
508
525
  permissions: [
509
526
  {
510
527
  key: "people.delete"
@@ -529,7 +546,6 @@ var operations = [
529
546
  summary: "Create a batch of contacts",
530
547
  description: "Create a batch of contacts. The `inputs` array can contain a `properties` object to define property values for each record, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.",
531
548
  tags: ["Batch"],
532
- security: [],
533
549
  parameters: [],
534
550
  request: {
535
551
  required: true,
@@ -553,7 +569,6 @@ var operations = [
553
569
  summary: "Retrieve a batch of contacts",
554
570
  description: "Retrieve a batch of contacts by ID (`contactId`) or unique property value (`idProperty`). ",
555
571
  tags: ["Batch"],
556
- security: [],
557
572
  parameters: [
558
573
  {
559
574
  name: "archived",
@@ -588,7 +603,6 @@ var operations = [
588
603
  summary: "Update a batch of contacts",
589
604
  description: "Update a batch of contacts by ID (`contactId`) or unique property value (`idProperty`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
590
605
  tags: ["Batch"],
591
- security: [],
592
606
  parameters: [],
593
607
  request: {
594
608
  required: true,
@@ -612,7 +626,6 @@ var operations = [
612
626
  summary: "Create or update a batch of contacts",
613
627
  description: "Upsert a batch of contacts. The `inputs` array can contain a `properties` object to define property values for each record.",
614
628
  tags: ["Batch"],
615
- security: [],
616
629
  parameters: [],
617
630
  request: {
618
631
  required: true,
@@ -636,7 +649,6 @@ var operations = [
636
649
  summary: "Permanently delete a contact (GDPR-compliant)",
637
650
  description: "Permanently delete a contact and all associated content to follow GDPR. Use optional property `idProperty` set to `email` to identify contact by email address. If email address is not found, the email address will be added to a blocklist and prevent it from being used in the future. Learn more about [permanently deleting contacts](https://knowledge.hubspot.com/privacy-and-consent/how-do-i-perform-a-gdpr-delete-in-hubspot).",
638
651
  tags: ["Advanced"],
639
- security: [],
640
652
  permissions: [
641
653
  {
642
654
  key: "people.delete"
@@ -661,7 +673,6 @@ var operations = [
661
673
  summary: "Merge two contacts",
662
674
  description: "Merge two contact records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records). ",
663
675
  tags: ["Advanced"],
664
- security: [],
665
676
  permissions: [
666
677
  {
667
678
  key: "people.delete"
@@ -690,7 +701,6 @@ var operations = [
690
701
  summary: "Search for contacts",
691
702
  description: "Search for contacts by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request).",
692
703
  tags: ["Search"],
693
- security: [],
694
704
  pagination: {
695
705
  style: "cursor",
696
706
  cursor: {
@@ -727,7 +737,6 @@ var operations = [
727
737
  summary: "Retrieve a contact",
728
738
  description: "Retrieve a contact by its ID (`contactId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter.",
729
739
  tags: ["Basic"],
730
- security: [],
731
740
  parameters: [
732
741
  {
733
742
  name: "contactId",
@@ -811,7 +820,6 @@ var operations = [
811
820
  summary: "Update a contact",
812
821
  description: "Update an existing contact, identified by ID or email/unique property value. To identify a contact by ID, include the ID in the request URL path. To identify a contact by their email or other unique property, include the email/property value in the request URL path, and add the `idProperty` query parameter (`/crm/v3/objects/contacts/jon@website.com?idProperty=email`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
813
822
  tags: ["Basic"],
814
- security: [],
815
823
  parameters: [
816
824
  {
817
825
  name: "contactId",
@@ -854,7 +862,6 @@ var operations = [
854
862
  summary: "Archive a contact",
855
863
  description: "Delete a contact by ID. Deleted contacts can be restored within 90 days of deletion. Learn more about the [data impacted by contact deletions](https://knowledge.hubspot.com/privacy-and-consent/understand-restorable-and-permanent-contact-deletions) and how to [restore archived records](https://knowledge.hubspot.com/records/restore-deleted-records).",
856
864
  tags: ["Basic"],
857
- security: [],
858
865
  permissions: [
859
866
  {
860
867
  key: "people.delete"
@@ -1043,7 +1050,6 @@ var operations = [
1043
1050
  summary: "Retrieve companies",
1044
1051
  description: "Retrieve all companies, using query parameters to control the information that gets returned.",
1045
1052
  tags: ["Basic"],
1046
- security: [],
1047
1053
  pagination: {
1048
1054
  style: "cursor",
1049
1055
  cursor: {
@@ -1142,7 +1148,6 @@ var operations = [
1142
1148
  summary: "Create a company",
1143
1149
  description: "Create a single company. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.",
1144
1150
  tags: ["Basic"],
1145
- security: [],
1146
1151
  parameters: [],
1147
1152
  request: {
1148
1153
  required: true,
@@ -1166,7 +1171,6 @@ var operations = [
1166
1171
  summary: "Archive a batch of companies",
1167
1172
  description: "Delete a batch of companies by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records).",
1168
1173
  tags: ["Batch"],
1169
- security: [],
1170
1174
  permissions: [
1171
1175
  {
1172
1176
  key: "organizations.delete"
@@ -1191,7 +1195,6 @@ var operations = [
1191
1195
  summary: "Create a batch of companies",
1192
1196
  description: "Create a batch of companies. The `inputs` array can contain a `properties` object to define property values for each company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.",
1193
1197
  tags: ["Batch"],
1194
- security: [],
1195
1198
  parameters: [],
1196
1199
  request: {
1197
1200
  required: true,
@@ -1215,7 +1218,6 @@ var operations = [
1215
1218
  summary: "Retrieve a batch of companies",
1216
1219
  description: "Retrieve a batch of companies by ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter.",
1217
1220
  tags: ["Batch"],
1218
- security: [],
1219
1221
  parameters: [
1220
1222
  {
1221
1223
  name: "archived",
@@ -1250,7 +1252,6 @@ var operations = [
1250
1252
  summary: "Update a batch of companies",
1251
1253
  description: "Update a batch of companies by ID.",
1252
1254
  tags: ["Batch"],
1253
- security: [],
1254
1255
  parameters: [],
1255
1256
  request: {
1256
1257
  required: true,
@@ -1274,7 +1275,6 @@ var operations = [
1274
1275
  summary: "Create or update a batch of companies by unique property values",
1275
1276
  description: "Create or update companies identified by a unique property value as specified by the `idProperty` query parameter. `idProperty` query param refers to a property whose values are unique for the object.",
1276
1277
  tags: ["Batch"],
1277
- security: [],
1278
1278
  parameters: [],
1279
1279
  request: {
1280
1280
  required: true,
@@ -1298,7 +1298,6 @@ var operations = [
1298
1298
  summary: "Merge two companies",
1299
1299
  description: "Merge two company records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records).",
1300
1300
  tags: ["Advanced"],
1301
- security: [],
1302
1301
  permissions: [
1303
1302
  {
1304
1303
  key: "organizations.delete"
@@ -1327,7 +1326,6 @@ var operations = [
1327
1326
  summary: "Search for companies",
1328
1327
  description: "Search for companies by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request).",
1329
1328
  tags: ["Search"],
1330
- security: [],
1331
1329
  pagination: {
1332
1330
  style: "cursor",
1333
1331
  cursor: {
@@ -1364,7 +1362,6 @@ var operations = [
1364
1362
  summary: "Retrieve a company",
1365
1363
  description: "Retrieve a company by its ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter.",
1366
1364
  tags: ["Basic"],
1367
- security: [],
1368
1365
  parameters: [
1369
1366
  {
1370
1367
  name: "companyId",
@@ -1448,7 +1445,6 @@ var operations = [
1448
1445
  summary: "Update a company",
1449
1446
  description: "Update a company by ID (`companyId`) or unique property value (`idProperty`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
1450
1447
  tags: ["Basic"],
1451
- security: [],
1452
1448
  parameters: [
1453
1449
  {
1454
1450
  name: "companyId",
@@ -1491,7 +1487,6 @@ var operations = [
1491
1487
  summary: "Archive a company",
1492
1488
  description: "Delete a company by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records).",
1493
1489
  tags: ["Basic"],
1494
- security: [],
1495
1490
  permissions: [
1496
1491
  {
1497
1492
  key: "organizations.delete"
@@ -1521,7 +1516,6 @@ var operations = [
1521
1516
  summary: "List",
1522
1517
  description: "Read a page of deals. Control what is returned via the `properties` query param.",
1523
1518
  tags: ["Basic"],
1524
- security: [],
1525
1519
  pagination: {
1526
1520
  style: "cursor",
1527
1521
  cursor: {
@@ -1620,7 +1614,6 @@ var operations = [
1620
1614
  summary: "Create",
1621
1615
  description: "Create a deal with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard deals is provided.",
1622
1616
  tags: ["Basic"],
1623
- security: [],
1624
1617
  parameters: [],
1625
1618
  request: {
1626
1619
  required: true,
@@ -1644,7 +1637,6 @@ var operations = [
1644
1637
  summary: "Archive a batch of deals by ID",
1645
1638
  description: "Archive multiple deals using their IDs.",
1646
1639
  tags: ["Batch"],
1647
- security: [],
1648
1640
  permissions: [
1649
1641
  {
1650
1642
  key: "deals.delete"
@@ -1669,7 +1661,6 @@ var operations = [
1669
1661
  summary: "Create a batch of deals",
1670
1662
  description: "Create multiple deals in a single request.",
1671
1663
  tags: ["Batch"],
1672
- security: [],
1673
1664
  parameters: [],
1674
1665
  request: {
1675
1666
  required: true,
@@ -1693,7 +1684,6 @@ var operations = [
1693
1684
  summary: "Read a batch of deals by internal ID, or unique property values",
1694
1685
  description: "Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. ",
1695
1686
  tags: ["Batch"],
1696
- security: [],
1697
1687
  parameters: [
1698
1688
  {
1699
1689
  name: "archived",
@@ -1728,7 +1718,6 @@ var operations = [
1728
1718
  summary: "Update a batch of deals by internal ID, or unique property values",
1729
1719
  description: "Update multiple deals using their internal IDs or unique property values.",
1730
1720
  tags: ["Batch"],
1731
- security: [],
1732
1721
  parameters: [],
1733
1722
  request: {
1734
1723
  required: true,
@@ -1752,7 +1741,6 @@ var operations = [
1752
1741
  summary: "Create or update a batch of deals by unique property values",
1753
1742
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
1754
1743
  tags: ["Batch"],
1755
- security: [],
1756
1744
  parameters: [],
1757
1745
  request: {
1758
1746
  required: true,
@@ -1776,7 +1764,6 @@ var operations = [
1776
1764
  summary: "Merge two deals with same type",
1777
1765
  description: "Combine two deals of the same type into a single deal.",
1778
1766
  tags: ["Basic"],
1779
- security: [],
1780
1767
  permissions: [
1781
1768
  {
1782
1769
  key: "deals.delete"
@@ -1805,7 +1792,6 @@ var operations = [
1805
1792
  summary: "Search for deals using various filters and criteria to retrieve specific records.",
1806
1793
  description: "Search for deals using specified criteria and filters.",
1807
1794
  tags: ["Search"],
1808
- security: [],
1809
1795
  pagination: {
1810
1796
  style: "cursor",
1811
1797
  cursor: {
@@ -1842,7 +1828,6 @@ var operations = [
1842
1828
  summary: "Read",
1843
1829
  description: "Read an Object identified by `{dealId}`. `{dealId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
1844
1830
  tags: ["Basic"],
1845
- security: [],
1846
1831
  parameters: [
1847
1832
  {
1848
1833
  name: "dealId",
@@ -1926,7 +1911,6 @@ var operations = [
1926
1911
  summary: "Update",
1927
1912
  description: "Perform a partial update of an Object identified by `{dealId}`or optionally a unique property value as specified by the `idProperty` query param. `{dealId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
1928
1913
  tags: ["Basic"],
1929
- security: [],
1930
1914
  parameters: [
1931
1915
  {
1932
1916
  name: "dealId",
@@ -1969,7 +1953,6 @@ var operations = [
1969
1953
  summary: "Archive",
1970
1954
  description: "Move an Object identified by `{dealId}` to the recycling bin.",
1971
1955
  tags: ["Basic"],
1972
- security: [],
1973
1956
  permissions: [
1974
1957
  {
1975
1958
  key: "deals.delete"
@@ -1999,7 +1982,6 @@ var operations = [
1999
1982
  summary: "List",
2000
1983
  description: "Read a page of tickets. Control what is returned via the `properties` query param.",
2001
1984
  tags: ["Basic"],
2002
- security: [],
2003
1985
  pagination: {
2004
1986
  style: "cursor",
2005
1987
  cursor: {
@@ -2098,7 +2080,6 @@ var operations = [
2098
2080
  summary: "Create",
2099
2081
  description: "Create a ticket with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tickets is provided.",
2100
2082
  tags: ["Basic"],
2101
- security: [],
2102
2083
  parameters: [],
2103
2084
  request: {
2104
2085
  required: true,
@@ -2122,7 +2103,6 @@ var operations = [
2122
2103
  summary: "Archive a batch of tickets by ID",
2123
2104
  description: "Delete a batch of tickets by ID. Deleted tickets can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records).",
2124
2105
  tags: ["Batch"],
2125
- security: [],
2126
2106
  permissions: [
2127
2107
  {
2128
2108
  key: "tickets.delete"
@@ -2147,7 +2127,6 @@ var operations = [
2147
2127
  summary: "Create a batch of tickets",
2148
2128
  description: "Create a batch of tickets. The `inputs` array can contain a `properties` object to define property values for the ticket, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.",
2149
2129
  tags: ["Batch"],
2150
- security: [],
2151
2130
  parameters: [],
2152
2131
  request: {
2153
2132
  required: true,
@@ -2171,7 +2150,6 @@ var operations = [
2171
2150
  summary: "Read a batch of tickets by internal ID, or unique property values",
2172
2151
  description: "Retrieve a batch of tickets by ID (`ticketId`) or unique property value (`idProperty`). ",
2173
2152
  tags: ["Batch"],
2174
- security: [],
2175
2153
  parameters: [
2176
2154
  {
2177
2155
  name: "archived",
@@ -2206,7 +2184,6 @@ var operations = [
2206
2184
  summary: "Update a batch of tickets by internal ID, or unique property values",
2207
2185
  description: "Update a batch of tickets by ID (`ticketId`) or unique property value (`idProperty`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
2208
2186
  tags: ["Batch"],
2209
- security: [],
2210
2187
  parameters: [],
2211
2188
  request: {
2212
2189
  required: true,
@@ -2230,7 +2207,6 @@ var operations = [
2230
2207
  summary: "Create or update a batch of tickets by unique property values",
2231
2208
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
2232
2209
  tags: ["Batch"],
2233
- security: [],
2234
2210
  parameters: [],
2235
2211
  request: {
2236
2212
  required: true,
@@ -2254,7 +2230,6 @@ var operations = [
2254
2230
  summary: "Merge two tickets",
2255
2231
  description: "Merge two tickets, combining them into one ticket record.",
2256
2232
  tags: ["Advanced"],
2257
- security: [],
2258
2233
  permissions: [
2259
2234
  {
2260
2235
  key: "tickets.delete"
@@ -2283,7 +2258,6 @@ var operations = [
2283
2258
  summary: "Search for tickets",
2284
2259
  description: "Search for tickets by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request).",
2285
2260
  tags: ["Search"],
2286
- security: [],
2287
2261
  pagination: {
2288
2262
  style: "cursor",
2289
2263
  cursor: {
@@ -2320,7 +2294,6 @@ var operations = [
2320
2294
  summary: "Read",
2321
2295
  description: "Read an Object identified by `{ticketId}`. `{ticketId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
2322
2296
  tags: ["Basic"],
2323
- security: [],
2324
2297
  parameters: [
2325
2298
  {
2326
2299
  name: "ticketId",
@@ -2404,7 +2377,6 @@ var operations = [
2404
2377
  summary: "Update",
2405
2378
  description: "Perform a partial update of an Object identified by `{ticketId}`or optionally a unique property value as specified by the `idProperty` query param. `{ticketId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
2406
2379
  tags: ["Basic"],
2407
- security: [],
2408
2380
  parameters: [
2409
2381
  {
2410
2382
  name: "ticketId",
@@ -2447,7 +2419,6 @@ var operations = [
2447
2419
  summary: "Archive",
2448
2420
  description: "Move an Object identified by `{ticketId}` to the recycling bin.",
2449
2421
  tags: ["Basic"],
2450
- security: [],
2451
2422
  permissions: [
2452
2423
  {
2453
2424
  key: "tickets.delete"
@@ -2477,7 +2448,6 @@ var operations = [
2477
2448
  summary: "List",
2478
2449
  description: "Read a page of leads. Control what is returned via the `properties` query param.",
2479
2450
  tags: ["Basic"],
2480
- security: [],
2481
2451
  pagination: {
2482
2452
  style: "cursor",
2483
2453
  cursor: {
@@ -2576,7 +2546,6 @@ var operations = [
2576
2546
  summary: "Create",
2577
2547
  description: "Create a lead with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard leads is provided.",
2578
2548
  tags: ["Basic"],
2579
- security: [],
2580
2549
  parameters: [],
2581
2550
  request: {
2582
2551
  required: true,
@@ -2600,7 +2569,6 @@ var operations = [
2600
2569
  summary: "Archive a batch of leads by ID",
2601
2570
  description: "Archive multiple leads by their IDs in a single request, moving them to the recycling bin.",
2602
2571
  tags: ["Batch"],
2603
- security: [],
2604
2572
  permissions: [
2605
2573
  {
2606
2574
  key: "leads.delete"
@@ -2625,7 +2593,6 @@ var operations = [
2625
2593
  summary: "Create a batch of leads",
2626
2594
  description: "Create multiple lead records in a single request by providing a batch of lead data. This endpoint allows for efficient creation of leads by processing them together, which can be useful for syncing data from other systems or importing large datasets.",
2627
2595
  tags: ["Batch"],
2628
- security: [],
2629
2596
  parameters: [],
2630
2597
  request: {
2631
2598
  required: true,
@@ -2649,7 +2616,6 @@ var operations = [
2649
2616
  summary: "Read a batch of leads by internal ID, or unique property values",
2650
2617
  description: "Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. ",
2651
2618
  tags: ["Batch"],
2652
- security: [],
2653
2619
  parameters: [
2654
2620
  {
2655
2621
  name: "archived",
@@ -2684,7 +2650,6 @@ var operations = [
2684
2650
  summary: "Update a batch of leads by internal ID, or unique property values",
2685
2651
  description: "Update multiple lead records using their internal IDs or unique property values. This endpoint allows batch processing of updates, where each lead's properties can be modified based on the provided input. Ensure that the properties being updated exist on the lead objects to avoid errors.",
2686
2652
  tags: ["Batch"],
2687
- security: [],
2688
2653
  parameters: [],
2689
2654
  request: {
2690
2655
  required: true,
@@ -2708,7 +2673,6 @@ var operations = [
2708
2673
  summary: "Create or update a batch of leads by unique property values",
2709
2674
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
2710
2675
  tags: ["Batch"],
2711
- security: [],
2712
2676
  parameters: [],
2713
2677
  request: {
2714
2678
  required: true,
@@ -2732,7 +2696,6 @@ var operations = [
2732
2696
  summary: "Search for leads using specified criteria.",
2733
2697
  description: "Perform a search for leads based on the provided filter groups, properties, and sorting options. The request allows for pagination and can return up to 200 results per page.",
2734
2698
  tags: ["Search"],
2735
- security: [],
2736
2699
  pagination: {
2737
2700
  style: "cursor",
2738
2701
  cursor: {
@@ -2769,7 +2732,6 @@ var operations = [
2769
2732
  summary: "Read",
2770
2733
  description: "Read an Object identified by `{leadsId}`. `{leadsId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
2771
2734
  tags: ["Basic"],
2772
- security: [],
2773
2735
  parameters: [
2774
2736
  {
2775
2737
  name: "leadsId",
@@ -2853,7 +2815,6 @@ var operations = [
2853
2815
  summary: "Update",
2854
2816
  description: "Perform a partial update of an Object identified by `{leadsId}`or optionally a unique property value as specified by the `idProperty` query param. `{leadsId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
2855
2817
  tags: ["Basic"],
2856
- security: [],
2857
2818
  parameters: [
2858
2819
  {
2859
2820
  name: "leadsId",
@@ -2896,7 +2857,6 @@ var operations = [
2896
2857
  summary: "Archive",
2897
2858
  description: "Move an Object identified by `{leadsId}` to the recycling bin.",
2898
2859
  tags: ["Basic"],
2899
- security: [],
2900
2860
  permissions: [
2901
2861
  {
2902
2862
  key: "leads.delete"
@@ -2926,7 +2886,6 @@ var operations = [
2926
2886
  summary: "List",
2927
2887
  description: "Read a page of notes. Control what is returned via the `properties` query param.",
2928
2888
  tags: ["Basic"],
2929
- security: [],
2930
2889
  pagination: {
2931
2890
  style: "cursor",
2932
2891
  cursor: {
@@ -3025,7 +2984,6 @@ var operations = [
3025
2984
  summary: "Create",
3026
2985
  description: "Create a note with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard notes is provided.",
3027
2986
  tags: ["Basic"],
3028
- security: [],
3029
2987
  parameters: [],
3030
2988
  request: {
3031
2989
  required: true,
@@ -3049,7 +3007,6 @@ var operations = [
3049
3007
  summary: "Archive a batch of notes by ID",
3050
3008
  description: "Archive multiple notes by their IDs in a single request. This operation moves the specified notes to the recycling bin, making them inaccessible from regular queries.",
3051
3009
  tags: ["Batch"],
3052
- security: [],
3053
3010
  permissions: [
3054
3011
  {
3055
3012
  key: "notes.delete"
@@ -3074,7 +3031,6 @@ var operations = [
3074
3031
  summary: "Create a batch of notes",
3075
3032
  description: "Create multiple notes in a single request by providing the necessary properties for each note. This operation returns the created notes with their unique identifiers.",
3076
3033
  tags: ["Batch"],
3077
- security: [],
3078
3034
  parameters: [],
3079
3035
  request: {
3080
3036
  required: true,
@@ -3098,7 +3054,6 @@ var operations = [
3098
3054
  summary: "Read a batch of notes by internal ID, or unique property values",
3099
3055
  description: "Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. ",
3100
3056
  tags: ["Batch"],
3101
- security: [],
3102
3057
  parameters: [
3103
3058
  {
3104
3059
  name: "archived",
@@ -3133,7 +3088,6 @@ var operations = [
3133
3088
  summary: "Update a batch of notes by internal ID, or unique property values",
3134
3089
  description: "Update multiple notes using their internal IDs or unique property values. This operation allows you to modify the properties of several notes in a single request, streamlining the process of managing note data in bulk.",
3135
3090
  tags: ["Batch"],
3136
- security: [],
3137
3091
  parameters: [],
3138
3092
  request: {
3139
3093
  required: true,
@@ -3157,7 +3111,6 @@ var operations = [
3157
3111
  summary: "Create or update a batch of notes by unique property values",
3158
3112
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
3159
3113
  tags: ["Batch"],
3160
- security: [],
3161
3114
  parameters: [],
3162
3115
  request: {
3163
3116
  required: true,
@@ -3181,7 +3134,6 @@ var operations = [
3181
3134
  summary: "Search for notes based on specified criteria.",
3182
3135
  description: "Execute a search for notes using filters, sorting options, and other query parameters to refine the results. This endpoint allows for complex queries to locate specific notes within the CRM system.",
3183
3136
  tags: ["Search"],
3184
- security: [],
3185
3137
  pagination: {
3186
3138
  style: "cursor",
3187
3139
  cursor: {
@@ -3218,7 +3170,6 @@ var operations = [
3218
3170
  summary: "Read",
3219
3171
  description: "Read an Object identified by `{noteId}`. `{noteId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
3220
3172
  tags: ["Basic"],
3221
- security: [],
3222
3173
  parameters: [
3223
3174
  {
3224
3175
  name: "noteId",
@@ -3302,7 +3253,6 @@ var operations = [
3302
3253
  summary: "Update",
3303
3254
  description: "Perform a partial update of an Object identified by `{noteId}`or optionally a unique property value as specified by the `idProperty` query param. `{noteId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
3304
3255
  tags: ["Basic"],
3305
- security: [],
3306
3256
  parameters: [
3307
3257
  {
3308
3258
  name: "noteId",
@@ -3345,7 +3295,6 @@ var operations = [
3345
3295
  summary: "Archive",
3346
3296
  description: "Move an Object identified by `{noteId}` to the recycling bin.",
3347
3297
  tags: ["Basic"],
3348
- security: [],
3349
3298
  permissions: [
3350
3299
  {
3351
3300
  key: "notes.delete"
@@ -3375,7 +3324,6 @@ var operations = [
3375
3324
  summary: "List",
3376
3325
  description: "Read a page of calls. Control what is returned via the `properties` query param.",
3377
3326
  tags: ["Basic"],
3378
- security: [],
3379
3327
  pagination: {
3380
3328
  style: "cursor",
3381
3329
  cursor: {
@@ -3474,7 +3422,6 @@ var operations = [
3474
3422
  summary: "Create",
3475
3423
  description: "Create a call with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard calls is provided.",
3476
3424
  tags: ["Basic"],
3477
- security: [],
3478
3425
  parameters: [],
3479
3426
  request: {
3480
3427
  required: true,
@@ -3498,7 +3445,6 @@ var operations = [
3498
3445
  summary: "Archive a batch of calls by ID",
3499
3446
  description: "Archive a batch of calls by ID. Deleted calls can be restored within 90 days of being deleted, but call recordings recording will be permanently deleted. Learn more about [restoring activity records](https://knowledge.hubspot.com/records/restore-deleted-activity-in-a-record).",
3500
3447
  tags: ["Batch"],
3501
- security: [],
3502
3448
  permissions: [
3503
3449
  {
3504
3450
  key: "calls.delete"
@@ -3523,7 +3469,6 @@ var operations = [
3523
3469
  summary: "Create a batch of calls",
3524
3470
  description: "Create a batch of calls. The `inputs` array can contain a `properties` object to define property values for each record, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.",
3525
3471
  tags: ["Batch"],
3526
- security: [],
3527
3472
  parameters: [],
3528
3473
  request: {
3529
3474
  required: true,
@@ -3547,7 +3492,6 @@ var operations = [
3547
3492
  summary: "Read a batch of calls by internal ID, or unique property values",
3548
3493
  description: "Retrieve a batch of calls by ID.",
3549
3494
  tags: ["Batch"],
3550
- security: [],
3551
3495
  parameters: [
3552
3496
  {
3553
3497
  name: "archived",
@@ -3582,7 +3526,6 @@ var operations = [
3582
3526
  summary: "Update a batch of calls by internal ID, or unique property values",
3583
3527
  description: "Update a batch of calls by ID.",
3584
3528
  tags: ["Batch"],
3585
- security: [],
3586
3529
  parameters: [],
3587
3530
  request: {
3588
3531
  required: true,
@@ -3606,7 +3549,6 @@ var operations = [
3606
3549
  summary: "Create or update a batch of calls by unique property values",
3607
3550
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
3608
3551
  tags: ["Batch"],
3609
- security: [],
3610
3552
  parameters: [],
3611
3553
  request: {
3612
3554
  required: true,
@@ -3630,7 +3572,6 @@ var operations = [
3630
3572
  summary: "Search for calls",
3631
3573
  description: "Search for calls by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request).",
3632
3574
  tags: ["Search"],
3633
- security: [],
3634
3575
  pagination: {
3635
3576
  style: "cursor",
3636
3577
  cursor: {
@@ -3667,7 +3608,6 @@ var operations = [
3667
3608
  summary: "Read",
3668
3609
  description: "Read an Object identified by `{callId}`. `{callId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
3669
3610
  tags: ["Basic"],
3670
- security: [],
3671
3611
  parameters: [
3672
3612
  {
3673
3613
  name: "callId",
@@ -3751,7 +3691,6 @@ var operations = [
3751
3691
  summary: "Update",
3752
3692
  description: "Perform a partial update of an Object identified by `{callId}`or optionally a unique property value as specified by the `idProperty` query param. `{callId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
3753
3693
  tags: ["Basic"],
3754
- security: [],
3755
3694
  parameters: [
3756
3695
  {
3757
3696
  name: "callId",
@@ -3794,7 +3733,6 @@ var operations = [
3794
3733
  summary: "Archive",
3795
3734
  description: "Move an Object identified by `{callId}` to the recycling bin.",
3796
3735
  tags: ["Basic"],
3797
- security: [],
3798
3736
  permissions: [
3799
3737
  {
3800
3738
  key: "calls.delete"
@@ -3824,7 +3762,6 @@ var operations = [
3824
3762
  summary: "List",
3825
3763
  description: "Read a page of emails. Control what is returned via the `properties` query param.",
3826
3764
  tags: ["Basic"],
3827
- security: [],
3828
3765
  pagination: {
3829
3766
  style: "cursor",
3830
3767
  cursor: {
@@ -3923,7 +3860,6 @@ var operations = [
3923
3860
  summary: "Create",
3924
3861
  description: "Create a email with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard emails is provided.",
3925
3862
  tags: ["Basic"],
3926
- security: [],
3927
3863
  parameters: [],
3928
3864
  request: {
3929
3865
  required: true,
@@ -3947,7 +3883,6 @@ var operations = [
3947
3883
  summary: "Archive a batch of emails by ID",
3948
3884
  description: "Archive a batch of emails identified by their IDs.",
3949
3885
  tags: ["Batch"],
3950
- security: [],
3951
3886
  permissions: [
3952
3887
  {
3953
3888
  key: "emails.delete"
@@ -3972,7 +3907,6 @@ var operations = [
3972
3907
  summary: "Create a batch of emails",
3973
3908
  description: "Create a batch of emails with specified properties and return the created objects.",
3974
3909
  tags: ["Batch"],
3975
- security: [],
3976
3910
  parameters: [],
3977
3911
  request: {
3978
3912
  required: true,
@@ -3996,7 +3930,6 @@ var operations = [
3996
3930
  summary: "Read a batch of emails by internal ID, or unique property values",
3997
3931
  description: "Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. ",
3998
3932
  tags: ["Batch"],
3999
- security: [],
4000
3933
  parameters: [
4001
3934
  {
4002
3935
  name: "archived",
@@ -4031,7 +3964,6 @@ var operations = [
4031
3964
  summary: "Update a batch of emails by internal ID, or unique property values",
4032
3965
  description: "Update a batch of emails using their internal IDs or unique property values.",
4033
3966
  tags: ["Batch"],
4034
- security: [],
4035
3967
  parameters: [],
4036
3968
  request: {
4037
3969
  required: true,
@@ -4055,7 +3987,6 @@ var operations = [
4055
3987
  summary: "Create or update a batch of emails by unique property values",
4056
3988
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
4057
3989
  tags: ["Batch"],
4058
- security: [],
4059
3990
  parameters: [],
4060
3991
  request: {
4061
3992
  required: true,
@@ -4079,7 +4010,6 @@ var operations = [
4079
4010
  summary: "Search for emails using specified criteria and filters.",
4080
4011
  description: "Perform a search for emails based on the provided query parameters and return matching results.",
4081
4012
  tags: ["Search"],
4082
- security: [],
4083
4013
  pagination: {
4084
4014
  style: "cursor",
4085
4015
  cursor: {
@@ -4116,7 +4046,6 @@ var operations = [
4116
4046
  summary: "Read",
4117
4047
  description: "Read an Object identified by `{emailId}`. `{emailId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
4118
4048
  tags: ["Basic"],
4119
- security: [],
4120
4049
  parameters: [
4121
4050
  {
4122
4051
  name: "emailId",
@@ -4200,7 +4129,6 @@ var operations = [
4200
4129
  summary: "Update",
4201
4130
  description: "Perform a partial update of an Object identified by `{emailId}`or optionally a unique property value as specified by the `idProperty` query param. `{emailId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
4202
4131
  tags: ["Basic"],
4203
- security: [],
4204
4132
  parameters: [
4205
4133
  {
4206
4134
  name: "emailId",
@@ -4243,7 +4171,6 @@ var operations = [
4243
4171
  summary: "Archive",
4244
4172
  description: "Move an Object identified by `{emailId}` to the recycling bin.",
4245
4173
  tags: ["Basic"],
4246
- security: [],
4247
4174
  permissions: [
4248
4175
  {
4249
4176
  key: "emails.delete"
@@ -4273,7 +4200,6 @@ var operations = [
4273
4200
  summary: "List",
4274
4201
  description: "Read a page of meetings. Control what is returned via the `properties` query param.",
4275
4202
  tags: ["Basic"],
4276
- security: [],
4277
4203
  pagination: {
4278
4204
  style: "cursor",
4279
4205
  cursor: {
@@ -4372,7 +4298,6 @@ var operations = [
4372
4298
  summary: "Create",
4373
4299
  description: "Create a meeting with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard meetings is provided.",
4374
4300
  tags: ["Basic"],
4375
- security: [],
4376
4301
  parameters: [],
4377
4302
  request: {
4378
4303
  required: true,
@@ -4396,7 +4321,6 @@ var operations = [
4396
4321
  summary: "Archive a batch of meetings by ID",
4397
4322
  description: "Delete a batch of meetings by ID.",
4398
4323
  tags: ["Batch"],
4399
- security: [],
4400
4324
  permissions: [
4401
4325
  {
4402
4326
  key: "meetings.delete"
@@ -4421,7 +4345,6 @@ var operations = [
4421
4345
  summary: "Create a batch of meetings",
4422
4346
  description: "Create a batch of meetings. The `inputs` array can contain a `properties` object to define property values for the record, along with an `associations` array to define relationships with other object records.",
4423
4347
  tags: ["Batch"],
4424
- security: [],
4425
4348
  parameters: [],
4426
4349
  request: {
4427
4350
  required: true,
@@ -4445,7 +4368,6 @@ var operations = [
4445
4368
  summary: "Read a batch of meetings by internal ID, or unique property values",
4446
4369
  description: "Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. ",
4447
4370
  tags: ["Batch"],
4448
- security: [],
4449
4371
  parameters: [
4450
4372
  {
4451
4373
  name: "archived",
@@ -4480,7 +4402,6 @@ var operations = [
4480
4402
  summary: "Update a batch of meetings by internal ID, or unique property values",
4481
4403
  description: "Update a batch of meetings by ID (`objectId`) or unique property value (`idProperty`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
4482
4404
  tags: ["Batch"],
4483
- security: [],
4484
4405
  parameters: [],
4485
4406
  request: {
4486
4407
  required: true,
@@ -4504,7 +4425,6 @@ var operations = [
4504
4425
  summary: "Create or update a batch of meetings by unique property values",
4505
4426
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
4506
4427
  tags: ["Batch"],
4507
- security: [],
4508
4428
  parameters: [],
4509
4429
  request: {
4510
4430
  required: true,
@@ -4528,7 +4448,6 @@ var operations = [
4528
4448
  summary: "Search for meetings",
4529
4449
  description: "Search for meetings by filtering on properties, searching through associations, and sorting results.",
4530
4450
  tags: ["Search"],
4531
- security: [],
4532
4451
  pagination: {
4533
4452
  style: "cursor",
4534
4453
  cursor: {
@@ -4565,7 +4484,6 @@ var operations = [
4565
4484
  summary: "Read",
4566
4485
  description: "Read an Object identified by `{meetingId}`. `{meetingId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
4567
4486
  tags: ["Basic"],
4568
- security: [],
4569
4487
  parameters: [
4570
4488
  {
4571
4489
  name: "meetingId",
@@ -4649,7 +4567,6 @@ var operations = [
4649
4567
  summary: "Update",
4650
4568
  description: "Perform a partial update of an Object identified by `{meetingId}`or optionally a unique property value as specified by the `idProperty` query param. `{meetingId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
4651
4569
  tags: ["Basic"],
4652
- security: [],
4653
4570
  parameters: [
4654
4571
  {
4655
4572
  name: "meetingId",
@@ -4692,7 +4609,6 @@ var operations = [
4692
4609
  summary: "Archive",
4693
4610
  description: "Move an Object identified by `{meetingId}` to the recycling bin.",
4694
4611
  tags: ["Basic"],
4695
- security: [],
4696
4612
  permissions: [
4697
4613
  {
4698
4614
  key: "meetings.delete"
@@ -4722,7 +4638,6 @@ var operations = [
4722
4638
  summary: "List",
4723
4639
  description: "Read a page of tasks. Control what is returned via the `properties` query param.",
4724
4640
  tags: ["Basic"],
4725
- security: [],
4726
4641
  pagination: {
4727
4642
  style: "cursor",
4728
4643
  cursor: {
@@ -4821,7 +4736,6 @@ var operations = [
4821
4736
  summary: "Create",
4822
4737
  description: "Create a task with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tasks is provided.",
4823
4738
  tags: ["Basic"],
4824
- security: [],
4825
4739
  parameters: [],
4826
4740
  request: {
4827
4741
  required: true,
@@ -4845,7 +4759,6 @@ var operations = [
4845
4759
  summary: "Archive a batch of tasks by ID",
4846
4760
  description: "Archive a batch of tasks by their IDs, moving them to the recycling bin. This operation requires a list of task IDs to be provided in the request body.",
4847
4761
  tags: ["Batch"],
4848
- security: [],
4849
4762
  permissions: [
4850
4763
  {
4851
4764
  key: "tasks.delete"
@@ -4870,7 +4783,6 @@ var operations = [
4870
4783
  summary: "Create a batch of tasks",
4871
4784
  description: "Create multiple tasks in a single request by providing a batch of task properties and associations. This endpoint allows for efficient task creation by processing multiple tasks together.",
4872
4785
  tags: ["Batch"],
4873
- security: [],
4874
4786
  parameters: [],
4875
4787
  request: {
4876
4788
  required: true,
@@ -4894,7 +4806,6 @@ var operations = [
4894
4806
  summary: "Read a batch of tasks by internal ID, or unique property values",
4895
4807
  description: "Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. ",
4896
4808
  tags: ["Batch"],
4897
- security: [],
4898
4809
  parameters: [
4899
4810
  {
4900
4811
  name: "archived",
@@ -4929,7 +4840,6 @@ var operations = [
4929
4840
  summary: "Update a batch of tasks by internal ID, or unique property values",
4930
4841
  description: "Update multiple tasks in a single request using their internal IDs or unique property values. This operation allows you to modify the properties of each task in the batch, ensuring efficient management of task data.",
4931
4842
  tags: ["Batch"],
4932
- security: [],
4933
4843
  parameters: [],
4934
4844
  request: {
4935
4845
  required: true,
@@ -4953,7 +4863,6 @@ var operations = [
4953
4863
  summary: "Create or update a batch of tasks by unique property values",
4954
4864
  description: "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.",
4955
4865
  tags: ["Batch"],
4956
- security: [],
4957
4866
  parameters: [],
4958
4867
  request: {
4959
4868
  required: true,
@@ -4977,7 +4886,6 @@ var operations = [
4977
4886
  summary: "Search for tasks using specified criteria.",
4978
4887
  description: "Execute a search for tasks based on the provided criteria, including filters, properties, and sorting options. This allows for retrieving tasks that match specific conditions or property values.",
4979
4888
  tags: ["Search"],
4980
- security: [],
4981
4889
  pagination: {
4982
4890
  style: "cursor",
4983
4891
  cursor: {
@@ -5014,7 +4922,6 @@ var operations = [
5014
4922
  summary: "Read",
5015
4923
  description: "Read an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.",
5016
4924
  tags: ["Basic"],
5017
- security: [],
5018
4925
  parameters: [
5019
4926
  {
5020
4927
  name: "taskId",
@@ -5098,7 +5005,6 @@ var operations = [
5098
5005
  summary: "Update",
5099
5006
  description: "Perform a partial update of an Object identified by `{taskId}`or optionally a unique property value as specified by the `idProperty` query param. `{taskId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.",
5100
5007
  tags: ["Basic"],
5101
- security: [],
5102
5008
  parameters: [
5103
5009
  {
5104
5010
  name: "taskId",
@@ -5141,7 +5047,6 @@ var operations = [
5141
5047
  summary: "Archive",
5142
5048
  description: "Move an Object identified by `{taskId}` to the recycling bin.",
5143
5049
  tags: ["Basic"],
5144
- security: [],
5145
5050
  permissions: [
5146
5051
  {
5147
5052
  key: "tasks.delete"
@@ -6944,12 +6849,8 @@ var bodyPermissions = Object.fromEntries(operations.filter(offered).flatMap((ope
6944
6849
  var API = {
6945
6850
  manifest: {
6946
6851
  ...manifest_exports,
6947
- operations: operations.filter(offered).map(({ security: security2, ...operation }) => ({
6852
+ operations: operations.filter(offered).map((operation) => ({
6948
6853
  ...operation,
6949
- // The object specs mark 115 operations `security: []`, which reads as "no sign-in", and the generator's `auth`
6950
- // keeps it: such an operation went out without the token and HubSpot answered 401. Left out, the manifest's
6951
- // bearer token applies, as on every other operation.
6952
- ...security2?.length ? { security: security2 } : {},
6953
6854
  permissions: [
6954
6855
  ...operation.permissions ?? [],
6955
6856
  ...keysOf(operation),
@@ -7322,12 +7223,12 @@ var apiCommand = /* @__PURE__ */ __name(() => {
7322
7223
  timeZone: sent.timeZone
7323
7224
  }), "failure"),
7324
7225
  token: tokenOf,
7325
- schemas: /* @__PURE__ */ __name(() => import("./schemas-JRL3DLMP.js").then((module) => module.schemas), "schemas"),
7226
+ schemas: /* @__PURE__ */ __name(() => import("./schemas-QLQ2K6DL.js").then((module) => module.schemas), "schemas"),
7326
7227
  definitions: /* @__PURE__ */ __name(() => import("./definitions-MVPICAWV.js").then((module) => module.definitions), "definitions")
7327
7228
  });
7328
7229
  }, "apiCommand");
7329
7230
 
7330
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/stage-tasks.js
7231
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/stage-tasks.js
7331
7232
  var DAY = 864e5;
7332
7233
  var openStageTasks = /* @__PURE__ */ __name(async (store, account, now, { history = false } = {}) => {
7333
7234
  const rules = await store.crm.stageTasks(account);
@@ -7364,7 +7265,7 @@ var openStageTasks = /* @__PURE__ */ __name(async (store, account, now, { histor
7364
7265
  return opened;
7365
7266
  }, "openStageTasks");
7366
7267
 
7367
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/digest.js
7268
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/digest.js
7368
7269
  var HOUR = 36e5;
7369
7270
  var STALE_HOURS = 24;
7370
7271
  var WORDS = {
@@ -7507,7 +7408,7 @@ var healthOf = /* @__PURE__ */ __name(async (store, account, { now, profile }) =
7507
7408
  return stale > STALE_HOURS ? [{ ...named, stale_hours: Math.floor(stale) }] : [];
7508
7409
  }, "healthOf");
7509
7410
 
7510
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/csv.js
7411
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/csv.js
7511
7412
  var csvFormatOption = /* @__PURE__ */ __name(() => annotateOption(new Option("--format <format>", "csv: this page as a table for a spreadsheet; --json=a,b picks its columns").choices(["csv"]), { mcp: false }), "csvFormatOption");
7512
7413
  var DEAL_CSV_COLUMNS = [
7513
7414
  "ref",
@@ -7556,14 +7457,14 @@ var customColumns = /* @__PURE__ */ __name((field, header) => {
7556
7457
  ];
7557
7458
  }, "customColumns");
7558
7459
  var customFieldsOf = /* @__PURE__ */ __name((page) => {
7559
- const listed = new Set(page.fields.map((field) => field.code));
7460
+ const listed2 = new Set(page.fields.map((field) => field.code));
7560
7461
  const extra = /* @__PURE__ */ new Map();
7561
7462
  for (const item of page.items) {
7562
7463
  const metadata2 = item.provider_metadata;
7563
7464
  if (!isRecord3(metadata2))
7564
7465
  continue;
7565
7466
  for (const [code, value] of Object.entries(metadata2))
7566
- if (!listed.has(code) && !extra.has(code)) {
7467
+ if (!listed2.has(code) && !extra.has(code)) {
7567
7468
  const label = isRecord3(value) && typeof value.label === "string" ? value.label : null;
7568
7469
  extra.set(code, { code, label, type: "string" });
7569
7470
  }
@@ -7615,10 +7516,10 @@ var printCsv = /* @__PURE__ */ __name((command, page, paths) => {
7615
7516
  if (page.hasMore)
7616
7517
  renderer.note(`\u2192 more rows: run it again with --page ${page.page + 1}`);
7617
7518
  }, "printCsv");
7618
- var renderCsv = /* @__PURE__ */ __name((command, open, read, defaults = DEAL_CSV_COLUMNS) => {
7519
+ var renderCsv = /* @__PURE__ */ __name((command, open2, read, defaults = DEAL_CSV_COLUMNS) => {
7619
7520
  refuseCsvConflict(command);
7620
7521
  return inCommandRun(command, async () => {
7621
- const run3 = await open(command, { readOnly: true });
7522
+ const run3 = await open2(command, { readOnly: true });
7622
7523
  let page;
7623
7524
  try {
7624
7525
  page = await read(run3);
@@ -7629,7 +7530,7 @@ var renderCsv = /* @__PURE__ */ __name((command, open, read, defaults = DEAL_CSV
7629
7530
  });
7630
7531
  }, "renderCsv");
7631
7532
 
7632
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/records.js
7533
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/records.js
7633
7534
  var time2 = nullable(isoTime);
7634
7535
  var metadata = optional(record(string(), strictObject({
7635
7536
  label: nullable(string()),
@@ -7796,7 +7697,7 @@ var sourceWith = /* @__PURE__ */ __name((run3, method, what) => {
7796
7697
  }, "sourceWith");
7797
7698
  var addCrmRecordCommands = /* @__PURE__ */ __name((program, options) => {
7798
7699
  const { within, example } = options;
7799
- const quotaOf = /* @__PURE__ */ __name((run3) => foreignContacts(run3.source(), async () => {
7700
+ const quotaOf2 = /* @__PURE__ */ __name((run3) => foreignContacts(run3.source(), async () => {
7800
7701
  const self = run3.source().self;
7801
7702
  return foreignContactsPathFor(options.app, run3.account, run3.env, self ? String(await self()) : void 0);
7802
7703
  }, { now: options.now }), "quotaOf");
@@ -7828,7 +7729,7 @@ var addCrmRecordCommands = /* @__PURE__ */ __name((program, options) => {
7828
7729
  limit: opts.limit,
7829
7730
  page: opts.page
7830
7731
  });
7831
- const shown = await quotaOf(run3).strip(noun.kind, page.items);
7732
+ const shown = await quotaOf2(run3).strip(noun.kind, page.items);
7832
7733
  return { items: shown.map(noun.of), fields, hasMore: page.hasMore };
7833
7734
  }, "read");
7834
7735
  if (csv)
@@ -7850,7 +7751,7 @@ var addCrmRecordCommands = /* @__PURE__ */ __name((program, options) => {
7850
7751
  example(answerEntity(annotate(group.command("show"), { effects: REMOTE_READ, offline: false }), noun.entity, noun.schema).description(`one of the CRM's ${noun.what}, read live, with its phones and e-mails; one that is not your client counts toward the day's limit when the CRM sets one`).argument(`<${noun.kind}>`, `the CRM's id of the ${noun.kind}, as list prints it, or its exact name`), `${noun.noun} show 42`, `${noun.noun} show "Anna Example" --json`).action(async (given, _opts, command) => {
7851
7752
  await within(command, async (run3) => {
7852
7753
  const found = await recordNamed(run3, noun, given);
7853
- await quotaOf(run3).spend(noun.kind, found);
7754
+ await quotaOf2(run3).spend(noun.kind, found);
7854
7755
  return itemOf(noun.of(found));
7855
7756
  });
7856
7757
  });
@@ -7998,7 +7899,7 @@ var addRecordWrites = /* @__PURE__ */ __name((group, noun, { within, example, wr
7998
7899
  }, "addRecordWrites");
7999
7900
  var idOf = /* @__PURE__ */ __name((opts) => opts.operationId === void 0 ? {} : { operationId: opts.operationId }, "idOf");
8000
7901
 
8001
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/activities.js
7902
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/activities.js
8002
7903
  var MOST2 = 500;
8003
7904
  var nullableText = nullable(text);
8004
7905
  var REFS = ["deal", "lead", "person", "organization"];
@@ -8111,7 +8012,7 @@ var addCrmActivityCommands = /* @__PURE__ */ __name((program, options) => {
8111
8012
  }, "addCrmActivityCommands");
8112
8013
  var refOf = /* @__PURE__ */ __name((kind, value) => value.includes(":") ? value : `${kind}:${value}`, "refOf");
8113
8014
 
8114
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/changes.js
8015
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/changes.js
8115
8016
  var MOST3 = 500;
8116
8017
  var DAY2 = 864e5;
8117
8018
  var nullableText2 = nullable(text);
@@ -8330,7 +8231,544 @@ var pipelineOf2 = /* @__PURE__ */ __name(async (run3, value) => {
8330
8231
  }) : new CliError("not_found", `no pipeline ${value} in this account`, { reason: "pipeline.not-found" });
8331
8232
  }, "pipelineOf");
8332
8233
 
8333
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/pipeline-view.js
8234
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/files.js
8235
+ import { createHash } from "node:crypto";
8236
+ import { chmodSync, constants, copyFileSync, existsSync, linkSync, mkdirSync, readFileSync as readFileSync2, renameSync, rmSync } from "node:fs";
8237
+ import { open } from "node:fs/promises";
8238
+ import { join as join2, resolve, sep } from "node:path";
8239
+ var MB = 1024 * 1024;
8240
+ var PAGE = 500;
8241
+ var DAY3 = 24 * 60 * 60 * 1e3;
8242
+ var DOWNLOAD_MB = 100;
8243
+ var MOST_DOWNLOAD_MB = 2048;
8244
+ var SHOWN_TEXT = 4e3;
8245
+ var FILES_ROUND = "crm:files-round";
8246
+ var FILES_DOWNLOAD_KEY = "files.download";
8247
+ var SKIP_REASONS = ["too-large", "run-files", "run-mb", "deadline", "disk-full", "unavailable"];
8248
+ var crmFile = strictObject({
8249
+ id: string(),
8250
+ name: string(),
8251
+ size: nullable(number()),
8252
+ mime: nullable(string()),
8253
+ created_at: nullable(string()),
8254
+ owner: strictObject({ kind: string(), id: string() }),
8255
+ source: string(),
8256
+ downloaded: boolean(),
8257
+ path: nullable(string()),
8258
+ untrusted: array(string())
8259
+ });
8260
+ var crmFileDownload = strictObject({
8261
+ ...crmFile.entries,
8262
+ text_status: string(),
8263
+ text: nullable(string()),
8264
+ text_truncated: boolean()
8265
+ });
8266
+ var crmFilesSync = strictObject({
8267
+ owners: number(),
8268
+ downloaded: array(strictObject({ id: string(), name: string(), size: number(), path: string(), text_status: string() })),
8269
+ skipped: array(strictObject({
8270
+ id: string(),
8271
+ name: string(),
8272
+ size: nullable(number()),
8273
+ reason: picklist(SKIP_REASONS),
8274
+ step: string()
8275
+ })),
8276
+ complete: boolean(),
8277
+ stopped: optional(picklist(SKIP_REASONS)),
8278
+ untrusted: array(string())
8279
+ });
8280
+ var OWNER_FLAGS = [
8281
+ ["deal", "--deal <id>"],
8282
+ ["lead", "--lead <id>"],
8283
+ ["person", "--person <id>"],
8284
+ ["organization", "--organization <id>"]
8285
+ ];
8286
+ var iso4 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
8287
+ var segment = /* @__PURE__ */ __name((text2) => text2.replace(/[^\w.-]+/gu, "_"), "segment");
8288
+ var accountFolder = /* @__PURE__ */ __name((app, run3) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env: run3.env ?? process.env }).state, "crm", "files", segment(`${run3.account.provider}-${run3.account.account}`)), "accountFolder");
8289
+ var ownFolder = /* @__PURE__ */ __name((top, folder) => {
8290
+ mkdirSync(folder, { recursive: true, mode: 448 });
8291
+ for (let at2 = resolve(folder); at2.startsWith(resolve(top)); at2 = resolve(at2, "..")) {
8292
+ chmodSync(at2, 448);
8293
+ if (at2 === resolve(top))
8294
+ break;
8295
+ }
8296
+ }, "ownFolder");
8297
+ var TooLarge = class extends Error {
8298
+ static {
8299
+ __name(this, "TooLarge");
8300
+ }
8301
+ };
8302
+ var Taken = class extends Error {
8303
+ static {
8304
+ __name(this, "Taken");
8305
+ }
8306
+ };
8307
+ var errnoOf = /* @__PURE__ */ __name((error) => error?.code, "errnoOf");
8308
+ var placeNew = /* @__PURE__ */ __name((part, target) => {
8309
+ try {
8310
+ linkSync(part, target);
8311
+ } catch (error) {
8312
+ if (errnoOf(error) === "EEXIST")
8313
+ throw new Taken();
8314
+ try {
8315
+ copyFileSync(part, target, constants.COPYFILE_EXCL);
8316
+ } catch (copying) {
8317
+ if (errnoOf(copying) === "EEXIST")
8318
+ throw new Taken();
8319
+ throw copying;
8320
+ }
8321
+ }
8322
+ rmSync(part, { force: true });
8323
+ }, "placeNew");
8324
+ var saveStream = /* @__PURE__ */ __name(async (stream, target, { cap, signal, exclusive }) => {
8325
+ const part = `${target}.part-${process.pid}`;
8326
+ const handle = await open(part, "wx", 384);
8327
+ const hash = createHash("sha256");
8328
+ const reader = stream.getReader();
8329
+ let bytes = 0;
8330
+ try {
8331
+ for (; ; ) {
8332
+ if (signal?.aborted)
8333
+ throw signal.reason ?? new Error("aborted");
8334
+ const { done, value } = await reader.read();
8335
+ if (done)
8336
+ break;
8337
+ bytes += value.byteLength;
8338
+ if (bytes > cap)
8339
+ throw new TooLarge();
8340
+ hash.update(value);
8341
+ await handle.write(value);
8342
+ }
8343
+ await handle.close();
8344
+ if (exclusive)
8345
+ placeNew(part, target);
8346
+ else
8347
+ renameSync(part, target);
8348
+ chmodSync(target, 384);
8349
+ return { bytes, sha256: hash.digest("hex") };
8350
+ } catch (error) {
8351
+ await reader.cancel().catch(() => {
8352
+ });
8353
+ await handle.close().catch(() => {
8354
+ });
8355
+ rmSync(part, { force: true });
8356
+ throw error;
8357
+ }
8358
+ }, "saveStream");
8359
+ var tooLarge = /* @__PURE__ */ __name((id, size, capMb, flag) => new CliError("validation_error", `${id} is ${size === null ? "larger than" : `${Math.ceil(size / MB)} MB, over`} the ${capMb} MB a download takes` + (flag ? `: --max-size raises it up to ${MOST_DOWNLOAD_MB}` : ""), { reason: "crm.file-too-large", limit: capMb, ...size === null ? {} : { total: size } }), "tooLarge");
8360
+ var listed = /* @__PURE__ */ __name(async ({ run: run3 }, owner, gaps = []) => {
8361
+ const source = run3.source();
8362
+ if (!source.files)
8363
+ throw new CliError("configuration_error", "this CRM does not list its records' files");
8364
+ const context = { spend: /* @__PURE__ */ __name(() => {
8365
+ }, "spend"), gap: /* @__PURE__ */ __name((gap) => gaps.push(gap), "gap") };
8366
+ const found = await source.files(owner, context);
8367
+ if (!found)
8368
+ throw new CliError("not_found", `the CRM has no ${owner.kind} ${owner.id}, or this sign-in cannot see it`);
8369
+ return found;
8370
+ }, "listed");
8371
+ var quotaOf = /* @__PURE__ */ __name((context) => {
8372
+ const { run: run3, app, now } = context;
8373
+ return foreignContacts(run3.source(), async () => {
8374
+ const self = run3.source().self;
8375
+ return foreignContactsPathFor(app, run3.account, run3.env, self ? String(await self()) : void 0);
8376
+ }, { now });
8377
+ }, "quotaOf");
8378
+ var roomFor = /* @__PURE__ */ __name(async ({ run: run3 }, folder, { need, capBytes, own, target, drop }) => {
8379
+ const files = run3.store.crmFiles;
8380
+ const prefix = `${folder}${sep}`;
8381
+ const earlier = await files.get(run3.account, own);
8382
+ let total = await files.storedBytes(run3.account, prefix) - (earlier?.localPath?.startsWith(prefix) ? earlier.size ?? 0 : 0);
8383
+ if (total + need <= capBytes)
8384
+ return true;
8385
+ const droppable = (await files.droppable(run3.account, prefix)).filter((one) => one.externalId !== own && one.localPath !== target);
8386
+ if (total - droppable.reduce((sum, one) => sum + (one.size ?? 0), 0) + need > capBytes)
8387
+ return false;
8388
+ if (!drop)
8389
+ return true;
8390
+ for (const one of droppable) {
8391
+ if (one.localPath)
8392
+ rmSync(one.localPath, { force: true });
8393
+ await files.forgetFile(run3.account, one.externalId);
8394
+ total -= one.size ?? 0;
8395
+ if (total + need <= capBytes)
8396
+ return true;
8397
+ }
8398
+ return false;
8399
+ }, "roomFor");
8400
+ var diskFull = /* @__PURE__ */ __name((limits, folder, setting) => new CliError("validation_error", `the CRM files folder ${folder} is at its ${limits.max_total_mb} MB even after dropping every file whose text is kept; raise ${setting} or free files there`, { reason: "crm.files-disk-full", limit: limits.max_total_mb, path: folder }), "diskFull");
8401
+ var targetOf = /* @__PURE__ */ __name((folder, file, earlier, held, capped) => {
8402
+ const providerId = segment(parseCrmFileId(file.id).providerId);
8403
+ const name = safeName(file.name) ?? `file-${providerId}`;
8404
+ const free = /* @__PURE__ */ __name((path) => path === earlier || !held.has(path) && !existsSync(path), "free");
8405
+ for (const candidate of [join2(folder, name), join2(folder, `${providerId}-${name}`)])
8406
+ if (free(candidate))
8407
+ return candidate;
8408
+ if (capped)
8409
+ for (let at2 = 2; ; at2 += 1) {
8410
+ const candidate = join2(folder, `${providerId}-${at2}-${name}`);
8411
+ if (free(candidate))
8412
+ return candidate;
8413
+ }
8414
+ throw new CliError("conflict", `${folder} already holds ${name} and ${providerId}-${name}: choose another --dir`, {
8415
+ reason: "crm.file-exists",
8416
+ path: folder
8417
+ });
8418
+ }, "targetOf");
8419
+ var downloadCrmFile = /* @__PURE__ */ __name(async (context, file, assignee, { capBytes, capMb, flag, dir, limits }) => {
8420
+ const { run: run3, app, now, signal } = context;
8421
+ if (file.size !== null && file.size > capBytes)
8422
+ throw tooLarge(file.id, file.size, capMb, flag);
8423
+ const top = accountFolder(app, run3);
8424
+ const folder = dir ? resolve(dir) : join2(top, segment(`${file.owner.kind}-${file.owner.id}`));
8425
+ const setting = `crm.${run3.account.provider}:${run3.account.account}.files.max_total_mb`;
8426
+ const capped = dir === void 0;
8427
+ const room = /* @__PURE__ */ __name((need, target2, drop) => roomFor(context, top, { need, capBytes: limits.max_total_mb * MB, own: file.id, target: target2, drop }), "room");
8428
+ if (capped && !await room(file.size ?? 0, null, false))
8429
+ throw diskFull(limits, top, setting);
8430
+ if (capped)
8431
+ ownFolder(join2(top, ".."), folder);
8432
+ else
8433
+ mkdirSync(folder, { recursive: true, mode: 448 });
8434
+ const earlier = await run3.store.crmFiles.get(run3.account, file.id);
8435
+ const held = new Set(await run3.store.crmFiles.savedPaths(run3.account));
8436
+ if (earlier?.localPath)
8437
+ held.delete(earlier.localPath);
8438
+ const target = targetOf(folder, file, earlier?.localPath ?? null, held, capped);
8439
+ const discard = /* @__PURE__ */ __name(async () => {
8440
+ rmSync(target, { force: true });
8441
+ if (earlier?.localPath === target)
8442
+ await run3.store.crmFiles.forgetFile(run3.account, file.id);
8443
+ }, "discard");
8444
+ let saved;
8445
+ try {
8446
+ saved = await saveStream(await file.open(signal), target, {
8447
+ cap: capBytes,
8448
+ ...signal ? { signal } : {},
8449
+ exclusive: !capped && target !== earlier?.localPath
8450
+ });
8451
+ } catch (error) {
8452
+ if (error instanceof TooLarge)
8453
+ throw tooLarge(file.id, file.size, capMb, flag);
8454
+ if (error instanceof Taken)
8455
+ throw new CliError("conflict", `a file appeared at the name ${file.id} was to take in ${folder}; run it again`, {
8456
+ reason: "crm.file-exists",
8457
+ path: folder
8458
+ });
8459
+ if (signal?.aborted)
8460
+ throw new CliError("timeout", `the download of ${file.id} was cut off at the time limit and nothing was kept: run it again with a longer --timeout, such as --timeout 10m`, { reason: "crm.file-unavailable" });
8461
+ throw new CliError(isCliError(error) ? error.code : "provider_error", `the CRM did not give the file ${file.id}, and nothing was kept`, { reason: "crm.file-unavailable" });
8462
+ }
8463
+ if (capped && !await room(saved.bytes, target, true)) {
8464
+ await discard();
8465
+ throw diskFull(limits, top, setting);
8466
+ }
8467
+ let bytes;
8468
+ try {
8469
+ bytes = readFileSync2(target);
8470
+ } catch {
8471
+ await discard();
8472
+ throw new CliError("not_found", `the saved copy of ${file.id} was removed before its text was read; run it again`, {
8473
+ reason: "crm.file-unavailable"
8474
+ });
8475
+ }
8476
+ const cutOff = /* @__PURE__ */ __name(async () => {
8477
+ await discard();
8478
+ return new CliError("cancelled", `the time limit stopped reading the text of ${file.id}, and nothing was kept: run it again with a longer --timeout, such as --timeout 10m`, { reason: "crm.file-unavailable" });
8479
+ }, "cutOff");
8480
+ let extraction;
8481
+ try {
8482
+ extraction = saved.bytes > attachmentMaxBytes(run3.env ?? process.env) ? { status: "too-large" } : await extractText(bytes, { kind: "file", name: file.name, mime: file.mime, path: target }, importEngine, signal, run3.env ?? process.env);
8483
+ } catch (error) {
8484
+ if (signal?.aborted)
8485
+ throw await cutOff();
8486
+ await discard();
8487
+ throw error;
8488
+ }
8489
+ if (signal?.aborted)
8490
+ throw await cutOff();
8491
+ const self = run3.source().self ? String(await run3.source().self?.()) : null;
8492
+ const row = {
8493
+ externalId: file.id,
8494
+ ownerKind: file.owner.kind,
8495
+ ownerId: file.owner.id,
8496
+ ownerAssignee: assignee === null ? null : crmIdentityId(run3.account, normalCrmUserId(assignee), "user"),
8497
+ source: file.source,
8498
+ name: file.name,
8499
+ mime: file.mime,
8500
+ size: saved.bytes,
8501
+ externalCreatedAt: file.created,
8502
+ localPath: target,
8503
+ contentSha256: saved.sha256,
8504
+ text: extraction.status === "extracted" ? extraction.text.slice(0, MAX_TEXT_CHARS) : null,
8505
+ extraction: extraction.status,
8506
+ extractionError: extraction.status === "unreadable" ? extraction.error : null,
8507
+ downloadedBy: self,
8508
+ downloadedAt: now()
8509
+ };
8510
+ await run3.store.crmFiles.save(run3.account, row);
8511
+ if (earlier?.localPath && earlier.localPath !== target && earlier.localPath.startsWith(`${top}${sep}`))
8512
+ rmSync(earlier.localPath, { force: true });
8513
+ return { row, textStatus: extraction.status };
8514
+ }, "downloadCrmFile");
8515
+ var itemOfFile = /* @__PURE__ */ __name((file, saved) => {
8516
+ const listed2 = "owner" in file;
8517
+ return {
8518
+ id: listed2 ? file.id : file.externalId,
8519
+ name: file.name,
8520
+ size: file.size,
8521
+ mime: file.mime,
8522
+ created_at: iso4(listed2 ? file.created : file.externalCreatedAt),
8523
+ owner: listed2 ? { kind: file.owner.kind, id: file.owner.id } : { kind: file.ownerKind, id: file.ownerId },
8524
+ source: file.source,
8525
+ downloaded: saved !== void 0 && saved.localPath !== null,
8526
+ path: saved?.localPath ?? null,
8527
+ untrusted: ["name", "mime", "path"]
8528
+ };
8529
+ }, "itemOfFile");
8530
+ var addCrmFileCommands = /* @__PURE__ */ __name((program, options) => {
8531
+ const { within, example, app, now } = options;
8532
+ const kinds = OWNER_FLAGS.filter(([kind]) => kind !== "lead" || options.leads !== false);
8533
+ const contextOf3 = /* @__PURE__ */ __name((run3, command) => {
8534
+ const { signal } = environmentOf(command);
8535
+ return { app, run: run3, now, ...signal ? { signal } : {} };
8536
+ }, "contextOf");
8537
+ const group = annotate(program.command("files"), { effects: REMOTE_READ }).description("the files of the CRM's deals, leads, contacts and companies: listed live, downloaded on demand, their text found by search all");
8538
+ const list = example(answerEntity(annotate(group.command("list"), { effects: REMOTE_READ, offline: false }), "crm_file", crmFile).description("one record's files, read live from the CRM, with the path of each already downloaded; another user's record counts toward the day's limit when the CRM sets one"), "files list --deal 12", "files list --person 42 --json");
8539
+ for (const [, flag] of kinds)
8540
+ list.option(flag, `the ${flag.slice(2, flag.indexOf(" "))} whose files to list`);
8541
+ list.action(async (opts, command) => {
8542
+ const given = kinds.filter(([kind]) => opts[kind] !== void 0);
8543
+ const [chosen] = given;
8544
+ if (given.length !== 1 || !chosen)
8545
+ throw new CliError("validation_error", `name one record: ${kinds.map(([, flag]) => flag).join(", ")}`, {
8546
+ reason: "ref.malformed"
8547
+ });
8548
+ const owner = { kind: chosen[0], id: String(opts[chosen[0]]).trim() };
8549
+ await within(command, async (run3) => {
8550
+ const context = contextOf3(run3, command);
8551
+ const gaps = [];
8552
+ const found = await listed(context, owner, gaps);
8553
+ await quotaOf(context).spend(owner.kind, { externalId: owner.id, assignee: found.assignee });
8554
+ const saved = new Map((await run3.store.crmFiles.ofOwner(run3.account, owner.kind, owner.id)).map((one) => [one.externalId, one]));
8555
+ for (const gap of gaps)
8556
+ outputFor(command).renderer.note(gap.message);
8557
+ const items = found.files.map((file) => itemOfFile(file, saved.get(file.id)));
8558
+ return listOf("files list", {
8559
+ items,
8560
+ limit: Math.max(1, items.length),
8561
+ page: 1,
8562
+ has_more: false,
8563
+ ...gaps.length ? {
8564
+ meta: {
8565
+ complete: false,
8566
+ issues: gaps.map((gap) => ({
8567
+ code: "permission_error",
8568
+ reason: "crm.scope-missing",
8569
+ source: `crm:files${gap.scope ? `/${gap.scope}` : ""}`
8570
+ }))
8571
+ }
8572
+ } : {}
8573
+ });
8574
+ });
8575
+ });
8576
+ example(answerEntity(annotate(group.command("download"), { effects: FETCH, offline: false }), "crm_file_download", crmFileDownload).description(`save one file under the state folder (or --dir) and read its text, which search all then finds; ${DOWNLOAD_MB} MB at most unless --max-size; another user's record counts toward the day's limit`).argument("<file>", "the file's id, as files list prints it").option("--max-size <MB>", `the largest file to take, up to ${MOST_DOWNLOAD_MB}`, integer(MOST_DOWNLOAD_MB)).option("--dir <folder>", "save it here instead, as the owner's own copy: not counted, never dropped"), "files download deal:12:record:345", "files download deal:12:document:7 --max-size 500 --dir ~/Contracts").action(async (given, opts, command) => {
8577
+ const id = given.trim().replace(/^crmfile:/u, "");
8578
+ const { owner } = parseCrmFileId(id);
8579
+ const capMb = opts.maxSize ?? DOWNLOAD_MB;
8580
+ await within(command, async (run3) => {
8581
+ const context = contextOf3(run3, command);
8582
+ const found = await listed(context, owner);
8583
+ await quotaOf(context).spend(owner.kind, { externalId: owner.id, assignee: found.assignee });
8584
+ const file = found.files.find((one) => one.id === id);
8585
+ if (!file)
8586
+ throw new CliError("not_found", `${owner.kind} ${owner.id} has no file ${id}; files list names them`);
8587
+ const done = await downloadCrmFile(context, file, found.assignee, {
8588
+ capBytes: capMb * MB,
8589
+ capMb,
8590
+ flag: capMb < MOST_DOWNLOAD_MB,
8591
+ limits: await run3.store.crmFiles.limits(run3.account),
8592
+ ...opts.dir === void 0 ? {} : { dir: opts.dir }
8593
+ });
8594
+ const text2 = done.row.text;
8595
+ return itemOf({
8596
+ ...itemOfFile(file, done.row),
8597
+ size: done.row.size,
8598
+ text_status: done.textStatus,
8599
+ text: text2 === null ? null : text2.slice(0, SHOWN_TEXT),
8600
+ text_truncated: text2 !== null && text2.length > SHOWN_TEXT,
8601
+ untrusted: ["name", "mime", "path", "text"]
8602
+ });
8603
+ });
8604
+ });
8605
+ example(answerEntity(annotate(group.command("sync"), { effects: FETCH, offline: false, cooperative: true, partial: true }), "crm_files_sync", crmFilesSync).description(`download the files of your own deals and leads that changed lately, newest first, within the account's files.* limits; stops at its deadline and the next run goes on. Never another user's files. Run it on a schedule: ${app.command} schedule command crm-files --every 1h -- files sync`), "files sync").action(async (_opts, command) => {
8606
+ const level = commandLevel(command, app, FILES_DOWNLOAD_KEY);
8607
+ if (level === "deny" || level === "readonly")
8608
+ throw new CliError("permission_error", `files sync downloads files, which ${FILES_DOWNLOAD_KEY} ${level}s`, {
8609
+ reason: "crm.files-denied",
8610
+ permission: FILES_DOWNLOAD_KEY
8611
+ });
8612
+ const budget = runBudgetOf(command);
8613
+ await within(command, async (run3) => {
8614
+ const report = await syncFiles(contextOf3(run3, command), () => budget.take() !== null);
8615
+ const next = report.complete ? void 0 : [
8616
+ {
8617
+ kind: "command",
8618
+ step: "crm.files-sync",
8619
+ command: "files sync",
8620
+ args: {},
8621
+ why: "the run stopped at a limit; the next run goes on from there",
8622
+ safe_to_auto_execute: true
8623
+ }
8624
+ ];
8625
+ return itemOf({
8626
+ ...report,
8627
+ skipped: report.skipped.map((one) => ({ ...one, step: lineOf(command, `files download ${one.id}`) })),
8628
+ untrusted: ["downloaded.name", "downloaded.path", "skipped.name"]
8629
+ }, { ...report.complete ? {} : { meta: { complete: false } }, ...next ? { next } : {} });
8630
+ });
8631
+ });
8632
+ }, "addCrmFileCommands");
8633
+ var MOST_TRIES = 3;
8634
+ var roundOf = /* @__PURE__ */ __name(async (run3) => {
8635
+ try {
8636
+ const found = JSON.parse((await run3.store.sync.syncState(run3.account, FILES_ROUND))?.value ?? "null");
8637
+ if (found && Array.isArray(found.done))
8638
+ return found;
8639
+ } catch {
8640
+ }
8641
+ return { after: null, started: null, done: [] };
8642
+ }, "roundOf");
8643
+ var syncFiles = /* @__PURE__ */ __name(async (context, outOfTime, deadline = (ms) => AbortSignal.timeout(ms)) => {
8644
+ const { run: run3, now } = context;
8645
+ const source = run3.source();
8646
+ if (!source.self)
8647
+ throw new CliError("configuration_error", "this CRM names no user for the sign-in, so no deal is yours");
8648
+ const self = normalCrmUserId(String(await source.self()));
8649
+ const limits = await run3.store.crmFiles.limits(run3.account);
8650
+ const started = now();
8651
+ const ends = started + limits.run_minutes * 6e4;
8652
+ const round = await roundOf(run3);
8653
+ const roundStart = round.started ?? started;
8654
+ const since = Math.max(round.after ?? 0, roundStart - limits.days * DAY3);
8655
+ const assignee = crmIdentityId(run3.account, self, "user");
8656
+ const candidates = [];
8657
+ for (const kind of ["deal", "lead"])
8658
+ for (let offset = 0; ; offset += PAGE) {
8659
+ const found = await run3.store.deals.list({
8660
+ kind,
8661
+ account: run3.account,
8662
+ owner: assignee,
8663
+ updated: { since },
8664
+ limit: PAGE,
8665
+ offset
8666
+ });
8667
+ for (const one of found.items)
8668
+ candidates.push({ kind, id: one.externalId ?? "", updated: Date.parse(one.updatedAt) });
8669
+ if (!found.hasMore)
8670
+ break;
8671
+ }
8672
+ const owners = candidates.filter((one) => one.id && !round.done.includes(`${one.kind}:${one.id}`)).sort((a, b) => b.updated - a.updated);
8673
+ const report = { owners: owners.length, downloaded: [], skipped: [], complete: true };
8674
+ const done = [...round.done];
8675
+ let retry = false;
8676
+ const tries = { ...round.tries ?? {} };
8677
+ let runBytes = 0;
8678
+ const stop = /* @__PURE__ */ __name((reason, file) => {
8679
+ report.skipped.push({ id: file.id, name: file.name, size: file.size, reason });
8680
+ report.stopped = reason;
8681
+ report.complete = false;
8682
+ }, "stop");
8683
+ outer: for (const owner of owners) {
8684
+ if (now() >= ends || outOfTime()) {
8685
+ report.stopped = "deadline";
8686
+ report.complete = false;
8687
+ break;
8688
+ }
8689
+ const found = await source.files?.({ kind: owner.kind, id: owner.id }, { spend: /* @__PURE__ */ __name(() => {
8690
+ }, "spend"), gap: /* @__PURE__ */ __name(() => {
8691
+ }, "gap") });
8692
+ if (!found || found.assignee === null || normalCrmUserId(found.assignee) !== self) {
8693
+ done.push(`${owner.kind}:${owner.id}`);
8694
+ continue;
8695
+ }
8696
+ const files = [...found.files].sort((a, b) => (b.created ?? 0) - (a.created ?? 0));
8697
+ let available = true;
8698
+ for (const file of files) {
8699
+ if (await run3.store.crmFiles.get(run3.account, file.id))
8700
+ continue;
8701
+ const fileCap = limits.max_file_mb * MB;
8702
+ if (file.size !== null && file.size > fileCap) {
8703
+ report.skipped.push({ id: file.id, name: file.name, size: file.size, reason: "too-large" });
8704
+ continue;
8705
+ }
8706
+ if (report.downloaded.length >= limits.max_files) {
8707
+ stop("run-files", file);
8708
+ break outer;
8709
+ }
8710
+ const left = limits.max_run_mb * MB - runBytes;
8711
+ if (file.size !== null && file.size > left) {
8712
+ stop("run-mb", file);
8713
+ break outer;
8714
+ }
8715
+ if (now() >= ends || outOfTime()) {
8716
+ stop("deadline", file);
8717
+ break outer;
8718
+ }
8719
+ const remaining = deadline(Math.max(1, ends - now()));
8720
+ const signal = context.signal ? AbortSignal.any([context.signal, remaining]) : remaining;
8721
+ try {
8722
+ const saved = await downloadCrmFile({ ...context, signal }, file, found.assignee, {
8723
+ capBytes: Math.min(fileCap, left),
8724
+ capMb: limits.max_file_mb,
8725
+ flag: false,
8726
+ limits
8727
+ });
8728
+ delete tries[file.id];
8729
+ runBytes += saved.row.size ?? 0;
8730
+ report.downloaded.push({
8731
+ id: file.id,
8732
+ name: file.name,
8733
+ size: saved.row.size ?? 0,
8734
+ path: saved.row.localPath ?? "",
8735
+ text_status: saved.textStatus
8736
+ });
8737
+ } catch (error) {
8738
+ const reason = isCliError(error) ? error.details.reason : void 0;
8739
+ if (reason === "crm.files-disk-full") {
8740
+ stop("disk-full", file);
8741
+ break outer;
8742
+ }
8743
+ if (reason === "crm.file-too-large") {
8744
+ if (left < fileCap) {
8745
+ stop("run-mb", file);
8746
+ break outer;
8747
+ }
8748
+ report.skipped.push({ id: file.id, name: file.name, size: file.size, reason: "too-large" });
8749
+ continue;
8750
+ }
8751
+ if (signal.aborted || isCliError(error) && error.code === "timeout") {
8752
+ stop("deadline", file);
8753
+ break outer;
8754
+ }
8755
+ report.skipped.push({ id: file.id, name: file.name, size: file.size, reason: "unavailable" });
8756
+ tries[file.id] = (tries[file.id] ?? 0) + 1;
8757
+ if ((tries[file.id] ?? 0) < MOST_TRIES)
8758
+ available = false;
8759
+ }
8760
+ }
8761
+ if (available)
8762
+ done.push(`${owner.kind}:${owner.id}`);
8763
+ else
8764
+ retry = true;
8765
+ }
8766
+ const next = report.complete && !retry ? { after: roundStart, started: null, done: [] } : { after: round.after, started: roundStart, done, tries };
8767
+ await run3.store.sync.setSyncState(run3.account, FILES_ROUND, JSON.stringify(next));
8768
+ return report;
8769
+ }, "syncFiles");
8770
+
8771
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/pipeline-view.js
8334
8772
  var sumOf = /* @__PURE__ */ __name((amounts) => amounts.map(({ amount, currency }) => `${groupDigits(amount)} ${currency}`).join(", ") || "\u2014", "sumOf");
8335
8773
  var percent = /* @__PURE__ */ __name((share) => share === null ? "\u2014" : `${Math.round(share * 100)}%`, "percent");
8336
8774
  var openStages = /* @__PURE__ */ __name((stages) => {
@@ -8376,7 +8814,7 @@ ${outcomes.join("\n")}`
8376
8814
  ].join("\n\n");
8377
8815
  }, "pipelineView");
8378
8816
 
8379
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/search-all.js
8817
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/search-all.js
8380
8818
  var SEARCHED = ["crm", ...SOURCE_SEARCHED];
8381
8819
  var DEFAULT_LIMIT = 20;
8382
8820
  var addCrmSearchAll = /* @__PURE__ */ __name((searches, { within, app, example, viewerOf: viewerOf2 }) => {
@@ -8390,7 +8828,7 @@ var addCrmSearchAll = /* @__PURE__ */ __name((searches, { within, app, example,
8390
8828
  throw new CliError("permission_error", "this process is locked to one profile; search all reads its own CRM account only, without --source", { reason: "profile.locked" });
8391
8829
  const asked = opts.only ?? SEARCHED;
8392
8830
  const denied = deniedKinds(leaf, app, [
8393
- ...asked.includes("crm") ? DEAL_KINDS : [],
8831
+ ...asked.includes("crm") ? [...DEAL_KINDS, "crm_file"] : [],
8394
8832
  ...asked.filter((one) => one !== "crm" && one !== "mail")
8395
8833
  ]);
8396
8834
  const out = new Set(denied.map(({ kind }) => kind));
@@ -8418,7 +8856,8 @@ var addCrmSearchAll = /* @__PURE__ */ __name((searches, { within, app, example,
8418
8856
  only,
8419
8857
  ...opts.only?.includes("meetings") ? { meetingsAsked: true } : {},
8420
8858
  ...crmKinds.length < DEAL_KINDS.length ? { crmKinds } : {},
8421
- ...viewers.length ? { crmViewers: viewers } : {},
8859
+ crmViewers: viewers,
8860
+ ...out.has("crm_file") ? { crmFiles: false } : {},
8422
8861
  ...opts.source === void 0 ? {} : { source: opts.source },
8423
8862
  ...alone ? { scope: { crm: [run3.account] } } : {}
8424
8863
  }, { app, hintCommand: commandAt(rootOf2(leaf), "models download") ? app.command : null }, void 0, meaningLane({ env, messenger: { app }, store: /* @__PURE__ */ __name(async () => run3.store, "store") }));
@@ -8441,15 +8880,15 @@ var addCrmSearchAll = /* @__PURE__ */ __name((searches, { within, app, example,
8441
8880
  });
8442
8881
  }, "addCrmSearchAll");
8443
8882
 
8444
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/store.js
8445
- import { mkdtempSync, rmSync } from "node:fs";
8883
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/store.js
8884
+ import { mkdtempSync, rmSync as rmSync2 } from "node:fs";
8446
8885
  import { tmpdir } from "node:os";
8447
- import { join as join2 } from "node:path";
8886
+ import { join as join3 } from "node:path";
8448
8887
  var openCrmStore = /* @__PURE__ */ __name(async (options) => {
8449
- const { app, env, profile, readOnly, open } = options;
8888
+ const { app, env, profile, readOnly, open: open2 } = options;
8450
8889
  const locked = readOnly && readOnlyLockOf(app, env) !== void 0;
8451
8890
  if (readOnly) {
8452
- const store = await open(env, { readOnly: true }).catch((error) => {
8891
+ const store = await open2(env, { readOnly: true }).catch((error) => {
8453
8892
  if (locked && !(isCliError(error) && error.code === "not_found"))
8454
8893
  throw error;
8455
8894
  return void 0;
@@ -8463,10 +8902,10 @@ var openCrmStore = /* @__PURE__ */ __name(async (options) => {
8463
8902
  }
8464
8903
  if (!locked)
8465
8904
  return withProfile(options, env, options.account());
8466
- const folder = mkdtempSync(join2(tmpdir(), `${app.command}-empty-`));
8467
- const removing = /* @__PURE__ */ __name(() => rmSync(folder, { recursive: true, force: true }), "removing");
8905
+ const folder = mkdtempSync(join3(tmpdir(), `${app.command}-empty-`));
8906
+ const removing = /* @__PURE__ */ __name(() => rmSync2(folder, { recursive: true, force: true }), "removing");
8468
8907
  try {
8469
- const empty = await withProfile(options, { ...env, MESSAGING_STORE: join2(folder, "wirecat.db") }, {
8908
+ const empty = await withProfile(options, { ...env, MESSAGING_STORE: join3(folder, "wirecat.db") }, {
8470
8909
  provider: options.provider,
8471
8910
  account: profile
8472
8911
  });
@@ -8478,8 +8917,8 @@ var openCrmStore = /* @__PURE__ */ __name(async (options) => {
8478
8917
  throw error;
8479
8918
  }
8480
8919
  }, "openCrmStore");
8481
- var withProfile = /* @__PURE__ */ __name(async ({ app, profile, open }, env, account) => {
8482
- const store = await open(env);
8920
+ var withProfile = /* @__PURE__ */ __name(async ({ app, profile, open: open2 }, env, account) => {
8921
+ const store = await open2(env);
8483
8922
  try {
8484
8923
  await store.accounts.saveAccount(account, { name: null, scope: "work" });
8485
8924
  await store.accounts.saveProfile(app.command, profile, account);
@@ -8490,7 +8929,7 @@ var withProfile = /* @__PURE__ */ __name(async ({ app, profile, open }, env, acc
8490
8929
  }
8491
8930
  }, "withProfile");
8492
8931
 
8493
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/crm/cli/index.js
8932
+ // node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/crm/cli/index.js
8494
8933
  var MOST4 = 500;
8495
8934
  var STAGE_REF = /^stage:\d+$/;
8496
8935
  var timeField = /* @__PURE__ */ __name((name, example, relation) => nativeField({ name, type: "time", operators: ["term", "range"], example, relation }), "timeField");
@@ -8999,14 +9438,14 @@ var addCrmCommandsDefinition = /* @__PURE__ */ __name((program, options) => {
8999
9438
  })
9000
9439
  ] : all;
9001
9440
  const rules = await run3.store.crm.stageTasks(run3.account);
9002
- const found = chosen.flatMap((pipeline) => pipeline.stages.map(({ name, position, outcome, externalId, open }) => {
9441
+ const found = chosen.flatMap((pipeline) => pipeline.stages.map(({ name, position, outcome, externalId, open: open2 }) => {
9003
9442
  const rule = externalId === null ? void 0 : rules[pipeline.kind][externalId];
9004
9443
  return {
9005
9444
  name,
9006
9445
  position,
9007
9446
  outcome,
9008
9447
  externalId,
9009
- open,
9448
+ open: open2,
9010
9449
  pipeline: pipeline.ref,
9011
9450
  pipelineName: pipeline.name,
9012
9451
  kind: pipeline.kind,
@@ -9032,6 +9471,8 @@ var addCrmCommandsDefinition = /* @__PURE__ */ __name((program, options) => {
9032
9471
  now
9033
9472
  });
9034
9473
  addCrmChangeCommands(program, { ...options, within, example, now, ownerOf, pathOf });
9474
+ if (options.files)
9475
+ addCrmFileCommands(program, { ...options, within, example, now });
9035
9476
  const fieldKinds = Object.keys(FIELD_KINDS).filter((word) => word !== "leads" || options.leads !== false);
9036
9477
  const fields = annotate(program.command("fields"), { effects: NO_EFFECTS }).description("the CRM's own fields on deals, leads, people and organizations, as last synced");
9037
9478
  example(withQuery(answerEntity(annotate(fields.command("list"), { effects: LOCAL_READ }), "crm_field", crmField).description("the CRM's custom fields of one kind, in its order, with a list field's options").argument("<kind>", fieldKinds.join(", ")).option("--limit <n>", `fields per page, 1\u2013${MOST4}`, integer(MOST4), 50).option("--page <n>", "which page, starting at 1", integer(1e6)).option("--all", "every field, no paging"), FIELDS_QUERY), "fields list deals", "fields list people --json").action(async (kind, words, opts, command) => {
@@ -9062,7 +9503,7 @@ var addCrmCommands = honoursDryRun(sharedCommand(addCrmCommandsDefinition));
9062
9503
 
9063
9504
  // dist/commands/crm-shared.js
9064
9505
  var savedAccount = /* @__PURE__ */ __name(async (env, profile) => {
9065
- const { openHubspotStore } = await import("./store-DXWYNVVB.js");
9506
+ const { openHubspotStore } = await import("./store-HXA2MRWI.js");
9066
9507
  const store = await openHubspotStore(env, { readOnly: true }).catch(() => void 0);
9067
9508
  if (!store)
9068
9509
  return void 0;
@@ -9077,9 +9518,9 @@ var savedAccount = /* @__PURE__ */ __name(async (env, profile) => {
9077
9518
  var openProfile = /* @__PURE__ */ __name(async (command, { readOnly }) => {
9078
9519
  const { env, profile, environment } = contextOf(command);
9079
9520
  const [{ openHubspotStore, PROVIDER: PROVIDER2 }, { hubspotCrmSource }, { hubspotCrmWriter }] = await Promise.all([
9080
- import("./store-DXWYNVVB.js"),
9081
- import("./source-54HR4IWG.js"),
9082
- import("./writer-NLLI5YRM.js")
9521
+ import("./store-HXA2MRWI.js"),
9522
+ import("./source-VHDK74YS.js"),
9523
+ import("./writer-CZYA657G.js")
9083
9524
  ]);
9084
9525
  const fromToken = fromEnvironment(command);
9085
9526
  const online = metaOf(command).effects?.remote !== "none";
@@ -9308,7 +9749,7 @@ var update = appUpdate({
9308
9749
  command: IDENTITY.command,
9309
9750
  version: IDENTITY.version,
9310
9751
  entry: new URL("../program.js", import.meta.url).href,
9311
- statePath: /* @__PURE__ */ __name((env) => join3(resolvePaths({ appName: IDENTITY.appName, prefix: IDENTITY.envPrefix, env }).state, "update-check.json"), "statePath"),
9752
+ statePath: /* @__PURE__ */ __name((env) => join4(resolvePaths({ appName: IDENTITY.appName, prefix: IDENTITY.envPrefix, env }).state, "update-check.json"), "statePath"),
9312
9753
  // biome-ignore lint/plugin/no-own-settings: the update check runs before any command exists to give baseContext
9313
9754
  enabled: /* @__PURE__ */ __name((env) => configuration.resolveSettings({}, { env, needsProfile: false }).updateCheck, "enabled"),
9314
9755
  offVariables: [`${IDENTITY.envPrefix}_NO_UPDATE_CHECK`]