dex-connector-intercom 0.1.0__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.
- dex_connector_intercom-0.1.0.dist-info/METADATA +19 -0
- dex_connector_intercom-0.1.0.dist-info/RECORD +21 -0
- dex_connector_intercom-0.1.0.dist-info/WHEEL +4 -0
- dex_connector_intercom-0.1.0.dist-info/licenses/LICENSE +21 -0
- dex_connectors/intercom/__init__.py +30 -0
- dex_connectors/intercom/_generated/__init__.py +2 -0
- dex_connectors/intercom/_generated/config.py +26 -0
- dex_connectors/intercom/_generated/connection.py +164 -0
- dex_connectors/intercom/_generated/definitions.py +112 -0
- dex_connectors/intercom/_generated/mock.py +308 -0
- dex_connectors/intercom/_generated/models.py +369 -0
- dex_connectors/intercom/_generated/steps.py +296 -0
- dex_connectors/intercom/_generated/timestamps.py +60 -0
- dex_connectors/intercom/client.py +351 -0
- dex_connectors/intercom/connection.py +12 -0
- dex_connectors/intercom/dex-connector.json +201 -0
- dex_connectors/intercom/intercommock/__init__.py +6 -0
- dex_connectors/intercom/models.py +5 -0
- dex_connectors/intercom/operations.py +1093 -0
- dex_connectors/intercom/py.typed +0 -0
- dex_connectors/intercom/steps.py +5 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: dex-connector-intercom
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Intercom connector for Dex Flows
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: dex-connectors-sdk==0.1.0
|
|
9
|
+
Requires-Dist: dex-python-sdk>=1.28.0
|
|
10
|
+
Requires-Dist: httpx>=0.27
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# Intercom Python connector
|
|
14
|
+
|
|
15
|
+
Dex Python operations for searching and reading Intercom conversations, replying as an admin, changing conversation state, and finding contacts by email. The package uses the static connection name declared in each application and resolves the current access token for each operation attempt.
|
|
16
|
+
|
|
17
|
+
The `examples/read_conversation/` application shows a runnable Dex Flow. The `intercommock` package contains generated outcomes for deterministic application tests.
|
|
18
|
+
|
|
19
|
+
Live provider authorization and behavior remain unverified.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
dex_connectors/intercom/__init__.py,sha256=88yvnSPxWpOL0PCfYgnogtit5gWbYABPM9rMbdVgfGA,879
|
|
2
|
+
dex_connectors/intercom/client.py,sha256=nIv_fOCLDhIleinxUnjEmZHtOKJATL0h4lFad5x7pwY,13365
|
|
3
|
+
dex_connectors/intercom/connection.py,sha256=E0FwQmLalxarthnU8AlX7LLqpU7BzDdn2XbsxnzWp5k,368
|
|
4
|
+
dex_connectors/intercom/dex-connector.json,sha256=x1ti9nQz0FZFGM8QFSGAFKaNa-BkR5FhAWR7-Gz5-Sw,4742
|
|
5
|
+
dex_connectors/intercom/models.py,sha256=R2rjfQ2tWJLkTS569v_TWTV3W5OUQIbmVXRTulLr9rE,157
|
|
6
|
+
dex_connectors/intercom/operations.py,sha256=HJP4Rd6pMUV84iGxZSO7drTCxRGyS047HELV9qUEQyQ,44468
|
|
7
|
+
dex_connectors/intercom/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
dex_connectors/intercom/steps.py,sha256=ba5TjddCNWRV0Z6n4K3DdgGaYLjbaHJ5v9m3EjckHPc,173
|
|
9
|
+
dex_connectors/intercom/_generated/__init__.py,sha256=ShfMsAGzSt4xuhCaf20ibgtfXl4pXomZb00ovUw6CeI,66
|
|
10
|
+
dex_connectors/intercom/_generated/config.py,sha256=ZBT2BW0PQ6Q6o1IA1pNImxpQqhpeWdMCsOyMBPnye2c,571
|
|
11
|
+
dex_connectors/intercom/_generated/connection.py,sha256=QDvHcJUDkq7akz3o1z1KLuOLmBXB5jzFb_lJzQ__XMs,9041
|
|
12
|
+
dex_connectors/intercom/_generated/definitions.py,sha256=t-P1tTHoQky6zAUNl3dIaGImn4TxTTuahBe32dg4R44,5565
|
|
13
|
+
dex_connectors/intercom/_generated/mock.py,sha256=y7Jiqao5l7HKJp3-5ALqzoGeTxrAzWB8uN16Z_U-k7w,22420
|
|
14
|
+
dex_connectors/intercom/_generated/models.py,sha256=8nNx77SlB4Q_2YNaAp6Q25a7mrMY7H5fm5-x7qDjK5g,22014
|
|
15
|
+
dex_connectors/intercom/_generated/steps.py,sha256=DVNH_HmEBHtROmFeJZ50CRCNqSd_7u3JpGYBpQ5qGUU,14373
|
|
16
|
+
dex_connectors/intercom/_generated/timestamps.py,sha256=Z8VwrE60w-33InIMgEMLiMPTFyRjj6oBq8tUro8Ssi8,3164
|
|
17
|
+
dex_connectors/intercom/intercommock/__init__.py,sha256=sEODfqQ6BJ0_cxRmH7FUHlzuhGC26jntpGD0cmUtm_U,167
|
|
18
|
+
dex_connector_intercom-0.1.0.dist-info/METADATA,sha256=-dUUgHZFhEFl1BmApRsiki2sMML-yl0N0yIiSsGQfP0,874
|
|
19
|
+
dex_connector_intercom-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
20
|
+
dex_connector_intercom-0.1.0.dist-info/licenses/LICENSE,sha256=WNj87Zd5micrAShl1LujOPM6PDzDqjlNLrryDZ4hE0M,1070
|
|
21
|
+
dex_connector_intercom-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Super Durable
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Copyright (c) 2026 Super Durable
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
"""Intercom connector for Dex Flows."""
|
|
4
|
+
|
|
5
|
+
from .client import Client, Config, Credentials
|
|
6
|
+
from .connection import Connection, new_connection, new_connection_with_operations, new_project_connection
|
|
7
|
+
from .models import * # noqa: F403
|
|
8
|
+
from .operations import (
|
|
9
|
+
FindContactByEmailOperation,
|
|
10
|
+
GetConversationOperation,
|
|
11
|
+
ReplyToConversationOperation,
|
|
12
|
+
SearchConversationsOperation,
|
|
13
|
+
UpdateConversationStateOperation,
|
|
14
|
+
)
|
|
15
|
+
from .steps import * # noqa: F403
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"Client",
|
|
19
|
+
"Config",
|
|
20
|
+
"Credentials",
|
|
21
|
+
"Connection",
|
|
22
|
+
"new_connection",
|
|
23
|
+
"new_connection_with_operations",
|
|
24
|
+
"new_project_connection",
|
|
25
|
+
"SearchConversationsOperation",
|
|
26
|
+
"GetConversationOperation",
|
|
27
|
+
"ReplyToConversationOperation",
|
|
28
|
+
"UpdateConversationStateOperation",
|
|
29
|
+
"FindContactByEmailOperation",
|
|
30
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Copyright (c) 2026 Super Durable
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# ruff: noqa
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
|
|
7
|
+
from dex_connectors.sdk import SecretString
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass(frozen=True, slots=True)
|
|
11
|
+
class Config:
|
|
12
|
+
|
|
13
|
+
region: str = "us"
|
|
14
|
+
max_response_bytes: int = 4194304
|
|
15
|
+
webhook_max_body_bytes: int = 2097152
|
|
16
|
+
|
|
17
|
+
setattr(Config, '__module__', 'dex_connectors.intercom.client')
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass(frozen=True, slots=True)
|
|
21
|
+
class Credentials:
|
|
22
|
+
|
|
23
|
+
access_token: SecretString
|
|
24
|
+
client_secret: SecretString
|
|
25
|
+
|
|
26
|
+
setattr(Credentials, '__module__', 'dex_connectors.intercom.client')
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Copyright (c) 2026 Super Durable
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# ruff: noqa
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
from dex_connectors.sdk import ConnectionRef, Mutation, Query, Call, SecretString
|
|
9
|
+
from dex_connectors.sdk.projectconfig import ConnectionKey, LoadedProject
|
|
10
|
+
|
|
11
|
+
from ..client import Client, Config, Credentials
|
|
12
|
+
from .definitions import CONNECTOR_ID, FIND_CONTACT_BY_EMAIL_DEFINITION, GET_CONVERSATION_DEFINITION, REPLY_TO_CONVERSATION_DEFINITION, SEARCH_CONVERSATIONS_DEFINITION, UPDATE_CONVERSATION_STATE_DEFINITION
|
|
13
|
+
from ..models import ConversationDetails, FindContactByEmailInput, FindContactByEmailOutput, GetConversationInput, ReplyToConversationInput, ReplyToConversationOutput, SearchConversationsInput, SearchConversationsOutput, UpdateConversationStateInput, UpdateConversationStateOutput
|
|
14
|
+
|
|
15
|
+
class Connection:
|
|
16
|
+
|
|
17
|
+
__slots__ = ('_search_conversations', '_get_conversation', '_reply_to_conversation', '_update_conversation_state', '_find_contact_by_email', '_client', 'reference')
|
|
18
|
+
|
|
19
|
+
def __init__(self,
|
|
20
|
+
reference: ConnectionRef,
|
|
21
|
+
search_conversations: Query[SearchConversationsInput, SearchConversationsOutput],
|
|
22
|
+
get_conversation: Query[GetConversationInput, ConversationDetails],
|
|
23
|
+
reply_to_conversation: Mutation[ReplyToConversationInput, ReplyToConversationOutput],
|
|
24
|
+
update_conversation_state: Mutation[UpdateConversationStateInput, UpdateConversationStateOutput],
|
|
25
|
+
find_contact_by_email: Query[FindContactByEmailInput, FindContactByEmailOutput],
|
|
26
|
+
client: Client | None = None,
|
|
27
|
+
) -> None:
|
|
28
|
+
reference.validate()
|
|
29
|
+
if reference.provider != CONNECTOR_ID or search_conversations is None or get_conversation is None or reply_to_conversation is None or update_conversation_state is None or find_contact_by_email is None:
|
|
30
|
+
raise ValueError("Intercom connection provider and operations are required")
|
|
31
|
+
if search_conversations.definition().operation != SEARCH_CONVERSATIONS_DEFINITION.operation:
|
|
32
|
+
raise ValueError("Intercom connection operation identity differs")
|
|
33
|
+
if get_conversation.definition().operation != GET_CONVERSATION_DEFINITION.operation:
|
|
34
|
+
raise ValueError("Intercom connection operation identity differs")
|
|
35
|
+
if reply_to_conversation.definition().operation != REPLY_TO_CONVERSATION_DEFINITION.operation:
|
|
36
|
+
raise ValueError("Intercom connection operation identity differs")
|
|
37
|
+
if update_conversation_state.definition().operation != UPDATE_CONVERSATION_STATE_DEFINITION.operation:
|
|
38
|
+
raise ValueError("Intercom connection operation identity differs")
|
|
39
|
+
if find_contact_by_email.definition().operation != FIND_CONTACT_BY_EMAIL_DEFINITION.operation:
|
|
40
|
+
raise ValueError("Intercom connection operation identity differs")
|
|
41
|
+
self.reference = reference
|
|
42
|
+
self._search_conversations = search_conversations
|
|
43
|
+
self._get_conversation = get_conversation
|
|
44
|
+
self._reply_to_conversation = reply_to_conversation
|
|
45
|
+
self._update_conversation_state = update_conversation_state
|
|
46
|
+
self._find_contact_by_email = find_contact_by_email
|
|
47
|
+
self._client = client
|
|
48
|
+
|
|
49
|
+
def search_conversations(self) -> Query[SearchConversationsInput, SearchConversationsOutput]:
|
|
50
|
+
return self._search_conversations
|
|
51
|
+
|
|
52
|
+
def get_conversation(self) -> Query[GetConversationInput, ConversationDetails]:
|
|
53
|
+
return self._get_conversation
|
|
54
|
+
|
|
55
|
+
def reply_to_conversation(self) -> Mutation[ReplyToConversationInput, ReplyToConversationOutput]:
|
|
56
|
+
return self._reply_to_conversation
|
|
57
|
+
|
|
58
|
+
def update_conversation_state(self) -> Mutation[UpdateConversationStateInput, UpdateConversationStateOutput]:
|
|
59
|
+
return self._update_conversation_state
|
|
60
|
+
|
|
61
|
+
def find_contact_by_email(self) -> Query[FindContactByEmailInput, FindContactByEmailOutput]:
|
|
62
|
+
return self._find_contact_by_email
|
|
63
|
+
|
|
64
|
+
async def aclose(self) -> None:
|
|
65
|
+
if self._client is not None:
|
|
66
|
+
await self._client.aclose()
|
|
67
|
+
|
|
68
|
+
def __repr__(self) -> str:
|
|
69
|
+
return "intercom.Connection([REDACTED])"
|
|
70
|
+
|
|
71
|
+
def __reduce__(self) -> tuple[object, ...]:
|
|
72
|
+
raise TypeError("Intercom connections cannot be serialized")
|
|
73
|
+
|
|
74
|
+
setattr(Connection, '__module__', 'dex_connectors.intercom.connection')
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def new_connection(client: Client, reference: ConnectionRef) -> Connection:
|
|
78
|
+
if client is None:
|
|
79
|
+
raise ValueError("Intercom client is required")
|
|
80
|
+
return Connection(reference, client.search_conversations(), client.get_conversation(), client.reply_to_conversation(), client.update_conversation_state(), client.find_contact_by_email(), client)
|
|
81
|
+
|
|
82
|
+
setattr(new_connection, '__module__', 'dex_connectors.intercom.connection')
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def new_connection_with_operations(
|
|
86
|
+
search_conversations: Query[SearchConversationsInput, SearchConversationsOutput],
|
|
87
|
+
get_conversation: Query[GetConversationInput, ConversationDetails],
|
|
88
|
+
reply_to_conversation: Mutation[ReplyToConversationInput, ReplyToConversationOutput],
|
|
89
|
+
update_conversation_state: Mutation[UpdateConversationStateInput, UpdateConversationStateOutput],
|
|
90
|
+
find_contact_by_email: Query[FindContactByEmailInput, FindContactByEmailOutput],
|
|
91
|
+
reference: ConnectionRef,
|
|
92
|
+
) -> Connection:
|
|
93
|
+
return Connection(reference, search_conversations, get_conversation, reply_to_conversation, update_conversation_state, find_contact_by_email)
|
|
94
|
+
|
|
95
|
+
setattr(new_connection_with_operations, '__module__', 'dex_connectors.intercom.connection')
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class _ProjectCredentialSource:
|
|
99
|
+
|
|
100
|
+
def __init__(self, project: LoadedProject, key: ConnectionKey) -> None:
|
|
101
|
+
self.project = project
|
|
102
|
+
self.key = key
|
|
103
|
+
|
|
104
|
+
async def resolve(self, call: Call) -> Credentials:
|
|
105
|
+
material = await self.project.resolve_credential(self.key, str(call.id))
|
|
106
|
+
if not isinstance(material, dict):
|
|
107
|
+
raise ValueError("Intercom stored credential does not match the connector credential fields")
|
|
108
|
+
if set(material) - set(('access_token', 'client_secret')):
|
|
109
|
+
raise ValueError("Intercom stored credential does not match the connector credential fields")
|
|
110
|
+
access_token = material.get("access_token")
|
|
111
|
+
if access_token is not None and not (isinstance(access_token, str)):
|
|
112
|
+
raise ValueError("Intercom credential access_token has an invalid type")
|
|
113
|
+
client_secret = material.get("client_secret")
|
|
114
|
+
if client_secret is not None and not (isinstance(client_secret, str)):
|
|
115
|
+
raise ValueError("Intercom credential client_secret has an invalid type")
|
|
116
|
+
if not access_token:
|
|
117
|
+
raise ValueError("Intercom credential access_token is required")
|
|
118
|
+
return Credentials(SecretString(access_token), SecretString(client_secret or ''))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def new_project_connection(
|
|
122
|
+
project: LoadedProject, connection_name: str, http_client: httpx.AsyncClient | None = None
|
|
123
|
+
) -> Connection:
|
|
124
|
+
if project is None:
|
|
125
|
+
raise ValueError("Intercom connection requires loaded project configuration")
|
|
126
|
+
reference = ConnectionRef(CONNECTOR_ID, connection_name)
|
|
127
|
+
reference.validate()
|
|
128
|
+
key = ConnectionKey(CONNECTOR_ID, connection_name)
|
|
129
|
+
matching = [
|
|
130
|
+
entry
|
|
131
|
+
for entry in project.configuration.connections
|
|
132
|
+
if entry.connector_id == CONNECTOR_ID and entry.connection_name == connection_name
|
|
133
|
+
]
|
|
134
|
+
if len(matching) != 1:
|
|
135
|
+
raise ValueError("Intercom project connection is missing or duplicated")
|
|
136
|
+
if matching[0].provider != CONNECTOR_ID:
|
|
137
|
+
raise ValueError("Intercom project connection provider differs")
|
|
138
|
+
config = _decode_config(matching[0].configuration)
|
|
139
|
+
client = Client(config, _ProjectCredentialSource(project, key), http_client)
|
|
140
|
+
return new_connection(client, reference)
|
|
141
|
+
|
|
142
|
+
setattr(new_project_connection, '__module__', 'dex_connectors.intercom.connection')
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def _decode_config(value: dict[str, Any]) -> Config:
|
|
146
|
+
if set(value) - {"region", "maxResponseBytes", "webhookMaxBodyBytes"}:
|
|
147
|
+
raise ValueError("Intercom configuration has unknown fields")
|
|
148
|
+
config_arguments: dict[str, Any] = {}
|
|
149
|
+
if "region" in value and value["region"] != '':
|
|
150
|
+
region = value["region"]
|
|
151
|
+
if not (isinstance(region, str) and region in ('us', 'eu', 'au')):
|
|
152
|
+
raise ValueError("Intercom configuration region has an invalid type")
|
|
153
|
+
config_arguments['region'] = region
|
|
154
|
+
if "maxResponseBytes" in value and value["maxResponseBytes"] != '':
|
|
155
|
+
max_response_bytes = value["maxResponseBytes"]
|
|
156
|
+
if not (type(max_response_bytes) is int):
|
|
157
|
+
raise ValueError("Intercom configuration maxResponseBytes has an invalid type")
|
|
158
|
+
config_arguments['max_response_bytes'] = max_response_bytes
|
|
159
|
+
if "webhookMaxBodyBytes" in value and value["webhookMaxBodyBytes"] != '':
|
|
160
|
+
webhook_max_body_bytes = value["webhookMaxBodyBytes"]
|
|
161
|
+
if not (type(webhook_max_body_bytes) is int):
|
|
162
|
+
raise ValueError("Intercom configuration webhookMaxBodyBytes has an invalid type")
|
|
163
|
+
config_arguments['webhook_max_body_bytes'] = webhook_max_body_bytes
|
|
164
|
+
return Config(**config_arguments)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Copyright (c) 2026 Super Durable
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# ruff: noqa
|
|
4
|
+
|
|
5
|
+
from datetime import timedelta
|
|
6
|
+
|
|
7
|
+
from dex_connectors.sdk import (
|
|
8
|
+
BranchDefinition,
|
|
9
|
+
MutationDefinition,
|
|
10
|
+
OperationRef,
|
|
11
|
+
QueryDefinition,
|
|
12
|
+
RetryPolicy,
|
|
13
|
+
StepDefaults,
|
|
14
|
+
default_connector_step_execute_retry_policy,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
CONNECTOR_ID = "intercom"
|
|
18
|
+
PROVIDER = "intercom"
|
|
19
|
+
SEARCH_CONVERSATIONS_OPERATION_ID = "searchConversations"
|
|
20
|
+
GET_CONVERSATION_OPERATION_ID = "getConversation"
|
|
21
|
+
REPLY_TO_CONVERSATION_OPERATION_ID = "replyToConversation"
|
|
22
|
+
UPDATE_CONVERSATION_STATE_OPERATION_ID = "updateConversationState"
|
|
23
|
+
FIND_CONTACT_BY_EMAIL_OPERATION_ID = "findContactByEmail"
|
|
24
|
+
DEFECT = "defect"
|
|
25
|
+
FOUND = "found"
|
|
26
|
+
INVALID_RESPONSE = "invalidResponse"
|
|
27
|
+
NOT_FOUND = "notFound"
|
|
28
|
+
PROVIDER_REJECTED = "providerRejected"
|
|
29
|
+
REPLIED = "replied"
|
|
30
|
+
SEARCHED = "searched"
|
|
31
|
+
UNCERTAIN = "uncertain"
|
|
32
|
+
UPDATED = "updated"
|
|
33
|
+
|
|
34
|
+
SEARCH_CONVERSATIONS_DEFINITION = QueryDefinition(
|
|
35
|
+
OperationRef(CONNECTOR_ID, SEARCH_CONVERSATIONS_OPERATION_ID),
|
|
36
|
+
(
|
|
37
|
+
BranchDefinition(SEARCHED, "One page of matching conversations was returned; it may be empty.", False),
|
|
38
|
+
BranchDefinition(PROVIDER_REJECTED, "Intercom conclusively rejected the search, such as an invalid token, a missing permission, or an invalid cursor.", True),
|
|
39
|
+
BranchDefinition(INVALID_RESPONSE, "Intercom returned an invalid or oversized search page.", True),
|
|
40
|
+
BranchDefinition(DEFECT, "Local input, connection configuration, or connector definition is invalid.", True),
|
|
41
|
+
),
|
|
42
|
+
StepDefaults(
|
|
43
|
+
timedelta(seconds=30),
|
|
44
|
+
2,
|
|
45
|
+
execute_retry=default_connector_step_execute_retry_policy(),
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
GET_CONVERSATION_DEFINITION = QueryDefinition(
|
|
50
|
+
OperationRef(CONNECTOR_ID, GET_CONVERSATION_OPERATION_ID),
|
|
51
|
+
(
|
|
52
|
+
BranchDefinition(FOUND, "The conversation and its latest parts were read.", False),
|
|
53
|
+
BranchDefinition(NOT_FOUND, "The conversation does not exist or is not visible to the connection's token.", True),
|
|
54
|
+
BranchDefinition(PROVIDER_REJECTED, "Intercom conclusively rejected the conversation read.", True),
|
|
55
|
+
BranchDefinition(INVALID_RESPONSE, "Intercom returned an invalid or oversized conversation.", True),
|
|
56
|
+
BranchDefinition(DEFECT, "Local input, connection configuration, or connector definition is invalid.", True),
|
|
57
|
+
),
|
|
58
|
+
StepDefaults(
|
|
59
|
+
timedelta(seconds=30),
|
|
60
|
+
2,
|
|
61
|
+
execute_retry=default_connector_step_execute_retry_policy(),
|
|
62
|
+
),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
REPLY_TO_CONVERSATION_DEFINITION = MutationDefinition(
|
|
66
|
+
OperationRef(CONNECTOR_ID, REPLY_TO_CONVERSATION_OPERATION_ID),
|
|
67
|
+
(
|
|
68
|
+
BranchDefinition(REPLIED, "The reply or note is in the conversation; a retried attempt that found its own earlier reply reports it instead of sending again.", False),
|
|
69
|
+
BranchDefinition(NOT_FOUND, "The conversation does not exist or is not visible to the connection's token; nothing was added.", True),
|
|
70
|
+
BranchDefinition(PROVIDER_REJECTED, "Intercom conclusively rejected the reply, such as an unknown admin or a closed channel; nothing was added.", True),
|
|
71
|
+
BranchDefinition(UNCERTAIN, "An earlier attempt sent the reply but its outcome cannot be confirmed and the conversation shows no matching part, so the reply may exist; the connector never resends it.", True),
|
|
72
|
+
BranchDefinition(INVALID_RESPONSE, "Intercom accepted the reply but returned an invalid or oversized conversation, so the reply exists.", True),
|
|
73
|
+
BranchDefinition(DEFECT, "Local input, connection configuration, or connector definition is invalid.", True),
|
|
74
|
+
),
|
|
75
|
+
StepDefaults(
|
|
76
|
+
timedelta(seconds=30),
|
|
77
|
+
1,
|
|
78
|
+
execute_retry=RetryPolicy(timedelta(seconds=1), 2, timedelta(seconds=60), 5, timedelta(seconds=300)),
|
|
79
|
+
),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
UPDATE_CONVERSATION_STATE_DEFINITION = MutationDefinition(
|
|
83
|
+
OperationRef(CONNECTOR_ID, UPDATE_CONVERSATION_STATE_OPERATION_ID),
|
|
84
|
+
(
|
|
85
|
+
BranchDefinition(UPDATED, "The conversation is in the requested state; a repeated attempt that finds it there writes nothing.", False),
|
|
86
|
+
BranchDefinition(NOT_FOUND, "The conversation does not exist or is not visible to the connection's token.", True),
|
|
87
|
+
BranchDefinition(PROVIDER_REJECTED, "Intercom conclusively rejected the change, such as an unknown admin, and the conversation is not in the requested state.", True),
|
|
88
|
+
BranchDefinition(INVALID_RESPONSE, "Intercom returned an invalid or oversized conversation, so the change may have been applied.", True),
|
|
89
|
+
BranchDefinition(DEFECT, "Local input, connection configuration, or connector definition is invalid.", True),
|
|
90
|
+
),
|
|
91
|
+
StepDefaults(
|
|
92
|
+
timedelta(seconds=30),
|
|
93
|
+
2,
|
|
94
|
+
execute_retry=default_connector_step_execute_retry_policy(),
|
|
95
|
+
),
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
FIND_CONTACT_BY_EMAIL_DEFINITION = QueryDefinition(
|
|
99
|
+
OperationRef(CONNECTOR_ID, FIND_CONTACT_BY_EMAIL_OPERATION_ID),
|
|
100
|
+
(
|
|
101
|
+
BranchDefinition(FOUND, "At least one contact has the email address.", False),
|
|
102
|
+
BranchDefinition(NOT_FOUND, "No contact has the email address yet; Intercom can take a few minutes to index a new contact.", True),
|
|
103
|
+
BranchDefinition(PROVIDER_REJECTED, "Intercom conclusively rejected the contact search.", True),
|
|
104
|
+
BranchDefinition(INVALID_RESPONSE, "Intercom returned an invalid or oversized contact page.", True),
|
|
105
|
+
BranchDefinition(DEFECT, "Local input, connection configuration, or connector definition is invalid.", True),
|
|
106
|
+
),
|
|
107
|
+
StepDefaults(
|
|
108
|
+
timedelta(seconds=30),
|
|
109
|
+
2,
|
|
110
|
+
execute_retry=default_connector_step_execute_retry_policy(),
|
|
111
|
+
),
|
|
112
|
+
)
|