@superdurable/connector-hubspot 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,443 @@
1
+ import { G as GetObjectInput, C as CRMObject, a as Connection, S as SearchObjectsInput, O as ObjectPage, U as UpdateObjectInput, b as UpsertObjectInput, c as UpsertedObject, d as Config, e as CredentialSource, f as Operations } from './connection-pqfXajbM.js';
2
+ export { g as CRMObjectSchema, h as ConfigSchema, i as Credentials, j as GetObjectInputSchema, k as ObjectPageSchema, l as SearchFilter, m as SearchFilterGroup, n as SearchFilterGroupSchema, o as SearchFilterSchema, p as SearchObjectsInputSchema, q as SearchSort, r as SearchSortSchema, s as UpdateObjectInputSchema, t as UpsertObjectInputSchema, u as UpsertedObjectSchema, v as decodeCredentials, w as decodeSharedCredentials, x as newConnection, y as newConnectionWithOperations } from './connection-pqfXajbM.js';
3
+ import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
4
+ import { QueryDefinition, MutationDefinition, QueryStepConfig, Query, QueryResult, MutationStepConfig, Mutation, MutationResult, QueryStep, MutationStep, Call, QueryAttempt, MutationAttempt, TriggerLogger, ReceiptDraft, Failure, ConnectorConfigurationUI, TriggerDefinition, TriggerBindingDefinition, TriggerTarget, TriggerRunner } from '@superdurable/connectors-sdk';
5
+ import { StepTarget } from '@superdurable/dex';
6
+ import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
7
+ import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
8
+ import { z } from 'zod';
9
+ import { CursorStore, Runner } from '@superdurable/connectors-sdk/pollingtrigger';
10
+
11
+ /** Stable connector identity. */
12
+ declare const ConnectorID = "hubspot";
13
+ /** Provider identity for named connections. */
14
+ declare const ProviderID = "hubspot";
15
+ /** Branch IDs for searchObjects. */
16
+ declare const SearchObjectsBranch: {
17
+ readonly Searched: "searched";
18
+ readonly ProviderRejected: "providerRejected";
19
+ readonly InvalidResponse: "invalidResponse";
20
+ readonly Defect: "defect";
21
+ };
22
+ /** HubSpot returned one bounded page of matching records; the page may be empty. */
23
+ declare const SearchObjectsBranchSearched: "searched";
24
+ /** HubSpot conclusively rejected the search, such as an unknown property, a missing scope, a rejected token, or an exhausted daily limit. */
25
+ declare const SearchObjectsBranchProviderRejected: "providerRejected";
26
+ /** HubSpot returned an invalid or oversized search response. */
27
+ declare const SearchObjectsBranchInvalidResponse: "invalidResponse";
28
+ /** Local input, connection configuration, or connector definition is invalid. */
29
+ declare const SearchObjectsBranchDefect: "defect";
30
+ /** Manifest definition for searchObjects. */
31
+ declare const SearchObjectsDefinition: QueryDefinition;
32
+ /** Manifest metadata for searchObjects. */
33
+ declare const SearchObjectsMetadata: {
34
+ readonly kind: "query";
35
+ readonly idempotency: "none";
36
+ readonly authorization: "required";
37
+ };
38
+ /** Branch IDs for getObject. */
39
+ declare const GetObjectBranch: {
40
+ readonly Found: "found";
41
+ readonly NotFound: "notFound";
42
+ readonly ProviderRejected: "providerRejected";
43
+ readonly InvalidResponse: "invalidResponse";
44
+ readonly Defect: "defect";
45
+ };
46
+ /** The record exists and was returned. */
47
+ declare const GetObjectBranchFound: "found";
48
+ /** No unarchived record of that object type has the record ID. */
49
+ declare const GetObjectBranchNotFound: "notFound";
50
+ /** HubSpot conclusively rejected the read, such as an unknown property, a missing scope, a rejected token, or an exhausted daily limit. */
51
+ declare const GetObjectBranchProviderRejected: "providerRejected";
52
+ /** HubSpot returned an invalid or oversized record response. */
53
+ declare const GetObjectBranchInvalidResponse: "invalidResponse";
54
+ /** Local input, connection configuration, or connector definition is invalid. */
55
+ declare const GetObjectBranchDefect: "defect";
56
+ /** Manifest definition for getObject. */
57
+ declare const GetObjectDefinition: QueryDefinition;
58
+ /** Manifest metadata for getObject. */
59
+ declare const GetObjectMetadata: {
60
+ readonly kind: "query";
61
+ readonly idempotency: "none";
62
+ readonly authorization: "required";
63
+ };
64
+ /** Branch IDs for upsertObject. */
65
+ declare const UpsertObjectBranch: {
66
+ readonly Upserted: "upserted";
67
+ readonly Conflict: "conflict";
68
+ readonly ProviderRejected: "providerRejected";
69
+ readonly InvalidResponse: "invalidResponse";
70
+ readonly Defect: "defect";
71
+ };
72
+ /** HubSpot created the record or updated the record that owns the unique value. */
73
+ declare const UpsertObjectBranchUpserted: "upserted";
74
+ /** The properties conflict with another record, such as an email that another contact already owns. */
75
+ declare const UpsertObjectBranchConflict: "conflict";
76
+ /** HubSpot conclusively rejected the upsert, such as an invalid property value, a property that is not unique, a missing scope, a rejected token, or an exhausted daily limit. */
77
+ declare const UpsertObjectBranchProviderRejected: "providerRejected";
78
+ /** HubSpot applied or rejected the upsert but returned an invalid or oversized response. */
79
+ declare const UpsertObjectBranchInvalidResponse: "invalidResponse";
80
+ /** Local input, connection configuration, or connector definition is invalid. */
81
+ declare const UpsertObjectBranchDefect: "defect";
82
+ /** Manifest definition for upsertObject. */
83
+ declare const UpsertObjectDefinition: MutationDefinition;
84
+ /** Manifest metadata for upsertObject. */
85
+ declare const UpsertObjectMetadata: {
86
+ readonly kind: "mutation";
87
+ readonly idempotency: "required";
88
+ readonly authorization: "required";
89
+ };
90
+ /** Branch IDs for updateObject. */
91
+ declare const UpdateObjectBranch: {
92
+ readonly Updated: "updated";
93
+ readonly NotFound: "notFound";
94
+ readonly Conflict: "conflict";
95
+ readonly ProviderRejected: "providerRejected";
96
+ readonly InvalidResponse: "invalidResponse";
97
+ readonly Defect: "defect";
98
+ };
99
+ /** HubSpot updated the record and returned it. */
100
+ declare const UpdateObjectBranchUpdated: "updated";
101
+ /** No unarchived record of that object type has the record ID. */
102
+ declare const UpdateObjectBranchNotFound: "notFound";
103
+ /** The properties conflict with another record, such as an email that another contact already owns. */
104
+ declare const UpdateObjectBranchConflict: "conflict";
105
+ /** HubSpot conclusively rejected the update, such as an invalid property value, a missing scope, a rejected token, or an exhausted daily limit. */
106
+ declare const UpdateObjectBranchProviderRejected: "providerRejected";
107
+ /** HubSpot applied or rejected the update but returned an invalid or oversized response. */
108
+ declare const UpdateObjectBranchInvalidResponse: "invalidResponse";
109
+ /** Local input, connection configuration, or connector definition is invalid. */
110
+ declare const UpdateObjectBranchDefect: "defect";
111
+ /** Manifest definition for updateObject. */
112
+ declare const UpdateObjectDefinition: MutationDefinition;
113
+ /** Manifest metadata for updateObject. */
114
+ declare const UpdateObjectMetadata: {
115
+ readonly kind: "mutation";
116
+ readonly idempotency: "required";
117
+ readonly authorization: "required";
118
+ };
119
+
120
+ /** Configuration for the searchObjects connector Step. */
121
+ interface SearchObjectsStepConfig<StepInput, OperationInput = SearchObjectsInput, OperationOutput = ObjectPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
122
+ /** Named connection supplying this operation. */
123
+ connection: Connection<{
124
+ searchObjects(): Query<OperationInput, OperationOutput>;
125
+ }>;
126
+ /** Name matching the bound connection. */
127
+ connectionName: string;
128
+ /** HubSpot returned one bounded page of matching records; the page may be empty. */
129
+ searched: StepTarget<QueryResult<OperationOutput>>;
130
+ /** HubSpot conclusively rejected the search, such as an unknown property, a missing scope, a rejected token, or an exhausted daily limit. */
131
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
132
+ /** HubSpot returned an invalid or oversized search response. */
133
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
134
+ /** Local input, connection configuration, or connector definition is invalid. */
135
+ defect?: StepTarget<QueryResult<OperationOutput>>;
136
+ }
137
+ /** Build the searchObjects Step from a named connection. */
138
+ declare function newSearchObjectsStep<StepInput, OperationInput = SearchObjectsInput, OperationOutput = ObjectPage>(configuration: SearchObjectsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
139
+ /** Configuration for the getObject connector Step. */
140
+ interface GetObjectStepConfig<StepInput, OperationInput = GetObjectInput, OperationOutput = CRMObject> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
141
+ /** Named connection supplying this operation. */
142
+ connection: Connection<{
143
+ getObject(): Query<OperationInput, OperationOutput>;
144
+ }>;
145
+ /** Name matching the bound connection. */
146
+ connectionName: string;
147
+ /** The record exists and was returned. */
148
+ found: StepTarget<QueryResult<OperationOutput>>;
149
+ /** No unarchived record of that object type has the record ID. */
150
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
151
+ /** HubSpot conclusively rejected the read, such as an unknown property, a missing scope, a rejected token, or an exhausted daily limit. */
152
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
153
+ /** HubSpot returned an invalid or oversized record response. */
154
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
155
+ /** Local input, connection configuration, or connector definition is invalid. */
156
+ defect?: StepTarget<QueryResult<OperationOutput>>;
157
+ }
158
+ /** Build the getObject Step from a named connection. */
159
+ declare function newGetObjectStep<StepInput, OperationInput = GetObjectInput, OperationOutput = CRMObject>(configuration: GetObjectStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
160
+ /** Configuration for the upsertObject connector Step. */
161
+ interface UpsertObjectStepConfig<StepInput, OperationInput = UpsertObjectInput, OperationOutput = UpsertedObject> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
162
+ /** Named connection supplying this operation. */
163
+ connection: Connection<{
164
+ upsertObject(): Mutation<OperationInput, OperationOutput>;
165
+ }>;
166
+ /** Name matching the bound connection. */
167
+ connectionName: string;
168
+ /** HubSpot created the record or updated the record that owns the unique value. */
169
+ upserted: StepTarget<MutationResult<OperationOutput>>;
170
+ /** The properties conflict with another record, such as an email that another contact already owns. */
171
+ conflict?: StepTarget<MutationResult<OperationOutput>>;
172
+ /** HubSpot conclusively rejected the upsert, such as an invalid property value, a property that is not unique, a missing scope, a rejected token, or an exhausted daily limit. */
173
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
174
+ /** HubSpot applied or rejected the upsert but returned an invalid or oversized response. */
175
+ invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
176
+ /** Local input, connection configuration, or connector definition is invalid. */
177
+ defect?: StepTarget<MutationResult<OperationOutput>>;
178
+ }
179
+ /** Build the upsertObject Step from a named connection. */
180
+ declare function newUpsertObjectStep<StepInput, OperationInput = UpsertObjectInput, OperationOutput = UpsertedObject>(configuration: UpsertObjectStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
181
+ /** Configuration for the updateObject connector Step. */
182
+ interface UpdateObjectStepConfig<StepInput, OperationInput = UpdateObjectInput, OperationOutput = CRMObject> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
183
+ /** Named connection supplying this operation. */
184
+ connection: Connection<{
185
+ updateObject(): Mutation<OperationInput, OperationOutput>;
186
+ }>;
187
+ /** Name matching the bound connection. */
188
+ connectionName: string;
189
+ /** HubSpot updated the record and returned it. */
190
+ updated: StepTarget<MutationResult<OperationOutput>>;
191
+ /** No unarchived record of that object type has the record ID. */
192
+ notFound?: StepTarget<MutationResult<OperationOutput>>;
193
+ /** The properties conflict with another record, such as an email that another contact already owns. */
194
+ conflict?: StepTarget<MutationResult<OperationOutput>>;
195
+ /** HubSpot conclusively rejected the update, such as an invalid property value, a missing scope, a rejected token, or an exhausted daily limit. */
196
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
197
+ /** HubSpot applied or rejected the update but returned an invalid or oversized response. */
198
+ invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
199
+ /** Local input, connection configuration, or connector definition is invalid. */
200
+ defect?: StepTarget<MutationResult<OperationOutput>>;
201
+ }
202
+ /** Build the updateObject Step from a named connection. */
203
+ declare function newUpdateObjectStep<StepInput, OperationInput = UpdateObjectInput, OperationOutput = CRMObject>(configuration: UpdateObjectStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
204
+
205
+ /** A supported CRM object type. */ type ObjectType = SearchObjectsInput['objectType'];
206
+ /** Search one bounded CRM page. */
207
+ declare class SearchObjectsOperation implements Query<SearchObjectsInput, ObjectPage> {
208
+ private readonly client;
209
+ /** Bind a client. */ constructor(client: HubSpotClient);
210
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
211
+ /** Validate, send, and decode a search. */
212
+ invoke(call: Call, input: SearchObjectsInput): Promise<QueryAttempt<ObjectPage>>;
213
+ }
214
+ /** Get one CRM record. */
215
+ declare class GetObjectOperation implements Query<GetObjectInput, CRMObject> {
216
+ private readonly client;
217
+ /** Bind a client. */ constructor(client: HubSpotClient);
218
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
219
+ /** Validate, send, and decode one record. */
220
+ invoke(call: Call, input: GetObjectInput): Promise<QueryAttempt<CRMObject>>;
221
+ }
222
+ /** Upsert one CRM record by a unique property. */
223
+ declare class UpsertObjectOperation implements Mutation<UpsertObjectInput, UpsertedObject> {
224
+ private readonly client;
225
+ /** Bind a client. */ constructor(client: HubSpotClient);
226
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
227
+ /** Reuse the stable Call ID for a repeat-safe upsert. */ idempotencyKey(callId: string): string;
228
+ /** Validate and dispatch, repeating one conflicting upsert. */
229
+ invoke(call: Call, input: UpsertObjectInput): Promise<MutationAttempt<UpsertedObject>>;
230
+ }
231
+ /** Replace named properties on one CRM record. */
232
+ declare class UpdateObjectOperation implements Mutation<UpdateObjectInput, CRMObject> {
233
+ private readonly client;
234
+ /** Bind a client. */ constructor(client: HubSpotClient);
235
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
236
+ /** Reuse the stable Call ID for an absolute update. */ idempotencyKey(callId: string): string;
237
+ /** Validate, send, and decode one update. */
238
+ invoke(call: Call, input: UpdateObjectInput): Promise<MutationAttempt<CRMObject>>;
239
+ }
240
+
241
+ /** Replace the provider sender or clock in deterministic tests. */
242
+ interface HubSpotClientOptions {
243
+ /** Caller-owned provider sender. */
244
+ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
245
+ /** Clock used for retry dates and receipts. */
246
+ now?: () => Date;
247
+ /**
248
+ * Receives the crmObjectChanged Trigger runner's records: seeds, reseeds after an unusable cursor, failed polls,
249
+ * rate-limit pauses, and the durable inboxes newProjectCRMObjectTriggerRunner opens. Records carry binding
250
+ * identity and never record properties or credentials. Omitted uses defaultTriggerLogger. Operation Steps do not log.
251
+ */
252
+ logger?: TriggerLogger;
253
+ }
254
+ /** Classified unsuccessful exchange. */
255
+ interface ExchangeFailure {
256
+ /** Retry or terminal disposition. */
257
+ disposition: 'retry' | 'notFound' | 'conflict' | 'rejected' | 'invalidResponse' | 'defect';
258
+ /** Safe failure. */
259
+ failure: Failure;
260
+ /** Provider-directed retry delay. */
261
+ retryAfterMs: number;
262
+ /** Provider receipt. */
263
+ receipt: ReceiptDraft;
264
+ }
265
+ /** Successful response or classified failure. */
266
+ type ExchangeResult = {
267
+ response: ProviderResponse;
268
+ } | {
269
+ outcome: ExchangeFailure;
270
+ };
271
+ /** HubSpot CRM client using host-owned renewable credentials. */
272
+ declare class HubSpotClient {
273
+ private readonly credentials;
274
+ private readonly endpoint;
275
+ private readonly maxResponseBytes;
276
+ private readonly send;
277
+ private readonly now;
278
+ /** Delay between crmObjectChanged polls in milliseconds. */ readonly pollIntervalMs: number;
279
+ /** Trigger record destination. */ readonly triggerLogger: TriggerLogger;
280
+ private readonly refreshDriver;
281
+ /**
282
+ * Validate settings and bind a credential source without contacting HubSpot. A blank endpoint uses
283
+ * https://api.hubapi.com, a zero maxResponseBytes uses one MiB, and a zero pollIntervalMs uses 30 seconds;
284
+ * pollIntervalMs must be at least 5 seconds.
285
+ */
286
+ constructor(config: Config, credentials: CredentialSource, options?: HubSpotClientOptions);
287
+ /** Bind the search query. */ searchObjects(): SearchObjectsOperation;
288
+ /** Bind the record query. */ getObject(): GetObjectOperation;
289
+ /** Bind the unique-property upsert. */ upsertObject(): UpsertObjectOperation;
290
+ /** Bind the absolute update. */ updateObject(): UpdateObjectOperation;
291
+ /** Return a safe receipt for a completed provider attempt. */
292
+ receipt(call: Call, response?: ProviderResponse, objectId?: string): ReceiptDraft;
293
+ /** Resolve, send, refresh after one OAuth 401, then classify the response. */
294
+ exchange(call: Call, operation: string, objectId: string, method: string, path: string, query?: string, body?: unknown): Promise<ExchangeResult>;
295
+ private validateCredentials;
296
+ private sendRequest;
297
+ /** Classify a batch upsert error using the same status rules as an HTTP error. */
298
+ classifyBatchError(operation: string, response: ProviderResponse, receipt: ReceiptDraft): ExchangeFailure;
299
+ private classify;
300
+ private failure;
301
+ }
302
+
303
+ /** Open a named HubSpot project connection with generated OAuth credential wiring. */
304
+ declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: HubSpotClientOptions): Connection<Operations>;
305
+
306
+ /** HubSpot object type picker UI unit, which stores HubSpot's object name. */ declare const UIUnitObjectTypePicker = "objectTypePicker";
307
+ /** Object type picker output port. */ declare const UIObjectTypePickerPortObjectType = "objectType";
308
+ /**
309
+ * Bounds CRMObjectChangedTriggerConfiguration.properties; the Trigger always requests the record's creation and
310
+ * last-modified dates beside them.
311
+ */
312
+ declare const MaximumTriggerProperties: number;
313
+ /**
314
+ * A record HubSpot created after the newest change an earlier poll of the binding observed, so no earlier
315
+ * delivery or baseline included it.
316
+ */
317
+ declare const CRMObjectChangeCreated = "created";
318
+ /** Any other change to a record's properties, including a record that appeared in search only after HubSpot's indexing delay. */
319
+ declare const CRMObjectChangeUpdated = "updated";
320
+ /** The derived kind of one crmObjectChanged delivery. */
321
+ type CRMObjectChangeKind = typeof CRMObjectChangeCreated | typeof CRMObjectChangeUpdated;
322
+ /**
323
+ * The crmObjectChanged binding configuration that the object type picker saves in Dex Web. Changing the object
324
+ * type of a binding that already polled makes its next poll record a new baseline for the new object type.
325
+ */
326
+ interface CRMObjectChangedTriggerConfiguration {
327
+ /** The watched object type, contacts, companies, or deals, saved by the object type picker. It is required. */
328
+ objectType: ObjectType;
329
+ /**
330
+ * Internal property names, such as email or dealstage, to return on each delivered record, at most
331
+ * MaximumTriggerProperties. Empty returns HubSpot's default search properties. The Dex Web picker does not
332
+ * set it; an application sets it in code.
333
+ */
334
+ properties?: string[] | null | undefined;
335
+ }
336
+ /**
337
+ * Decodes a saved crmObjectChanged configuration strictly; unknown fields are rejected. It does not validate
338
+ * values; validateCRMObjectChangedTriggerConfiguration does, as every runner and Trigger factory does.
339
+ */
340
+ declare const CRMObjectChangedTriggerConfigurationSchema: z.ZodType<CRMObjectChangedTriggerConfiguration>;
341
+ /**
342
+ * Reject a missing or unsupported object type, invalid property names, and a property list whose search request
343
+ * would exceed HubSpot's request body limit, as the Go connector's Validate does.
344
+ */
345
+ declare function validateCRMObjectChangedTriggerConfiguration(configuration: CRMObjectChangedTriggerConfiguration): void;
346
+ /**
347
+ * One created or changed HubSpot CRM record read through CRM search. Several edits made between two polls
348
+ * arrive as one change carrying the record's latest values. Deleted, archived, and merged-away records are not
349
+ * reported, because CRM search does not return them. Field names match the Go connector.
350
+ */
351
+ interface CRMObjectChangedEvent {
352
+ /** The watched object type. */ objectType: ObjectType;
353
+ /** The derived change kind; see CRMObjectChangeKind. */ changeKind: CRMObjectChangeKind;
354
+ /**
355
+ * The record's last-modified date, lastmodifieddate for contacts and hs_lastmodifieddate otherwise, in UTC with
356
+ * millisecond precision, as Go encodes a time.Time.
357
+ */
358
+ modifiedAt: string;
359
+ /** The record as CRM search returned it, with the configured properties. */ object: CRMObject;
360
+ }
361
+ /** Decodes a crmObjectChanged payload that this package or the Go connector recorded. */
362
+ declare const CRMObjectChangedEventSchema: z.ZodType<CRMObjectChangedEvent>;
363
+ /** Manifest definition of crmObjectChanged. */
364
+ declare const CRMObjectChangedTriggerDefinition: TriggerDefinition;
365
+ /** One static application binding of crmObjectChanged. */
366
+ interface CRMObjectChangedTriggerBindingConfig {
367
+ /** Static connection name. */ connectionName: string;
368
+ /** Static binding name. */ bindingName: string;
369
+ /** Connector Studio configuration units for the binding, such as the objectTypePicker unit. */ configurationUI: ConnectorConfigurationUI;
370
+ }
371
+ /** Declare a static crmObjectChanged binding for Flow Definition tooling and Dex Web. */
372
+ declare function defineCRMObjectChangedTriggerBinding(config: CRMObjectChangedTriggerBindingConfig): TriggerBindingDefinition;
373
+
374
+ /** One unsuccessful search exchange; its message carries no record data. */
375
+ declare class CRMObjectChangeSearchError extends Error {
376
+ readonly failure: Failure;
377
+ /** Wrap the classified failure of one search. */
378
+ constructor(failure: Failure);
379
+ }
380
+
381
+ /** Binds one crmObjectChanged configuration to its application target and cursor. */
382
+ interface CRMObjectChangedTriggerRoute {
383
+ /** The stable application binding name, unique within the runner. */ bindingName: string;
384
+ /** Selects the watched object type and the returned properties. */ configuration: CRMObjectChangedTriggerConfiguration;
385
+ /**
386
+ * Routes each change into the application. A target that prepares deliveries, such as newDurableTriggerTarget,
387
+ * records each change before the cursor commits past it; any other target consumes it first.
388
+ */
389
+ target: TriggerTarget<CRMObjectChangedEvent>;
390
+ /**
391
+ * Stores the binding's search position, such as LoadedProject.pollCursorStore. Omitted keeps it in memory, so
392
+ * every process start records a new baseline and changes made while stopped are lost.
393
+ */
394
+ cursor?: CursorStore | undefined;
395
+ }
396
+ /** Configures every HubSpot Trigger binding polled through one connection. */
397
+ interface CRMObjectTriggerRunnerConfig {
398
+ /** A connection from newProjectConnection or newConnection with a HubSpotClient. */ connection: Connection;
399
+ /** The crmObjectChanged bindings; at least one is required. */ crmObjectChangedRoutes: readonly CRMObjectChangedTriggerRoute[];
400
+ }
401
+ /**
402
+ * Create one poll runner for the configured crmObjectChanged bindings. run replays each durable target, records a
403
+ * baseline for a binding without a cursor, then polls every binding each pollInterval with jitter, in
404
+ * configuration order, one search request at a time. A 429 or 423 pauses every binding of the connection for
405
+ * Retry-After or X-HubSpot-RateLimit-Interval-Milliseconds, and an exhausted daily limit backs off exponentially up
406
+ * to 15 minutes; other failures back off per binding. A paging offset HubSpot rejects records a new baseline and
407
+ * logs a WARN record. Delivery is at least once, and each record version keeps one Trigger event ID across
408
+ * refetches. Throws for invalid wiring or configuration.
409
+ */
410
+ declare function newCRMObjectTriggerRunner(config: CRMObjectTriggerRunnerConfig): Runner;
411
+ /** Selects one crmObjectChanged binding saved in the project configuration. */
412
+ interface ProjectCRMObjectChangedTriggerRoute {
413
+ /** Names the saved binding. */ bindingName: string;
414
+ /** Property names to return on each delivered record, as the configuration's properties; applies when the saved binding names none. */ properties?: string[] | undefined;
415
+ /** Routes each change into the application, usually newDexFlowTriggerTarget. */ target: TriggerTarget<CRMObjectChangedEvent>;
416
+ }
417
+ /** Selects HubSpot Trigger bindings saved in the project configuration. */
418
+ interface ProjectCRMObjectTriggerRunnerConfig {
419
+ /** The crmObjectChanged bindings; at least one is required. */ crmObjectChangedRoutes: readonly ProjectCRMObjectChangedTriggerRoute[];
420
+ }
421
+ /**
422
+ * Open connectionName from the loaded project, load each binding's saved object type, and create a durable runner:
423
+ * each route records changes in its binding's project Trigger inbox before its search position commits in the
424
+ * binding's project poll cursor, so a restarted or replaced replica neither misses nor repeats a change. A binding
425
+ * without a saved object type throws. The options' logger also applies to those inboxes.
426
+ */
427
+ declare function newProjectCRMObjectTriggerRunner(project: LoadedProject, connectionName: string, config: ProjectCRMObjectTriggerRunnerConfig, options?: HubSpotClientOptions): Runner;
428
+ /** Configuration of one crmObjectChanged Trigger built by hand. */
429
+ interface CRMObjectChangedTriggerConfig {
430
+ /** A connection from newProjectConnection or newConnection with a HubSpotClient. */ connection: Connection;
431
+ /** Static connection name; must equal the connection's name. */ connectionName: string;
432
+ /** Static binding name. */ bindingName: string;
433
+ /** The watched object type and returned properties. */ configuration: CRMObjectChangedTriggerConfiguration;
434
+ /** Routes each change into the application. */ target: TriggerTarget<CRMObjectChangedEvent>;
435
+ }
436
+ /**
437
+ * Create one crmObjectChanged Trigger polled every pollInterval. It has no project storage, so it keeps the cursor
438
+ * in memory and records a new baseline on every start; use newProjectCRMObjectTriggerRunner for durable polling.
439
+ * Throws for an invalid configuration or a connection name that differs from the connection's.
440
+ */
441
+ declare function newCRMObjectChangedTrigger(config: CRMObjectChangedTriggerConfig): TriggerRunner;
442
+
443
+ export { CRMObject, CRMObjectChangeCreated, type CRMObjectChangeKind, CRMObjectChangeSearchError, CRMObjectChangeUpdated, type CRMObjectChangedEvent, CRMObjectChangedEventSchema, type CRMObjectChangedTriggerBindingConfig, type CRMObjectChangedTriggerConfig, type CRMObjectChangedTriggerConfiguration, CRMObjectChangedTriggerConfigurationSchema, CRMObjectChangedTriggerDefinition, type CRMObjectChangedTriggerRoute, type CRMObjectTriggerRunnerConfig, Config, Connection, ConnectorID, CredentialSource, GetObjectBranch, GetObjectBranchDefect, GetObjectBranchFound, GetObjectBranchInvalidResponse, GetObjectBranchNotFound, GetObjectBranchProviderRejected, GetObjectDefinition, GetObjectInput, GetObjectMetadata, GetObjectOperation, type GetObjectStepConfig, HubSpotClient, type HubSpotClientOptions, MaximumTriggerProperties, ObjectPage, type ProjectCRMObjectChangedTriggerRoute, type ProjectCRMObjectTriggerRunnerConfig, ProviderID, SearchObjectsBranch, SearchObjectsBranchDefect, SearchObjectsBranchInvalidResponse, SearchObjectsBranchProviderRejected, SearchObjectsBranchSearched, SearchObjectsDefinition, SearchObjectsInput, SearchObjectsMetadata, SearchObjectsOperation, type SearchObjectsStepConfig, UIObjectTypePickerPortObjectType, UIUnitObjectTypePicker, UpdateObjectBranch, UpdateObjectBranchConflict, UpdateObjectBranchDefect, UpdateObjectBranchInvalidResponse, UpdateObjectBranchNotFound, UpdateObjectBranchProviderRejected, UpdateObjectBranchUpdated, UpdateObjectDefinition, UpdateObjectInput, UpdateObjectMetadata, UpdateObjectOperation, type UpdateObjectStepConfig, UpsertObjectBranch, UpsertObjectBranchConflict, UpsertObjectBranchDefect, UpsertObjectBranchInvalidResponse, UpsertObjectBranchProviderRejected, UpsertObjectBranchUpserted, UpsertObjectDefinition, UpsertObjectInput, UpsertObjectMetadata, UpsertObjectOperation, type UpsertObjectStepConfig, UpsertedObject, defineCRMObjectChangedTriggerBinding, newCRMObjectChangedTrigger, newCRMObjectTriggerRunner, newGetObjectStep, newProjectCRMObjectTriggerRunner, newProjectConnection, newSearchObjectsStep, newUpdateObjectStep, newUpsertObjectStep, validateCRMObjectChangedTriggerConfiguration };