@xemahq/biomes-platform-hubspot 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +175 -0
- package/contributions/hubspot.connector-adapter.contribution.json +112 -0
- package/dist/connector-adapters/index.d.ts +11 -0
- package/dist/connector-adapters/index.d.ts.map +1 -0
- package/dist/connector-adapters/index.js +71 -0
- package/dist/connector-adapters/index.js.map +1 -0
- package/dist/connector-adapters/operation-input-schemas.d.ts +19 -0
- package/dist/connector-adapters/operation-input-schemas.d.ts.map +1 -0
- package/dist/connector-adapters/operation-input-schemas.js +118 -0
- package/dist/connector-adapters/operation-input-schemas.js.map +1 -0
- package/dist/connector-adapters/operations.d.ts +24 -0
- package/dist/connector-adapters/operations.d.ts.map +1 -0
- package/dist/connector-adapters/operations.js +77 -0
- package/dist/connector-adapters/operations.js.map +1 -0
- package/install-schema/install.json +14 -0
- package/package.json +42 -0
- package/xema-biome.json +124 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Xema Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
5
|
+
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Neuralchowder Inc.
|
|
11
|
+
|
|
12
|
+
Licensed Work: Xema. The Licensed Work is (c) 2026 Neuralchowder Inc.
|
|
13
|
+
|
|
14
|
+
The Licensed Work includes, without limitation, Xema Core, Xema Runtime,
|
|
15
|
+
Xema Kernel, Xema control plane, Xema application runtime, Xema biome
|
|
16
|
+
runtime, Xema biome registry, Xema store services, Xema orchestration
|
|
17
|
+
services, Xema agents, Xema skills, Xema memory services, Xema APIs, Xema
|
|
18
|
+
user interfaces, Xema command-line tools, Xema deployment artifacts, Xema
|
|
19
|
+
templates, Xema specifications, Xema schemas, Xema manifests, Xema
|
|
20
|
+
documentation, Xema examples, and all source code, object code, binaries,
|
|
21
|
+
packages, modules, configuration files, manifests, schemas, examples,
|
|
22
|
+
templates, documentation, and derivative works included in or distributed
|
|
23
|
+
as part of the Xema software project.
|
|
24
|
+
|
|
25
|
+
The Licensed Work does not include any third-party software, libraries,
|
|
26
|
+
dependencies, packages, assets, or components that are distributed with the
|
|
27
|
+
Licensed Work but are governed by their own separate license terms. Such
|
|
28
|
+
third-party materials remain subject to their respective licenses.
|
|
29
|
+
|
|
30
|
+
A specific file, package, component, or directory may state that it is
|
|
31
|
+
governed by a different license. In that case, that specific file, package,
|
|
32
|
+
component, or directory is governed by the license expressly stated therein.
|
|
33
|
+
|
|
34
|
+
Additional Use Grant:
|
|
35
|
+
|
|
36
|
+
You may make production use of the Licensed Work, provided that your use
|
|
37
|
+
does not include offering, providing, making available, distributing,
|
|
38
|
+
hosting, managing, embedding, reselling, white-labeling, sublicensing,
|
|
39
|
+
commercializing, or otherwise making the Licensed Work, or any modified
|
|
40
|
+
version or derivative work of the Licensed Work, available to Third Parties
|
|
41
|
+
as part of a Competitive Offering.
|
|
42
|
+
|
|
43
|
+
The following definitions and clarifications form part of, and govern
|
|
44
|
+
the interpretation of, the Additional Use Grant set out above.
|
|
45
|
+
|
|
46
|
+
1. "Production Use" means any use of the Licensed Work other than for
|
|
47
|
+
development, testing, evaluation, demonstration, experimentation,
|
|
48
|
+
benchmarking, or other non-production purposes.
|
|
49
|
+
|
|
50
|
+
2. "Affiliate" means any entity that, directly or indirectly,
|
|
51
|
+
controls, is controlled by, or is under common control with you,
|
|
52
|
+
where "control" means ownership of more than fifty percent (50%) of
|
|
53
|
+
the voting interests of the entity, or the power to direct its
|
|
54
|
+
management.
|
|
55
|
+
|
|
56
|
+
3. "Third Party" means any natural person or legal entity other than
|
|
57
|
+
you and your Affiliates.
|
|
58
|
+
|
|
59
|
+
4. "Competitive Offering" means any product or service, made available
|
|
60
|
+
to one or more Third Parties for a fee or other consideration
|
|
61
|
+
(including without limitation on a paid, subscription,
|
|
62
|
+
advertising-supported, hosted, or managed-service basis), that is
|
|
63
|
+
offered or marketed as, or that competes with, a software platform,
|
|
64
|
+
runtime, orchestration system, agent or automation system,
|
|
65
|
+
extension or distribution marketplace, or other software system
|
|
66
|
+
that provides, in substantial part, the same or substantially
|
|
67
|
+
similar capabilities as those provided by the Licensed Work. A
|
|
68
|
+
product or service is a Competitive Offering whether the Licensed
|
|
69
|
+
Work is provided in whole or in part, alone or bundled with other
|
|
70
|
+
software, and whether modified or unmodified.
|
|
71
|
+
|
|
72
|
+
5. Providing, hosting, or managing the Licensed Work for a Third Party,
|
|
73
|
+
or otherwise making the Licensed Work available to a Third Party as
|
|
74
|
+
a hosted or managed service such that the Third Party obtains the
|
|
75
|
+
principal value or functionality of the Licensed Work, is a
|
|
76
|
+
Competitive Offering and is not permitted by the Additional Use
|
|
77
|
+
Grant.
|
|
78
|
+
|
|
79
|
+
6. Subject to the foregoing, the Additional Use Grant permits you to
|
|
80
|
+
make Production Use of the Licensed Work for your own internal
|
|
81
|
+
business purposes and to build, operate, and provide your own
|
|
82
|
+
products and services to Third Parties, provided that the Licensed
|
|
83
|
+
Work itself (whether modified or unmodified) is not the product or
|
|
84
|
+
service, and is not a Competitive Offering, made available to those
|
|
85
|
+
Third Parties.
|
|
86
|
+
|
|
87
|
+
7. You may modify the Licensed Work and create derivative works for
|
|
88
|
+
any purpose permitted by this License. Any Production Use of such
|
|
89
|
+
modified or derivative works remains subject to the same
|
|
90
|
+
restrictions as the Licensed Work, including the prohibition on
|
|
91
|
+
Competitive Offerings.
|
|
92
|
+
|
|
93
|
+
8. Use of the Licensed Work by your own employees, contractors, and
|
|
94
|
+
agents, acting on your behalf and for your benefit, is not by
|
|
95
|
+
itself making the Licensed Work available to a Third Party.
|
|
96
|
+
|
|
97
|
+
9. Embedding or distributing the Licensed Work as a component of your
|
|
98
|
+
own product or service is permitted only where the Licensed Work
|
|
99
|
+
does not constitute the principal value of that product or service
|
|
100
|
+
and the product or service is not a Competitive Offering.
|
|
101
|
+
|
|
102
|
+
10. Nothing in this Additional Use Grant grants any right to use any
|
|
103
|
+
name, trademark, service mark, or logo of the Licensor or its
|
|
104
|
+
Affiliates, except as reasonably required for customary
|
|
105
|
+
attribution.
|
|
106
|
+
|
|
107
|
+
11. The rights stated in this Additional Use Grant are the maximum
|
|
108
|
+
rights granted for Production Use prior to the Change Date. Any
|
|
109
|
+
Production Use not expressly permitted requires a separate
|
|
110
|
+
commercial license from the Licensor.
|
|
111
|
+
|
|
112
|
+
12. If any provision of this Additional Use Grant is held invalid or
|
|
113
|
+
unenforceable, that provision shall be limited or eliminated to
|
|
114
|
+
the minimum extent necessary so that the remainder of this
|
|
115
|
+
Additional Use Grant, and of this License, remains in full force
|
|
116
|
+
and effect. The Licensor reserves all rights not expressly granted
|
|
117
|
+
by this License.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
Change Date: Four years from the date the specific version of the Licensed
|
|
121
|
+
Work is first publicly released by Licensor.
|
|
122
|
+
|
|
123
|
+
Change License: Mozilla Public License, Version 2.0
|
|
124
|
+
|
|
125
|
+
For information about alternative licensing arrangements, commercial
|
|
126
|
+
licensing, enterprise licensing, OEM licensing, appliance licensing, managed
|
|
127
|
+
service licensing, cloud provider licensing, or other commercial use of the
|
|
128
|
+
Licensed Work, please contact: licensing@neuralchowder.com
|
|
129
|
+
|
|
130
|
+
-----------------------------------------------------------------------------
|
|
131
|
+
|
|
132
|
+
Notice
|
|
133
|
+
|
|
134
|
+
Business Source License 1.1
|
|
135
|
+
|
|
136
|
+
Terms
|
|
137
|
+
|
|
138
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
139
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
140
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
141
|
+
production use.
|
|
142
|
+
|
|
143
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
144
|
+
available distribution of a specific version of the Licensed Work under this
|
|
145
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
146
|
+
the terms of the Change License, and the rights granted in the paragraph above
|
|
147
|
+
terminate.
|
|
148
|
+
|
|
149
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
150
|
+
currently in effect as described in this License, you must purchase a
|
|
151
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
152
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
153
|
+
|
|
154
|
+
All copies of the original and modified Licensed Work, and derivative works of
|
|
155
|
+
the Licensed Work, are subject to this License. This License applies separately
|
|
156
|
+
for each version of the Licensed Work and the Change Date may vary for each
|
|
157
|
+
version of the Licensed Work released by Licensor.
|
|
158
|
+
|
|
159
|
+
You must conspicuously display this License on each original or modified copy
|
|
160
|
+
of the Licensed Work. If you receive the Licensed Work in original or modified
|
|
161
|
+
form from a third party, the terms and conditions set forth in this License
|
|
162
|
+
apply to your use of that work.
|
|
163
|
+
|
|
164
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
165
|
+
terminate your rights under this License for the current and all other
|
|
166
|
+
versions of the Licensed Work.
|
|
167
|
+
|
|
168
|
+
This License does not grant you any right in any trademark or logo of Licensor
|
|
169
|
+
or its affiliates, provided that you may use a trademark or logo of Licensor
|
|
170
|
+
as expressly required by this License.
|
|
171
|
+
|
|
172
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN
|
|
173
|
+
"AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS
|
|
174
|
+
OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
175
|
+
FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "connector-adapter",
|
|
3
|
+
"manifest": {
|
|
4
|
+
"provider": {
|
|
5
|
+
"providerKey": "hubspot",
|
|
6
|
+
"displayName": "HubSpot",
|
|
7
|
+
"description": "HubSpot CRM — read access to contacts, companies and deals, authenticated per connection by a private-app access token.",
|
|
8
|
+
"iconName": "Contact",
|
|
9
|
+
"category": "CRM",
|
|
10
|
+
"apiBaseUrl": "https://api.hubapi.com",
|
|
11
|
+
"appAuthKind": "none",
|
|
12
|
+
"allowOrgOverride": false
|
|
13
|
+
},
|
|
14
|
+
"connectors": [
|
|
15
|
+
{
|
|
16
|
+
"connectorKey": "HUBSPOT_CRM",
|
|
17
|
+
"displayName": "HubSpot CRM (read-only)",
|
|
18
|
+
"description": "Search HubSpot CRM contacts, companies and deals, and read a contact in full. Read-only: connector writes cannot yet declare an approval requirement, so none are shipped.",
|
|
19
|
+
"iconName": "Contact",
|
|
20
|
+
"providerKey": "hubspot",
|
|
21
|
+
"scopes": [
|
|
22
|
+
"crm.objects.contacts.read",
|
|
23
|
+
"crm.objects.companies.read",
|
|
24
|
+
"crm.objects.deals.read"
|
|
25
|
+
],
|
|
26
|
+
"connectionCredentialKind": "api_key",
|
|
27
|
+
"adapterKind": "crm",
|
|
28
|
+
"operations": [
|
|
29
|
+
{
|
|
30
|
+
"capabilityRef": "connector:hubspot.search-contacts@1",
|
|
31
|
+
"adapterKind": "declarative-http",
|
|
32
|
+
"scopes": [
|
|
33
|
+
"crm.objects.contacts.read"
|
|
34
|
+
],
|
|
35
|
+
"requiresConnection": true,
|
|
36
|
+
"httpRequest": {
|
|
37
|
+
"method": "POST",
|
|
38
|
+
"pathTemplate": "/crm/v3/objects/contacts/search",
|
|
39
|
+
"bodyMode": "json_input",
|
|
40
|
+
"auth": {
|
|
41
|
+
"kind": "bearer_header"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"capabilityRef": "connector:hubspot.get-contact@1",
|
|
47
|
+
"adapterKind": "declarative-http",
|
|
48
|
+
"scopes": [
|
|
49
|
+
"crm.objects.contacts.read"
|
|
50
|
+
],
|
|
51
|
+
"requiresConnection": true,
|
|
52
|
+
"httpRequest": {
|
|
53
|
+
"method": "GET",
|
|
54
|
+
"pathTemplate": "/crm/v3/objects/contacts/{contactId}",
|
|
55
|
+
"query": {
|
|
56
|
+
"properties": "{properties}"
|
|
57
|
+
},
|
|
58
|
+
"bodyMode": "none",
|
|
59
|
+
"auth": {
|
|
60
|
+
"kind": "bearer_header"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"capabilityRef": "connector:hubspot.search-companies@1",
|
|
66
|
+
"adapterKind": "declarative-http",
|
|
67
|
+
"scopes": [
|
|
68
|
+
"crm.objects.companies.read"
|
|
69
|
+
],
|
|
70
|
+
"requiresConnection": true,
|
|
71
|
+
"httpRequest": {
|
|
72
|
+
"method": "POST",
|
|
73
|
+
"pathTemplate": "/crm/v3/objects/companies/search",
|
|
74
|
+
"bodyMode": "json_input",
|
|
75
|
+
"auth": {
|
|
76
|
+
"kind": "bearer_header"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"capabilityRef": "connector:hubspot.search-deals@1",
|
|
82
|
+
"adapterKind": "declarative-http",
|
|
83
|
+
"scopes": [
|
|
84
|
+
"crm.objects.deals.read"
|
|
85
|
+
],
|
|
86
|
+
"requiresConnection": true,
|
|
87
|
+
"httpRequest": {
|
|
88
|
+
"method": "POST",
|
|
89
|
+
"pathTemplate": "/crm/v3/objects/deals/search",
|
|
90
|
+
"bodyMode": "json_input",
|
|
91
|
+
"auth": {
|
|
92
|
+
"kind": "bearer_header"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"credentialFields": [
|
|
100
|
+
{
|
|
101
|
+
"key": "accessToken",
|
|
102
|
+
"label": "Private app access token",
|
|
103
|
+
"type": "PASSWORD",
|
|
104
|
+
"required": true,
|
|
105
|
+
"isSecret": true,
|
|
106
|
+
"placeholder": "pat-na1-…",
|
|
107
|
+
"hint": "HubSpot → Settings → Integrations → Private Apps → your app → Auth. Grant only the scopes this connector declares — all three are READ scopes, so a token minted for it cannot modify your CRM even if it leaked. The token is held by the credential broker at org scope and is never shown to an agent.",
|
|
108
|
+
"transform": "TRIM"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ConnectorAdapterModule } from '@xemahq/biome-sdk/adapter';
|
|
2
|
+
import { type ConnectorDescriptor, type ProviderDescriptor } from '@xemahq/kernel-contracts/connector';
|
|
3
|
+
export declare const HUBSPOT_CONNECTOR_KEY = "HUBSPOT_CRM";
|
|
4
|
+
export declare const providerDescriptor: ProviderDescriptor;
|
|
5
|
+
export declare const connectorDescriptors: readonly ConnectorDescriptor[];
|
|
6
|
+
export declare const hubspotProvider: ConnectorAdapterModule;
|
|
7
|
+
declare const connectorAdapters: readonly ConnectorAdapterModule[];
|
|
8
|
+
export default connectorAdapters;
|
|
9
|
+
export { CRM_ADAPTER_KIND, HUBSPOT_API_BASE_URL, HUBSPOT_CAPABILITY_REFS, HUBSPOT_PROVIDER_KEY, HubSpotScope, HubSpotVerb, hubspotConnectorScopes, hubspotOperations, } from './operations.js';
|
|
10
|
+
export { operationInputSchemas, operationInputSchemasByVerb, type OperationInputSchema, } from './operation-input-schemas.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connector-adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAExB,MAAM,oCAAoC,CAAC;AA8D5C,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAqDnD,eAAO,MAAM,kBAAkB,EAAE,kBAgBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,SAAS,mBAAmB,EAgB9D,CAAC;AASF,eAAO,MAAM,eAAe,EAAE,sBAQ5B,CAAC;AAEH,QAAA,MAAM,iBAAiB,EAAE,SAAS,sBAAsB,EAAsB,CAAC;AAC/E,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineConnectorAdapter, } from '@xemahq/biome-sdk/adapter';
|
|
2
|
+
import { ConnectorOnboardingKind, CredentialFieldTransform, CredentialFieldType, CredentialKind, ProviderAppAuthKind, ProviderOrigin, } from '@xemahq/kernel-contracts/connector';
|
|
3
|
+
import { CRM_ADAPTER_KIND, HUBSPOT_API_BASE_URL, HUBSPOT_PROVIDER_KEY, hubspotConnectorScopes, hubspotOperations, } from './operations.js';
|
|
4
|
+
export const HUBSPOT_CONNECTOR_KEY = 'HUBSPOT_CRM';
|
|
5
|
+
const ICON_NAME = 'Contact';
|
|
6
|
+
const onboarding = {
|
|
7
|
+
provider: HUBSPOT_PROVIDER_KEY,
|
|
8
|
+
displayName: 'HubSpot',
|
|
9
|
+
description: 'Read HubSpot CRM contacts, companies and deals with a private-app access token.',
|
|
10
|
+
iconName: ICON_NAME,
|
|
11
|
+
kind: ConnectorOnboardingKind.CREDENTIALS,
|
|
12
|
+
supportedProjectBindingAdapterKinds: [],
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
key: 'accessToken',
|
|
16
|
+
label: 'Private app access token',
|
|
17
|
+
type: CredentialFieldType.PASSWORD,
|
|
18
|
+
required: true,
|
|
19
|
+
isSecret: true,
|
|
20
|
+
placeholder: 'pat-na1-…',
|
|
21
|
+
hint: 'HubSpot → Settings → Integrations → Private Apps → your app → Auth. ' +
|
|
22
|
+
'Grant only the scopes this connector declares — all three are READ ' +
|
|
23
|
+
'scopes, so a token minted for it cannot modify your CRM even if it ' +
|
|
24
|
+
'leaked. The token is held by the credential broker at org scope and is ' +
|
|
25
|
+
'never shown to an agent.',
|
|
26
|
+
transform: CredentialFieldTransform.TRIM,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
hint: 'A private app authenticates one HubSpot account. For several accounts, ' +
|
|
30
|
+
'create one connection per account — each carries its own token.',
|
|
31
|
+
};
|
|
32
|
+
export const providerDescriptor = {
|
|
33
|
+
providerKey: HUBSPOT_PROVIDER_KEY,
|
|
34
|
+
displayName: 'HubSpot',
|
|
35
|
+
description: 'HubSpot CRM — read access to contacts, companies and deals, authenticated per connection by a private-app access token.',
|
|
36
|
+
iconName: ICON_NAME,
|
|
37
|
+
category: 'CRM',
|
|
38
|
+
apiBaseUrl: HUBSPOT_API_BASE_URL,
|
|
39
|
+
appAuthKind: ProviderAppAuthKind.None,
|
|
40
|
+
origin: ProviderOrigin.Biome,
|
|
41
|
+
allowOrgOverride: false,
|
|
42
|
+
};
|
|
43
|
+
export const connectorDescriptors = [
|
|
44
|
+
{
|
|
45
|
+
connectorKey: HUBSPOT_CONNECTOR_KEY,
|
|
46
|
+
displayName: 'HubSpot CRM (read-only)',
|
|
47
|
+
description: 'Search HubSpot CRM contacts, companies and deals, and read a contact in ' +
|
|
48
|
+
'full. Read-only: connector writes cannot yet declare an approval ' +
|
|
49
|
+
'requirement, so none are shipped.',
|
|
50
|
+
iconName: ICON_NAME,
|
|
51
|
+
providerKey: HUBSPOT_PROVIDER_KEY,
|
|
52
|
+
scopes: hubspotConnectorScopes,
|
|
53
|
+
connectionCredentialKind: CredentialKind.ApiKey,
|
|
54
|
+
adapterKind: CRM_ADAPTER_KIND,
|
|
55
|
+
operations: hubspotOperations,
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
export const hubspotProvider = defineConnectorAdapter({
|
|
59
|
+
adapterKind: CRM_ADAPTER_KIND,
|
|
60
|
+
provider: HUBSPOT_PROVIDER_KEY,
|
|
61
|
+
displayName: 'HubSpot',
|
|
62
|
+
credentialKind: CredentialKind.ApiKey,
|
|
63
|
+
resources: {},
|
|
64
|
+
actions: {},
|
|
65
|
+
onboarding,
|
|
66
|
+
});
|
|
67
|
+
const connectorAdapters = [hubspotProvider];
|
|
68
|
+
export default connectorAdapters;
|
|
69
|
+
export { CRM_ADAPTER_KIND, HUBSPOT_API_BASE_URL, HUBSPOT_CAPABILITY_REFS, HUBSPOT_PROVIDER_KEY, HubSpotScope, HubSpotVerb, hubspotConnectorScopes, hubspotOperations, } from './operations.js';
|
|
70
|
+
export { operationInputSchemas, operationInputSchemasByVerb, } from './operation-input-schemas.js';
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connector-adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,cAAc,GAIf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAsDzB,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAGnD,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,UAAU,GAA+B;IAC7C,QAAQ,EAAE,oBAAoB;IAC9B,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,iFAAiF;IACnF,Q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EAAE,SAAS;IACtB,cAAc,EAAE,cAAc,CAAC,MAAM;IACrC,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAsC,CAAC,eAAe,CAAC,CAAC;AAC/E,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAE5B,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HubSpotVerb } from './operations.js';
|
|
2
|
+
import type { CapabilityRef } from '@xemahq/kernel-contracts/capability';
|
|
3
|
+
type JsonSchemaNode = Readonly<Record<string, unknown>>;
|
|
4
|
+
export interface OperationInputSchema {
|
|
5
|
+
readonly $schema: 'http://json-schema.org/draft-07/schema#';
|
|
6
|
+
readonly type: 'object';
|
|
7
|
+
readonly title: string;
|
|
8
|
+
readonly description: string;
|
|
9
|
+
readonly properties: Readonly<Record<string, JsonSchemaNode>>;
|
|
10
|
+
readonly required: readonly string[];
|
|
11
|
+
readonly additionalProperties: false;
|
|
12
|
+
readonly anyOf?: readonly {
|
|
13
|
+
readonly required: readonly string[];
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
export declare const operationInputSchemasByVerb: Readonly<Record<HubSpotVerb, OperationInputSchema>>;
|
|
17
|
+
export declare const operationInputSchemas: Readonly<Record<CapabilityRef, OperationInputSchema>>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=operation-input-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-input-schemas.d.ts","sourceRoot":"","sources":["../../src/connector-adapters/operation-input-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAsCzE,KAAK,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AASxD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,yCAAyC,CAAC;IAC5D,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC;IAErC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CACtE;AA8FD,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAChD,MAAM,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAiDzC,CAAC;AAQH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAC1C,MAAM,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAQ5C,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { HUBSPOT_CAPABILITY_REFS, HubSpotVerb } from './operations.js';
|
|
2
|
+
const DRAFT_07 = 'http://json-schema.org/draft-07/schema#';
|
|
3
|
+
function searchSchema(input) {
|
|
4
|
+
return {
|
|
5
|
+
$schema: DRAFT_07,
|
|
6
|
+
type: 'object',
|
|
7
|
+
title: input.title,
|
|
8
|
+
description: `Search HubSpot ${input.objectPlural}. Supply a free-text \`query\`, or ` +
|
|
9
|
+
'`filterGroups` for a structured search (groups are OR-ed, filters within ' +
|
|
10
|
+
'a group are AND-ed). The response carries `paging.next.after`; pass it ' +
|
|
11
|
+
'back as `after` to page.',
|
|
12
|
+
properties: {
|
|
13
|
+
query: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
minLength: 1,
|
|
16
|
+
description: `Free-text search across the ${input.objectPlural}' searchable properties.`,
|
|
17
|
+
},
|
|
18
|
+
filterGroups: {
|
|
19
|
+
type: 'array',
|
|
20
|
+
maxItems: 5,
|
|
21
|
+
description: 'Structured search. Each group is `{ "filters": [{ "propertyName", ' +
|
|
22
|
+
'"operator", "value" | "values" | "highValue" }] }`. At most 5 groups, ' +
|
|
23
|
+
'each with at most 6 filters (HubSpot limit).',
|
|
24
|
+
items: {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
filters: { type: 'array', maxItems: 6, items: { type: 'object' } },
|
|
28
|
+
},
|
|
29
|
+
required: ['filters'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
sorts: {
|
|
33
|
+
type: 'array',
|
|
34
|
+
description: 'At most one sort, as `{ "propertyName", "direction": "ASCENDING" | ' +
|
|
35
|
+
'"DESCENDING" }` (HubSpot accepts a single sort).',
|
|
36
|
+
maxItems: 1,
|
|
37
|
+
items: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
propertyName: { type: 'string' },
|
|
41
|
+
direction: { type: 'string', enum: ['ASCENDING', 'DESCENDING'] },
|
|
42
|
+
},
|
|
43
|
+
required: ['propertyName', 'direction'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
properties: {
|
|
47
|
+
type: 'array',
|
|
48
|
+
items: { type: 'string' },
|
|
49
|
+
description: 'Property names to return on each result. Omit for HubSpot\'s default ' +
|
|
50
|
+
`projection. Examples: ${input.examplePropertyNames.join(', ')}.`,
|
|
51
|
+
},
|
|
52
|
+
limit: {
|
|
53
|
+
type: 'integer',
|
|
54
|
+
minimum: 1,
|
|
55
|
+
maximum: 200,
|
|
56
|
+
default: 10,
|
|
57
|
+
description: 'Page size. HubSpot caps search at 200.',
|
|
58
|
+
},
|
|
59
|
+
after: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'Paging cursor from a previous response (`paging.next.after`). Omit ' +
|
|
62
|
+
'for the first page.',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: [],
|
|
66
|
+
additionalProperties: false,
|
|
67
|
+
anyOf: [{ required: ['query'] }, { required: ['filterGroups'] }],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export const operationInputSchemasByVerb = Object.freeze({
|
|
71
|
+
[HubSpotVerb.SearchContacts]: searchSchema({
|
|
72
|
+
title: 'Search HubSpot contacts',
|
|
73
|
+
objectPlural: 'contacts',
|
|
74
|
+
examplePropertyNames: ['email', 'firstname', 'lastname', 'company', 'lifecyclestage'],
|
|
75
|
+
}),
|
|
76
|
+
[HubSpotVerb.GetContact]: {
|
|
77
|
+
$schema: DRAFT_07,
|
|
78
|
+
type: 'object',
|
|
79
|
+
title: 'Get one HubSpot contact',
|
|
80
|
+
description: 'Read a single contact by its HubSpot record id, returning the named ' +
|
|
81
|
+
'properties.',
|
|
82
|
+
properties: {
|
|
83
|
+
contactId: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
minLength: 1,
|
|
86
|
+
pattern: '^[0-9]+$',
|
|
87
|
+
description: 'HubSpot contact record id (the numeric `id` on a search hit).',
|
|
88
|
+
},
|
|
89
|
+
properties: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
minLength: 1,
|
|
92
|
+
pattern: '^[a-zA-Z0-9_]+(,[a-zA-Z0-9_]+)*$',
|
|
93
|
+
description: 'COMMA-SEPARATED property names, e.g. `email,firstname,lastname`. A ' +
|
|
94
|
+
'string and not an array: this value fills a query-string placeholder, ' +
|
|
95
|
+
'and the executor substitutes scalars only — it has no array-to-CSV ' +
|
|
96
|
+
'serialisation. Required, because a declared placeholder with no input ' +
|
|
97
|
+
'value is a fail-fast error, so there is no way to express "omit it".',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: ['contactId', 'properties'],
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
},
|
|
103
|
+
[HubSpotVerb.SearchCompanies]: searchSchema({
|
|
104
|
+
title: 'Search HubSpot companies',
|
|
105
|
+
objectPlural: 'companies',
|
|
106
|
+
examplePropertyNames: ['name', 'domain', 'industry', 'country', 'numberofemployees'],
|
|
107
|
+
}),
|
|
108
|
+
[HubSpotVerb.SearchDeals]: searchSchema({
|
|
109
|
+
title: 'Search HubSpot deals',
|
|
110
|
+
objectPlural: 'deals',
|
|
111
|
+
examplePropertyNames: ['dealname', 'amount', 'dealstage', 'pipeline', 'closedate'],
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
export const operationInputSchemas = Object.freeze(Object.fromEntries(Object.values(HubSpotVerb).map((verb) => [
|
|
115
|
+
HUBSPOT_CAPABILITY_REFS[verb],
|
|
116
|
+
operationInputSchemasByVerb[verb],
|
|
117
|
+
])));
|
|
118
|
+
//# sourceMappingURL=operation-input-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-input-schemas.js","sourceRoot":"","sources":["../../src/connector-adapters/operation-input-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA6DvE,MAAM,QAAQ,GAAG,yCAAkD,CAAC;AAOpE,SAAS,YAAY,CAAC,KAIrB;IACC,OAAO;QACL,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,WAAW,EACT,kBAAkB,KAAK,CAAC,YAAY,qCAAqC;YACzE,2EAA2E;YAC3E,yEAAyE;YACzE,0BAA0B;QAC5B,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,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,SAAS,EAAE,mBAAmB,CAAC;KACrF,CAAC;IAEF,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC;QACtC,KAAK,EAAE,sBAAsB;QAC7B,YAAY,EAAE,OAAO;QACrB,oBAAoB,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC;KACnF,CAAC;CACH,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,qBAAqB,GAE9B,MAAM,CAAC,MAAM,CACf,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IACvC,uBAAuB,CAAC,IAAI,CAAC;IAC7B,2BAA2B,CAAC,IAAI,CAAC;CAClC,CAAC,CACH,CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ConnectorOperationDescriptor } from '@xemahq/kernel-contracts/connector';
|
|
2
|
+
export declare const HUBSPOT_PROVIDER_KEY = "hubspot";
|
|
3
|
+
export declare const CRM_ADAPTER_KIND = "crm";
|
|
4
|
+
export declare const HUBSPOT_API_BASE_URL = "https://api.hubapi.com";
|
|
5
|
+
export declare enum HubSpotScope {
|
|
6
|
+
ContactsRead = "crm.objects.contacts.read",
|
|
7
|
+
CompaniesRead = "crm.objects.companies.read",
|
|
8
|
+
DealsRead = "crm.objects.deals.read"
|
|
9
|
+
}
|
|
10
|
+
export declare enum HubSpotVerb {
|
|
11
|
+
SearchContacts = "search-contacts",
|
|
12
|
+
GetContact = "get-contact",
|
|
13
|
+
SearchCompanies = "search-companies",
|
|
14
|
+
SearchDeals = "search-deals"
|
|
15
|
+
}
|
|
16
|
+
export declare const HUBSPOT_CAPABILITY_REFS: Readonly<{
|
|
17
|
+
"search-contacts": import("@xemahq/kernel-contracts/capability").CapabilityRef;
|
|
18
|
+
"get-contact": import("@xemahq/kernel-contracts/capability").CapabilityRef;
|
|
19
|
+
"search-companies": import("@xemahq/kernel-contracts/capability").CapabilityRef;
|
|
20
|
+
"search-deals": import("@xemahq/kernel-contracts/capability").CapabilityRef;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const hubspotOperations: readonly ConnectorOperationDescriptor[];
|
|
23
|
+
export declare const hubspotConnectorScopes: readonly string[];
|
|
24
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/connector-adapters/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,4BAA4B,EAClC,MAAM,oCAAoC,CAAC;AA8E5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAQ9C,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAGtC,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAO7D,oBAAY,YAAY;IACtB,YAAY,8BAA8B;IAC1C,aAAa,+BAA+B;IAC5C,SAAS,2BAA2B;CACrC;AAOD,oBAAY,WAAW;IACrB,cAAc,oBAAoB;IAClC,UAAU,gBAAgB;IAC1B,eAAe,qBAAqB;IACpC,WAAW,iBAAiB;CAC7B;AAGD,eAAO,MAAM,uBAAuB;;;;;EAiBlC,CAAC;AAuDH,eAAO,MAAM,iBAAiB,EAAE,SAAS,4BAA4B,EAuCjE,CAAC;AAQL,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAElD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ConnectorAdapterKind, ConnectorAuthInjectionKind, ConnectorHttpBodyMode, ConnectorHttpMethod, } from '@xemahq/kernel-contracts/connector';
|
|
2
|
+
import { buildConnectorCapabilityRef } from '@xemahq/kernel-contracts/capability';
|
|
3
|
+
export const HUBSPOT_PROVIDER_KEY = 'hubspot';
|
|
4
|
+
export const CRM_ADAPTER_KIND = 'crm';
|
|
5
|
+
export const HUBSPOT_API_BASE_URL = 'https://api.hubapi.com';
|
|
6
|
+
export var HubSpotScope;
|
|
7
|
+
(function (HubSpotScope) {
|
|
8
|
+
HubSpotScope["ContactsRead"] = "crm.objects.contacts.read";
|
|
9
|
+
HubSpotScope["CompaniesRead"] = "crm.objects.companies.read";
|
|
10
|
+
HubSpotScope["DealsRead"] = "crm.objects.deals.read";
|
|
11
|
+
})(HubSpotScope || (HubSpotScope = {}));
|
|
12
|
+
export var HubSpotVerb;
|
|
13
|
+
(function (HubSpotVerb) {
|
|
14
|
+
HubSpotVerb["SearchContacts"] = "search-contacts";
|
|
15
|
+
HubSpotVerb["GetContact"] = "get-contact";
|
|
16
|
+
HubSpotVerb["SearchCompanies"] = "search-companies";
|
|
17
|
+
HubSpotVerb["SearchDeals"] = "search-deals";
|
|
18
|
+
})(HubSpotVerb || (HubSpotVerb = {}));
|
|
19
|
+
export const HUBSPOT_CAPABILITY_REFS = Object.freeze({
|
|
20
|
+
[HubSpotVerb.SearchContacts]: buildConnectorCapabilityRef(HUBSPOT_PROVIDER_KEY, HubSpotVerb.SearchContacts),
|
|
21
|
+
[HubSpotVerb.GetContact]: buildConnectorCapabilityRef(HUBSPOT_PROVIDER_KEY, HubSpotVerb.GetContact),
|
|
22
|
+
[HubSpotVerb.SearchCompanies]: buildConnectorCapabilityRef(HUBSPOT_PROVIDER_KEY, HubSpotVerb.SearchCompanies),
|
|
23
|
+
[HubSpotVerb.SearchDeals]: buildConnectorCapabilityRef(HUBSPOT_PROVIDER_KEY, HubSpotVerb.SearchDeals),
|
|
24
|
+
});
|
|
25
|
+
const BEARER_AUTH = Object.freeze({
|
|
26
|
+
kind: ConnectorAuthInjectionKind.BearerHeader,
|
|
27
|
+
});
|
|
28
|
+
function declarativeOperation(input) {
|
|
29
|
+
return {
|
|
30
|
+
capabilityRef: HUBSPOT_CAPABILITY_REFS[input.verb],
|
|
31
|
+
adapterKind: ConnectorAdapterKind.DeclarativeHttp,
|
|
32
|
+
scopes: input.scopes,
|
|
33
|
+
requiresConnection: true,
|
|
34
|
+
httpRequest: {
|
|
35
|
+
method: input.method,
|
|
36
|
+
pathTemplate: input.pathTemplate,
|
|
37
|
+
...(input.query === undefined ? {} : { query: input.query }),
|
|
38
|
+
bodyMode: input.bodyMode,
|
|
39
|
+
auth: BEARER_AUTH,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export const hubspotOperations = Object.freeze([
|
|
44
|
+
declarativeOperation({
|
|
45
|
+
verb: HubSpotVerb.SearchContacts,
|
|
46
|
+
scopes: [HubSpotScope.ContactsRead],
|
|
47
|
+
method: ConnectorHttpMethod.Post,
|
|
48
|
+
pathTemplate: '/crm/v3/objects/contacts/search',
|
|
49
|
+
bodyMode: ConnectorHttpBodyMode.JsonInput,
|
|
50
|
+
}),
|
|
51
|
+
declarativeOperation({
|
|
52
|
+
verb: HubSpotVerb.GetContact,
|
|
53
|
+
scopes: [HubSpotScope.ContactsRead],
|
|
54
|
+
method: ConnectorHttpMethod.Get,
|
|
55
|
+
pathTemplate: '/crm/v3/objects/contacts/{contactId}',
|
|
56
|
+
query: { properties: '{properties}' },
|
|
57
|
+
bodyMode: ConnectorHttpBodyMode.None,
|
|
58
|
+
}),
|
|
59
|
+
declarativeOperation({
|
|
60
|
+
verb: HubSpotVerb.SearchCompanies,
|
|
61
|
+
scopes: [HubSpotScope.CompaniesRead],
|
|
62
|
+
method: ConnectorHttpMethod.Post,
|
|
63
|
+
pathTemplate: '/crm/v3/objects/companies/search',
|
|
64
|
+
bodyMode: ConnectorHttpBodyMode.JsonInput,
|
|
65
|
+
}),
|
|
66
|
+
declarativeOperation({
|
|
67
|
+
verb: HubSpotVerb.SearchDeals,
|
|
68
|
+
scopes: [HubSpotScope.DealsRead],
|
|
69
|
+
method: ConnectorHttpMethod.Post,
|
|
70
|
+
pathTemplate: '/crm/v3/objects/deals/search',
|
|
71
|
+
bodyMode: ConnectorHttpBodyMode.JsonInput,
|
|
72
|
+
}),
|
|
73
|
+
]);
|
|
74
|
+
export const hubspotConnectorScopes = Object.freeze([
|
|
75
|
+
...new Set(hubspotOperations.flatMap((operation) => operation.scopes)),
|
|
76
|
+
]);
|
|
77
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/connector-adapters/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AA6ElF,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAQ9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAGtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAO7D,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,0DAA0C,CAAA;IAC1C,4DAA4C,CAAA;IAC5C,oDAAoC,CAAA;AACtC,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAOD,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,iDAAkC,CAAA;IAClC,yCAA0B,CAAA;IAC1B,mDAAoC,CAAA;IACpC,2CAA4B,CAAA;AAC9B,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAGD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;IACnD,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,2BAA2B,CACvD,oBAAoB,EACpB,WAAW,CAAC,cAAc,CAC3B;IACD,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,2BAA2B,CACnD,oBAAoB,EACpB,WAAW,CAAC,UAAU,CACvB;IACD,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,2BAA2B,CACxD,oBAAoB,EACpB,WAAW,CAAC,eAAe,CAC5B;IACD,CAAC,WAAW,CAAC,WAAW,C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E,qBAAqB,CAAC,IAAI;KACrC,CAAC;IAEF,oBAAoB,CAAC;QACnB,IAAI,EAAE,WAAW,CAAC,eAAe;QACjC,MAAM,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC;QACpC,MAAM,EAAE,mBAAmB,CAAC,IAAI;QAChC,YAAY,EAAE,kCAAkC;QAChD,QAAQ,EAAE,qBAAqB,CAAC,SAAS;KAC1C,CAAC;IAEF,oBAAoB,CAAC;QACnB,IAAI,EAAE,WAAW,CAAC,WAAW;QAC7B,MAAM,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC;QAChC,MAAM,EAAE,mBAAmB,CAAC,IAAI;QAChC,YAAY,EAAE,8BAA8B;QAC5C,QAAQ,EAAE,qBAAqB,CAAC,SAAS;KAC1C,CAAC;CACH,CAAC,CAAC;AAQL,MAAM,CAAC,MAAM,sBAAsB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACrE,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;CACvE,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "connector-hubspot-install",
|
|
4
|
+
"title": "HubSpot CRM Connector Settings",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["integration"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"integration": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"title": "HubSpot connection",
|
|
11
|
+
"description": "Which connected HubSpot account this installation uses. One connection per HubSpot account — each carries its own private-app access token, held at org scope by the credential broker."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xemahq/biomes-platform-hubspot",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/xema-dev/xema-community.git",
|
|
7
|
+
"directory": "biomes/connector-hubspot"
|
|
8
|
+
},
|
|
9
|
+
"license": "LicenseRef-Xema-BSL-1.1",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"registry": "https://registry.npmjs.org/",
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"main": "dist/connector-adapters/index.js",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"install-schema",
|
|
19
|
+
"xema-biome.json",
|
|
20
|
+
"contributions"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./connector-adapters": {
|
|
24
|
+
"types": "./dist/connector-adapters/index.d.ts",
|
|
25
|
+
"default": "./dist/connector-adapters/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@xemahq/biome-sdk": "^6.2.3",
|
|
31
|
+
"@xemahq/kernel-contracts": "^15.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "25.2.3",
|
|
35
|
+
"typescript": "5.9.3"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"test": "node --test ./tests/**/*.test.mjs"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/xema-biome.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xemahq/biomes-platform-hubspot",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"xema": {
|
|
5
|
+
"id": "connector-hubspot",
|
|
6
|
+
"displayName": "HubSpot CRM Connector (read-only)",
|
|
7
|
+
"display": {
|
|
8
|
+
"icon": "contact",
|
|
9
|
+
"category": "connect",
|
|
10
|
+
"summary": "HubSpot CRM connector \u2014 search contacts, companies and deals and read a contact in full, through four declarative-HTTP operations. Read-only by design."
|
|
11
|
+
},
|
|
12
|
+
"description": "First-party connector biome for HubSpot CRM, and the first whose every operation is `declarative-http`: four ConnectorHttpRequestTemplates executed by connector-gateway-api's generic DeclarativeHttpExecutorService with NO connector-specific code, no provider SDK and no adapter dispatch. Projects `connector:hubspot.search-contacts@1`, `.get-contact@1`, `.search-companies@1` and `.search-deals@1` against HubSpot's single global API host. Each connection authenticates with its own HubSpot private-app access token (curated `api_key` credential kind, injected as `Authorization: Bearer`), held by the credential broker at org scope \u2014 there is no shared platform app to provision, so the connector is connectable the moment it is installed. READ-ONLY BY DESIGN: `create-contact` and `update-contact` were written and removed before shipping, because `ConnectorOperationDescriptor` is a strictObject with no `requiresApproval`, `inputSchema`, `riskTier` or idempotency field \u2014 so a connector write can never reach the platform's durable approval gate, can never be validated at the capability boundary, and can never be safely retried against a provider that rate-limits. Adding those four optional fields to the kernel descriptor (and having the projector read them instead of UNDECLARED_OPERATION_METADATA) is the exact change that unblocks writes; the input schemas are already written and asserted in src/connector-adapters/operation-input-schemas.ts. Ships no webhook block (a private-app connection has no push channel) and no code actions.",
|
|
13
|
+
"scope": "platform",
|
|
14
|
+
"storeListed": true,
|
|
15
|
+
"target": "server",
|
|
16
|
+
"kind": "connector",
|
|
17
|
+
"bundleSource": {
|
|
18
|
+
"kind": "npm",
|
|
19
|
+
"name": "@xemahq/biomes-platform-hubspot",
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
},
|
|
22
|
+
"trustTier": "first-party",
|
|
23
|
+
"connectorRequirements": [
|
|
24
|
+
{
|
|
25
|
+
"adapterKind": "crm",
|
|
26
|
+
"purpose": "Read an org's own HubSpot CRM records (contacts, companies, deals) from agents and workflows. Read-only \u2014 see the biome description for why no write operation is shipped.",
|
|
27
|
+
"capabilities": [
|
|
28
|
+
"crm.search-contacts",
|
|
29
|
+
"crm.get-contact",
|
|
30
|
+
"crm.search-companies",
|
|
31
|
+
"crm.search-deals"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"components": [
|
|
36
|
+
{
|
|
37
|
+
"key": "connector-adapter",
|
|
38
|
+
"kind": "adapter",
|
|
39
|
+
"artifact": {
|
|
40
|
+
"kind": "host-module",
|
|
41
|
+
"path": "dist/connector-adapters/index.js"
|
|
42
|
+
},
|
|
43
|
+
"entrypoint": {
|
|
44
|
+
"kind": "module-export",
|
|
45
|
+
"module": "dist/connector-adapters/index.js",
|
|
46
|
+
"exportName": "default"
|
|
47
|
+
},
|
|
48
|
+
"protocol": {
|
|
49
|
+
"kind": "adapter",
|
|
50
|
+
"revision": "v1"
|
|
51
|
+
},
|
|
52
|
+
"hostAbi": {
|
|
53
|
+
"name": "xema-adapter-host",
|
|
54
|
+
"versionRange": "^1"
|
|
55
|
+
},
|
|
56
|
+
"executionModes": [
|
|
57
|
+
"shared-host",
|
|
58
|
+
"isolated"
|
|
59
|
+
],
|
|
60
|
+
"requirements": {
|
|
61
|
+
"tenancy": {
|
|
62
|
+
"allowed": [
|
|
63
|
+
"org",
|
|
64
|
+
"project"
|
|
65
|
+
],
|
|
66
|
+
"tenantContext": "verified"
|
|
67
|
+
},
|
|
68
|
+
"isolation": {
|
|
69
|
+
"minimum": "none"
|
|
70
|
+
},
|
|
71
|
+
"trust": {
|
|
72
|
+
"minimum": "verified"
|
|
73
|
+
},
|
|
74
|
+
"locality": {
|
|
75
|
+
"allowed": [
|
|
76
|
+
"cloud",
|
|
77
|
+
"customer-private"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"state": {
|
|
81
|
+
"kind": "stateless"
|
|
82
|
+
},
|
|
83
|
+
"resources": {
|
|
84
|
+
"minimum": {
|
|
85
|
+
"cpu": "100m",
|
|
86
|
+
"memory": "64Mi",
|
|
87
|
+
"ephemeralStorage": "64Mi"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"runtime": {
|
|
91
|
+
"kind": "node",
|
|
92
|
+
"versionRange": ">=22 <25"
|
|
93
|
+
},
|
|
94
|
+
"io": {
|
|
95
|
+
"ingress": "none",
|
|
96
|
+
"egress": "internet",
|
|
97
|
+
"rawBody": false,
|
|
98
|
+
"devices": []
|
|
99
|
+
},
|
|
100
|
+
"scaling": {
|
|
101
|
+
"mode": "horizontal",
|
|
102
|
+
"concurrency": {
|
|
103
|
+
"handling": "parallel",
|
|
104
|
+
"maximumPerInstance": 16
|
|
105
|
+
},
|
|
106
|
+
"readiness": {
|
|
107
|
+
"kind": "protocol",
|
|
108
|
+
"initialDelaySeconds": 0
|
|
109
|
+
},
|
|
110
|
+
"drain": {
|
|
111
|
+
"kind": "graceful",
|
|
112
|
+
"maximumSeconds": 30
|
|
113
|
+
},
|
|
114
|
+
"hints": {
|
|
115
|
+
"cpu": "latency",
|
|
116
|
+
"memory": "steady",
|
|
117
|
+
"startup": "fast"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
}
|