@particle-academy/hubspot-js 0.3.3 → 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.
@@ -0,0 +1,1086 @@
1
+ import { callConnector } from '@particle-academy/fancy-connector-core';
2
+
3
+ // src/faker.ts
4
+ function fakeCompanyCreate({ config, fake }) {
5
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
6
+ return {
7
+ "id": boundRecordId,
8
+ "properties": {
9
+ "name": "Acme",
10
+ "domain": "acme.example.test",
11
+ "hs_object_id": boundRecordId,
12
+ "createdate": "2026-01-01T00:00:00.000Z",
13
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
14
+ },
15
+ "createdAt": "2026-01-01T00:00:00.000Z",
16
+ "updatedAt": "2026-01-01T00:00:00.000Z",
17
+ "archived": false
18
+ };
19
+ }
20
+ function fakeCompanyGet({ config, fake }) {
21
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
22
+ return {
23
+ "id": boundRecordId,
24
+ "properties": {
25
+ "name": "Acme",
26
+ "domain": "acme.example.test",
27
+ "hs_object_id": boundRecordId,
28
+ "createdate": "2026-01-01T00:00:00.000Z",
29
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
30
+ },
31
+ "createdAt": "2026-01-01T00:00:00.000Z",
32
+ "updatedAt": "2026-01-01T00:00:00.000Z",
33
+ "archived": false
34
+ };
35
+ }
36
+ function fakeCompanyList({ config, fake }) {
37
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
38
+ return {
39
+ "results": [
40
+ {
41
+ "id": boundRecordId,
42
+ "properties": {
43
+ "name": "Acme",
44
+ "domain": "acme.example.test",
45
+ "hs_object_id": boundRecordId,
46
+ "createdate": "2026-01-01T00:00:00.000Z",
47
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
48
+ },
49
+ "createdAt": "2026-01-01T00:00:00.000Z",
50
+ "updatedAt": "2026-01-01T00:00:00.000Z",
51
+ "archived": false
52
+ }
53
+ ],
54
+ "paging": {
55
+ "next": {
56
+ "after": "10",
57
+ "link": "?after=10"
58
+ }
59
+ }
60
+ };
61
+ }
62
+ function fakeCompanySearch({ config, fake }) {
63
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
64
+ return {
65
+ "total": 1,
66
+ "results": [
67
+ {
68
+ "id": boundRecordId,
69
+ "properties": {
70
+ "name": "Acme",
71
+ "domain": "acme.example.test",
72
+ "hs_object_id": boundRecordId,
73
+ "createdate": "2026-01-01T00:00:00.000Z",
74
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
75
+ },
76
+ "createdAt": "2026-01-01T00:00:00.000Z",
77
+ "updatedAt": "2026-01-01T00:00:00.000Z",
78
+ "archived": false
79
+ }
80
+ ],
81
+ "paging": {
82
+ "next": {
83
+ "after": "10",
84
+ "link": "?after=10"
85
+ }
86
+ }
87
+ };
88
+ }
89
+ function fakeCompanyUpdate({ config, fake }) {
90
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
91
+ return {
92
+ "id": boundRecordId,
93
+ "properties": {
94
+ "name": "Acme",
95
+ "domain": "acme.example.test",
96
+ "hs_object_id": boundRecordId,
97
+ "createdate": "2026-01-01T00:00:00.000Z",
98
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
99
+ },
100
+ "createdAt": "2026-01-01T00:00:00.000Z",
101
+ "updatedAt": "2026-01-01T00:00:00.000Z",
102
+ "archived": false
103
+ };
104
+ }
105
+ function fakeContactCreate({ config, fake }) {
106
+ const boundContactId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
107
+ return {
108
+ "id": boundContactId,
109
+ "properties": {
110
+ "email": config.email !== void 0 && config.email !== null && config.email !== "" ? String(config.email) : null,
111
+ "firstname": config.firstName !== void 0 && config.firstName !== null && config.firstName !== "" ? String(config.firstName) : null,
112
+ "lastname": config.lastName !== void 0 && config.lastName !== null && config.lastName !== "" ? String(config.lastName) : null,
113
+ "company": config.company !== void 0 && config.company !== null && config.company !== "" ? String(config.company) : null,
114
+ "phone": config.phone !== void 0 && config.phone !== null && config.phone !== "" ? String(config.phone) : null,
115
+ "lifecyclestage": config.lifecycleStage !== void 0 && config.lifecycleStage !== null && config.lifecycleStage !== "" ? String(config.lifecycleStage) : "lead",
116
+ "createdate": "2026-01-01T00:00:00.000Z",
117
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z",
118
+ "hs_object_id": boundContactId
119
+ },
120
+ "createdAt": "2026-01-01T00:00:00.000Z",
121
+ "updatedAt": "2026-01-01T00:00:00.000Z",
122
+ "archived": false
123
+ };
124
+ }
125
+ function fakeContactGet({ config, fake }) {
126
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
127
+ return {
128
+ "id": boundRecordId,
129
+ "properties": {
130
+ "email": "rosa@example.test",
131
+ "firstname": "Rosa",
132
+ "lastname": "Diaz",
133
+ "hs_object_id": boundRecordId,
134
+ "createdate": "2026-01-01T00:00:00.000Z",
135
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
136
+ },
137
+ "createdAt": "2026-01-01T00:00:00.000Z",
138
+ "updatedAt": "2026-01-01T00:00:00.000Z",
139
+ "archived": false
140
+ };
141
+ }
142
+ function fakeContactList({ config, fake }) {
143
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
144
+ return {
145
+ "results": [
146
+ {
147
+ "id": boundRecordId,
148
+ "properties": {
149
+ "email": "rosa@example.test",
150
+ "firstname": "Rosa",
151
+ "lastname": "Diaz",
152
+ "hs_object_id": boundRecordId,
153
+ "createdate": "2026-01-01T00:00:00.000Z",
154
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
155
+ },
156
+ "createdAt": "2026-01-01T00:00:00.000Z",
157
+ "updatedAt": "2026-01-01T00:00:00.000Z",
158
+ "archived": false
159
+ }
160
+ ],
161
+ "paging": {
162
+ "next": {
163
+ "after": "10",
164
+ "link": "?after=10"
165
+ }
166
+ }
167
+ };
168
+ }
169
+ function fakeContactSearch({ config, fake }) {
170
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
171
+ return {
172
+ "total": 1,
173
+ "results": [
174
+ {
175
+ "id": boundRecordId,
176
+ "properties": {
177
+ "email": "rosa@example.test",
178
+ "firstname": "Rosa",
179
+ "lastname": "Diaz",
180
+ "hs_object_id": boundRecordId,
181
+ "createdate": "2026-01-01T00:00:00.000Z",
182
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
183
+ },
184
+ "createdAt": "2026-01-01T00:00:00.000Z",
185
+ "updatedAt": "2026-01-01T00:00:00.000Z",
186
+ "archived": false
187
+ }
188
+ ],
189
+ "paging": {
190
+ "next": {
191
+ "after": "10",
192
+ "link": "?after=10"
193
+ }
194
+ }
195
+ };
196
+ }
197
+ function fakeContactUpdate({ config, fake }) {
198
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
199
+ return {
200
+ "id": boundRecordId,
201
+ "properties": {
202
+ "email": "rosa@example.test",
203
+ "firstname": "Rosa",
204
+ "lastname": "Diaz",
205
+ "hs_object_id": boundRecordId,
206
+ "createdate": "2026-01-01T00:00:00.000Z",
207
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
208
+ },
209
+ "createdAt": "2026-01-01T00:00:00.000Z",
210
+ "updatedAt": "2026-01-01T00:00:00.000Z",
211
+ "archived": false
212
+ };
213
+ }
214
+ function fakeDealCreate({ config, fake }) {
215
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
216
+ return {
217
+ "id": boundRecordId,
218
+ "properties": {
219
+ "dealname": "Acme renewal",
220
+ "amount": "12000",
221
+ "dealstage": "appointmentscheduled",
222
+ "pipeline": "default",
223
+ "hs_object_id": boundRecordId,
224
+ "createdate": "2026-01-01T00:00:00.000Z",
225
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
226
+ },
227
+ "createdAt": "2026-01-01T00:00:00.000Z",
228
+ "updatedAt": "2026-01-01T00:00:00.000Z",
229
+ "archived": false
230
+ };
231
+ }
232
+ function fakeDealGet({ config, fake }) {
233
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
234
+ return {
235
+ "id": boundRecordId,
236
+ "properties": {
237
+ "dealname": "Acme renewal",
238
+ "amount": "12000",
239
+ "dealstage": "appointmentscheduled",
240
+ "pipeline": "default",
241
+ "hs_object_id": boundRecordId,
242
+ "createdate": "2026-01-01T00:00:00.000Z",
243
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
244
+ },
245
+ "createdAt": "2026-01-01T00:00:00.000Z",
246
+ "updatedAt": "2026-01-01T00:00:00.000Z",
247
+ "archived": false
248
+ };
249
+ }
250
+ function fakeDealList({ config, fake }) {
251
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
252
+ return {
253
+ "results": [
254
+ {
255
+ "id": boundRecordId,
256
+ "properties": {
257
+ "dealname": "Acme renewal",
258
+ "amount": "12000",
259
+ "dealstage": "appointmentscheduled",
260
+ "pipeline": "default",
261
+ "hs_object_id": boundRecordId,
262
+ "createdate": "2026-01-01T00:00:00.000Z",
263
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
264
+ },
265
+ "createdAt": "2026-01-01T00:00:00.000Z",
266
+ "updatedAt": "2026-01-01T00:00:00.000Z",
267
+ "archived": false
268
+ }
269
+ ],
270
+ "paging": {
271
+ "next": {
272
+ "after": "10",
273
+ "link": "?after=10"
274
+ }
275
+ }
276
+ };
277
+ }
278
+ function fakeDealSearch({ config, fake }) {
279
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
280
+ return {
281
+ "total": 1,
282
+ "results": [
283
+ {
284
+ "id": boundRecordId,
285
+ "properties": {
286
+ "dealname": "Acme renewal",
287
+ "amount": "12000",
288
+ "dealstage": "appointmentscheduled",
289
+ "pipeline": "default",
290
+ "hs_object_id": boundRecordId,
291
+ "createdate": "2026-01-01T00:00:00.000Z",
292
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
293
+ },
294
+ "createdAt": "2026-01-01T00:00:00.000Z",
295
+ "updatedAt": "2026-01-01T00:00:00.000Z",
296
+ "archived": false
297
+ }
298
+ ],
299
+ "paging": {
300
+ "next": {
301
+ "after": "10",
302
+ "link": "?after=10"
303
+ }
304
+ }
305
+ };
306
+ }
307
+ function fakeDealUpdate({ config, fake }) {
308
+ const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join("");
309
+ return {
310
+ "id": boundRecordId,
311
+ "properties": {
312
+ "dealname": "Acme renewal",
313
+ "amount": "12000",
314
+ "dealstage": "appointmentscheduled",
315
+ "pipeline": "default",
316
+ "hs_object_id": boundRecordId,
317
+ "createdate": "2026-01-01T00:00:00.000Z",
318
+ "lastmodifieddate": "2026-01-01T00:00:00.000Z"
319
+ },
320
+ "createdAt": "2026-01-01T00:00:00.000Z",
321
+ "updatedAt": "2026-01-01T00:00:00.000Z",
322
+ "archived": false
323
+ };
324
+ }
325
+ function fakeOwnerList({ config, fake }) {
326
+ const boundOwnerId = Array.from({ length: 8 }, () => fake.int(0, 9)).join("");
327
+ return {
328
+ "results": [
329
+ {
330
+ "id": boundOwnerId,
331
+ "email": "rosa@example.test",
332
+ "firstName": "Rosa",
333
+ "lastName": "Diaz",
334
+ "userId": 4242,
335
+ "archived": false
336
+ }
337
+ ],
338
+ "paging": {
339
+ "next": {
340
+ "after": "10",
341
+ "link": "?after=10"
342
+ }
343
+ }
344
+ };
345
+ }
346
+ function fakePipelineList({ config, fake }) {
347
+ return {
348
+ "results": [
349
+ {
350
+ "id": "default",
351
+ "label": "Sales pipeline",
352
+ "displayOrder": 0,
353
+ "archived": false,
354
+ "stages": [
355
+ {
356
+ "id": "appointmentscheduled",
357
+ "label": "Appointment scheduled",
358
+ "displayOrder": 0,
359
+ "metadata": {
360
+ "probability": "0.2"
361
+ }
362
+ },
363
+ {
364
+ "id": "closedwon",
365
+ "label": "Closed won",
366
+ "displayOrder": 1,
367
+ "metadata": {
368
+ "probability": "1.0"
369
+ }
370
+ }
371
+ ]
372
+ }
373
+ ]
374
+ };
375
+ }
376
+ function fakePropertyList({ config, fake }) {
377
+ return {
378
+ "results": [
379
+ {
380
+ "name": "dealstage",
381
+ "label": "Deal Stage",
382
+ "type": "enumeration",
383
+ "fieldType": "select",
384
+ "groupName": "dealinformation",
385
+ "options": [
386
+ {
387
+ "label": "Appointment scheduled",
388
+ "value": "appointmentscheduled"
389
+ }
390
+ ]
391
+ }
392
+ ]
393
+ };
394
+ }
395
+ var hubspotFaker = (operation, request) => {
396
+ switch (operation) {
397
+ case "company_create":
398
+ return fakeCompanyCreate(request);
399
+ case "company_get":
400
+ return fakeCompanyGet(request);
401
+ case "company_list":
402
+ return fakeCompanyList(request);
403
+ case "company_search":
404
+ return fakeCompanySearch(request);
405
+ case "company_update":
406
+ return fakeCompanyUpdate(request);
407
+ case "contact_create":
408
+ return fakeContactCreate(request);
409
+ case "contact_get":
410
+ return fakeContactGet(request);
411
+ case "contact_list":
412
+ return fakeContactList(request);
413
+ case "contact_search":
414
+ return fakeContactSearch(request);
415
+ case "contact_update":
416
+ return fakeContactUpdate(request);
417
+ case "deal_create":
418
+ return fakeDealCreate(request);
419
+ case "deal_get":
420
+ return fakeDealGet(request);
421
+ case "deal_list":
422
+ return fakeDealList(request);
423
+ case "deal_search":
424
+ return fakeDealSearch(request);
425
+ case "deal_update":
426
+ return fakeDealUpdate(request);
427
+ case "owner_list":
428
+ return fakeOwnerList(request);
429
+ case "pipeline_list":
430
+ return fakePipelineList(request);
431
+ case "property_list":
432
+ return fakePropertyList(request);
433
+ default:
434
+ throw new Error(
435
+ `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.`
436
+ );
437
+ }
438
+ };
439
+
440
+ // src/service.ts
441
+ var CONNECTOR_API_VERSION = 1;
442
+ var HUBSPOT_BASE_URLS = {
443
+ "live": "https://api.hubapi.com",
444
+ "sandbox": "https://api.hubapi.com"
445
+ };
446
+ var HUBSPOT_REQUIRES = [
447
+ "accessToken"
448
+ ];
449
+ function hubspotAuthorize(credentials, request, _mode) {
450
+ request.headers.Authorization = `Bearer ${credentials.accessToken ?? ""}`;
451
+ }
452
+ var HUBSPOT = {
453
+ service: "hubspot",
454
+ title: "HubSpot",
455
+ sandbox: "separate-account",
456
+ baseUrls: { ...HUBSPOT_BASE_URLS },
457
+ requires: [...HUBSPOT_REQUIRES],
458
+ authorize: hubspotAuthorize,
459
+ faker: hubspotFaker
460
+ };
461
+ var COMPANY_CREATE_OPERATION = "company_create";
462
+ async function hubspotCompanyCreate(options) {
463
+ const config = options.config ?? {};
464
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
465
+ throw new Error(`company_create: "properties" is required (Properties).`);
466
+ }
467
+ return callConnector(HUBSPOT, {
468
+ operation: COMPANY_CREATE_OPERATION,
469
+ config,
470
+ input: options.input,
471
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
472
+ ...options.mode === void 0 ? {} : { mode: options.mode },
473
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
474
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
475
+ ...options.transport === void 0 ? {} : { transport: options.transport },
476
+ request: {
477
+ method: "POST",
478
+ path: "/crm/v3/objects/companies",
479
+ json: {
480
+ "properties": propertiesMap(config.properties),
481
+ "associations": []
482
+ }
483
+ }
484
+ });
485
+ }
486
+ function propertiesMap(value) {
487
+ if (!value || typeof value !== "object") return {};
488
+ const out = {};
489
+ for (const [key, item] of Object.entries(value)) {
490
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
491
+ }
492
+ return out;
493
+ }
494
+ var COMPANY_GET_OPERATION = "company_get";
495
+ async function hubspotCompanyGet(options) {
496
+ const config = options.config ?? {};
497
+ if (config.companyId === void 0 || config.companyId === null || config.companyId === "") {
498
+ throw new Error(`company_get: "companyId" is required (Company id).`);
499
+ }
500
+ return callConnector(HUBSPOT, {
501
+ operation: COMPANY_GET_OPERATION,
502
+ config,
503
+ input: options.input,
504
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
505
+ ...options.mode === void 0 ? {} : { mode: options.mode },
506
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
507
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
508
+ ...options.transport === void 0 ? {} : { transport: options.transport },
509
+ request: {
510
+ method: "GET",
511
+ path: `/crm/v3/objects/companies/${encodeURIComponent(String(config.companyId))}`,
512
+ query: {
513
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
514
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
515
+ }
516
+ }
517
+ });
518
+ }
519
+ var COMPANY_LIST_OPERATION = "company_list";
520
+ async function hubspotCompanyList(options) {
521
+ const config = options.config ?? {};
522
+ {
523
+ const n = Number(config.limit);
524
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
525
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
526
+ throw new Error(
527
+ `company_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
528
+ );
529
+ }
530
+ }
531
+ return callConnector(HUBSPOT, {
532
+ operation: COMPANY_LIST_OPERATION,
533
+ config,
534
+ input: options.input,
535
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
536
+ ...options.mode === void 0 ? {} : { mode: options.mode },
537
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
538
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
539
+ ...options.transport === void 0 ? {} : { transport: options.transport },
540
+ request: {
541
+ method: "GET",
542
+ path: "/crm/v3/objects/companies",
543
+ query: {
544
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
545
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {},
546
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
547
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
548
+ }
549
+ }
550
+ });
551
+ }
552
+ var COMPANY_SEARCH_OPERATION = "company_search";
553
+ async function hubspotCompanySearch(options) {
554
+ const config = options.config ?? {};
555
+ if (typeof config.filterGroups === "string" && config.filterGroups !== "") {
556
+ try {
557
+ JSON.parse(config.filterGroups);
558
+ } catch (error) {
559
+ throw new Error(`company_search: "filterGroups" must be JSON: ${error.message}`);
560
+ }
561
+ }
562
+ if (typeof config.sorts === "string" && config.sorts !== "") {
563
+ try {
564
+ JSON.parse(config.sorts);
565
+ } catch (error) {
566
+ throw new Error(`company_search: "sorts" must be JSON: ${error.message}`);
567
+ }
568
+ }
569
+ {
570
+ const n = Number(config.limit);
571
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
572
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {
573
+ throw new Error(
574
+ `company_search: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
575
+ );
576
+ }
577
+ }
578
+ return callConnector(HUBSPOT, {
579
+ operation: COMPANY_SEARCH_OPERATION,
580
+ config,
581
+ input: options.input,
582
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
583
+ ...options.mode === void 0 ? {} : { mode: options.mode },
584
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
585
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
586
+ ...options.transport === void 0 ? {} : { transport: options.transport },
587
+ request: {
588
+ method: "POST",
589
+ path: "/crm/v3/objects/companies/search",
590
+ json: {
591
+ ...config.filterGroups !== void 0 && config.filterGroups !== null && config.filterGroups !== "" ? { "filterGroups": typeof config.filterGroups === "string" ? JSON.parse(config.filterGroups) : config.filterGroups } : {},
592
+ ...config.sorts !== void 0 && config.sorts !== null && config.sorts !== "" ? { "sorts": typeof config.sorts === "string" ? JSON.parse(config.sorts) : config.sorts } : {},
593
+ ...config.query !== void 0 && config.query !== null && config.query !== "" ? { "query": String(config.query) } : {},
594
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": propertiesList(config.properties) } : {},
595
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
596
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
597
+ }
598
+ }
599
+ });
600
+ }
601
+ function propertiesList(value) {
602
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
603
+ return items.map((item) => item.trim()).filter(Boolean);
604
+ }
605
+ var COMPANY_UPDATE_OPERATION = "company_update";
606
+ async function hubspotCompanyUpdate(options) {
607
+ const config = options.config ?? {};
608
+ if (config.companyId === void 0 || config.companyId === null || config.companyId === "") {
609
+ throw new Error(`company_update: "companyId" is required (Company id).`);
610
+ }
611
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
612
+ throw new Error(`company_update: "properties" is required (Properties).`);
613
+ }
614
+ return callConnector(HUBSPOT, {
615
+ operation: COMPANY_UPDATE_OPERATION,
616
+ config,
617
+ input: options.input,
618
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
619
+ ...options.mode === void 0 ? {} : { mode: options.mode },
620
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
621
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
622
+ ...options.transport === void 0 ? {} : { transport: options.transport },
623
+ request: {
624
+ method: "PATCH",
625
+ path: `/crm/v3/objects/companies/${encodeURIComponent(String(config.companyId))}`,
626
+ json: {
627
+ "properties": propertiesMap2(config.properties)
628
+ }
629
+ }
630
+ });
631
+ }
632
+ function propertiesMap2(value) {
633
+ if (!value || typeof value !== "object") return {};
634
+ const out = {};
635
+ for (const [key, item] of Object.entries(value)) {
636
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
637
+ }
638
+ return out;
639
+ }
640
+ var CONTACT_CREATE_OPERATION = "contact_create";
641
+ async function hubspotContactCreate(options) {
642
+ const config = options.config ?? {};
643
+ if (config.email === void 0 || config.email === null || config.email === "") {
644
+ throw new Error(`contact_create: "email" is required (Email).`);
645
+ }
646
+ return callConnector(HUBSPOT, {
647
+ operation: CONTACT_CREATE_OPERATION,
648
+ config,
649
+ input: options.input,
650
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
651
+ ...options.mode === void 0 ? {} : { mode: options.mode },
652
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
653
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
654
+ ...options.transport === void 0 ? {} : { transport: options.transport },
655
+ request: {
656
+ method: "POST",
657
+ path: "/crm/v3/objects/contacts",
658
+ json: nestFields({
659
+ "properties.email": String(config.email).trim(),
660
+ ...config.firstName !== void 0 && config.firstName !== null && config.firstName !== "" ? { "properties.firstname": String(config.firstName) } : {},
661
+ ...config.lastName !== void 0 && config.lastName !== null && config.lastName !== "" ? { "properties.lastname": String(config.lastName) } : {},
662
+ ...config.company !== void 0 && config.company !== null && config.company !== "" ? { "properties.company": String(config.company) } : {},
663
+ ...config.phone !== void 0 && config.phone !== null && config.phone !== "" ? { "properties.phone": String(config.phone) } : {},
664
+ ...config.lifecycleStage !== void 0 && config.lifecycleStage !== null && config.lifecycleStage !== "" ? { "properties.lifecyclestage": String(config.lifecycleStage) } : {},
665
+ "associations": []
666
+ })
667
+ }
668
+ });
669
+ }
670
+ function nestFields(flat) {
671
+ const out = {};
672
+ for (const [path, value] of Object.entries(flat)) {
673
+ const parts = path.split(".");
674
+ let node = out;
675
+ while (parts.length > 1) {
676
+ const key = parts.shift();
677
+ const wantsArray = /^\d+$/.test(parts[0] ?? "");
678
+ if (typeof node[key] !== "object" || node[key] === null) node[key] = wantsArray ? [] : {};
679
+ node = node[key];
680
+ }
681
+ node[parts[0]] = value;
682
+ }
683
+ return out;
684
+ }
685
+ var CONTACT_GET_OPERATION = "contact_get";
686
+ async function hubspotContactGet(options) {
687
+ const config = options.config ?? {};
688
+ if (config.contactId === void 0 || config.contactId === null || config.contactId === "") {
689
+ throw new Error(`contact_get: "contactId" is required (Contact id).`);
690
+ }
691
+ return callConnector(HUBSPOT, {
692
+ operation: CONTACT_GET_OPERATION,
693
+ config,
694
+ input: options.input,
695
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
696
+ ...options.mode === void 0 ? {} : { mode: options.mode },
697
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
698
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
699
+ ...options.transport === void 0 ? {} : { transport: options.transport },
700
+ request: {
701
+ method: "GET",
702
+ path: `/crm/v3/objects/contacts/${encodeURIComponent(String(config.contactId))}`,
703
+ query: {
704
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
705
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
706
+ }
707
+ }
708
+ });
709
+ }
710
+ var CONTACT_LIST_OPERATION = "contact_list";
711
+ async function hubspotContactList(options) {
712
+ const config = options.config ?? {};
713
+ {
714
+ const n = Number(config.limit);
715
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
716
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
717
+ throw new Error(
718
+ `contact_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
719
+ );
720
+ }
721
+ }
722
+ return callConnector(HUBSPOT, {
723
+ operation: CONTACT_LIST_OPERATION,
724
+ config,
725
+ input: options.input,
726
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
727
+ ...options.mode === void 0 ? {} : { mode: options.mode },
728
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
729
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
730
+ ...options.transport === void 0 ? {} : { transport: options.transport },
731
+ request: {
732
+ method: "GET",
733
+ path: "/crm/v3/objects/contacts",
734
+ query: {
735
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
736
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {},
737
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
738
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
739
+ }
740
+ }
741
+ });
742
+ }
743
+ var CONTACT_SEARCH_OPERATION = "contact_search";
744
+ async function hubspotContactSearch(options) {
745
+ const config = options.config ?? {};
746
+ if (typeof config.filterGroups === "string" && config.filterGroups !== "") {
747
+ try {
748
+ JSON.parse(config.filterGroups);
749
+ } catch (error) {
750
+ throw new Error(`contact_search: "filterGroups" must be JSON: ${error.message}`);
751
+ }
752
+ }
753
+ if (typeof config.sorts === "string" && config.sorts !== "") {
754
+ try {
755
+ JSON.parse(config.sorts);
756
+ } catch (error) {
757
+ throw new Error(`contact_search: "sorts" must be JSON: ${error.message}`);
758
+ }
759
+ }
760
+ {
761
+ const n = Number(config.limit);
762
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
763
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {
764
+ throw new Error(
765
+ `contact_search: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
766
+ );
767
+ }
768
+ }
769
+ return callConnector(HUBSPOT, {
770
+ operation: CONTACT_SEARCH_OPERATION,
771
+ config,
772
+ input: options.input,
773
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
774
+ ...options.mode === void 0 ? {} : { mode: options.mode },
775
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
776
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
777
+ ...options.transport === void 0 ? {} : { transport: options.transport },
778
+ request: {
779
+ method: "POST",
780
+ path: "/crm/v3/objects/contacts/search",
781
+ json: {
782
+ ...config.filterGroups !== void 0 && config.filterGroups !== null && config.filterGroups !== "" ? { "filterGroups": typeof config.filterGroups === "string" ? JSON.parse(config.filterGroups) : config.filterGroups } : {},
783
+ ...config.sorts !== void 0 && config.sorts !== null && config.sorts !== "" ? { "sorts": typeof config.sorts === "string" ? JSON.parse(config.sorts) : config.sorts } : {},
784
+ ...config.query !== void 0 && config.query !== null && config.query !== "" ? { "query": String(config.query) } : {},
785
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": propertiesList2(config.properties) } : {},
786
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
787
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
788
+ }
789
+ }
790
+ });
791
+ }
792
+ function propertiesList2(value) {
793
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
794
+ return items.map((item) => item.trim()).filter(Boolean);
795
+ }
796
+ var CONTACT_UPDATE_OPERATION = "contact_update";
797
+ async function hubspotContactUpdate(options) {
798
+ const config = options.config ?? {};
799
+ if (config.contactId === void 0 || config.contactId === null || config.contactId === "") {
800
+ throw new Error(`contact_update: "contactId" is required (Contact id).`);
801
+ }
802
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
803
+ throw new Error(`contact_update: "properties" is required (Properties).`);
804
+ }
805
+ return callConnector(HUBSPOT, {
806
+ operation: CONTACT_UPDATE_OPERATION,
807
+ config,
808
+ input: options.input,
809
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
810
+ ...options.mode === void 0 ? {} : { mode: options.mode },
811
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
812
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
813
+ ...options.transport === void 0 ? {} : { transport: options.transport },
814
+ request: {
815
+ method: "PATCH",
816
+ path: `/crm/v3/objects/contacts/${encodeURIComponent(String(config.contactId))}`,
817
+ json: {
818
+ "properties": propertiesMap3(config.properties)
819
+ }
820
+ }
821
+ });
822
+ }
823
+ function propertiesMap3(value) {
824
+ if (!value || typeof value !== "object") return {};
825
+ const out = {};
826
+ for (const [key, item] of Object.entries(value)) {
827
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
828
+ }
829
+ return out;
830
+ }
831
+ var DEAL_CREATE_OPERATION = "deal_create";
832
+ async function hubspotDealCreate(options) {
833
+ const config = options.config ?? {};
834
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
835
+ throw new Error(`deal_create: "properties" is required (Properties).`);
836
+ }
837
+ return callConnector(HUBSPOT, {
838
+ operation: DEAL_CREATE_OPERATION,
839
+ config,
840
+ input: options.input,
841
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
842
+ ...options.mode === void 0 ? {} : { mode: options.mode },
843
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
844
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
845
+ ...options.transport === void 0 ? {} : { transport: options.transport },
846
+ request: {
847
+ method: "POST",
848
+ path: "/crm/v3/objects/deals",
849
+ json: {
850
+ "properties": propertiesMap4(config.properties),
851
+ "associations": []
852
+ }
853
+ }
854
+ });
855
+ }
856
+ function propertiesMap4(value) {
857
+ if (!value || typeof value !== "object") return {};
858
+ const out = {};
859
+ for (const [key, item] of Object.entries(value)) {
860
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
861
+ }
862
+ return out;
863
+ }
864
+ var DEAL_GET_OPERATION = "deal_get";
865
+ async function hubspotDealGet(options) {
866
+ const config = options.config ?? {};
867
+ if (config.dealId === void 0 || config.dealId === null || config.dealId === "") {
868
+ throw new Error(`deal_get: "dealId" is required (Deal id).`);
869
+ }
870
+ return callConnector(HUBSPOT, {
871
+ operation: DEAL_GET_OPERATION,
872
+ config,
873
+ input: options.input,
874
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
875
+ ...options.mode === void 0 ? {} : { mode: options.mode },
876
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
877
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
878
+ ...options.transport === void 0 ? {} : { transport: options.transport },
879
+ request: {
880
+ method: "GET",
881
+ path: `/crm/v3/objects/deals/${encodeURIComponent(String(config.dealId))}`,
882
+ query: {
883
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
884
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
885
+ }
886
+ }
887
+ });
888
+ }
889
+ var DEAL_LIST_OPERATION = "deal_list";
890
+ async function hubspotDealList(options) {
891
+ const config = options.config ?? {};
892
+ {
893
+ const n = Number(config.limit);
894
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
895
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
896
+ throw new Error(
897
+ `deal_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
898
+ );
899
+ }
900
+ }
901
+ return callConnector(HUBSPOT, {
902
+ operation: DEAL_LIST_OPERATION,
903
+ config,
904
+ input: options.input,
905
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
906
+ ...options.mode === void 0 ? {} : { mode: options.mode },
907
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
908
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
909
+ ...options.transport === void 0 ? {} : { transport: options.transport },
910
+ request: {
911
+ method: "GET",
912
+ path: "/crm/v3/objects/deals",
913
+ query: {
914
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
915
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {},
916
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": String(config.properties) } : {},
917
+ ...config.associations !== void 0 && config.associations !== null && config.associations !== "" ? { "associations": String(config.associations) } : {}
918
+ }
919
+ }
920
+ });
921
+ }
922
+ var DEAL_SEARCH_OPERATION = "deal_search";
923
+ async function hubspotDealSearch(options) {
924
+ const config = options.config ?? {};
925
+ if (typeof config.filterGroups === "string" && config.filterGroups !== "") {
926
+ try {
927
+ JSON.parse(config.filterGroups);
928
+ } catch (error) {
929
+ throw new Error(`deal_search: "filterGroups" must be JSON: ${error.message}`);
930
+ }
931
+ }
932
+ if (typeof config.sorts === "string" && config.sorts !== "") {
933
+ try {
934
+ JSON.parse(config.sorts);
935
+ } catch (error) {
936
+ throw new Error(`deal_search: "sorts" must be JSON: ${error.message}`);
937
+ }
938
+ }
939
+ {
940
+ const n = Number(config.limit);
941
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
942
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {
943
+ throw new Error(
944
+ `deal_search: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
945
+ );
946
+ }
947
+ }
948
+ return callConnector(HUBSPOT, {
949
+ operation: DEAL_SEARCH_OPERATION,
950
+ config,
951
+ input: options.input,
952
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
953
+ ...options.mode === void 0 ? {} : { mode: options.mode },
954
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
955
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
956
+ ...options.transport === void 0 ? {} : { transport: options.transport },
957
+ request: {
958
+ method: "POST",
959
+ path: "/crm/v3/objects/deals/search",
960
+ json: {
961
+ ...config.filterGroups !== void 0 && config.filterGroups !== null && config.filterGroups !== "" ? { "filterGroups": typeof config.filterGroups === "string" ? JSON.parse(config.filterGroups) : config.filterGroups } : {},
962
+ ...config.sorts !== void 0 && config.sorts !== null && config.sorts !== "" ? { "sorts": typeof config.sorts === "string" ? JSON.parse(config.sorts) : config.sorts } : {},
963
+ ...config.query !== void 0 && config.query !== null && config.query !== "" ? { "query": String(config.query) } : {},
964
+ ...config.properties !== void 0 && config.properties !== null && config.properties !== "" ? { "properties": propertiesList3(config.properties) } : {},
965
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
966
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
967
+ }
968
+ }
969
+ });
970
+ }
971
+ function propertiesList3(value) {
972
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
973
+ return items.map((item) => item.trim()).filter(Boolean);
974
+ }
975
+ var DEAL_UPDATE_OPERATION = "deal_update";
976
+ async function hubspotDealUpdate(options) {
977
+ const config = options.config ?? {};
978
+ if (config.dealId === void 0 || config.dealId === null || config.dealId === "") {
979
+ throw new Error(`deal_update: "dealId" is required (Deal id).`);
980
+ }
981
+ if (config.properties === void 0 || config.properties === null || config.properties === "") {
982
+ throw new Error(`deal_update: "properties" is required (Properties).`);
983
+ }
984
+ return callConnector(HUBSPOT, {
985
+ operation: DEAL_UPDATE_OPERATION,
986
+ config,
987
+ input: options.input,
988
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
989
+ ...options.mode === void 0 ? {} : { mode: options.mode },
990
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
991
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
992
+ ...options.transport === void 0 ? {} : { transport: options.transport },
993
+ request: {
994
+ method: "PATCH",
995
+ path: `/crm/v3/objects/deals/${encodeURIComponent(String(config.dealId))}`,
996
+ json: {
997
+ "properties": propertiesMap5(config.properties)
998
+ }
999
+ }
1000
+ });
1001
+ }
1002
+ function propertiesMap5(value) {
1003
+ if (!value || typeof value !== "object") return {};
1004
+ const out = {};
1005
+ for (const [key, item] of Object.entries(value)) {
1006
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
1007
+ }
1008
+ return out;
1009
+ }
1010
+ var OWNER_LIST_OPERATION = "owner_list";
1011
+ async function hubspotOwnerList(options) {
1012
+ const config = options.config ?? {};
1013
+ {
1014
+ const n = Number(config.limit);
1015
+ const given = config.limit !== void 0 && config.limit !== null && config.limit !== "";
1016
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {
1017
+ throw new Error(
1018
+ `owner_list: "limit" must be a integer, got ${JSON.stringify(config.limit)}.`
1019
+ );
1020
+ }
1021
+ }
1022
+ return callConnector(HUBSPOT, {
1023
+ operation: OWNER_LIST_OPERATION,
1024
+ config,
1025
+ input: options.input,
1026
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
1027
+ ...options.mode === void 0 ? {} : { mode: options.mode },
1028
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
1029
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
1030
+ ...options.transport === void 0 ? {} : { transport: options.transport },
1031
+ request: {
1032
+ method: "GET",
1033
+ path: "/crm/v3/owners",
1034
+ query: {
1035
+ ...config.email !== void 0 && config.email !== null && config.email !== "" ? { "email": String(config.email) } : {},
1036
+ ...config.limit !== void 0 && config.limit !== null && config.limit !== "" ? { "limit": Math.trunc(Number(config.limit)) } : {},
1037
+ ...config.after !== void 0 && config.after !== null && config.after !== "" ? { "after": String(config.after) } : {}
1038
+ }
1039
+ }
1040
+ });
1041
+ }
1042
+ var PIPELINE_LIST_OPERATION = "pipeline_list";
1043
+ async function hubspotPipelineList(options) {
1044
+ const config = options.config ?? {};
1045
+ return callConnector(HUBSPOT, {
1046
+ operation: PIPELINE_LIST_OPERATION,
1047
+ config,
1048
+ input: options.input,
1049
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
1050
+ ...options.mode === void 0 ? {} : { mode: options.mode },
1051
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
1052
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
1053
+ ...options.transport === void 0 ? {} : { transport: options.transport },
1054
+ request: {
1055
+ method: "GET",
1056
+ path: "/crm/v3/pipelines/deals",
1057
+ query: {}
1058
+ }
1059
+ });
1060
+ }
1061
+ var PROPERTY_LIST_OPERATION = "property_list";
1062
+ async function hubspotPropertyList(options) {
1063
+ const config = options.config ?? {};
1064
+ if (config.objectType === void 0 || config.objectType === null || config.objectType === "") {
1065
+ throw new Error(`property_list: "objectType" is required (Object).`);
1066
+ }
1067
+ return callConnector(HUBSPOT, {
1068
+ operation: PROPERTY_LIST_OPERATION,
1069
+ config,
1070
+ input: options.input,
1071
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
1072
+ ...options.mode === void 0 ? {} : { mode: options.mode },
1073
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
1074
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
1075
+ ...options.transport === void 0 ? {} : { transport: options.transport },
1076
+ request: {
1077
+ method: "GET",
1078
+ path: `/crm/v3/properties/${encodeURIComponent(String(config.objectType))}`,
1079
+ query: {}
1080
+ }
1081
+ });
1082
+ }
1083
+
1084
+ export { COMPANY_CREATE_OPERATION, COMPANY_GET_OPERATION, COMPANY_LIST_OPERATION, COMPANY_SEARCH_OPERATION, COMPANY_UPDATE_OPERATION, CONNECTOR_API_VERSION, CONTACT_CREATE_OPERATION, CONTACT_GET_OPERATION, CONTACT_LIST_OPERATION, CONTACT_SEARCH_OPERATION, CONTACT_UPDATE_OPERATION, DEAL_CREATE_OPERATION, DEAL_GET_OPERATION, DEAL_LIST_OPERATION, DEAL_SEARCH_OPERATION, DEAL_UPDATE_OPERATION, HUBSPOT, HUBSPOT_BASE_URLS, HUBSPOT_REQUIRES, OWNER_LIST_OPERATION, PIPELINE_LIST_OPERATION, PROPERTY_LIST_OPERATION, hubspotAuthorize, hubspotCompanyCreate, hubspotCompanyGet, hubspotCompanyList, hubspotCompanySearch, hubspotCompanyUpdate, hubspotContactCreate, hubspotContactGet, hubspotContactList, hubspotContactSearch, hubspotContactUpdate, hubspotDealCreate, hubspotDealGet, hubspotDealList, hubspotDealSearch, hubspotDealUpdate, hubspotFaker, hubspotOwnerList, hubspotPipelineList, hubspotPropertyList };
1085
+ //# sourceMappingURL=chunk-FFT5OGGS.js.map
1086
+ //# sourceMappingURL=chunk-FFT5OGGS.js.map