airbyte-agent-hubspot 0.15.25__py3-none-any.whl → 0.15.43__py3-none-any.whl
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.
- airbyte_agent_hubspot/__init__.py +100 -25
- airbyte_agent_hubspot/_vendored/connector_sdk/auth_strategies.py +2 -5
- airbyte_agent_hubspot/_vendored/connector_sdk/auth_template.py +1 -1
- airbyte_agent_hubspot/_vendored/connector_sdk/cloud_utils/client.py +26 -26
- airbyte_agent_hubspot/_vendored/connector_sdk/connector_model_loader.py +11 -4
- airbyte_agent_hubspot/_vendored/connector_sdk/constants.py +1 -1
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/hosted_executor.py +10 -11
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/local_executor.py +163 -34
- airbyte_agent_hubspot/_vendored/connector_sdk/extensions.py +43 -5
- airbyte_agent_hubspot/_vendored/connector_sdk/http/response.py +2 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/introspection.py +262 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/logging/logger.py +9 -9
- airbyte_agent_hubspot/_vendored/connector_sdk/logging/types.py +10 -10
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/config.py +179 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/models.py +6 -6
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/session.py +41 -32
- airbyte_agent_hubspot/_vendored/connector_sdk/performance/metrics.py +3 -3
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/base.py +20 -18
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/components.py +59 -58
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/connector.py +22 -33
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/extensions.py +103 -10
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/operations.py +32 -32
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/security.py +44 -34
- airbyte_agent_hubspot/_vendored/connector_sdk/secrets.py +2 -2
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/events.py +9 -8
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/tracker.py +9 -5
- airbyte_agent_hubspot/_vendored/connector_sdk/types.py +7 -3
- airbyte_agent_hubspot/connector.py +182 -87
- airbyte_agent_hubspot/connector_model.py +17 -12
- airbyte_agent_hubspot/models.py +21 -21
- airbyte_agent_hubspot/types.py +45 -45
- {airbyte_agent_hubspot-0.15.25.dist-info → airbyte_agent_hubspot-0.15.43.dist-info}/METADATA +25 -22
- {airbyte_agent_hubspot-0.15.25.dist-info → airbyte_agent_hubspot-0.15.43.dist-info}/RECORD +34 -32
- {airbyte_agent_hubspot-0.15.25.dist-info → airbyte_agent_hubspot-0.15.43.dist-info}/WHEEL +0 -0
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
Hubspot connector.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import logging
|
|
8
|
+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, overload
|
|
8
9
|
try:
|
|
9
10
|
from typing import Literal
|
|
10
11
|
except ImportError:
|
|
11
12
|
from typing_extensions import Literal
|
|
12
13
|
|
|
13
14
|
from .connector_model import HubspotConnectorModel
|
|
14
|
-
|
|
15
|
+
from ._vendored.connector_sdk.introspection import describe_entities, generate_tool_description
|
|
15
16
|
from .types import (
|
|
17
|
+
CompaniesApiSearchParams,
|
|
18
|
+
CompaniesApiSearchParamsFiltergroupsItem,
|
|
19
|
+
CompaniesApiSearchParamsSortsItem,
|
|
16
20
|
CompaniesGetParams,
|
|
17
21
|
CompaniesListParams,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
ContactsApiSearchParams,
|
|
23
|
+
ContactsApiSearchParamsFiltergroupsItem,
|
|
24
|
+
ContactsApiSearchParamsSortsItem,
|
|
21
25
|
ContactsGetParams,
|
|
22
26
|
ContactsListParams,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
DealsApiSearchParams,
|
|
28
|
+
DealsApiSearchParamsFiltergroupsItem,
|
|
29
|
+
DealsApiSearchParamsSortsItem,
|
|
26
30
|
DealsGetParams,
|
|
27
31
|
DealsListParams,
|
|
28
|
-
DealsSearchParams,
|
|
29
|
-
DealsSearchParamsFiltergroupsItem,
|
|
30
|
-
DealsSearchParamsSortsItem,
|
|
31
32
|
ObjectsGetParams,
|
|
32
33
|
ObjectsListParams,
|
|
33
34
|
SchemasGetParams,
|
|
34
35
|
SchemasListParams,
|
|
36
|
+
TicketsApiSearchParams,
|
|
37
|
+
TicketsApiSearchParamsFiltergroupsItem,
|
|
38
|
+
TicketsApiSearchParamsSortsItem,
|
|
35
39
|
TicketsGetParams,
|
|
36
40
|
TicketsListParams,
|
|
37
|
-
TicketsSearchParams,
|
|
38
|
-
TicketsSearchParamsFiltergroupsItem,
|
|
39
|
-
TicketsSearchParamsSortsItem,
|
|
40
41
|
)
|
|
41
|
-
|
|
42
42
|
if TYPE_CHECKING:
|
|
43
43
|
from .models import HubspotAuthConfig
|
|
44
44
|
# Import response models and envelope models at runtime
|
|
@@ -46,13 +46,13 @@ from .models import (
|
|
|
46
46
|
HubspotExecuteResult,
|
|
47
47
|
HubspotExecuteResultWithMeta,
|
|
48
48
|
ContactsListResult,
|
|
49
|
-
|
|
49
|
+
ContactsApiSearchResult,
|
|
50
50
|
CompaniesListResult,
|
|
51
|
-
|
|
51
|
+
CompaniesApiSearchResult,
|
|
52
52
|
DealsListResult,
|
|
53
|
-
|
|
53
|
+
DealsApiSearchResult,
|
|
54
54
|
TicketsListResult,
|
|
55
|
-
|
|
55
|
+
TicketsApiSearchResult,
|
|
56
56
|
SchemasListResult,
|
|
57
57
|
ObjectsListResult,
|
|
58
58
|
CRMObject,
|
|
@@ -63,6 +63,9 @@ from .models import (
|
|
|
63
63
|
Ticket,
|
|
64
64
|
)
|
|
65
65
|
|
|
66
|
+
# TypeVar for decorator type preservation
|
|
67
|
+
_F = TypeVar("_F", bound=Callable[..., Any])
|
|
68
|
+
|
|
66
69
|
|
|
67
70
|
class HubspotConnector:
|
|
68
71
|
"""
|
|
@@ -75,24 +78,24 @@ class HubspotConnector:
|
|
|
75
78
|
connector_version = "0.1.3"
|
|
76
79
|
vendored_sdk_version = "0.1.0" # Version of vendored connector-sdk
|
|
77
80
|
|
|
78
|
-
# Map of (entity, action) ->
|
|
79
|
-
|
|
81
|
+
# Map of (entity, action) -> needs_envelope for envelope wrapping decision
|
|
82
|
+
_ENVELOPE_MAP = {
|
|
80
83
|
("contacts", "list"): True,
|
|
81
|
-
("contacts", "get"):
|
|
82
|
-
("contacts", "
|
|
84
|
+
("contacts", "get"): None,
|
|
85
|
+
("contacts", "api_search"): True,
|
|
83
86
|
("companies", "list"): True,
|
|
84
|
-
("companies", "get"):
|
|
85
|
-
("companies", "
|
|
87
|
+
("companies", "get"): None,
|
|
88
|
+
("companies", "api_search"): True,
|
|
86
89
|
("deals", "list"): True,
|
|
87
|
-
("deals", "get"):
|
|
88
|
-
("deals", "
|
|
90
|
+
("deals", "get"): None,
|
|
91
|
+
("deals", "api_search"): True,
|
|
89
92
|
("tickets", "list"): True,
|
|
90
|
-
("tickets", "get"):
|
|
91
|
-
("tickets", "
|
|
93
|
+
("tickets", "get"): None,
|
|
94
|
+
("tickets", "api_search"): True,
|
|
92
95
|
("schemas", "list"): True,
|
|
93
|
-
("schemas", "get"):
|
|
96
|
+
("schemas", "get"): None,
|
|
94
97
|
("objects", "list"): True,
|
|
95
|
-
("objects", "get"):
|
|
98
|
+
("objects", "get"): None,
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
# Map of (entity, action) -> {python_param_name: api_param_name}
|
|
@@ -100,16 +103,16 @@ class HubspotConnector:
|
|
|
100
103
|
_PARAM_MAP = {
|
|
101
104
|
('contacts', 'list'): {'limit': 'limit', 'after': 'after', 'associations': 'associations', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'archived': 'archived'},
|
|
102
105
|
('contacts', 'get'): {'contact_id': 'contactId', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'associations': 'associations', 'id_property': 'idProperty', 'archived': 'archived'},
|
|
103
|
-
('contacts', '
|
|
106
|
+
('contacts', 'api_search'): {'filter_groups': 'filterGroups', 'properties': 'properties', 'limit': 'limit', 'after': 'after', 'sorts': 'sorts', 'query': 'query'},
|
|
104
107
|
('companies', 'list'): {'limit': 'limit', 'after': 'after', 'associations': 'associations', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'archived': 'archived'},
|
|
105
108
|
('companies', 'get'): {'company_id': 'companyId', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'associations': 'associations', 'id_property': 'idProperty', 'archived': 'archived'},
|
|
106
|
-
('companies', '
|
|
109
|
+
('companies', 'api_search'): {'filter_groups': 'filterGroups', 'properties': 'properties', 'limit': 'limit', 'after': 'after', 'sorts': 'sorts', 'query': 'query'},
|
|
107
110
|
('deals', 'list'): {'limit': 'limit', 'after': 'after', 'associations': 'associations', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'archived': 'archived'},
|
|
108
111
|
('deals', 'get'): {'deal_id': 'dealId', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'associations': 'associations', 'id_property': 'idProperty', 'archived': 'archived'},
|
|
109
|
-
('deals', '
|
|
112
|
+
('deals', 'api_search'): {'filter_groups': 'filterGroups', 'properties': 'properties', 'limit': 'limit', 'after': 'after', 'sorts': 'sorts', 'query': 'query'},
|
|
110
113
|
('tickets', 'list'): {'limit': 'limit', 'after': 'after', 'associations': 'associations', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'archived': 'archived'},
|
|
111
114
|
('tickets', 'get'): {'ticket_id': 'ticketId', 'properties': 'properties', 'properties_with_history': 'propertiesWithHistory', 'associations': 'associations', 'id_property': 'idProperty', 'archived': 'archived'},
|
|
112
|
-
('tickets', '
|
|
115
|
+
('tickets', 'api_search'): {'filter_groups': 'filterGroups', 'properties': 'properties', 'limit': 'limit', 'after': 'after', 'sorts': 'sorts', 'query': 'query'},
|
|
113
116
|
('schemas', 'list'): {'archived': 'archived'},
|
|
114
117
|
('schemas', 'get'): {'object_type': 'objectType'},
|
|
115
118
|
('objects', 'list'): {'object_type': 'objectType', 'limit': 'limit', 'after': 'after', 'properties': 'properties', 'archived': 'archived', 'associations': 'associations', 'properties_with_history': 'propertiesWithHistory'},
|
|
@@ -220,9 +223,9 @@ class HubspotConnector:
|
|
|
220
223
|
async def execute(
|
|
221
224
|
self,
|
|
222
225
|
entity: Literal["contacts"],
|
|
223
|
-
action: Literal["
|
|
224
|
-
params: "
|
|
225
|
-
) -> "
|
|
226
|
+
action: Literal["api_search"],
|
|
227
|
+
params: "ContactsApiSearchParams"
|
|
228
|
+
) -> "ContactsApiSearchResult": ...
|
|
226
229
|
|
|
227
230
|
@overload
|
|
228
231
|
async def execute(
|
|
@@ -244,9 +247,9 @@ class HubspotConnector:
|
|
|
244
247
|
async def execute(
|
|
245
248
|
self,
|
|
246
249
|
entity: Literal["companies"],
|
|
247
|
-
action: Literal["
|
|
248
|
-
params: "
|
|
249
|
-
) -> "
|
|
250
|
+
action: Literal["api_search"],
|
|
251
|
+
params: "CompaniesApiSearchParams"
|
|
252
|
+
) -> "CompaniesApiSearchResult": ...
|
|
250
253
|
|
|
251
254
|
@overload
|
|
252
255
|
async def execute(
|
|
@@ -268,9 +271,9 @@ class HubspotConnector:
|
|
|
268
271
|
async def execute(
|
|
269
272
|
self,
|
|
270
273
|
entity: Literal["deals"],
|
|
271
|
-
action: Literal["
|
|
272
|
-
params: "
|
|
273
|
-
) -> "
|
|
274
|
+
action: Literal["api_search"],
|
|
275
|
+
params: "DealsApiSearchParams"
|
|
276
|
+
) -> "DealsApiSearchResult": ...
|
|
274
277
|
|
|
275
278
|
@overload
|
|
276
279
|
async def execute(
|
|
@@ -292,9 +295,9 @@ class HubspotConnector:
|
|
|
292
295
|
async def execute(
|
|
293
296
|
self,
|
|
294
297
|
entity: Literal["tickets"],
|
|
295
|
-
action: Literal["
|
|
296
|
-
params: "
|
|
297
|
-
) -> "
|
|
298
|
+
action: Literal["api_search"],
|
|
299
|
+
params: "TicketsApiSearchParams"
|
|
300
|
+
) -> "TicketsApiSearchResult": ...
|
|
298
301
|
|
|
299
302
|
@overload
|
|
300
303
|
async def execute(
|
|
@@ -387,7 +390,7 @@ class HubspotConnector:
|
|
|
387
390
|
raise RuntimeError(f"Execution failed: {result.error}")
|
|
388
391
|
|
|
389
392
|
# Check if this operation has extractors configured
|
|
390
|
-
has_extractors = self.
|
|
393
|
+
has_extractors = self._ENVELOPE_MAP.get((entity, action), False)
|
|
391
394
|
|
|
392
395
|
if has_extractors:
|
|
393
396
|
# With extractors - return Pydantic envelope with data and meta
|
|
@@ -402,6 +405,88 @@ class HubspotConnector:
|
|
|
402
405
|
# No extractors - return raw response data
|
|
403
406
|
return result.data
|
|
404
407
|
|
|
408
|
+
# ===== INTROSPECTION METHODS =====
|
|
409
|
+
|
|
410
|
+
@classmethod
|
|
411
|
+
def describe(cls, func: _F) -> _F:
|
|
412
|
+
"""
|
|
413
|
+
Decorator that populates a function's docstring with connector capabilities.
|
|
414
|
+
|
|
415
|
+
This class method can be used as a decorator to automatically generate
|
|
416
|
+
comprehensive documentation for AI tool functions.
|
|
417
|
+
|
|
418
|
+
Usage:
|
|
419
|
+
@mcp.tool()
|
|
420
|
+
@HubspotConnector.describe
|
|
421
|
+
async def execute(entity: str, action: str, params: dict):
|
|
422
|
+
'''Execute operations.'''
|
|
423
|
+
...
|
|
424
|
+
|
|
425
|
+
The decorated function's __doc__ will be updated with:
|
|
426
|
+
- Available entities and their actions
|
|
427
|
+
- Parameter signatures with required (*) and optional (?) markers
|
|
428
|
+
- Response structure documentation
|
|
429
|
+
- Example questions (if available in OpenAPI spec)
|
|
430
|
+
|
|
431
|
+
Args:
|
|
432
|
+
func: The function to decorate
|
|
433
|
+
|
|
434
|
+
Returns:
|
|
435
|
+
The same function with updated __doc__
|
|
436
|
+
"""
|
|
437
|
+
description = generate_tool_description(HubspotConnectorModel)
|
|
438
|
+
|
|
439
|
+
original_doc = func.__doc__ or ""
|
|
440
|
+
if original_doc.strip():
|
|
441
|
+
func.__doc__ = f"{original_doc.strip()}\n{description}"
|
|
442
|
+
else:
|
|
443
|
+
func.__doc__ = description
|
|
444
|
+
|
|
445
|
+
return func
|
|
446
|
+
|
|
447
|
+
def list_entities(self) -> list[dict[str, Any]]:
|
|
448
|
+
"""
|
|
449
|
+
Get structured data about available entities, actions, and parameters.
|
|
450
|
+
|
|
451
|
+
Returns a list of entity descriptions with:
|
|
452
|
+
- entity_name: Name of the entity (e.g., "contacts", "deals")
|
|
453
|
+
- description: Entity description from the first endpoint
|
|
454
|
+
- available_actions: List of actions (e.g., ["list", "get", "create"])
|
|
455
|
+
- parameters: Dict mapping action -> list of parameter dicts
|
|
456
|
+
|
|
457
|
+
Example:
|
|
458
|
+
entities = connector.list_entities()
|
|
459
|
+
for entity in entities:
|
|
460
|
+
print(f"{entity['entity_name']}: {entity['available_actions']}")
|
|
461
|
+
"""
|
|
462
|
+
return describe_entities(HubspotConnectorModel)
|
|
463
|
+
|
|
464
|
+
def entity_schema(self, entity: str) -> dict[str, Any] | None:
|
|
465
|
+
"""
|
|
466
|
+
Get the JSON schema for an entity.
|
|
467
|
+
|
|
468
|
+
Args:
|
|
469
|
+
entity: Entity name (e.g., "contacts", "companies")
|
|
470
|
+
|
|
471
|
+
Returns:
|
|
472
|
+
JSON schema dict describing the entity structure, or None if not found.
|
|
473
|
+
|
|
474
|
+
Example:
|
|
475
|
+
schema = connector.entity_schema("contacts")
|
|
476
|
+
if schema:
|
|
477
|
+
print(f"Contact properties: {list(schema.get('properties', {}).keys())}")
|
|
478
|
+
"""
|
|
479
|
+
entity_def = next(
|
|
480
|
+
(e for e in HubspotConnectorModel.entities if e.name == entity),
|
|
481
|
+
None
|
|
482
|
+
)
|
|
483
|
+
if entity_def is None:
|
|
484
|
+
logging.getLogger(__name__).warning(
|
|
485
|
+
f"Entity '{entity}' not found. Available entities: "
|
|
486
|
+
f"{[e.name for e in HubspotConnectorModel.entities]}"
|
|
487
|
+
)
|
|
488
|
+
return entity_def.entity_schema if entity_def else None
|
|
489
|
+
|
|
405
490
|
|
|
406
491
|
|
|
407
492
|
class ContactsQuery:
|
|
@@ -452,7 +537,8 @@ class ContactsQuery:
|
|
|
452
537
|
# Cast generic envelope to concrete typed result
|
|
453
538
|
return ContactsListResult(
|
|
454
539
|
data=result.data,
|
|
455
|
-
meta=result.meta
|
|
540
|
+
meta=result.meta
|
|
541
|
+
)
|
|
456
542
|
|
|
457
543
|
|
|
458
544
|
|
|
@@ -496,16 +582,16 @@ class ContactsQuery:
|
|
|
496
582
|
|
|
497
583
|
|
|
498
584
|
|
|
499
|
-
async def
|
|
585
|
+
async def api_search(
|
|
500
586
|
self,
|
|
501
|
-
filter_groups: list[
|
|
587
|
+
filter_groups: list[ContactsApiSearchParamsFiltergroupsItem] | None = None,
|
|
502
588
|
properties: list[str] | None = None,
|
|
503
589
|
limit: int | None = None,
|
|
504
590
|
after: str | None = None,
|
|
505
|
-
sorts: list[
|
|
591
|
+
sorts: list[ContactsApiSearchParamsSortsItem] | None = None,
|
|
506
592
|
query: str | None = None,
|
|
507
593
|
**kwargs
|
|
508
|
-
) ->
|
|
594
|
+
) -> ContactsApiSearchResult:
|
|
509
595
|
"""
|
|
510
596
|
Search for contacts by filtering on properties, searching through associations, and sorting results.
|
|
511
597
|
|
|
@@ -519,7 +605,7 @@ class ContactsQuery:
|
|
|
519
605
|
**kwargs: Additional parameters
|
|
520
606
|
|
|
521
607
|
Returns:
|
|
522
|
-
|
|
608
|
+
ContactsApiSearchResult
|
|
523
609
|
"""
|
|
524
610
|
params = {k: v for k, v in {
|
|
525
611
|
"filterGroups": filter_groups,
|
|
@@ -531,11 +617,12 @@ class ContactsQuery:
|
|
|
531
617
|
**kwargs
|
|
532
618
|
}.items() if v is not None}
|
|
533
619
|
|
|
534
|
-
result = await self._connector.execute("contacts", "
|
|
620
|
+
result = await self._connector.execute("contacts", "api_search", params)
|
|
535
621
|
# Cast generic envelope to concrete typed result
|
|
536
|
-
return
|
|
622
|
+
return ContactsApiSearchResult(
|
|
537
623
|
data=result.data,
|
|
538
|
-
meta=result.meta
|
|
624
|
+
meta=result.meta
|
|
625
|
+
)
|
|
539
626
|
|
|
540
627
|
|
|
541
628
|
|
|
@@ -587,7 +674,8 @@ class CompaniesQuery:
|
|
|
587
674
|
# Cast generic envelope to concrete typed result
|
|
588
675
|
return CompaniesListResult(
|
|
589
676
|
data=result.data,
|
|
590
|
-
meta=result.meta
|
|
677
|
+
meta=result.meta
|
|
678
|
+
)
|
|
591
679
|
|
|
592
680
|
|
|
593
681
|
|
|
@@ -631,16 +719,16 @@ class CompaniesQuery:
|
|
|
631
719
|
|
|
632
720
|
|
|
633
721
|
|
|
634
|
-
async def
|
|
722
|
+
async def api_search(
|
|
635
723
|
self,
|
|
636
|
-
filter_groups: list[
|
|
724
|
+
filter_groups: list[CompaniesApiSearchParamsFiltergroupsItem] | None = None,
|
|
637
725
|
properties: list[str] | None = None,
|
|
638
726
|
limit: int | None = None,
|
|
639
727
|
after: str | None = None,
|
|
640
|
-
sorts: list[
|
|
728
|
+
sorts: list[CompaniesApiSearchParamsSortsItem] | None = None,
|
|
641
729
|
query: str | None = None,
|
|
642
730
|
**kwargs
|
|
643
|
-
) ->
|
|
731
|
+
) -> CompaniesApiSearchResult:
|
|
644
732
|
"""
|
|
645
733
|
Search for companies by filtering on properties, searching through associations, and sorting results.
|
|
646
734
|
|
|
@@ -654,7 +742,7 @@ class CompaniesQuery:
|
|
|
654
742
|
**kwargs: Additional parameters
|
|
655
743
|
|
|
656
744
|
Returns:
|
|
657
|
-
|
|
745
|
+
CompaniesApiSearchResult
|
|
658
746
|
"""
|
|
659
747
|
params = {k: v for k, v in {
|
|
660
748
|
"filterGroups": filter_groups,
|
|
@@ -666,11 +754,12 @@ class CompaniesQuery:
|
|
|
666
754
|
**kwargs
|
|
667
755
|
}.items() if v is not None}
|
|
668
756
|
|
|
669
|
-
result = await self._connector.execute("companies", "
|
|
757
|
+
result = await self._connector.execute("companies", "api_search", params)
|
|
670
758
|
# Cast generic envelope to concrete typed result
|
|
671
|
-
return
|
|
759
|
+
return CompaniesApiSearchResult(
|
|
672
760
|
data=result.data,
|
|
673
|
-
meta=result.meta
|
|
761
|
+
meta=result.meta
|
|
762
|
+
)
|
|
674
763
|
|
|
675
764
|
|
|
676
765
|
|
|
@@ -722,7 +811,8 @@ class DealsQuery:
|
|
|
722
811
|
# Cast generic envelope to concrete typed result
|
|
723
812
|
return DealsListResult(
|
|
724
813
|
data=result.data,
|
|
725
|
-
meta=result.meta
|
|
814
|
+
meta=result.meta
|
|
815
|
+
)
|
|
726
816
|
|
|
727
817
|
|
|
728
818
|
|
|
@@ -766,16 +856,16 @@ class DealsQuery:
|
|
|
766
856
|
|
|
767
857
|
|
|
768
858
|
|
|
769
|
-
async def
|
|
859
|
+
async def api_search(
|
|
770
860
|
self,
|
|
771
|
-
filter_groups: list[
|
|
861
|
+
filter_groups: list[DealsApiSearchParamsFiltergroupsItem] | None = None,
|
|
772
862
|
properties: list[str] | None = None,
|
|
773
863
|
limit: int | None = None,
|
|
774
864
|
after: str | None = None,
|
|
775
|
-
sorts: list[
|
|
865
|
+
sorts: list[DealsApiSearchParamsSortsItem] | None = None,
|
|
776
866
|
query: str | None = None,
|
|
777
867
|
**kwargs
|
|
778
|
-
) ->
|
|
868
|
+
) -> DealsApiSearchResult:
|
|
779
869
|
"""
|
|
780
870
|
Search deals with filters and sorting
|
|
781
871
|
|
|
@@ -789,7 +879,7 @@ class DealsQuery:
|
|
|
789
879
|
**kwargs: Additional parameters
|
|
790
880
|
|
|
791
881
|
Returns:
|
|
792
|
-
|
|
882
|
+
DealsApiSearchResult
|
|
793
883
|
"""
|
|
794
884
|
params = {k: v for k, v in {
|
|
795
885
|
"filterGroups": filter_groups,
|
|
@@ -801,11 +891,12 @@ class DealsQuery:
|
|
|
801
891
|
**kwargs
|
|
802
892
|
}.items() if v is not None}
|
|
803
893
|
|
|
804
|
-
result = await self._connector.execute("deals", "
|
|
894
|
+
result = await self._connector.execute("deals", "api_search", params)
|
|
805
895
|
# Cast generic envelope to concrete typed result
|
|
806
|
-
return
|
|
896
|
+
return DealsApiSearchResult(
|
|
807
897
|
data=result.data,
|
|
808
|
-
meta=result.meta
|
|
898
|
+
meta=result.meta
|
|
899
|
+
)
|
|
809
900
|
|
|
810
901
|
|
|
811
902
|
|
|
@@ -857,7 +948,8 @@ class TicketsQuery:
|
|
|
857
948
|
# Cast generic envelope to concrete typed result
|
|
858
949
|
return TicketsListResult(
|
|
859
950
|
data=result.data,
|
|
860
|
-
meta=result.meta
|
|
951
|
+
meta=result.meta
|
|
952
|
+
)
|
|
861
953
|
|
|
862
954
|
|
|
863
955
|
|
|
@@ -901,16 +993,16 @@ class TicketsQuery:
|
|
|
901
993
|
|
|
902
994
|
|
|
903
995
|
|
|
904
|
-
async def
|
|
996
|
+
async def api_search(
|
|
905
997
|
self,
|
|
906
|
-
filter_groups: list[
|
|
998
|
+
filter_groups: list[TicketsApiSearchParamsFiltergroupsItem] | None = None,
|
|
907
999
|
properties: list[str] | None = None,
|
|
908
1000
|
limit: int | None = None,
|
|
909
1001
|
after: str | None = None,
|
|
910
|
-
sorts: list[
|
|
1002
|
+
sorts: list[TicketsApiSearchParamsSortsItem] | None = None,
|
|
911
1003
|
query: str | None = None,
|
|
912
1004
|
**kwargs
|
|
913
|
-
) ->
|
|
1005
|
+
) -> TicketsApiSearchResult:
|
|
914
1006
|
"""
|
|
915
1007
|
Search for tickets by filtering on properties, searching through associations, and sorting results.
|
|
916
1008
|
|
|
@@ -924,7 +1016,7 @@ class TicketsQuery:
|
|
|
924
1016
|
**kwargs: Additional parameters
|
|
925
1017
|
|
|
926
1018
|
Returns:
|
|
927
|
-
|
|
1019
|
+
TicketsApiSearchResult
|
|
928
1020
|
"""
|
|
929
1021
|
params = {k: v for k, v in {
|
|
930
1022
|
"filterGroups": filter_groups,
|
|
@@ -936,11 +1028,12 @@ class TicketsQuery:
|
|
|
936
1028
|
**kwargs
|
|
937
1029
|
}.items() if v is not None}
|
|
938
1030
|
|
|
939
|
-
result = await self._connector.execute("tickets", "
|
|
1031
|
+
result = await self._connector.execute("tickets", "api_search", params)
|
|
940
1032
|
# Cast generic envelope to concrete typed result
|
|
941
|
-
return
|
|
1033
|
+
return TicketsApiSearchResult(
|
|
942
1034
|
data=result.data,
|
|
943
|
-
meta=result.meta
|
|
1035
|
+
meta=result.meta
|
|
1036
|
+
)
|
|
944
1037
|
|
|
945
1038
|
|
|
946
1039
|
|
|
@@ -976,7 +1069,8 @@ class SchemasQuery:
|
|
|
976
1069
|
result = await self._connector.execute("schemas", "list", params)
|
|
977
1070
|
# Cast generic envelope to concrete typed result
|
|
978
1071
|
return SchemasListResult(
|
|
979
|
-
data=result.data
|
|
1072
|
+
data=result.data
|
|
1073
|
+
)
|
|
980
1074
|
|
|
981
1075
|
|
|
982
1076
|
|
|
@@ -1056,7 +1150,8 @@ class ObjectsQuery:
|
|
|
1056
1150
|
# Cast generic envelope to concrete typed result
|
|
1057
1151
|
return ObjectsListResult(
|
|
1058
1152
|
data=result.data,
|
|
1059
|
-
meta=result.meta
|
|
1153
|
+
meta=result.meta
|
|
1154
|
+
)
|
|
1060
1155
|
|
|
1061
1156
|
|
|
1062
1157
|
|
|
@@ -71,12 +71,17 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
71
71
|
'refresh_token': '${refresh_token}',
|
|
72
72
|
'access_token': '${access_token}',
|
|
73
73
|
},
|
|
74
|
+
replication_auth_key_mapping={
|
|
75
|
+
'client_id': 'client_id',
|
|
76
|
+
'client_secret': 'client_secret',
|
|
77
|
+
'refresh_token': 'refresh_token',
|
|
78
|
+
},
|
|
74
79
|
),
|
|
75
80
|
),
|
|
76
81
|
entities=[
|
|
77
82
|
EntityDefinition(
|
|
78
83
|
name='contacts',
|
|
79
|
-
actions=[Action.LIST, Action.GET, Action.
|
|
84
|
+
actions=[Action.LIST, Action.GET, Action.API_SEARCH],
|
|
80
85
|
endpoints={
|
|
81
86
|
Action.LIST: EndpointDefinition(
|
|
82
87
|
method='GET',
|
|
@@ -287,10 +292,10 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
287
292
|
'x-airbyte-entity-name': 'contacts',
|
|
288
293
|
},
|
|
289
294
|
),
|
|
290
|
-
Action.
|
|
295
|
+
Action.API_SEARCH: EndpointDefinition(
|
|
291
296
|
method='POST',
|
|
292
297
|
path='/crm/v3/objects/contacts/search',
|
|
293
|
-
action=Action.
|
|
298
|
+
action=Action.API_SEARCH,
|
|
294
299
|
description='Search for contacts by filtering on properties, searching through associations, and sorting results.',
|
|
295
300
|
body_fields=[
|
|
296
301
|
'filterGroups',
|
|
@@ -553,7 +558,7 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
553
558
|
),
|
|
554
559
|
EntityDefinition(
|
|
555
560
|
name='companies',
|
|
556
|
-
actions=[Action.LIST, Action.GET, Action.
|
|
561
|
+
actions=[Action.LIST, Action.GET, Action.API_SEARCH],
|
|
557
562
|
endpoints={
|
|
558
563
|
Action.LIST: EndpointDefinition(
|
|
559
564
|
method='GET',
|
|
@@ -758,10 +763,10 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
758
763
|
'x-airbyte-entity-name': 'companies',
|
|
759
764
|
},
|
|
760
765
|
),
|
|
761
|
-
Action.
|
|
766
|
+
Action.API_SEARCH: EndpointDefinition(
|
|
762
767
|
method='POST',
|
|
763
768
|
path='/crm/v3/objects/companies/search',
|
|
764
|
-
action=Action.
|
|
769
|
+
action=Action.API_SEARCH,
|
|
765
770
|
description='Search for companies by filtering on properties, searching through associations, and sorting results.',
|
|
766
771
|
body_fields=[
|
|
767
772
|
'filterGroups',
|
|
@@ -1018,7 +1023,7 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
1018
1023
|
),
|
|
1019
1024
|
EntityDefinition(
|
|
1020
1025
|
name='deals',
|
|
1021
|
-
actions=[Action.LIST, Action.GET, Action.
|
|
1026
|
+
actions=[Action.LIST, Action.GET, Action.API_SEARCH],
|
|
1022
1027
|
endpoints={
|
|
1023
1028
|
Action.LIST: EndpointDefinition(
|
|
1024
1029
|
method='GET',
|
|
@@ -1241,10 +1246,10 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
1241
1246
|
'x-airbyte-entity-name': 'deals',
|
|
1242
1247
|
},
|
|
1243
1248
|
),
|
|
1244
|
-
Action.
|
|
1249
|
+
Action.API_SEARCH: EndpointDefinition(
|
|
1245
1250
|
method='POST',
|
|
1246
1251
|
path='/crm/v3/objects/deals/search',
|
|
1247
|
-
action=Action.
|
|
1252
|
+
action=Action.API_SEARCH,
|
|
1248
1253
|
description='Search deals with filters and sorting',
|
|
1249
1254
|
body_fields=[
|
|
1250
1255
|
'filterGroups',
|
|
@@ -1519,7 +1524,7 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
1519
1524
|
),
|
|
1520
1525
|
EntityDefinition(
|
|
1521
1526
|
name='tickets',
|
|
1522
|
-
actions=[Action.LIST, Action.GET, Action.
|
|
1527
|
+
actions=[Action.LIST, Action.GET, Action.API_SEARCH],
|
|
1523
1528
|
endpoints={
|
|
1524
1529
|
Action.LIST: EndpointDefinition(
|
|
1525
1530
|
method='GET',
|
|
@@ -1748,10 +1753,10 @@ HubspotConnectorModel: ConnectorModel = ConnectorModel(
|
|
|
1748
1753
|
'x-airbyte-entity-name': 'tickets',
|
|
1749
1754
|
},
|
|
1750
1755
|
),
|
|
1751
|
-
Action.
|
|
1756
|
+
Action.API_SEARCH: EndpointDefinition(
|
|
1752
1757
|
method='POST',
|
|
1753
1758
|
path='/crm/v3/objects/tickets/search',
|
|
1754
|
-
action=Action.
|
|
1759
|
+
action=Action.API_SEARCH,
|
|
1755
1760
|
description='Search for tickets by filtering on properties, searching through associations, and sorting results.',
|
|
1756
1761
|
body_fields=[
|
|
1757
1762
|
'filterGroups',
|