@particle-academy/hubspot-js 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -7,6 +7,44 @@ The four packages share one version, because they are generated from one
7
7
  `provider/` definition and a version that meant something different in each
8
8
  would be a version nobody could reason about.
9
9
 
10
+ ## [0.6.0] — 2026-11-05
11
+
12
+ ### Added
13
+
14
+ - **`contact_create` takes a `properties` map, as `company_create` and
15
+ `deal_create` do**, so a contact is created with ANY property (`jobtitle`,
16
+ an address, a custom property) in one call. Additive: the named fields
17
+ (Email, First name, Last name, Company, Phone, Lifecycle stage) work
18
+ exactly as before and merge into the map. `email` is still required, and
19
+ may be given in Email OR as `email` in Properties; missing from both, the
20
+ refusal names both places. The same property given both ways with
21
+ DIFFERENT values is refused by name rather than guessed. The editor no
22
+ longer marks Email required, because the map can satisfy it. Found by MOIC
23
+ (their #905): `properties` given the company_create way was refused as a
24
+ missing email.
25
+
26
+ ### Fixed
27
+
28
+ - **PHP: a `properties` map passed as an OBJECT is read, not dropped.** The
29
+ generated PHP read a map that arrived as a decoded JSON OBJECT (`stdClass`,
30
+ e.g. an upstream node's value or `json_decode(..., false)`) as "not an
31
+ array" and sent it EMPTY, without an error: silent data loss. It now reads
32
+ the object's properties. **Affected:** PHP callers passing the map as an
33
+ object. **Not affected:** callers passing an array, which always worked;
34
+ they need do nothing. TypeScript and Python were never affected.
35
+ - **`crm_event` no longer tells a host to dedupe on `eventId`.** HubSpot's
36
+ field table says `eventId` "is not guaranteed to be unique", so deduping on
37
+ it can drop a DIFFERENT event that shares one, such as two properties of one
38
+ deal changing together. The setup text and the `eventId` / `attemptNumber`
39
+ descriptions now say what a retry is: the same event resent, differing only
40
+ in `attemptNumber`, so a host compares every other field. Found by MOIC.
41
+ - **The setup guidance now says a host does not copy this connector's scope
42
+ list into its consent URL.** The list covers every action, read and write.
43
+ HubSpot requires the scopes an app marks required in the authorize URL's
44
+ `scope` parameter and shows an error otherwise, so a read-only host asks for
45
+ its read scopes only. On the `accessToken` credential's help and in
46
+ `crm_event`'s setup. Found by MOIC. The list itself is unchanged.
47
+
10
48
  ## [0.5.0] — 2026-11-01
11
49
 
12
50
  ### Added
package/README.md CHANGED
@@ -43,7 +43,7 @@ A HubSpot connection holds 4 values.
43
43
  |---|---|---|---|
44
44
  | **App client ID** | per installation | not secret | From your HubSpot app's Auth tab. ONE value for the whole installation -- the same app serves every connected account. |
45
45
  | **App client secret** | per installation | **secret** | From the same Auth tab. Used to exchange the code and to refresh; never sent with an API request. |
46
- | **Access token** | per connected account | **secret** | Obtained by the host's OAuth exchange, PER CONNECTED ACCOUNT. Expires after 30 minutes -- a host that does not refresh will work all afternoon and be broken by morning. |
46
+ | **Access token** | per connected account | **secret** | Obtained by the host's OAuth exchange, PER CONNECTED ACCOUNT. Expires after 30 minutes -- a host that does not refresh will work all afternoon and be broken by morning. This connector's scope list covers every action, read and write, and is not what your consent URL must ask for: HubSpot requires your app's required scopes in the authorize URL's `scope` parameter and shows an error otherwise, so build it from your own app's configuration. A read-only host asks for its read scopes only. |
47
47
  | **Refresh token** *(optional)* | per connected account | **secret** | Also per account. Does not expire, so it is the credential worth protecting most: it mints access tokens indefinitely until the install is revoked. |
48
48
 
49
49
  ### Authorising
@@ -136,12 +136,13 @@ Create a contact in HubSpot.
136
136
 
137
137
  | Input | Required | What it is |
138
138
  |---|---|---|
139
- | `email` | yes | HubSpot de-duplicates contacts on email within an account. A contact created without one cannot be de-duplicated, and a retry will make a second. |
139
+ | `email` | yes | HubSpot de-duplicates contacts on email within an account. A contact created without one cannot be de-duplicated, and a retry will make a second. Required here OR as email in Properties. |
140
140
  | `firstName` | no | First name |
141
141
  | `lastName` | no | Last name |
142
142
  | `company` | no | Company |
143
143
  | `phone` | no | Phone |
144
144
  | `lifecycleStage` | no | HubSpot's own stage names. A value it does not recognise is refused at write time, not at setup. |
145
+ | `properties` | no | Any other HubSpot property name → value for the new contact (jobtitle, an address, a custom property), sent in the same call. Values are sent as strings, which is how HubSpot stores every property. The fields above merge into this map; email may be given here instead of in Email, and the same property given both ways with different values is refused rather than guessed. |
145
146
 
146
147
  #### `contact_get` — Get contact
147
148
 
@@ -295,7 +296,7 @@ Delivered by webhook, and the signature is verified before anything runs.
295
296
 
296
297
  **You have to set this up with the provider first:**
297
298
 
298
- In the HubSpot app's webhook settings, set the target URL to the route your host mounts for this trigger and subscribe to the deal, contact and company events you want. Deliveries are signed with the app's client secret, already on the connection as `clientSecret`. ONE URL serves every portal that installed the app, so route each event by its portalId, and only after the signature has verified: map portalId to the connection created when that portal installed, and drop an unmapped portalId with a 2xx and a log line, creating nothing.
299
+ In the HubSpot app's webhook settings, set the target URL to the route your host mounts for this trigger and subscribe to the deal, contact and company events you want. Deliveries are signed with the app's client secret, already on the connection as `clientSecret`. ONE URL serves every portal that installed the app, so route each event by its portalId, and only after the signature has verified: map portalId to the connection created when that portal installed, and drop an unmapped portalId with a 2xx and a log line, creating nothing. HubSpot retries a failed delivery, and eventId is not guaranteed to be unique, so never dedupe on eventId alone: a retry is the same event resent, differing only in attemptNumber, so compare every other field. This connector's scope list covers every action, read and write, and is not what your consent URL must ask for: HubSpot requires your app's required scopes in the authorize URL's `scope` parameter and shows an error otherwise, so build it from your own app's configuration. A read-only host asks for its read scopes only.
299
300
 
300
301
  ## Run it before you have credentials
301
302
 
@@ -673,8 +673,44 @@ function propertiesMap2(value) {
673
673
  var CONTACT_CREATE_OPERATION = "contact_create";
674
674
  async function hubspotContactCreate(options) {
675
675
  const config = options.config ?? {};
676
- if (config.email === void 0 || config.email === null || config.email === "") {
677
- throw new Error(`contact_create: "email" is required (Email).`);
676
+ if ((config.email === void 0 || config.email === null || config.email === "") && propertiesMap3(config.properties)["email"] === void 0) {
677
+ throw new Error(`contact_create: "email" is required \u2014 as Email, or as "email" in Properties.`);
678
+ }
679
+ {
680
+ const inMap = propertiesMap3(config.properties)["email"];
681
+ if (config.email !== void 0 && config.email !== null && config.email !== "" && inMap !== void 0 && inMap !== String(config.email).trim()) {
682
+ throw new Error(`contact_create: "email" was given twice with different values \u2014 as Email and as "email" in Properties.`);
683
+ }
684
+ }
685
+ {
686
+ const inMap = propertiesMap3(config.properties)["firstname"];
687
+ if (config.firstName !== void 0 && config.firstName !== null && config.firstName !== "" && inMap !== void 0 && inMap !== String(config.firstName)) {
688
+ throw new Error(`contact_create: "firstName" was given twice with different values \u2014 as First name and as "firstname" in Properties.`);
689
+ }
690
+ }
691
+ {
692
+ const inMap = propertiesMap3(config.properties)["lastname"];
693
+ if (config.lastName !== void 0 && config.lastName !== null && config.lastName !== "" && inMap !== void 0 && inMap !== String(config.lastName)) {
694
+ throw new Error(`contact_create: "lastName" was given twice with different values \u2014 as Last name and as "lastname" in Properties.`);
695
+ }
696
+ }
697
+ {
698
+ const inMap = propertiesMap3(config.properties)["company"];
699
+ if (config.company !== void 0 && config.company !== null && config.company !== "" && inMap !== void 0 && inMap !== String(config.company)) {
700
+ throw new Error(`contact_create: "company" was given twice with different values \u2014 as Company and as "company" in Properties.`);
701
+ }
702
+ }
703
+ {
704
+ const inMap = propertiesMap3(config.properties)["phone"];
705
+ if (config.phone !== void 0 && config.phone !== null && config.phone !== "" && inMap !== void 0 && inMap !== String(config.phone)) {
706
+ throw new Error(`contact_create: "phone" was given twice with different values \u2014 as Phone and as "phone" in Properties.`);
707
+ }
708
+ }
709
+ {
710
+ const inMap = propertiesMap3(config.properties)["lifecyclestage"];
711
+ if (config.lifecycleStage !== void 0 && config.lifecycleStage !== null && config.lifecycleStage !== "" && inMap !== void 0 && inMap !== String(config.lifecycleStage)) {
712
+ throw new Error(`contact_create: "lifecycleStage" was given twice with different values \u2014 as Lifecycle stage and as "lifecyclestage" in Properties.`);
713
+ }
678
714
  }
679
715
  return callConnector(HUBSPOT, {
680
716
  operation: CONTACT_CREATE_OPERATION,
@@ -688,15 +724,15 @@ async function hubspotContactCreate(options) {
688
724
  request: {
689
725
  method: "POST",
690
726
  path: "/crm/v3/objects/contacts",
691
- json: nestFields({
692
- "properties.email": String(config.email).trim(),
727
+ json: mergeInto(nestFields({
728
+ ...config.email !== void 0 && config.email !== null && config.email !== "" ? { "properties.email": String(config.email).trim() } : {},
693
729
  ...config.firstName !== void 0 && config.firstName !== null && config.firstName !== "" ? { "properties.firstname": String(config.firstName) } : {},
694
730
  ...config.lastName !== void 0 && config.lastName !== null && config.lastName !== "" ? { "properties.lastname": String(config.lastName) } : {},
695
731
  ...config.company !== void 0 && config.company !== null && config.company !== "" ? { "properties.company": String(config.company) } : {},
696
732
  ...config.phone !== void 0 && config.phone !== null && config.phone !== "" ? { "properties.phone": String(config.phone) } : {},
697
733
  ...config.lifecycleStage !== void 0 && config.lifecycleStage !== null && config.lifecycleStage !== "" ? { "properties.lifecyclestage": String(config.lifecycleStage) } : {},
698
734
  "associations": []
699
- })
735
+ }), "properties", propertiesMap3(config.properties))
700
736
  }
701
737
  });
702
738
  }
@@ -715,6 +751,18 @@ function nestFields(flat) {
715
751
  }
716
752
  return out;
717
753
  }
754
+ function mergeInto(body, key, map) {
755
+ const named = body[key];
756
+ return { ...body, [key]: { ...map, ...named !== null && typeof named === "object" ? named : {} } };
757
+ }
758
+ function propertiesMap3(value) {
759
+ if (!value || typeof value !== "object") return {};
760
+ const out = {};
761
+ for (const [key, item] of Object.entries(value)) {
762
+ if (item !== void 0 && item !== null && item !== "") out[key] = String(item);
763
+ }
764
+ return out;
765
+ }
718
766
  var CONTACT_GET_OPERATION = "contact_get";
719
767
  async function hubspotContactGet(options) {
720
768
  const config = options.config ?? {};
@@ -848,12 +896,12 @@ async function hubspotContactUpdate(options) {
848
896
  method: "PATCH",
849
897
  path: `/crm/v3/objects/contacts/${encodeURIComponent(String(config.contactId))}`,
850
898
  json: {
851
- "properties": propertiesMap3(config.properties)
899
+ "properties": propertiesMap4(config.properties)
852
900
  }
853
901
  }
854
902
  });
855
903
  }
856
- function propertiesMap3(value) {
904
+ function propertiesMap4(value) {
857
905
  if (!value || typeof value !== "object") return {};
858
906
  const out = {};
859
907
  for (const [key, item] of Object.entries(value)) {
@@ -880,13 +928,13 @@ async function hubspotDealCreate(options) {
880
928
  method: "POST",
881
929
  path: "/crm/v3/objects/deals",
882
930
  json: {
883
- "properties": propertiesMap4(config.properties),
931
+ "properties": propertiesMap5(config.properties),
884
932
  "associations": []
885
933
  }
886
934
  }
887
935
  });
888
936
  }
889
- function propertiesMap4(value) {
937
+ function propertiesMap5(value) {
890
938
  if (!value || typeof value !== "object") return {};
891
939
  const out = {};
892
940
  for (const [key, item] of Object.entries(value)) {
@@ -1027,12 +1075,12 @@ async function hubspotDealUpdate(options) {
1027
1075
  method: "PATCH",
1028
1076
  path: `/crm/v3/objects/deals/${encodeURIComponent(String(config.dealId))}`,
1029
1077
  json: {
1030
- "properties": propertiesMap5(config.properties)
1078
+ "properties": propertiesMap6(config.properties)
1031
1079
  }
1032
1080
  }
1033
1081
  });
1034
1082
  }
1035
- function propertiesMap5(value) {
1083
+ function propertiesMap6(value) {
1036
1084
  if (!value || typeof value !== "object") return {};
1037
1085
  const out = {};
1038
1086
  for (const [key, item] of Object.entries(value)) {
@@ -1128,7 +1176,7 @@ var HUBSPOT_CRM_EVENT = {
1128
1176
  service: "hubspot",
1129
1177
  operation: "crm_event",
1130
1178
  delivery: "webhook",
1131
- setup: "In the HubSpot app's webhook settings, set the target URL to the route your host mounts for this trigger and subscribe to the deal, contact and company events you want. Deliveries are signed with the app's client secret, already on the connection as `clientSecret`. ONE URL serves every portal that installed the app, so route each event by its portalId, and only after the signature has verified: map portalId to the connection created when that portal installed, and drop an unmapped portalId with a 2xx and a log line, creating nothing.",
1179
+ setup: "In the HubSpot app's webhook settings, set the target URL to the route your host mounts for this trigger and subscribe to the deal, contact and company events you want. Deliveries are signed with the app's client secret, already on the connection as `clientSecret`. ONE URL serves every portal that installed the app, so route each event by its portalId, and only after the signature has verified: map portalId to the connection created when that portal installed, and drop an unmapped portalId with a 2xx and a log line, creating nothing. HubSpot retries a failed delivery, and eventId is not guaranteed to be unique, so never dedupe on eventId alone: a retry is the same event resent, differing only in attemptNumber, so compare every other field. This connector's scope list covers every action, read and write, and is not what your consent URL must ask for: HubSpot requires your app's required scopes in the authorize URL's `scope` parameter and shows an error otherwise, so build it from your own app's configuration. A read-only host asks for its read scopes only.",
1132
1180
  verification: {
1133
1181
  signatureHeader: HUBSPOT_CRM_EVENT_SIGNATURE_HEADER,
1134
1182
  scheme: HUBSPOT_CRM_EVENT_SCHEME,
@@ -1142,5 +1190,5 @@ function verifyHubspotDelivery(delivery, clientSecret, now) {
1142
1190
  }
1143
1191
 
1144
1192
  export { COMPANY_CREATE_OPERATION, COMPANY_GET_OPERATION, COMPANY_LIST_OPERATION, COMPANY_SEARCH_OPERATION, COMPANY_UPDATE_OPERATION, CONNECTOR_API_VERSION, CONTACT_CREATE_OPERATION, CONTACT_GET_OPERATION, CONTACT_LIST_OPERATION, CONTACT_SEARCH_OPERATION, CONTACT_UPDATE_OPERATION, DEAL_CREATE_OPERATION, DEAL_GET_OPERATION, DEAL_LIST_OPERATION, DEAL_SEARCH_OPERATION, DEAL_UPDATE_OPERATION, HUBSPOT, HUBSPOT_BASE_URLS, HUBSPOT_CRM_EVENT, HUBSPOT_CRM_EVENT_SCHEME, HUBSPOT_CRM_EVENT_SIGNATURE_HEADER, HUBSPOT_CRM_EVENT_TOLERANCE, HUBSPOT_REQUIRES, OWNER_LIST_OPERATION, PIPELINE_LIST_OPERATION, PROPERTY_LIST_OPERATION, hubspotAuthorize, hubspotCompanyCreate, hubspotCompanyGet, hubspotCompanyList, hubspotCompanySearch, hubspotCompanyUpdate, hubspotContactCreate, hubspotContactGet, hubspotContactList, hubspotContactSearch, hubspotContactUpdate, hubspotDealCreate, hubspotDealGet, hubspotDealList, hubspotDealSearch, hubspotDealUpdate, hubspotFaker, hubspotOwnerList, hubspotPipelineList, hubspotPropertyList, verifyHubspotDelivery };
1145
- //# sourceMappingURL=chunk-SZT3VK7Z.js.map
1146
- //# sourceMappingURL=chunk-SZT3VK7Z.js.map
1193
+ //# sourceMappingURL=chunk-AVMPFAVL.js.map
1194
+ //# sourceMappingURL=chunk-AVMPFAVL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/company-create.ts","../src/actions/company-get.ts","../src/actions/company-list.ts","../src/actions/company-search.ts","../src/actions/company-update.ts","../src/actions/contact-create.ts","../src/actions/contact-get.ts","../src/actions/contact-list.ts","../src/actions/contact-search.ts","../src/actions/contact-update.ts","../src/actions/deal-create.ts","../src/actions/deal-get.ts","../src/actions/deal-list.ts","../src/actions/deal-search.ts","../src/actions/deal-update.ts","../src/actions/owner-list.ts","../src/actions/pipeline-list.ts","../src/actions/property-list.ts","../src/triggers/crm-event.ts"],"names":["callConnector","propertiesMap","propertiesList"],"mappings":";;;AAyBA,SAAS,iBAAA,CAAkB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AACjE,EAAA,MAAM,aAAA,GAAgB,KAAA,CAAM,IAAA,CAAK,EAAE,QAAQ,CAAA,EAAE,EAAG,MAAM,IAAA,CAAK,IAAI,CAAA,EAAG,CAAC,CAAC,CAAA,CAAE,KAAK,EAAE,CAAA;AAE7E,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,aAAA;AAAA,IACN,YAAA,EAAc;AAAA,MACZ,MAAA,EAAQ,MAAA;AAAA,MACR,QAAA,EAAU,mBAAA;AAAA,MACV,cAAA,EAAgB,aAAA;AAAA,MAChB,YAAA,EAAc,0BAAA;AAAA,MACd,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,WAAA,EAAa,0BAAA;AAAA,IACb,WAAA,EAAa,0BAAA;AAAA,IACb,UAAA,EAAY;AAAA,GACd;AACF;AAEA,SAAS,cAAA,CAAe,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC9D,EAAA,MAAM,aAAA,GAAgB,KAAA,CAAM,IAAA,CAAK,EAAE,QAAQ,CAAA,EAAE,EAAG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G,SAAS,CAAA,CAAA;AAAA,EAC1G,SAAA,EAAW,2BAAA;AAAA,EACX,aAAA,EAAe,IAAA;AAAA,EACf,gBAAA,EAAkB,IAAA;AAAA,EAClB,GAAA,EAAK,YAAA;AAAA,EACL,QAAA,EAAU;AACZ;AAEO,IAAM,iBAAA,GAAuC;AAAA,EAClD,OAAA,EAAS,SAAA;AAAA,EACT,SAAA,EAAW,WAAA;AAAA,EACX,QAAA,EAAU,SAAA;AAAA,EACV,KAAA,EACE,ijCAAA;AAAA,EACF,YAAA,EAAc;AAAA,IACZ,eAAA,EAAiB,kCAAA;AAAA,IACjB,MAAA,EAAQ,wBAAA;AAAA,IACR,eAAA,EAAiB;AAAA,GACnB;AAAA,EACA,KAAA,EAAO,EAAE,EAAA,EAAI,UAAA,EAAY,MAAM,aAAA,EAAc;AAAA,EAC7C,KAAA,EAAO;AACT;AAYO,SAAS,qBAAA,CACd,QAAA,EACA,YAAA,EACA,GAAA,EAC8B;AAC9B,EAAA,OAAO,cAAA,CAAe,iBAAA,EAAmB,QAAA,EAAU,YAAA,EAAc,GAAG,CAAA;AACtE","file":"chunk-AVMPFAVL.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/fixtures/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/fixtures/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * The HubSpot faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES HubSpot actually publishes, so an author can wire {{ $json.data.id }}\n * against a fake and have it keep working against the real thing.\n *\n * Deterministic — same inputs, same output. A faker returning a fresh uuid\n * every call cannot be asserted on, so its fixtures degrade to \"it did not\n * throw\", which is the assertion that catches nothing.\n */\n\nimport type { ConnectorFaker, FakeRequest } from \"@particle-academy/fancy-connector-core\";\n\nfunction fakeCompanyCreate({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.example.test\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeCompanyGet({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.example.test\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeCompanyList({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"results\": [\n {\n \"id\": boundRecordId,\n \"properties\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.example.test\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n },\n ],\n \"paging\": {\n \"next\": {\n \"after\": \"10\",\n \"link\": \"?after=10\",\n },\n },\n };\n}\n\nfunction fakeCompanySearch({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"total\": 1,\n \"results\": [\n {\n \"id\": boundRecordId,\n \"properties\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.example.test\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n },\n ],\n \"paging\": {\n \"next\": {\n \"after\": \"10\",\n \"link\": \"?after=10\",\n },\n },\n };\n}\n\nfunction fakeCompanyUpdate({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.example.test\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeContactCreate({ config, fake }: FakeRequest): unknown {\n const boundContactId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundContactId,\n \"properties\": {\n \"email\": (config.email !== undefined && config.email !== null && config.email !== \"\" ? String(config.email) : null),\n \"firstname\": (config.firstName !== undefined && config.firstName !== null && config.firstName !== \"\" ? String(config.firstName) : null),\n \"lastname\": (config.lastName !== undefined && config.lastName !== null && config.lastName !== \"\" ? String(config.lastName) : null),\n \"company\": (config.company !== undefined && config.company !== null && config.company !== \"\" ? String(config.company) : null),\n \"phone\": (config.phone !== undefined && config.phone !== null && config.phone !== \"\" ? String(config.phone) : null),\n \"lifecyclestage\": (config.lifecycleStage !== undefined && config.lifecycleStage !== null && config.lifecycleStage !== \"\" ? String(config.lifecycleStage) : \"lead\"),\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n \"hs_object_id\": boundContactId,\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeContactGet({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"email\": \"rosa@example.test\",\n \"firstname\": \"Rosa\",\n \"lastname\": \"Diaz\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeContactList({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"results\": [\n {\n \"id\": boundRecordId,\n \"properties\": {\n \"email\": \"rosa@example.test\",\n \"firstname\": \"Rosa\",\n \"lastname\": \"Diaz\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n },\n ],\n \"paging\": {\n \"next\": {\n \"after\": \"10\",\n \"link\": \"?after=10\",\n },\n },\n };\n}\n\nfunction fakeContactSearch({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"total\": 1,\n \"results\": [\n {\n \"id\": boundRecordId,\n \"properties\": {\n \"email\": \"rosa@example.test\",\n \"firstname\": \"Rosa\",\n \"lastname\": \"Diaz\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n },\n ],\n \"paging\": {\n \"next\": {\n \"after\": \"10\",\n \"link\": \"?after=10\",\n },\n },\n };\n}\n\nfunction fakeContactUpdate({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"email\": \"rosa@example.test\",\n \"firstname\": \"Rosa\",\n \"lastname\": \"Diaz\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeDealCreate({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"dealname\": \"Acme renewal\",\n \"amount\": \"12000\",\n \"dealstage\": \"appointmentscheduled\",\n \"pipeline\": \"default\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeDealGet({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"dealname\": \"Acme renewal\",\n \"amount\": \"12000\",\n \"dealstage\": \"appointmentscheduled\",\n \"pipeline\": \"default\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeDealList({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"results\": [\n {\n \"id\": boundRecordId,\n \"properties\": {\n \"dealname\": \"Acme renewal\",\n \"amount\": \"12000\",\n \"dealstage\": \"appointmentscheduled\",\n \"pipeline\": \"default\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n },\n ],\n \"paging\": {\n \"next\": {\n \"after\": \"10\",\n \"link\": \"?after=10\",\n },\n },\n };\n}\n\nfunction fakeDealSearch({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"total\": 1,\n \"results\": [\n {\n \"id\": boundRecordId,\n \"properties\": {\n \"dealname\": \"Acme renewal\",\n \"amount\": \"12000\",\n \"dealstage\": \"appointmentscheduled\",\n \"pipeline\": \"default\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n },\n ],\n \"paging\": {\n \"next\": {\n \"after\": \"10\",\n \"link\": \"?after=10\",\n },\n },\n };\n}\n\nfunction fakeDealUpdate({ config, fake }: FakeRequest): unknown {\n const boundRecordId = Array.from({ length: 9 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"id\": boundRecordId,\n \"properties\": {\n \"dealname\": \"Acme renewal\",\n \"amount\": \"12000\",\n \"dealstage\": \"appointmentscheduled\",\n \"pipeline\": \"default\",\n \"hs_object_id\": boundRecordId,\n \"createdate\": \"2026-01-01T00:00:00.000Z\",\n \"lastmodifieddate\": \"2026-01-01T00:00:00.000Z\",\n },\n \"createdAt\": \"2026-01-01T00:00:00.000Z\",\n \"updatedAt\": \"2026-01-01T00:00:00.000Z\",\n \"archived\": false,\n };\n}\n\nfunction fakeOwnerList({ config, fake }: FakeRequest): unknown {\n const boundOwnerId = Array.from({ length: 8 }, () => fake.int(0, 9)).join(\"\");\n\n return {\n \"results\": [\n {\n \"id\": boundOwnerId,\n \"email\": \"rosa@example.test\",\n \"firstName\": \"Rosa\",\n \"lastName\": \"Diaz\",\n \"userId\": 4242,\n \"archived\": false,\n },\n ],\n \"paging\": {\n \"next\": {\n \"after\": \"10\",\n \"link\": \"?after=10\",\n },\n },\n };\n}\n\nfunction fakePipelineList({ config, fake }: FakeRequest): unknown {\n return {\n \"results\": [\n {\n \"id\": \"default\",\n \"label\": \"Sales pipeline\",\n \"displayOrder\": 0,\n \"archived\": false,\n \"stages\": [\n {\n \"id\": \"appointmentscheduled\",\n \"label\": \"Appointment scheduled\",\n \"displayOrder\": 0,\n \"metadata\": {\n \"probability\": \"0.2\",\n },\n },\n {\n \"id\": \"closedwon\",\n \"label\": \"Closed won\",\n \"displayOrder\": 1,\n \"metadata\": {\n \"probability\": \"1.0\",\n },\n },\n ],\n },\n ],\n };\n}\n\nfunction fakePropertyList({ config, fake }: FakeRequest): unknown {\n return {\n \"results\": [\n {\n \"name\": \"dealstage\",\n \"label\": \"Deal Stage\",\n \"type\": \"enumeration\",\n \"fieldType\": \"select\",\n \"groupName\": \"dealinformation\",\n \"options\": [\n {\n \"label\": \"Appointment scheduled\",\n \"value\": \"appointmentscheduled\",\n },\n ],\n },\n ],\n };\n}\n\nfunction fakeCrmEvent({ config, fake }: FakeRequest): unknown {\n return [\n {\n \"eventId\": 531833541,\n \"subscriptionId\": 3923621,\n \"portalId\": 48807704,\n \"appId\": 16111050,\n \"occurredAt\": 1752613920733,\n \"subscriptionType\": \"contact.creation\",\n \"attemptNumber\": 0,\n \"objectId\": 138017612137,\n \"changeFlag\": \"CREATED\",\n \"changeSource\": \"CRM_UI\",\n \"sourceId\": \"userId:76023669\",\n },\n {\n \"eventId\": 531833542,\n \"subscriptionId\": 3923622,\n \"portalId\": 48807704,\n \"appId\": 16111050,\n \"occurredAt\": 1752613921000,\n \"subscriptionType\": \"deal.propertyChange\",\n \"attemptNumber\": 0,\n \"objectId\": 9876543210,\n \"propertyName\": \"dealstage\",\n \"propertyValue\": \"closedwon\",\n \"changeSource\": \"CRM_UI\",\n \"sourceId\": \"userId:76023669\",\n },\n ];\n}\n\nexport const hubspotFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"company_create\":\n return fakeCompanyCreate(request);\n\n case \"company_get\":\n return fakeCompanyGet(request);\n\n case \"company_list\":\n return fakeCompanyList(request);\n\n case \"company_search\":\n return fakeCompanySearch(request);\n\n case \"company_update\":\n return fakeCompanyUpdate(request);\n\n case \"contact_create\":\n return fakeContactCreate(request);\n\n case \"contact_get\":\n return fakeContactGet(request);\n\n case \"contact_list\":\n return fakeContactList(request);\n\n case \"contact_search\":\n return fakeContactSearch(request);\n\n case \"contact_update\":\n return fakeContactUpdate(request);\n\n case \"deal_create\":\n return fakeDealCreate(request);\n\n case \"deal_get\":\n return fakeDealGet(request);\n\n case \"deal_list\":\n return fakeDealList(request);\n\n case \"deal_search\":\n return fakeDealSearch(request);\n\n case \"deal_update\":\n return fakeDealUpdate(request);\n\n case \"owner_list\":\n return fakeOwnerList(request);\n\n case \"pipeline_list\":\n return fakePipelineList(request);\n\n case \"property_list\":\n return fakePropertyList(request);\n\n case \"crm_event\":\n return fakeCrmEvent(request);\n\n default:\n // A faker asked for an operation it has no shape for must SAY so. Making\n // something up would produce a green run whose output silently has none\n // of the fields the author is about to reference.\n throw new Error(\n `hubspot: no fake response is defined for \"${operation}\". ` +\n \"Add a fixture under provider/fixtures/ and regenerate — a connector without a faker \" +\n \"cannot be developed against, tested, or demonstrated.\",\n );\n }\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * HubSpot, as one service descriptor shared by every HubSpot operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of HubSpot: its base URL, its auth\n * scheme, its idempotency header, and its faker.\n *\n * ## The sandbox trap, written down where it is used\n *\n * HubSpot's test estate is a DEVELOPER TEST ACCOUNT: a separate portal you\n * create from the developer account, with its own portal id, its own data and\n * its own OAuth install. Same API host, different account -- so the credential\n * is different and the URL is not. Test accounts expire if unused and carry\n * reduced limits, which is why they are a place to test rather than a place to\n * build against.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { hubspotFaker } from \"./faker.js\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported. An imported constant lets an upgrade rewrite the\n * very claim it exists to detect, after which the copy agrees with itself\n * forever.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\nexport const HUBSPOT_BASE_URLS = {\n \"live\": \"https://api.hubapi.com\",\n \"sandbox\": \"https://api.hubapi.com\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const HUBSPOT_REQUIRES = [\n \"accessToken\"\n] as const;\n\n/**\n * Apply HubSpot's auth scheme to an outgoing request.\n *\n * An OAuth2 access token is presented exactly like a static bearer token. The\n * difference is not in the request -- it is that this one EXPIRES, and\n * something has to refresh it. That is the host's job, and `oauth` below is\n * what tells it how.\n *\n * The mode is passed in because for some providers auth and estate are the\n * same decision expressed in the URL; here it is unused, and saying so is\n * cheaper than wondering later whether it was forgotten.\n */\nexport function hubspotAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers.Authorization = `Bearer ${credentials.accessToken ?? \"\"}`;\n}\n\n/** The HubSpot service, for the TypeScript runtime. */\nexport const HUBSPOT: ServiceDescriptor = {\n service: \"hubspot\",\n title: \"HubSpot\",\n sandbox: \"separate-account\",\n baseUrls: { ...HUBSPOT_BASE_URLS },\n requires: [...HUBSPOT_REQUIRES],\n authorize: hubspotAuthorize,\n faker: hubspotFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/company-create.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/company-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Create a company in HubSpot.\n *\n * POST /crm/v3/objects/companies —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/companies\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n *\n * sideEffects: unsafe-to-replay.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const COMPANY_CREATE_OPERATION = \"company_create\";\n\nexport type CompanyCreateOptions = {\n /** The node's resolved config. Keys: properties. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotCompanyCreate(options: CompanyCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.properties === undefined || config.properties === null || config.properties === \"\") {\n throw new Error(`company_create: \"properties\" is required (Properties).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: COMPANY_CREATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/crm/v3/objects/companies\",\n json: {\n \"properties\": propertiesMap(config.properties),\n \"associations\": [],\n },\n },\n });\n}\n\n/** `{ k: \"v\" }` → `{ \"properties\": { \"k\": \"v\" } }` — a JSON body wants the real object. */\nfunction propertiesMap(value: unknown): Record<string, string> {\n if (!value || typeof value !== \"object\") return {};\n\n const out: Record<string, string> = {};\n for (const [key, item] of Object.entries(value as Record<string, unknown>)) {\n if (item !== undefined && item !== null && item !== \"\") out[key] = String(item);\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/company-get.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/company-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Read one company, with its associations when asked.\n *\n * GET /crm/v3/objects/companies/{companyId} —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/companies\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const COMPANY_GET_OPERATION = \"company_get\";\n\nexport type CompanyGetOptions = {\n /** The node's resolved config. Keys: companyId, properties, associations. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotCompanyGet(options: CompanyGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.companyId === undefined || config.companyId === null || config.companyId === \"\") {\n throw new Error(`company_get: \"companyId\" is required (Company id).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: COMPANY_GET_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/crm/v3/objects/companies/${encodeURIComponent(String(config.companyId))}`,\n query: {\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": String(config.properties) } : {}),\n ...(config.associations !== undefined && config.associations !== null && config.associations !== \"\" ? { \"associations\": String(config.associations) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/company-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/company-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Page through every company in the portal.\n *\n * GET /crm/v3/objects/companies —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/companies\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const COMPANY_LIST_OPERATION = \"company_list\";\n\nexport type CompanyListOptions = {\n /** The node's resolved config. Keys: limit, after, properties, associations. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotCompanyList(options: CompanyListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n {\n const n = Number(config.limit);\n const given = config.limit !== undefined && config.limit !== null && config.limit !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {\n throw new Error(\n `company_list: \"limit\" must be a integer, got ${JSON.stringify(config.limit)}.`,\n );\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: COMPANY_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: \"/crm/v3/objects/companies\",\n query: {\n ...(config.limit !== undefined && config.limit !== null && config.limit !== \"\" ? { \"limit\": Math.trunc(Number(config.limit)) } : {}),\n ...(config.after !== undefined && config.after !== null && config.after !== \"\" ? { \"after\": String(config.after) } : {}),\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": String(config.properties) } : {}),\n ...(config.associations !== undefined && config.associations !== null && config.associations !== \"\" ? { \"associations\": String(config.associations) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/company-search.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/company-search.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Find companies by property filters, sorts or a text query.\n *\n * POST /crm/v3/objects/companies/search —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/companies\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const COMPANY_SEARCH_OPERATION = \"company_search\";\n\nexport type CompanySearchOptions = {\n /** The node's resolved config. Keys: filterGroups, sorts, query, properties, limit, after. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotCompanySearch(options: CompanySearchOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (typeof config.filterGroups === \"string\" && config.filterGroups !== \"\") {\n try {\n JSON.parse(config.filterGroups);\n } catch (error) {\n throw new Error(`company_search: \"filterGroups\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n if (typeof config.sorts === \"string\" && config.sorts !== \"\") {\n try {\n JSON.parse(config.sorts);\n } catch (error) {\n throw new Error(`company_search: \"sorts\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n {\n const n = Number(config.limit);\n const given = config.limit !== undefined && config.limit !== null && config.limit !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {\n throw new Error(\n `company_search: \"limit\" must be a integer, got ${JSON.stringify(config.limit)}.`,\n );\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: COMPANY_SEARCH_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/crm/v3/objects/companies/search\",\n json: {\n ...(config.filterGroups !== undefined && config.filterGroups !== null && config.filterGroups !== \"\" ? { \"filterGroups\": typeof config.filterGroups === \"string\" ? JSON.parse(config.filterGroups) : config.filterGroups } : {}),\n ...(config.sorts !== undefined && config.sorts !== null && config.sorts !== \"\" ? { \"sorts\": typeof config.sorts === \"string\" ? JSON.parse(config.sorts) : config.sorts } : {}),\n ...(config.query !== undefined && config.query !== null && config.query !== \"\" ? { \"query\": String(config.query) } : {}),\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": propertiesList(config.properties) } : {}),\n ...(config.limit !== undefined && config.limit !== null && config.limit !== \"\" ? { \"limit\": Math.trunc(Number(config.limit)) } : {}),\n ...(config.after !== undefined && config.after !== null && config.after !== \"\" ? { \"after\": String(config.after) } : {}),\n },\n },\n });\n}\n\n/** One value, a \",\"-separated string, or an array — all end up a list. */\nfunction propertiesList(value: unknown): string[] {\n const items = Array.isArray(value)\n ? value.map(String)\n : typeof value === \"string\"\n ? value.split(\",\")\n : [];\n\n return items.map((item) => item.trim()).filter(Boolean);\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/company-update.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/company-update.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Change properties on an existing company.\n *\n * PATCH /crm/v3/objects/companies/{companyId} —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/companies\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const COMPANY_UPDATE_OPERATION = \"company_update\";\n\nexport type CompanyUpdateOptions = {\n /** The node's resolved config. Keys: companyId, properties. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotCompanyUpdate(options: CompanyUpdateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.companyId === undefined || config.companyId === null || config.companyId === \"\") {\n throw new Error(`company_update: \"companyId\" is required (Company id).`);\n }\n\n if (config.properties === undefined || config.properties === null || config.properties === \"\") {\n throw new Error(`company_update: \"properties\" is required (Properties).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: COMPANY_UPDATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"PATCH\",\n path: `/crm/v3/objects/companies/${encodeURIComponent(String(config.companyId))}`,\n json: {\n \"properties\": propertiesMap(config.properties),\n },\n },\n });\n}\n\n/** `{ k: \"v\" }` → `{ \"properties\": { \"k\": \"v\" } }` — a JSON body wants the real object. */\nfunction propertiesMap(value: unknown): Record<string, string> {\n if (!value || typeof value !== \"object\") return {};\n\n const out: Record<string, string> = {};\n for (const [key, item] of Object.entries(value as Record<string, unknown>)) {\n if (item !== undefined && item !== null && item !== \"\") out[key] = String(item);\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/contact-create.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/contact-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Create a contact in HubSpot.\n *\n * POST /crm/v3/objects/contacts —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/contacts\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n *\n * sideEffects: unsafe-to-replay.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const CONTACT_CREATE_OPERATION = \"contact_create\";\n\nexport type ContactCreateOptions = {\n /** The node's resolved config. Keys: email, firstName, lastName, company, phone, lifecycleStage, properties. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotContactCreate(options: ContactCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if ((config.email === undefined || config.email === null || config.email === \"\") && propertiesMap(config.properties)[\"email\"] === undefined) {\n throw new Error(`contact_create: \"email\" is required — as Email, or as \"email\" in Properties.`);\n }\n\n {\n const inMap = propertiesMap(config.properties)[\"email\"];\n if (config.email !== undefined && config.email !== null && config.email !== \"\" && inMap !== undefined && inMap !== String(config.email).trim()) {\n throw new Error(`contact_create: \"email\" was given twice with different values — as Email and as \"email\" in Properties.`);\n }\n }\n\n {\n const inMap = propertiesMap(config.properties)[\"firstname\"];\n if (config.firstName !== undefined && config.firstName !== null && config.firstName !== \"\" && inMap !== undefined && inMap !== String(config.firstName)) {\n throw new Error(`contact_create: \"firstName\" was given twice with different values — as First name and as \"firstname\" in Properties.`);\n }\n }\n\n {\n const inMap = propertiesMap(config.properties)[\"lastname\"];\n if (config.lastName !== undefined && config.lastName !== null && config.lastName !== \"\" && inMap !== undefined && inMap !== String(config.lastName)) {\n throw new Error(`contact_create: \"lastName\" was given twice with different values — as Last name and as \"lastname\" in Properties.`);\n }\n }\n\n {\n const inMap = propertiesMap(config.properties)[\"company\"];\n if (config.company !== undefined && config.company !== null && config.company !== \"\" && inMap !== undefined && inMap !== String(config.company)) {\n throw new Error(`contact_create: \"company\" was given twice with different values — as Company and as \"company\" in Properties.`);\n }\n }\n\n {\n const inMap = propertiesMap(config.properties)[\"phone\"];\n if (config.phone !== undefined && config.phone !== null && config.phone !== \"\" && inMap !== undefined && inMap !== String(config.phone)) {\n throw new Error(`contact_create: \"phone\" was given twice with different values — as Phone and as \"phone\" in Properties.`);\n }\n }\n\n {\n const inMap = propertiesMap(config.properties)[\"lifecyclestage\"];\n if (config.lifecycleStage !== undefined && config.lifecycleStage !== null && config.lifecycleStage !== \"\" && inMap !== undefined && inMap !== String(config.lifecycleStage)) {\n throw new Error(`contact_create: \"lifecycleStage\" was given twice with different values — as Lifecycle stage and as \"lifecyclestage\" in Properties.`);\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: CONTACT_CREATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/crm/v3/objects/contacts\",\n json: mergeInto(nestFields({\n ...(config.email !== undefined && config.email !== null && config.email !== \"\" ? { \"properties.email\": String(config.email).trim() } : {}),\n ...(config.firstName !== undefined && config.firstName !== null && config.firstName !== \"\" ? { \"properties.firstname\": String(config.firstName) } : {}),\n ...(config.lastName !== undefined && config.lastName !== null && config.lastName !== \"\" ? { \"properties.lastname\": String(config.lastName) } : {}),\n ...(config.company !== undefined && config.company !== null && config.company !== \"\" ? { \"properties.company\": String(config.company) } : {}),\n ...(config.phone !== undefined && config.phone !== null && config.phone !== \"\" ? { \"properties.phone\": String(config.phone) } : {}),\n ...(config.lifecycleStage !== undefined && config.lifecycleStage !== null && config.lifecycleStage !== \"\" ? { \"properties.lifecyclestage\": String(config.lifecycleStage) } : {}),\n \"associations\": [],\n }), \"properties\", propertiesMap(config.properties)),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\n}\n\n/**\n * The map under `key` is the BASE; the named fields already nested there\n * merge into it. A key given both ways with different values was refused\n * before this ran.\n */\nfunction mergeInto(body: Record<string, unknown>, key: string, map: Record<string, string>): Record<string, unknown> {\n const named = body[key];\n\n return { ...body, [key]: { ...map, ...(named !== null && typeof named === \"object\" ? named : {}) } };\n}\n\n/** `{ k: \"v\" }` → `{ \"properties\": { \"k\": \"v\" } }` — a JSON body wants the real object. */\nfunction propertiesMap(value: unknown): Record<string, string> {\n if (!value || typeof value !== \"object\") return {};\n\n const out: Record<string, string> = {};\n for (const [key, item] of Object.entries(value as Record<string, unknown>)) {\n if (item !== undefined && item !== null && item !== \"\") out[key] = String(item);\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/contact-get.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/contact-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Read one contact, with its associations when asked.\n *\n * GET /crm/v3/objects/contacts/{contactId} —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/contacts\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const CONTACT_GET_OPERATION = \"contact_get\";\n\nexport type ContactGetOptions = {\n /** The node's resolved config. Keys: contactId, properties, associations. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotContactGet(options: ContactGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.contactId === undefined || config.contactId === null || config.contactId === \"\") {\n throw new Error(`contact_get: \"contactId\" is required (Contact id).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: CONTACT_GET_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/crm/v3/objects/contacts/${encodeURIComponent(String(config.contactId))}`,\n query: {\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": String(config.properties) } : {}),\n ...(config.associations !== undefined && config.associations !== null && config.associations !== \"\" ? { \"associations\": String(config.associations) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/contact-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/contact-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Page through every contact in the portal.\n *\n * GET /crm/v3/objects/contacts —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/contacts\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const CONTACT_LIST_OPERATION = \"contact_list\";\n\nexport type ContactListOptions = {\n /** The node's resolved config. Keys: limit, after, properties, associations. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotContactList(options: ContactListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n {\n const n = Number(config.limit);\n const given = config.limit !== undefined && config.limit !== null && config.limit !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {\n throw new Error(\n `contact_list: \"limit\" must be a integer, got ${JSON.stringify(config.limit)}.`,\n );\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: CONTACT_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: \"/crm/v3/objects/contacts\",\n query: {\n ...(config.limit !== undefined && config.limit !== null && config.limit !== \"\" ? { \"limit\": Math.trunc(Number(config.limit)) } : {}),\n ...(config.after !== undefined && config.after !== null && config.after !== \"\" ? { \"after\": String(config.after) } : {}),\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": String(config.properties) } : {}),\n ...(config.associations !== undefined && config.associations !== null && config.associations !== \"\" ? { \"associations\": String(config.associations) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/contact-search.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/contact-search.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Find contacts by property filters, sorts or a text query.\n *\n * POST /crm/v3/objects/contacts/search —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/contacts\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const CONTACT_SEARCH_OPERATION = \"contact_search\";\n\nexport type ContactSearchOptions = {\n /** The node's resolved config. Keys: filterGroups, sorts, query, properties, limit, after. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotContactSearch(options: ContactSearchOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (typeof config.filterGroups === \"string\" && config.filterGroups !== \"\") {\n try {\n JSON.parse(config.filterGroups);\n } catch (error) {\n throw new Error(`contact_search: \"filterGroups\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n if (typeof config.sorts === \"string\" && config.sorts !== \"\") {\n try {\n JSON.parse(config.sorts);\n } catch (error) {\n throw new Error(`contact_search: \"sorts\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n {\n const n = Number(config.limit);\n const given = config.limit !== undefined && config.limit !== null && config.limit !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {\n throw new Error(\n `contact_search: \"limit\" must be a integer, got ${JSON.stringify(config.limit)}.`,\n );\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: CONTACT_SEARCH_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/crm/v3/objects/contacts/search\",\n json: {\n ...(config.filterGroups !== undefined && config.filterGroups !== null && config.filterGroups !== \"\" ? { \"filterGroups\": typeof config.filterGroups === \"string\" ? JSON.parse(config.filterGroups) : config.filterGroups } : {}),\n ...(config.sorts !== undefined && config.sorts !== null && config.sorts !== \"\" ? { \"sorts\": typeof config.sorts === \"string\" ? JSON.parse(config.sorts) : config.sorts } : {}),\n ...(config.query !== undefined && config.query !== null && config.query !== \"\" ? { \"query\": String(config.query) } : {}),\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": propertiesList(config.properties) } : {}),\n ...(config.limit !== undefined && config.limit !== null && config.limit !== \"\" ? { \"limit\": Math.trunc(Number(config.limit)) } : {}),\n ...(config.after !== undefined && config.after !== null && config.after !== \"\" ? { \"after\": String(config.after) } : {}),\n },\n },\n });\n}\n\n/** One value, a \",\"-separated string, or an array — all end up a list. */\nfunction propertiesList(value: unknown): string[] {\n const items = Array.isArray(value)\n ? value.map(String)\n : typeof value === \"string\"\n ? value.split(\",\")\n : [];\n\n return items.map((item) => item.trim()).filter(Boolean);\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/contact-update.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/contact-update.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Change properties on an existing contact.\n *\n * PATCH /crm/v3/objects/contacts/{contactId} —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/contacts\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const CONTACT_UPDATE_OPERATION = \"contact_update\";\n\nexport type ContactUpdateOptions = {\n /** The node's resolved config. Keys: contactId, properties. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotContactUpdate(options: ContactUpdateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.contactId === undefined || config.contactId === null || config.contactId === \"\") {\n throw new Error(`contact_update: \"contactId\" is required (Contact id).`);\n }\n\n if (config.properties === undefined || config.properties === null || config.properties === \"\") {\n throw new Error(`contact_update: \"properties\" is required (Properties).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: CONTACT_UPDATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"PATCH\",\n path: `/crm/v3/objects/contacts/${encodeURIComponent(String(config.contactId))}`,\n json: {\n \"properties\": propertiesMap(config.properties),\n },\n },\n });\n}\n\n/** `{ k: \"v\" }` → `{ \"properties\": { \"k\": \"v\" } }` — a JSON body wants the real object. */\nfunction propertiesMap(value: unknown): Record<string, string> {\n if (!value || typeof value !== \"object\") return {};\n\n const out: Record<string, string> = {};\n for (const [key, item] of Object.entries(value as Record<string, unknown>)) {\n if (item !== undefined && item !== null && item !== \"\") out[key] = String(item);\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/deal-create.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/deal-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Create a deal in HubSpot.\n *\n * POST /crm/v3/objects/deals —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/deals\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n *\n * sideEffects: unsafe-to-replay.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const DEAL_CREATE_OPERATION = \"deal_create\";\n\nexport type DealCreateOptions = {\n /** The node's resolved config. Keys: properties. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotDealCreate(options: DealCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.properties === undefined || config.properties === null || config.properties === \"\") {\n throw new Error(`deal_create: \"properties\" is required (Properties).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: DEAL_CREATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/crm/v3/objects/deals\",\n json: {\n \"properties\": propertiesMap(config.properties),\n \"associations\": [],\n },\n },\n });\n}\n\n/** `{ k: \"v\" }` → `{ \"properties\": { \"k\": \"v\" } }` — a JSON body wants the real object. */\nfunction propertiesMap(value: unknown): Record<string, string> {\n if (!value || typeof value !== \"object\") return {};\n\n const out: Record<string, string> = {};\n for (const [key, item] of Object.entries(value as Record<string, unknown>)) {\n if (item !== undefined && item !== null && item !== \"\") out[key] = String(item);\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/deal-get.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/deal-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Read one deal, with its associations when asked.\n *\n * GET /crm/v3/objects/deals/{dealId} —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/deals\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const DEAL_GET_OPERATION = \"deal_get\";\n\nexport type DealGetOptions = {\n /** The node's resolved config. Keys: dealId, properties, associations. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotDealGet(options: DealGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.dealId === undefined || config.dealId === null || config.dealId === \"\") {\n throw new Error(`deal_get: \"dealId\" is required (Deal id).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: DEAL_GET_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/crm/v3/objects/deals/${encodeURIComponent(String(config.dealId))}`,\n query: {\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": String(config.properties) } : {}),\n ...(config.associations !== undefined && config.associations !== null && config.associations !== \"\" ? { \"associations\": String(config.associations) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/deal-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/deal-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Page through every deal in the portal.\n *\n * GET /crm/v3/objects/deals —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/deals\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const DEAL_LIST_OPERATION = \"deal_list\";\n\nexport type DealListOptions = {\n /** The node's resolved config. Keys: limit, after, properties, associations. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotDealList(options: DealListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n {\n const n = Number(config.limit);\n const given = config.limit !== undefined && config.limit !== null && config.limit !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {\n throw new Error(\n `deal_list: \"limit\" must be a integer, got ${JSON.stringify(config.limit)}.`,\n );\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: DEAL_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: \"/crm/v3/objects/deals\",\n query: {\n ...(config.limit !== undefined && config.limit !== null && config.limit !== \"\" ? { \"limit\": Math.trunc(Number(config.limit)) } : {}),\n ...(config.after !== undefined && config.after !== null && config.after !== \"\" ? { \"after\": String(config.after) } : {}),\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": String(config.properties) } : {}),\n ...(config.associations !== undefined && config.associations !== null && config.associations !== \"\" ? { \"associations\": String(config.associations) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/deal-search.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/deal-search.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Find deals by property filters, sorts or a text query.\n *\n * POST /crm/v3/objects/deals/search —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/deals\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const DEAL_SEARCH_OPERATION = \"deal_search\";\n\nexport type DealSearchOptions = {\n /** The node's resolved config. Keys: filterGroups, sorts, query, properties, limit, after. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotDealSearch(options: DealSearchOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (typeof config.filterGroups === \"string\" && config.filterGroups !== \"\") {\n try {\n JSON.parse(config.filterGroups);\n } catch (error) {\n throw new Error(`deal_search: \"filterGroups\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n if (typeof config.sorts === \"string\" && config.sorts !== \"\") {\n try {\n JSON.parse(config.sorts);\n } catch (error) {\n throw new Error(`deal_search: \"sorts\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n {\n const n = Number(config.limit);\n const given = config.limit !== undefined && config.limit !== null && config.limit !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 200)) {\n throw new Error(\n `deal_search: \"limit\" must be a integer, got ${JSON.stringify(config.limit)}.`,\n );\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: DEAL_SEARCH_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/crm/v3/objects/deals/search\",\n json: {\n ...(config.filterGroups !== undefined && config.filterGroups !== null && config.filterGroups !== \"\" ? { \"filterGroups\": typeof config.filterGroups === \"string\" ? JSON.parse(config.filterGroups) : config.filterGroups } : {}),\n ...(config.sorts !== undefined && config.sorts !== null && config.sorts !== \"\" ? { \"sorts\": typeof config.sorts === \"string\" ? JSON.parse(config.sorts) : config.sorts } : {}),\n ...(config.query !== undefined && config.query !== null && config.query !== \"\" ? { \"query\": String(config.query) } : {}),\n ...(config.properties !== undefined && config.properties !== null && config.properties !== \"\" ? { \"properties\": propertiesList(config.properties) } : {}),\n ...(config.limit !== undefined && config.limit !== null && config.limit !== \"\" ? { \"limit\": Math.trunc(Number(config.limit)) } : {}),\n ...(config.after !== undefined && config.after !== null && config.after !== \"\" ? { \"after\": String(config.after) } : {}),\n },\n },\n });\n}\n\n/** One value, a \",\"-separated string, or an array — all end up a list. */\nfunction propertiesList(value: unknown): string[] {\n const items = Array.isArray(value)\n ? value.map(String)\n : typeof value === \"string\"\n ? value.split(\",\")\n : [];\n\n return items.map((item) => item.trim()).filter(Boolean);\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/deal-update.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/deal-update.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Change properties on an existing deal.\n *\n * PATCH /crm/v3/objects/deals/{dealId} —\n * https://developers.hubspot.com/docs/reference/api/crm/objects/deals\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const DEAL_UPDATE_OPERATION = \"deal_update\";\n\nexport type DealUpdateOptions = {\n /** The node's resolved config. Keys: dealId, properties. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotDealUpdate(options: DealUpdateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.dealId === undefined || config.dealId === null || config.dealId === \"\") {\n throw new Error(`deal_update: \"dealId\" is required (Deal id).`);\n }\n\n if (config.properties === undefined || config.properties === null || config.properties === \"\") {\n throw new Error(`deal_update: \"properties\" is required (Properties).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: DEAL_UPDATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"PATCH\",\n path: `/crm/v3/objects/deals/${encodeURIComponent(String(config.dealId))}`,\n json: {\n \"properties\": propertiesMap(config.properties),\n },\n },\n });\n}\n\n/** `{ k: \"v\" }` → `{ \"properties\": { \"k\": \"v\" } }` — a JSON body wants the real object. */\nfunction propertiesMap(value: unknown): Record<string, string> {\n if (!value || typeof value !== \"object\") return {};\n\n const out: Record<string, string> = {};\n for (const [key, item] of Object.entries(value as Record<string, unknown>)) {\n if (item !== undefined && item !== null && item !== \"\") out[key] = String(item);\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/owner-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/owner-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Page through the portal's owners: the users records can be assigned to.\n *\n * GET /crm/v3/owners —\n * https://developers.hubspot.com/docs/reference/api/crm/owners\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const OWNER_LIST_OPERATION = \"owner_list\";\n\nexport type OwnerListOptions = {\n /** The node's resolved config. Keys: email, limit, after. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotOwnerList(options: OwnerListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n {\n const n = Number(config.limit);\n const given = config.limit !== undefined && config.limit !== null && config.limit !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 100)) {\n throw new Error(\n `owner_list: \"limit\" must be a integer, got ${JSON.stringify(config.limit)}.`,\n );\n }\n }\n\n return callConnector(HUBSPOT, {\n operation: OWNER_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: \"/crm/v3/owners\",\n query: {\n ...(config.email !== undefined && config.email !== null && config.email !== \"\" ? { \"email\": String(config.email) } : {}),\n ...(config.limit !== undefined && config.limit !== null && config.limit !== \"\" ? { \"limit\": Math.trunc(Number(config.limit)) } : {}),\n ...(config.after !== undefined && config.after !== null && config.after !== \"\" ? { \"after\": String(config.after) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/pipeline-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/pipeline-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Every deal pipeline in the portal, with its stages in order.\n *\n * GET /crm/v3/pipelines/deals —\n * https://developers.hubspot.com/docs/reference/api/crm/pipelines\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const PIPELINE_LIST_OPERATION = \"pipeline_list\";\n\nexport type PipelineListOptions = {\n /** The node's resolved config. Keys: . */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotPipelineList(options: PipelineListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n return callConnector(HUBSPOT, {\n operation: PIPELINE_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: \"/crm/v3/pipelines/deals\",\n query: {},\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/property-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/property-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * Every property defined on deals, contacts or companies: name, label, type\n * and the options of an enumeration.\n *\n * GET /crm/v3/properties/{objectType} —\n * https://developers.hubspot.com/docs/reference/api/crm/properties\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls HubSpot or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { HUBSPOT } from \"../service.js\";\n\nexport const PROPERTY_LIST_OPERATION = \"property_list\";\n\nexport type PropertyListOptions = {\n /** The node's resolved config. Keys: objectType. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function hubspotPropertyList(options: PropertyListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.objectType === undefined || config.objectType === null || config.objectType === \"\") {\n throw new Error(`property_list: \"objectType\" is required (Object).`);\n }\n\n return callConnector(HUBSPOT, {\n operation: PROPERTY_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/crm/v3/properties/${encodeURIComponent(String(config.objectType))}`,\n query: {},\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/triggers/crm-event.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/triggers/crm-event.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- hubspot\n */\n\n/**\n * HubSpot's webhook trigger — the delivery contract.\n *\n * Kept beside the service descriptor rather than inside a node, because a\n * signature scheme is a fact about HUBSPOT. Two HubSpot triggers must not be\n * able to disagree about how a delivery is verified.\n */\n\nimport { verifyDelivery, type HmacScheme, type InboundDelivery, type TriggerDescriptor, type WebhookVerification } from \"@particle-academy/fancy-connector-core\";\nimport { hubspotFaker } from \"../faker.js\";\n\nexport const HUBSPOT_CRM_EVENT_SIGNATURE_HEADER = \"X-HubSpot-Signature-v3\";\n/** The provider's documented replay window, in seconds. */\nexport const HUBSPOT_CRM_EVENT_TOLERANCE = 300;\n\nexport const HUBSPOT_CRM_EVENT_SCHEME: HmacScheme = {\n algorithm: \"SHA-256\",\n payload: (raw, timestamp, _id, request) => `${request?.method ?? \"\"}${request?.uri ?? \"\"}${raw}${timestamp}`,\n tolerance: HUBSPOT_CRM_EVENT_TOLERANCE,\n timestampUnit: \"ms\",\n signsRequestLine: true,\n uri: \"hubspot-v3\",\n encoding: \"base64\",\n};\n\nexport const HUBSPOT_CRM_EVENT: TriggerDescriptor = {\n service: \"hubspot\",\n operation: \"crm_event\",\n delivery: \"webhook\",\n setup:\n \"In the HubSpot app's webhook settings, set the target URL to the route your host mounts for this trigger and subscribe to the deal, contact and company events you want. Deliveries are signed with the app's client secret, already on the connection as `clientSecret`. ONE URL serves every portal that installed the app, so route each event by its portalId, and only after the signature has verified: map portalId to the connection created when that portal installed, and drop an unmapped portalId with a 2xx and a log line, creating nothing. HubSpot retries a failed delivery, and eventId is not guaranteed to be unique, so never dedupe on eventId alone: a retry is the same event resent, differing only in attemptNumber, so compare every other field. This connector's scope list covers every action, read and write, and is not what your consent URL must ask for: HubSpot requires your app's required scopes in the authorize URL's `scope` parameter and shows an error otherwise, so build it from your own app's configuration. A read-only host asks for its read scopes only.\",\n verification: {\n signatureHeader: HUBSPOT_CRM_EVENT_SIGNATURE_HEADER,\n scheme: HUBSPOT_CRM_EVENT_SCHEME,\n timestampHeader: \"X-HubSpot-Request-Timestamp\",\n },\n route: { by: \"portalId\", path: \"[].portalId\" },\n faker: hubspotFaker,\n};\n\n/**\n * Verify one inbound HubSpot delivery.\n *\n * The host calls this BEFORE starting a run, with the body exactly as\n * received. Re-serialised JSON changes key order and whitespace, and produces\n * a mismatch that looks precisely like a wrong secret — hours of debugging the\n * wrong thing.\n *\n * The secret is the connection's `clientSecret`.\n */\nexport function verifyHubspotDelivery(\n delivery: InboundDelivery,\n clientSecret: string | undefined,\n now?: number,\n): Promise<WebhookVerification> {\n return verifyDelivery(HUBSPOT_CRM_EVENT, delivery, clientSecret, now);\n}\n"]}