@particle-academy/hubspot-js 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flow.cjs CHANGED
@@ -6,6 +6,107 @@ var hubspotUi = require('@particle-academy/hubspot-ui');
6
6
  // src/flow.ts
7
7
 
8
8
  // src/faker.ts
9
+ function fakeCompanyCreate({ config, fake }) {
10
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
11
+ return {
12
+ "id": boundRecordId,
13
+ "properties": {
14
+ "name": "Acme",
15
+ "domain": "acme.example.test",
16
+ "hs_object_id": boundRecordId,
17
+ "createdate": "2026-01-01T00:00:00.000Z",
18
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
19
+ },
20
+ "createdAt": "2026-01-01T00:00:00.000Z",
21
+ "updatedAt": "2026-01-01T00:00:00.000Z",
22
+ "archived": false
23
+ };
24
+ }
25
+ function fakeCompanyGet({ config, fake }) {
26
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
27
+ return {
28
+ "id": boundRecordId,
29
+ "properties": {
30
+ "name": "Acme",
31
+ "domain": "acme.example.test",
32
+ "hs_object_id": boundRecordId,
33
+ "createdate": "2026-01-01T00:00:00.000Z",
34
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
35
+ },
36
+ "createdAt": "2026-01-01T00:00:00.000Z",
37
+ "updatedAt": "2026-01-01T00:00:00.000Z",
38
+ "archived": false
39
+ };
40
+ }
41
+ function fakeCompanyList({ config, fake }) {
42
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
43
+ return {
44
+ "results": [
45
+ {
46
+ "id": boundRecordId,
47
+ "properties": {
48
+ "name": "Acme",
49
+ "domain": "acme.example.test",
50
+ "hs_object_id": boundRecordId,
51
+ "createdate": "2026-01-01T00:00:00.000Z",
52
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
53
+ },
54
+ "createdAt": "2026-01-01T00:00:00.000Z",
55
+ "updatedAt": "2026-01-01T00:00:00.000Z",
56
+ "archived": false
57
+ }
58
+ ],
59
+ "paging": {
60
+ "next": {
61
+ "after": "10",
62
+ "link": "?after=10"
63
+ }
64
+ }
65
+ };
66
+ }
67
+ function fakeCompanySearch({ config, fake }) {
68
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
69
+ return {
70
+ "total": 1,
71
+ "results": [
72
+ {
73
+ "id": boundRecordId,
74
+ "properties": {
75
+ "name": "Acme",
76
+ "domain": "acme.example.test",
77
+ "hs_object_id": boundRecordId,
78
+ "createdate": "2026-01-01T00:00:00.000Z",
79
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
80
+ },
81
+ "createdAt": "2026-01-01T00:00:00.000Z",
82
+ "updatedAt": "2026-01-01T00:00:00.000Z",
83
+ "archived": false
84
+ }
85
+ ],
86
+ "paging": {
87
+ "next": {
88
+ "after": "10",
89
+ "link": "?after=10"
90
+ }
91
+ }
92
+ };
93
+ }
94
+ function fakeCompanyUpdate({ config, fake }) {
95
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
96
+ return {
97
+ "id": boundRecordId,
98
+ "properties": {
99
+ "name": "Acme",
100
+ "domain": "acme.example.test",
101
+ "hs_object_id": boundRecordId,
102
+ "createdate": "2026-01-01T00:00:00.000Z",
103
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
104
+ },
105
+ "createdAt": "2026-01-01T00:00:00.000Z",
106
+ "updatedAt": "2026-01-01T00:00:00.000Z",
107
+ "archived": false
108
+ };
109
+ }
9
110
  function fakeContactCreate({ config, fake }) {
10
111
  const boundContactId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
11
112
  return {
@@ -26,10 +127,314 @@ function fakeContactCreate({ config, fake }) {
26
127
  "archived": false
27
128
  };
28
129
  }
130
+ function fakeContactGet({ config, fake }) {
131
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
132
+ return {
133
+ "id": boundRecordId,
134
+ "properties": {
135
+ "email": "rosa@example.test",
136
+ "firstname": "Rosa",
137
+ "lastname": "Diaz",
138
+ "hs_object_id": boundRecordId,
139
+ "createdate": "2026-01-01T00:00:00.000Z",
140
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
141
+ },
142
+ "createdAt": "2026-01-01T00:00:00.000Z",
143
+ "updatedAt": "2026-01-01T00:00:00.000Z",
144
+ "archived": false
145
+ };
146
+ }
147
+ function fakeContactList({ config, fake }) {
148
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
149
+ return {
150
+ "results": [
151
+ {
152
+ "id": boundRecordId,
153
+ "properties": {
154
+ "email": "rosa@example.test",
155
+ "firstname": "Rosa",
156
+ "lastname": "Diaz",
157
+ "hs_object_id": boundRecordId,
158
+ "createdate": "2026-01-01T00:00:00.000Z",
159
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
160
+ },
161
+ "createdAt": "2026-01-01T00:00:00.000Z",
162
+ "updatedAt": "2026-01-01T00:00:00.000Z",
163
+ "archived": false
164
+ }
165
+ ],
166
+ "paging": {
167
+ "next": {
168
+ "after": "10",
169
+ "link": "?after=10"
170
+ }
171
+ }
172
+ };
173
+ }
174
+ function fakeContactSearch({ config, fake }) {
175
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
176
+ return {
177
+ "total": 1,
178
+ "results": [
179
+ {
180
+ "id": boundRecordId,
181
+ "properties": {
182
+ "email": "rosa@example.test",
183
+ "firstname": "Rosa",
184
+ "lastname": "Diaz",
185
+ "hs_object_id": boundRecordId,
186
+ "createdate": "2026-01-01T00:00:00.000Z",
187
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
188
+ },
189
+ "createdAt": "2026-01-01T00:00:00.000Z",
190
+ "updatedAt": "2026-01-01T00:00:00.000Z",
191
+ "archived": false
192
+ }
193
+ ],
194
+ "paging": {
195
+ "next": {
196
+ "after": "10",
197
+ "link": "?after=10"
198
+ }
199
+ }
200
+ };
201
+ }
202
+ function fakeContactUpdate({ config, fake }) {
203
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
204
+ return {
205
+ "id": boundRecordId,
206
+ "properties": {
207
+ "email": "rosa@example.test",
208
+ "firstname": "Rosa",
209
+ "lastname": "Diaz",
210
+ "hs_object_id": boundRecordId,
211
+ "createdate": "2026-01-01T00:00:00.000Z",
212
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
213
+ },
214
+ "createdAt": "2026-01-01T00:00:00.000Z",
215
+ "updatedAt": "2026-01-01T00:00:00.000Z",
216
+ "archived": false
217
+ };
218
+ }
219
+ function fakeDealCreate({ config, fake }) {
220
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
221
+ return {
222
+ "id": boundRecordId,
223
+ "properties": {
224
+ "dealname": "Acme renewal",
225
+ "amount": "12000",
226
+ "dealstage": "appointmentscheduled",
227
+ "pipeline": "default",
228
+ "hs_object_id": boundRecordId,
229
+ "createdate": "2026-01-01T00:00:00.000Z",
230
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
231
+ },
232
+ "createdAt": "2026-01-01T00:00:00.000Z",
233
+ "updatedAt": "2026-01-01T00:00:00.000Z",
234
+ "archived": false
235
+ };
236
+ }
237
+ function fakeDealGet({ config, fake }) {
238
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
239
+ return {
240
+ "id": boundRecordId,
241
+ "properties": {
242
+ "dealname": "Acme renewal",
243
+ "amount": "12000",
244
+ "dealstage": "appointmentscheduled",
245
+ "pipeline": "default",
246
+ "hs_object_id": boundRecordId,
247
+ "createdate": "2026-01-01T00:00:00.000Z",
248
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
249
+ },
250
+ "createdAt": "2026-01-01T00:00:00.000Z",
251
+ "updatedAt": "2026-01-01T00:00:00.000Z",
252
+ "archived": false
253
+ };
254
+ }
255
+ function fakeDealList({ config, fake }) {
256
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
257
+ return {
258
+ "results": [
259
+ {
260
+ "id": boundRecordId,
261
+ "properties": {
262
+ "dealname": "Acme renewal",
263
+ "amount": "12000",
264
+ "dealstage": "appointmentscheduled",
265
+ "pipeline": "default",
266
+ "hs_object_id": boundRecordId,
267
+ "createdate": "2026-01-01T00:00:00.000Z",
268
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
269
+ },
270
+ "createdAt": "2026-01-01T00:00:00.000Z",
271
+ "updatedAt": "2026-01-01T00:00:00.000Z",
272
+ "archived": false
273
+ }
274
+ ],
275
+ "paging": {
276
+ "next": {
277
+ "after": "10",
278
+ "link": "?after=10"
279
+ }
280
+ }
281
+ };
282
+ }
283
+ function fakeDealSearch({ config, fake }) {
284
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
285
+ return {
286
+ "total": 1,
287
+ "results": [
288
+ {
289
+ "id": boundRecordId,
290
+ "properties": {
291
+ "dealname": "Acme renewal",
292
+ "amount": "12000",
293
+ "dealstage": "appointmentscheduled",
294
+ "pipeline": "default",
295
+ "hs_object_id": boundRecordId,
296
+ "createdate": "2026-01-01T00:00:00.000Z",
297
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
298
+ },
299
+ "createdAt": "2026-01-01T00:00:00.000Z",
300
+ "updatedAt": "2026-01-01T00:00:00.000Z",
301
+ "archived": false
302
+ }
303
+ ],
304
+ "paging": {
305
+ "next": {
306
+ "after": "10",
307
+ "link": "?after=10"
308
+ }
309
+ }
310
+ };
311
+ }
312
+ function fakeDealUpdate({ config, fake }) {
313
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
314
+ return {
315
+ "id": boundRecordId,
316
+ "properties": {
317
+ "dealname": "Acme renewal",
318
+ "amount": "12000",
319
+ "dealstage": "appointmentscheduled",
320
+ "pipeline": "default",
321
+ "hs_object_id": boundRecordId,
322
+ "createdate": "2026-01-01T00:00:00.000Z",
323
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
324
+ },
325
+ "createdAt": "2026-01-01T00:00:00.000Z",
326
+ "updatedAt": "2026-01-01T00:00:00.000Z",
327
+ "archived": false
328
+ };
329
+ }
330
+ function fakeOwnerList({ config, fake }) {
331
+ const boundOwnerId = Array.from({ length: 8 }, () => fake.int(0, 9)).join("");
332
+ return {
333
+ "results": [
334
+ {
335
+ "id": boundOwnerId,
336
+ "email": "rosa@example.test",
337
+ "firstName": "Rosa",
338
+ "lastName": "Diaz",
339
+ "userId": 4242,
340
+ "archived": false
341
+ }
342
+ ],
343
+ "paging": {
344
+ "next": {
345
+ "after": "10",
346
+ "link": "?after=10"
347
+ }
348
+ }
349
+ };
350
+ }
351
+ function fakePipelineList({ config, fake }) {
352
+ return {
353
+ "results": [
354
+ {
355
+ "id": "default",
356
+ "label": "Sales pipeline",
357
+ "displayOrder": 0,
358
+ "archived": false,
359
+ "stages": [
360
+ {
361
+ "id": "appointmentscheduled",
362
+ "label": "Appointment scheduled",
363
+ "displayOrder": 0,
364
+ "metadata": {
365
+ "probability": "0.2"
366
+ }
367
+ },
368
+ {
369
+ "id": "closedwon",
370
+ "label": "Closed won",
371
+ "displayOrder": 1,
372
+ "metadata": {
373
+ "probability": "1.0"
374
+ }
375
+ }
376
+ ]
377
+ }
378
+ ]
379
+ };
380
+ }
381
+ function fakePropertyList({ config, fake }) {
382
+ return {
383
+ "results": [
384
+ {
385
+ "name": "dealstage",
386
+ "label": "Deal Stage",
387
+ "type": "enumeration",
388
+ "fieldType": "select",
389
+ "groupName": "dealinformation",
390
+ "options": [
391
+ {
392
+ "label": "Appointment scheduled",
393
+ "value": "appointmentscheduled"
394
+ }
395
+ ]
396
+ }
397
+ ]
398
+ };
399
+ }
29
400
  var hubspotFaker = (operation, request) => {
30
401
  switch (operation) {
402
+ case "company_create":
403
+ return fakeCompanyCreate(request);
404
+ case "company_get":
405
+ return fakeCompanyGet(request);
406
+ case "company_list":
407
+ return fakeCompanyList(request);
408
+ case "company_search":
409
+ return fakeCompanySearch(request);
410
+ case "company_update":
411
+ return fakeCompanyUpdate(request);
31
412
  case "contact_create":
32
413
  return fakeContactCreate(request);
414
+ case "contact_get":
415
+ return fakeContactGet(request);
416
+ case "contact_list":
417
+ return fakeContactList(request);
418
+ case "contact_search":
419
+ return fakeContactSearch(request);
420
+ case "contact_update":
421
+ return fakeContactUpdate(request);
422
+ case "deal_create":
423
+ return fakeDealCreate(request);
424
+ case "deal_get":
425
+ return fakeDealGet(request);
426
+ case "deal_list":
427
+ return fakeDealList(request);
428
+ case "deal_search":
429
+ return fakeDealSearch(request);
430
+ case "deal_update":
431
+ return fakeDealUpdate(request);
432
+ case "owner_list":
433
+ return fakeOwnerList(request);
434
+ case "pipeline_list":
435
+ return fakePipelineList(request);
436
+ case "property_list":
437
+ return fakePropertyList(request);
33
438
  default:
34
439
  throw new Error(
35
440
  `hubspot: no fake response is defined for "${operation}". Add a fixture under provider/fixtures/ and regenerate \u2014 a connector without a faker cannot be developed against, tested, or demonstrated.`
@@ -57,6 +462,185 @@ var HUBSPOT = {
57
462
  authorize: hubspotAuthorize,
58
463
  faker: hubspotFaker
59
464
  };
465
+ var COMPANY_CREATE_OPERATION = "company_create";
466
+ async function hubspotCompanyCreate(options) {
467
+ const config = options.config ?? {};
468
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
469
+ throw new Error(`company_create: "properties" is required (Properties).`);
470
+ }
471
+ return fancyConnectorCore.callConnector(HUBSPOT, {
472
+ operation: COMPANY_CREATE_OPERATION,
473
+ config,
474
+ input: options.input,
475
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
476
+ ...options.mode === void 0 ? {} : { mode: options.mode },
477
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
478
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
479
+ ...options.transport === void 0 ? {} : { transport: options.transport },
480
+ request: {
481
+ method: "POST",
482
+ path: "/crm/v3/objects/companies",
483
+ json: {
484
+ "properties": propertiesMap(config.properties),
485
+ "associations": []
486
+ }
487
+ }
488
+ });
489
+ }
490
+ function propertiesMap(value) {
491
+ if (!value || typeof value !== "object") return {};
492
+ const out = {};
493
+ for (const [key, item] of Object.entries(value)) {
494
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
495
+ }
496
+ return out;
497
+ }
498
+ var COMPANY_GET_OPERATION = "company_get";
499
+ async function hubspotCompanyGet(options) {
500
+ const config = options.config ?? {};
501
+ if (config.companyId === void 0 || config.companyId === null || config.companyId === "") {
502
+ throw new Error(`company_get: "companyId" is required (Company id).`);
503
+ }
504
+ return fancyConnectorCore.callConnector(HUBSPOT, {
505
+ operation: COMPANY_GET_OPERATION,
506
+ config,
507
+ input: options.input,
508
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
509
+ ...options.mode === void 0 ? {} : { mode: options.mode },
510
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
511
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
512
+ ...options.transport === void 0 ? {} : { transport: options.transport },
513
+ request: {
514
+ method: "GET",
515
+ path: `/crm/v3/objects/companies/${encodeURIComponent(String(config.companyId))}`,
516
+ query: {
517
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
518
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
519
+ }
520
+ }
521
+ });
522
+ }
523
+ var COMPANY_LIST_OPERATION = "company_list";
524
+ async function hubspotCompanyList(options) {
525
+ const config = options.config ?? {};
526
+ {
527
+ const n = Number(config.limit);
528
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
529
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
530
+ throw new Error(
531
+ `company_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
532
+ );
533
+ }
534
+ }
535
+ return fancyConnectorCore.callConnector(HUBSPOT, {
536
+ operation: COMPANY_LIST_OPERATION,
537
+ config,
538
+ input: options.input,
539
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
540
+ ...options.mode === void 0 ? {} : { mode: options.mode },
541
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
542
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
543
+ ...options.transport === void 0 ? {} : { transport: options.transport },
544
+ request: {
545
+ method: "GET",
546
+ path: "/crm/v3/objects/companies",
547
+ query: {
548
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
549
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {},
550
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
551
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
552
+ }
553
+ }
554
+ });
555
+ }
556
+ var COMPANY_SEARCH_OPERATION = "company_search";
557
+ async function hubspotCompanySearch(options) {
558
+ const config = options.config ?? {};
559
+ if (typeof config.filterGroups === "string" && config.filterGroups !== "") {
560
+ try {
561
+ JSON.parse(config.filterGroups);
562
+ } catch (error) {
563
+ throw new Error(`company_search: "filterGroups" must be JSON: ${error.message}`);
564
+ }
565
+ }
566
+ if (typeof config.sorts === "string" && config.sorts !== "") {
567
+ try {
568
+ JSON.parse(config.sorts);
569
+ } catch (error) {
570
+ throw new Error(`company_search: "sorts" must be JSON: ${error.message}`);
571
+ }
572
+ }
573
+ {
574
+ const n = Number(config.limit);
575
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
576
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {
577
+ throw new Error(
578
+ `company_search: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
579
+ );
580
+ }
581
+ }
582
+ return fancyConnectorCore.callConnector(HUBSPOT, {
583
+ operation: COMPANY_SEARCH_OPERATION,
584
+ config,
585
+ input: options.input,
586
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
587
+ ...options.mode === void 0 ? {} : { mode: options.mode },
588
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
589
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
590
+ ...options.transport === void 0 ? {} : { transport: options.transport },
591
+ request: {
592
+ method: "POST",
593
+ path: "/crm/v3/objects/companies/search",
594
+ json: {
595
+ ...config.filterGroups !== void 0 && config.filterGroups !== null && config.filterGroups !== "" ? { "filterGroups": typeof config.filterGroups === "string" ? JSON.parse(config.filterGroups) : config.filterGroups } : {},
596
+ ...config.sorts !== void 0 && config.sorts !== null && config.sorts !== "" ? { "sorts": typeof config.sorts === "string" ? JSON.parse(config.sorts) : config.sorts } : {},
597
+ ...config.query !== void 0 && config.query !== null && config.query !== "" ? { "query": String(config.query) } : {},
598
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": propertiesList(config.properties) } : {},
599
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
600
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
601
+ }
602
+ }
603
+ });
604
+ }
605
+ function propertiesList(value) {
606
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
607
+ return items.map((item) => item.trim()).filter(Boolean);
608
+ }
609
+ var COMPANY_UPDATE_OPERATION = "company_update";
610
+ async function hubspotCompanyUpdate(options) {
611
+ const config = options.config ?? {};
612
+ if (config.companyId === void 0 || config.companyId === null || config.companyId === "") {
613
+ throw new Error(`company_update: "companyId" is required (Company id).`);
614
+ }
615
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
616
+ throw new Error(`company_update: "properties" is required (Properties).`);
617
+ }
618
+ return fancyConnectorCore.callConnector(HUBSPOT, {
619
+ operation: COMPANY_UPDATE_OPERATION,
620
+ config,
621
+ input: options.input,
622
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
623
+ ...options.mode === void 0 ? {} : { mode: options.mode },
624
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
625
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
626
+ ...options.transport === void 0 ? {} : { transport: options.transport },
627
+ request: {
628
+ method: "PATCH",
629
+ path: `/crm/v3/objects/companies/${encodeURIComponent(String(config.companyId))}`,
630
+ json: {
631
+ "properties": propertiesMap2(config.properties)
632
+ }
633
+ }
634
+ });
635
+ }
636
+ function propertiesMap2(value) {
637
+ if (!value || typeof value !== "object") return {};
638
+ const out = {};
639
+ for (const [key, item] of Object.entries(value)) {
640
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
641
+ }
642
+ return out;
643
+ }
60
644
  var CONTACT_CREATE_OPERATION = "contact_create";
61
645
  async function hubspotContactCreate(options) {
62
646
  const config = options.config ?? {};
@@ -102,27 +686,697 @@ function nestFields(flat) {
102
686
  }
103
687
  return out;
104
688
  }
105
-
106
- // src/flow.ts
107
- var hubspotContactCreateExecutor = async (ctx) => {
108
- const config = ctx.node.data?.config ?? {};
109
- const result = await hubspotContactCreate({
689
+ var CONTACT_GET_OPERATION = "contact_get";
690
+ async function hubspotContactGet(options) {
691
+ const config = options.config ?? {};
692
+ if (config.contactId === void 0 || config.contactId === null || config.contactId === "") {
693
+ throw new Error(`contact_get: "contactId" is required (Contact id).`);
694
+ }
695
+ return fancyConnectorCore.callConnector(HUBSPOT, {
696
+ operation: CONTACT_GET_OPERATION,
110
697
  config,
111
- input: ctx.inputs?.in
698
+ input: options.input,
699
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
700
+ ...options.mode === void 0 ? {} : { mode: options.mode },
701
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
702
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
703
+ ...options.transport === void 0 ? {} : { transport: options.transport },
704
+ request: {
705
+ method: "GET",
706
+ path: `/crm/v3/objects/contacts/${encodeURIComponent(String(config.contactId))}`,
707
+ query: {
708
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
709
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
710
+ }
711
+ }
112
712
  });
113
- ctx.emit({
114
- type: "log",
115
- level: "info",
116
- nodeId: ctx.node.id,
117
- message: `hubspot contact_create ${result.data?.id} (${result.mode})`
713
+ }
714
+ var CONTACT_LIST_OPERATION = "contact_list";
715
+ async function hubspotContactList(options) {
716
+ const config = options.config ?? {};
717
+ {
718
+ const n = Number(config.limit);
719
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
720
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
721
+ throw new Error(
722
+ `contact_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
723
+ );
724
+ }
725
+ }
726
+ return fancyConnectorCore.callConnector(HUBSPOT, {
727
+ operation: CONTACT_LIST_OPERATION,
728
+ config,
729
+ input: options.input,
730
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
731
+ ...options.mode === void 0 ? {} : { mode: options.mode },
732
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
733
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
734
+ ...options.transport === void 0 ? {} : { transport: options.transport },
735
+ request: {
736
+ method: "GET",
737
+ path: "/crm/v3/objects/contacts",
738
+ query: {
739
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
740
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {},
741
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
742
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
743
+ }
744
+ }
745
+ });
746
+ }
747
+ var CONTACT_SEARCH_OPERATION = "contact_search";
748
+ async function hubspotContactSearch(options) {
749
+ const config = options.config ?? {};
750
+ if (typeof config.filterGroups === "string" && config.filterGroups !== "") {
751
+ try {
752
+ JSON.parse(config.filterGroups);
753
+ } catch (error) {
754
+ throw new Error(`contact_search: "filterGroups" must be JSON: ${error.message}`);
755
+ }
756
+ }
757
+ if (typeof config.sorts === "string" && config.sorts !== "") {
758
+ try {
759
+ JSON.parse(config.sorts);
760
+ } catch (error) {
761
+ throw new Error(`contact_search: "sorts" must be JSON: ${error.message}`);
762
+ }
763
+ }
764
+ {
765
+ const n = Number(config.limit);
766
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
767
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {
768
+ throw new Error(
769
+ `contact_search: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
770
+ );
771
+ }
772
+ }
773
+ return fancyConnectorCore.callConnector(HUBSPOT, {
774
+ operation: CONTACT_SEARCH_OPERATION,
775
+ config,
776
+ input: options.input,
777
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
778
+ ...options.mode === void 0 ? {} : { mode: options.mode },
779
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
780
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
781
+ ...options.transport === void 0 ? {} : { transport: options.transport },
782
+ request: {
783
+ method: "POST",
784
+ path: "/crm/v3/objects/contacts/search",
785
+ json: {
786
+ ...config.filterGroups !== void 0 && config.filterGroups !== null && config.filterGroups !== "" ? { "filterGroups": typeof config.filterGroups === "string" ? JSON.parse(config.filterGroups) : config.filterGroups } : {},
787
+ ...config.sorts !== void 0 && config.sorts !== null && config.sorts !== "" ? { "sorts": typeof config.sorts === "string" ? JSON.parse(config.sorts) : config.sorts } : {},
788
+ ...config.query !== void 0 && config.query !== null && config.query !== "" ? { "query": String(config.query) } : {},
789
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": propertiesList2(config.properties) } : {},
790
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
791
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
792
+ }
793
+ }
794
+ });
795
+ }
796
+ function propertiesList2(value) {
797
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
798
+ return items.map((item) => item.trim()).filter(Boolean);
799
+ }
800
+ var CONTACT_UPDATE_OPERATION = "contact_update";
801
+ async function hubspotContactUpdate(options) {
802
+ const config = options.config ?? {};
803
+ if (config.contactId === void 0 || config.contactId === null || config.contactId === "") {
804
+ throw new Error(`contact_update: "contactId" is required (Contact id).`);
805
+ }
806
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
807
+ throw new Error(`contact_update: "properties" is required (Properties).`);
808
+ }
809
+ return fancyConnectorCore.callConnector(HUBSPOT, {
810
+ operation: CONTACT_UPDATE_OPERATION,
811
+ config,
812
+ input: options.input,
813
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
814
+ ...options.mode === void 0 ? {} : { mode: options.mode },
815
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
816
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
817
+ ...options.transport === void 0 ? {} : { transport: options.transport },
818
+ request: {
819
+ method: "PATCH",
820
+ path: `/crm/v3/objects/contacts/${encodeURIComponent(String(config.contactId))}`,
821
+ json: {
822
+ "properties": propertiesMap3(config.properties)
823
+ }
824
+ }
825
+ });
826
+ }
827
+ function propertiesMap3(value) {
828
+ if (!value || typeof value !== "object") return {};
829
+ const out = {};
830
+ for (const [key, item] of Object.entries(value)) {
831
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
832
+ }
833
+ return out;
834
+ }
835
+ var DEAL_CREATE_OPERATION = "deal_create";
836
+ async function hubspotDealCreate(options) {
837
+ const config = options.config ?? {};
838
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
839
+ throw new Error(`deal_create: "properties" is required (Properties).`);
840
+ }
841
+ return fancyConnectorCore.callConnector(HUBSPOT, {
842
+ operation: DEAL_CREATE_OPERATION,
843
+ config,
844
+ input: options.input,
845
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
846
+ ...options.mode === void 0 ? {} : { mode: options.mode },
847
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
848
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
849
+ ...options.transport === void 0 ? {} : { transport: options.transport },
850
+ request: {
851
+ method: "POST",
852
+ path: "/crm/v3/objects/deals",
853
+ json: {
854
+ "properties": propertiesMap4(config.properties),
855
+ "associations": []
856
+ }
857
+ }
858
+ });
859
+ }
860
+ function propertiesMap4(value) {
861
+ if (!value || typeof value !== "object") return {};
862
+ const out = {};
863
+ for (const [key, item] of Object.entries(value)) {
864
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
865
+ }
866
+ return out;
867
+ }
868
+ var DEAL_GET_OPERATION = "deal_get";
869
+ async function hubspotDealGet(options) {
870
+ const config = options.config ?? {};
871
+ if (config.dealId === void 0 || config.dealId === null || config.dealId === "") {
872
+ throw new Error(`deal_get: "dealId" is required (Deal id).`);
873
+ }
874
+ return fancyConnectorCore.callConnector(HUBSPOT, {
875
+ operation: DEAL_GET_OPERATION,
876
+ config,
877
+ input: options.input,
878
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
879
+ ...options.mode === void 0 ? {} : { mode: options.mode },
880
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
881
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
882
+ ...options.transport === void 0 ? {} : { transport: options.transport },
883
+ request: {
884
+ method: "GET",
885
+ path: `/crm/v3/objects/deals/${encodeURIComponent(String(config.dealId))}`,
886
+ query: {
887
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
888
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
889
+ }
890
+ }
891
+ });
892
+ }
893
+ var DEAL_LIST_OPERATION = "deal_list";
894
+ async function hubspotDealList(options) {
895
+ const config = options.config ?? {};
896
+ {
897
+ const n = Number(config.limit);
898
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
899
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
900
+ throw new Error(
901
+ `deal_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
902
+ );
903
+ }
904
+ }
905
+ return fancyConnectorCore.callConnector(HUBSPOT, {
906
+ operation: DEAL_LIST_OPERATION,
907
+ config,
908
+ input: options.input,
909
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
910
+ ...options.mode === void 0 ? {} : { mode: options.mode },
911
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
912
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
913
+ ...options.transport === void 0 ? {} : { transport: options.transport },
914
+ request: {
915
+ method: "GET",
916
+ path: "/crm/v3/objects/deals",
917
+ query: {
918
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
919
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {},
920
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
921
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
922
+ }
923
+ }
924
+ });
925
+ }
926
+ var DEAL_SEARCH_OPERATION = "deal_search";
927
+ async function hubspotDealSearch(options) {
928
+ const config = options.config ?? {};
929
+ if (typeof config.filterGroups === "string" && config.filterGroups !== "") {
930
+ try {
931
+ JSON.parse(config.filterGroups);
932
+ } catch (error) {
933
+ throw new Error(`deal_search: "filterGroups" must be JSON: ${error.message}`);
934
+ }
935
+ }
936
+ if (typeof config.sorts === "string" && config.sorts !== "") {
937
+ try {
938
+ JSON.parse(config.sorts);
939
+ } catch (error) {
940
+ throw new Error(`deal_search: "sorts" must be JSON: ${error.message}`);
941
+ }
942
+ }
943
+ {
944
+ const n = Number(config.limit);
945
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
946
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {
947
+ throw new Error(
948
+ `deal_search: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
949
+ );
950
+ }
951
+ }
952
+ return fancyConnectorCore.callConnector(HUBSPOT, {
953
+ operation: DEAL_SEARCH_OPERATION,
954
+ config,
955
+ input: options.input,
956
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
957
+ ...options.mode === void 0 ? {} : { mode: options.mode },
958
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
959
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
960
+ ...options.transport === void 0 ? {} : { transport: options.transport },
961
+ request: {
962
+ method: "POST",
963
+ path: "/crm/v3/objects/deals/search",
964
+ json: {
965
+ ...config.filterGroups !== void 0 && config.filterGroups !== null && config.filterGroups !== "" ? { "filterGroups": typeof config.filterGroups === "string" ? JSON.parse(config.filterGroups) : config.filterGroups } : {},
966
+ ...config.sorts !== void 0 && config.sorts !== null && config.sorts !== "" ? { "sorts": typeof config.sorts === "string" ? JSON.parse(config.sorts) : config.sorts } : {},
967
+ ...config.query !== void 0 && config.query !== null && config.query !== "" ? { "query": String(config.query) } : {},
968
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": propertiesList3(config.properties) } : {},
969
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
970
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
971
+ }
972
+ }
973
+ });
974
+ }
975
+ function propertiesList3(value) {
976
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
977
+ return items.map((item) => item.trim()).filter(Boolean);
978
+ }
979
+ var DEAL_UPDATE_OPERATION = "deal_update";
980
+ async function hubspotDealUpdate(options) {
981
+ const config = options.config ?? {};
982
+ if (config.dealId === void 0 || config.dealId === null || config.dealId === "") {
983
+ throw new Error(`deal_update: "dealId" is required (Deal id).`);
984
+ }
985
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
986
+ throw new Error(`deal_update: "properties" is required (Properties).`);
987
+ }
988
+ return fancyConnectorCore.callConnector(HUBSPOT, {
989
+ operation: DEAL_UPDATE_OPERATION,
990
+ config,
991
+ input: options.input,
992
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
993
+ ...options.mode === void 0 ? {} : { mode: options.mode },
994
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
995
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
996
+ ...options.transport === void 0 ? {} : { transport: options.transport },
997
+ request: {
998
+ method: "PATCH",
999
+ path: `/crm/v3/objects/deals/${encodeURIComponent(String(config.dealId))}`,
1000
+ json: {
1001
+ "properties": propertiesMap5(config.properties)
1002
+ }
1003
+ }
1004
+ });
1005
+ }
1006
+ function propertiesMap5(value) {
1007
+ if (!value || typeof value !== "object") return {};
1008
+ const out = {};
1009
+ for (const [key, item] of Object.entries(value)) {
1010
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
1011
+ }
1012
+ return out;
1013
+ }
1014
+ var OWNER_LIST_OPERATION = "owner_list";
1015
+ async function hubspotOwnerList(options) {
1016
+ const config = options.config ?? {};
1017
+ {
1018
+ const n = Number(config.limit);
1019
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
1020
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
1021
+ throw new Error(
1022
+ `owner_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
1023
+ );
1024
+ }
1025
+ }
1026
+ return fancyConnectorCore.callConnector(HUBSPOT, {
1027
+ operation: OWNER_LIST_OPERATION,
1028
+ config,
1029
+ input: options.input,
1030
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
1031
+ ...options.mode === void 0 ? {} : { mode: options.mode },
1032
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
1033
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
1034
+ ...options.transport === void 0 ? {} : { transport: options.transport },
1035
+ request: {
1036
+ method: "GET",
1037
+ path: "/crm/v3/owners",
1038
+ query: {
1039
+ ...config.email !== void 0 && config.email !== null && config.email !== "" ? { "email": String(config.email) } : {},
1040
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
1041
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
1042
+ }
1043
+ }
1044
+ });
1045
+ }
1046
+ var PIPELINE_LIST_OPERATION = "pipeline_list";
1047
+ async function hubspotPipelineList(options) {
1048
+ const config = options.config ?? {};
1049
+ return fancyConnectorCore.callConnector(HUBSPOT, {
1050
+ operation: PIPELINE_LIST_OPERATION,
1051
+ config,
1052
+ input: options.input,
1053
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
1054
+ ...options.mode === void 0 ? {} : { mode: options.mode },
1055
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
1056
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
1057
+ ...options.transport === void 0 ? {} : { transport: options.transport },
1058
+ request: {
1059
+ method: "GET",
1060
+ path: "/crm/v3/pipelines/deals",
1061
+ query: {}
1062
+ }
1063
+ });
1064
+ }
1065
+ var PROPERTY_LIST_OPERATION = "property_list";
1066
+ async function hubspotPropertyList(options) {
1067
+ const config = options.config ?? {};
1068
+ if (config.objectType === void 0 || config.objectType === null || config.objectType === "") {
1069
+ throw new Error(`property_list: "objectType" is required (Object).`);
1070
+ }
1071
+ return fancyConnectorCore.callConnector(HUBSPOT, {
1072
+ operation: PROPERTY_LIST_OPERATION,
1073
+ config,
1074
+ input: options.input,
1075
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
1076
+ ...options.mode === void 0 ? {} : { mode: options.mode },
1077
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
1078
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
1079
+ ...options.transport === void 0 ? {} : { transport: options.transport },
1080
+ request: {
1081
+ method: "GET",
1082
+ path: `/crm/v3/properties/${encodeURIComponent(String(config.objectType))}`,
1083
+ query: {}
1084
+ }
1085
+ });
1086
+ }
1087
+
1088
+ // src/flow.ts
1089
+ var hubspotCompanyCreateExecutor = async (ctx) => {
1090
+ const config = ctx.node.data?.config ?? {};
1091
+ const result = await hubspotCompanyCreate({
1092
+ config,
1093
+ input: ctx.inputs?.in
1094
+ });
1095
+ ctx.emit({
1096
+ type: "log",
1097
+ level: "info",
1098
+ nodeId: ctx.node.id,
1099
+ message: `hubspot company_create ${result.data?.id} (${result.mode})`
1100
+ });
1101
+ return { __port: "out", value: result };
1102
+ };
1103
+ var hubspotCompanyGetExecutor = async (ctx) => {
1104
+ const config = ctx.node.data?.config ?? {};
1105
+ const result = await hubspotCompanyGet({
1106
+ config,
1107
+ input: ctx.inputs?.in
1108
+ });
1109
+ ctx.emit({
1110
+ type: "log",
1111
+ level: "info",
1112
+ nodeId: ctx.node.id,
1113
+ message: `hubspot company_get ${result.data?.id} (${result.mode})`
1114
+ });
1115
+ return { __port: "out", value: result };
1116
+ };
1117
+ var hubspotCompanyListExecutor = async (ctx) => {
1118
+ const config = ctx.node.data?.config ?? {};
1119
+ const result = await hubspotCompanyList({
1120
+ config,
1121
+ input: ctx.inputs?.in
1122
+ });
1123
+ ctx.emit({
1124
+ type: "log",
1125
+ level: "info",
1126
+ nodeId: ctx.node.id,
1127
+ message: `hubspot company_list ${result.data?.id} (${result.mode})`
1128
+ });
1129
+ return { __port: "out", value: result };
1130
+ };
1131
+ var hubspotCompanySearchExecutor = async (ctx) => {
1132
+ const config = ctx.node.data?.config ?? {};
1133
+ const result = await hubspotCompanySearch({
1134
+ config,
1135
+ input: ctx.inputs?.in
1136
+ });
1137
+ ctx.emit({
1138
+ type: "log",
1139
+ level: "info",
1140
+ nodeId: ctx.node.id,
1141
+ message: `hubspot company_search ${result.data?.id} (${result.mode})`
1142
+ });
1143
+ return { __port: "out", value: result };
1144
+ };
1145
+ var hubspotCompanyUpdateExecutor = async (ctx) => {
1146
+ const config = ctx.node.data?.config ?? {};
1147
+ const result = await hubspotCompanyUpdate({
1148
+ config,
1149
+ input: ctx.inputs?.in
1150
+ });
1151
+ ctx.emit({
1152
+ type: "log",
1153
+ level: "info",
1154
+ nodeId: ctx.node.id,
1155
+ message: `hubspot company_update ${result.data?.id} (${result.mode})`
1156
+ });
1157
+ return { __port: "out", value: result };
1158
+ };
1159
+ var hubspotContactCreateExecutor = async (ctx) => {
1160
+ const config = ctx.node.data?.config ?? {};
1161
+ const result = await hubspotContactCreate({
1162
+ config,
1163
+ input: ctx.inputs?.in
1164
+ });
1165
+ ctx.emit({
1166
+ type: "log",
1167
+ level: "info",
1168
+ nodeId: ctx.node.id,
1169
+ message: `hubspot contact_create ${result.data?.id} (${result.mode})`
1170
+ });
1171
+ return { __port: "out", value: result };
1172
+ };
1173
+ var hubspotContactGetExecutor = async (ctx) => {
1174
+ const config = ctx.node.data?.config ?? {};
1175
+ const result = await hubspotContactGet({
1176
+ config,
1177
+ input: ctx.inputs?.in
1178
+ });
1179
+ ctx.emit({
1180
+ type: "log",
1181
+ level: "info",
1182
+ nodeId: ctx.node.id,
1183
+ message: `hubspot contact_get ${result.data?.id} (${result.mode})`
1184
+ });
1185
+ return { __port: "out", value: result };
1186
+ };
1187
+ var hubspotContactListExecutor = async (ctx) => {
1188
+ const config = ctx.node.data?.config ?? {};
1189
+ const result = await hubspotContactList({
1190
+ config,
1191
+ input: ctx.inputs?.in
1192
+ });
1193
+ ctx.emit({
1194
+ type: "log",
1195
+ level: "info",
1196
+ nodeId: ctx.node.id,
1197
+ message: `hubspot contact_list ${result.data?.id} (${result.mode})`
1198
+ });
1199
+ return { __port: "out", value: result };
1200
+ };
1201
+ var hubspotContactSearchExecutor = async (ctx) => {
1202
+ const config = ctx.node.data?.config ?? {};
1203
+ const result = await hubspotContactSearch({
1204
+ config,
1205
+ input: ctx.inputs?.in
1206
+ });
1207
+ ctx.emit({
1208
+ type: "log",
1209
+ level: "info",
1210
+ nodeId: ctx.node.id,
1211
+ message: `hubspot contact_search ${result.data?.id} (${result.mode})`
1212
+ });
1213
+ return { __port: "out", value: result };
1214
+ };
1215
+ var hubspotContactUpdateExecutor = async (ctx) => {
1216
+ const config = ctx.node.data?.config ?? {};
1217
+ const result = await hubspotContactUpdate({
1218
+ config,
1219
+ input: ctx.inputs?.in
1220
+ });
1221
+ ctx.emit({
1222
+ type: "log",
1223
+ level: "info",
1224
+ nodeId: ctx.node.id,
1225
+ message: `hubspot contact_update ${result.data?.id} (${result.mode})`
1226
+ });
1227
+ return { __port: "out", value: result };
1228
+ };
1229
+ var hubspotDealCreateExecutor = async (ctx) => {
1230
+ const config = ctx.node.data?.config ?? {};
1231
+ const result = await hubspotDealCreate({
1232
+ config,
1233
+ input: ctx.inputs?.in
1234
+ });
1235
+ ctx.emit({
1236
+ type: "log",
1237
+ level: "info",
1238
+ nodeId: ctx.node.id,
1239
+ message: `hubspot deal_create ${result.data?.id} (${result.mode})`
1240
+ });
1241
+ return { __port: "out", value: result };
1242
+ };
1243
+ var hubspotDealGetExecutor = async (ctx) => {
1244
+ const config = ctx.node.data?.config ?? {};
1245
+ const result = await hubspotDealGet({
1246
+ config,
1247
+ input: ctx.inputs?.in
1248
+ });
1249
+ ctx.emit({
1250
+ type: "log",
1251
+ level: "info",
1252
+ nodeId: ctx.node.id,
1253
+ message: `hubspot deal_get ${result.data?.id} (${result.mode})`
1254
+ });
1255
+ return { __port: "out", value: result };
1256
+ };
1257
+ var hubspotDealListExecutor = async (ctx) => {
1258
+ const config = ctx.node.data?.config ?? {};
1259
+ const result = await hubspotDealList({
1260
+ config,
1261
+ input: ctx.inputs?.in
1262
+ });
1263
+ ctx.emit({
1264
+ type: "log",
1265
+ level: "info",
1266
+ nodeId: ctx.node.id,
1267
+ message: `hubspot deal_list ${result.data?.id} (${result.mode})`
1268
+ });
1269
+ return { __port: "out", value: result };
1270
+ };
1271
+ var hubspotDealSearchExecutor = async (ctx) => {
1272
+ const config = ctx.node.data?.config ?? {};
1273
+ const result = await hubspotDealSearch({
1274
+ config,
1275
+ input: ctx.inputs?.in
1276
+ });
1277
+ ctx.emit({
1278
+ type: "log",
1279
+ level: "info",
1280
+ nodeId: ctx.node.id,
1281
+ message: `hubspot deal_search ${result.data?.id} (${result.mode})`
1282
+ });
1283
+ return { __port: "out", value: result };
1284
+ };
1285
+ var hubspotDealUpdateExecutor = async (ctx) => {
1286
+ const config = ctx.node.data?.config ?? {};
1287
+ const result = await hubspotDealUpdate({
1288
+ config,
1289
+ input: ctx.inputs?.in
1290
+ });
1291
+ ctx.emit({
1292
+ type: "log",
1293
+ level: "info",
1294
+ nodeId: ctx.node.id,
1295
+ message: `hubspot deal_update ${result.data?.id} (${result.mode})`
1296
+ });
1297
+ return { __port: "out", value: result };
1298
+ };
1299
+ var hubspotOwnerListExecutor = async (ctx) => {
1300
+ const config = ctx.node.data?.config ?? {};
1301
+ const result = await hubspotOwnerList({
1302
+ config,
1303
+ input: ctx.inputs?.in
1304
+ });
1305
+ ctx.emit({
1306
+ type: "log",
1307
+ level: "info",
1308
+ nodeId: ctx.node.id,
1309
+ message: `hubspot owner_list ${result.data?.id} (${result.mode})`
1310
+ });
1311
+ return { __port: "out", value: result };
1312
+ };
1313
+ var hubspotPipelineListExecutor = async (ctx) => {
1314
+ const config = ctx.node.data?.config ?? {};
1315
+ const result = await hubspotPipelineList({
1316
+ config,
1317
+ input: ctx.inputs?.in
1318
+ });
1319
+ ctx.emit({
1320
+ type: "log",
1321
+ level: "info",
1322
+ nodeId: ctx.node.id,
1323
+ message: `hubspot pipeline_list ${result.data?.id} (${result.mode})`
1324
+ });
1325
+ return { __port: "out", value: result };
1326
+ };
1327
+ var hubspotPropertyListExecutor = async (ctx) => {
1328
+ const config = ctx.node.data?.config ?? {};
1329
+ const result = await hubspotPropertyList({
1330
+ config,
1331
+ input: ctx.inputs?.in
1332
+ });
1333
+ ctx.emit({
1334
+ type: "log",
1335
+ level: "info",
1336
+ nodeId: ctx.node.id,
1337
+ message: `hubspot property_list ${result.data?.id} (${result.mode})`
118
1338
  });
119
1339
  return { __port: "out", value: result };
120
1340
  };
121
1341
  var HUBSPOT_RUNNABLE_KINDS = [
122
- { ...hubspotUi.hubspotContactCreateKind, executor: hubspotContactCreateExecutor }
1342
+ { ...hubspotUi.hubspotCompanyCreateKind, executor: hubspotCompanyCreateExecutor },
1343
+ { ...hubspotUi.hubspotCompanyGetKind, executor: hubspotCompanyGetExecutor },
1344
+ { ...hubspotUi.hubspotCompanyListKind, executor: hubspotCompanyListExecutor },
1345
+ { ...hubspotUi.hubspotCompanySearchKind, executor: hubspotCompanySearchExecutor },
1346
+ { ...hubspotUi.hubspotCompanyUpdateKind, executor: hubspotCompanyUpdateExecutor },
1347
+ { ...hubspotUi.hubspotContactCreateKind, executor: hubspotContactCreateExecutor },
1348
+ { ...hubspotUi.hubspotContactGetKind, executor: hubspotContactGetExecutor },
1349
+ { ...hubspotUi.hubspotContactListKind, executor: hubspotContactListExecutor },
1350
+ { ...hubspotUi.hubspotContactSearchKind, executor: hubspotContactSearchExecutor },
1351
+ { ...hubspotUi.hubspotContactUpdateKind, executor: hubspotContactUpdateExecutor },
1352
+ { ...hubspotUi.hubspotDealCreateKind, executor: hubspotDealCreateExecutor },
1353
+ { ...hubspotUi.hubspotDealGetKind, executor: hubspotDealGetExecutor },
1354
+ { ...hubspotUi.hubspotDealListKind, executor: hubspotDealListExecutor },
1355
+ { ...hubspotUi.hubspotDealSearchKind, executor: hubspotDealSearchExecutor },
1356
+ { ...hubspotUi.hubspotDealUpdateKind, executor: hubspotDealUpdateExecutor },
1357
+ { ...hubspotUi.hubspotOwnerListKind, executor: hubspotOwnerListExecutor },
1358
+ { ...hubspotUi.hubspotPipelineListKind, executor: hubspotPipelineListExecutor },
1359
+ { ...hubspotUi.hubspotPropertyListKind, executor: hubspotPropertyListExecutor }
123
1360
  ];
124
1361
 
125
1362
  exports.HUBSPOT_RUNNABLE_KINDS = HUBSPOT_RUNNABLE_KINDS;
1363
+ exports.hubspotCompanyCreateExecutor = hubspotCompanyCreateExecutor;
1364
+ exports.hubspotCompanyGetExecutor = hubspotCompanyGetExecutor;
1365
+ exports.hubspotCompanyListExecutor = hubspotCompanyListExecutor;
1366
+ exports.hubspotCompanySearchExecutor = hubspotCompanySearchExecutor;
1367
+ exports.hubspotCompanyUpdateExecutor = hubspotCompanyUpdateExecutor;
126
1368
  exports.hubspotContactCreateExecutor = hubspotContactCreateExecutor;
1369
+ exports.hubspotContactGetExecutor = hubspotContactGetExecutor;
1370
+ exports.hubspotContactListExecutor = hubspotContactListExecutor;
1371
+ exports.hubspotContactSearchExecutor = hubspotContactSearchExecutor;
1372
+ exports.hubspotContactUpdateExecutor = hubspotContactUpdateExecutor;
1373
+ exports.hubspotDealCreateExecutor = hubspotDealCreateExecutor;
1374
+ exports.hubspotDealGetExecutor = hubspotDealGetExecutor;
1375
+ exports.hubspotDealListExecutor = hubspotDealListExecutor;
1376
+ exports.hubspotDealSearchExecutor = hubspotDealSearchExecutor;
1377
+ exports.hubspotDealUpdateExecutor = hubspotDealUpdateExecutor;
1378
+ exports.hubspotOwnerListExecutor = hubspotOwnerListExecutor;
1379
+ exports.hubspotPipelineListExecutor = hubspotPipelineListExecutor;
1380
+ exports.hubspotPropertyListExecutor = hubspotPropertyListExecutor;
127
1381
  //# sourceMappingURL=flow.cjs.map
128
1382
  //# sourceMappingURL=flow.cjs.map