From 2db8442cdaf1011f38e60b3f2410ca14925f8afb Mon Sep 17 00:00:00 2001 From: Nico Sammito Date: Thu, 23 Jul 2026 19:54:41 +0200 Subject: [PATCH 1/6] feat: add hubspot action (#41) --- .gitlab-ci.yml | 1 + README.md | 1 + actions/hubspot-action/.gitignore | 3 + actions/hubspot-action/Dockerfile | 13 + actions/hubspot-action/README.md | 81 ++++++ actions/hubspot-action/package.json | 25 ++ .../src/data_types/hubspotCompany.ts | 12 + .../src/data_types/hubspotContact.ts | 12 + .../src/data_types/hubspotDeal.ts | 12 + .../src/data_types/hubspotNote.ts | 12 + .../src/data_types/hubspotObjectBase.ts | 24 ++ .../src/data_types/hubspotSearchResult.ts | 15 + .../src/data_types/hubspotWebhookEvent.ts | 32 +++ .../events/hubspotContactCreatedWebhook.ts | 23 ++ .../src/events/hubspotDealCreatedWebhook.ts | 23 ++ .../events/hubspotDealStageChangedWebhook.ts | 23 ++ .../src/events/hubspotFormSubmittedWebhook.ts | 23 ++ .../src/functions/hubspotAddNoteFunction.ts | 26 ++ .../src/functions/hubspotAssociateFunction.ts | 27 ++ .../functions/hubspotCreateCompanyFunction.ts | 26 ++ .../functions/hubspotCreateContactFunction.ts | 26 ++ .../functions/hubspotCreateDealFunction.ts | 29 ++ .../hubspotGetContactByEmailFunction.ts | 25 ++ .../functions/hubspotSearchObjectsFunction.ts | 26 ++ .../functions/hubspotUpdateContactFunction.ts | 26 ++ .../functions/hubspotUpdateDealFunction.ts | 26 ++ actions/hubspot-action/src/helpers.ts | 262 ++++++++++++++++++ actions/hubspot-action/src/index.ts | 106 +++++++ actions/hubspot-action/test/index.test.ts | 71 +++++ actions/hubspot-action/tsconfig.json | 23 ++ actions/hubspot-action/vite.config.ts | 19 ++ 31 files changed, 1053 insertions(+) create mode 100644 actions/hubspot-action/.gitignore create mode 100644 actions/hubspot-action/Dockerfile create mode 100644 actions/hubspot-action/README.md create mode 100644 actions/hubspot-action/package.json create mode 100644 actions/hubspot-action/src/data_types/hubspotCompany.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotContact.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotDeal.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotNote.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotObjectBase.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotSearchResult.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts create mode 100644 actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts create mode 100644 actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts create mode 100644 actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts create mode 100644 actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts create mode 100644 actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotAssociateFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts create mode 100644 actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts create mode 100644 actions/hubspot-action/src/helpers.ts create mode 100644 actions/hubspot-action/src/index.ts create mode 100644 actions/hubspot-action/test/index.test.ts create mode 100644 actions/hubspot-action/tsconfig.json create mode 100644 actions/hubspot-action/vite.config.ts diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9953a6..f9fb5a1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,7 @@ include: - stripe-action - smtp-action - github-action + - hubspot-action .rust-actions: - cron-action diff --git a/README.md b/README.md index 32adaf6..0782bfc 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ The "central" place for all actions — a monorepo containing integrations provi | [GLS](docs/Actions/GLS/overview.md) | GLS ShipIT integration for creating and managing shipments | | [Stripe](actions/stripe-action/README.md) | Stripe payments integration for managing customers, payment intents and refunds | | SMTP | Send emails (with attachments) through any SMTP server via nodemailer | +| HubSpot | HubSpot CRM integration: webhooks for contacts/deals/companies plus create, update, search, associate, and note functions | ## ENV All actions share the following base environment variables, which connect them to the Hercules/Aquila infrastructure: diff --git a/actions/hubspot-action/.gitignore b/actions/hubspot-action/.gitignore new file mode 100644 index 0000000..ddc3c2a --- /dev/null +++ b/actions/hubspot-action/.gitignore @@ -0,0 +1,3 @@ +.env +node_modules/ +dist/ diff --git a/actions/hubspot-action/Dockerfile b/actions/hubspot-action/Dockerfile new file mode 100644 index 0000000..5871953 --- /dev/null +++ b/actions/hubspot-action/Dockerfile @@ -0,0 +1,13 @@ +FROM node:24.10.0-alpine + +WORKDIR /app + +COPY package.json package-lock.json* ./ + +RUN npm install + +COPY . . + +RUN npm run build + +CMD ["npm", "run", "start"] diff --git a/actions/hubspot-action/README.md b/actions/hubspot-action/README.md new file mode 100644 index 0000000..30cb960 --- /dev/null +++ b/actions/hubspot-action/README.md @@ -0,0 +1,81 @@ +# HubSpot Action + +HubSpot CRM integration for the **Hercules** automation platform. Lets flows +react to HubSpot webhook events and create, update, search, associate, and +annotate CRM records through the official +[`@hubspot/api-client`](https://www.npmjs.com/package/@hubspot/api-client) SDK +(HubSpot CRM v3 API). + +## Configuration + +Configured via the action's `ConfigurationDefinition`s: + +| Identifier | Type | Required | Description | +|------------|------|----------|-------------| +| `access_token` | TEXT | yes | Private-app access token (Bearer) for the HubSpot CRM API. | +| `app_id` | TEXT | no | HubSpot app id, used when managing webhook subscriptions. | +| `client_secret` | TEXT | no | HubSpot app client secret, used to validate the `X-HubSpot-Signature` on inbound webhooks. | + +Beyond the shared Hercules variables (`HERCULES_AUTH_TOKEN`, +`HERCULES_AQUILA_URL`, `HERCULES_ACTION_ID`, `HERCULES_SDK_VERSION`), the only +provider-specific credential required is the HubSpot private-app access token. + +### Creating a private app + +1. In HubSpot, go to **Settings → Integrations → Private Apps**. +2. Create a private app and grant the CRM scopes you need + (`crm.objects.contacts.*`, `crm.objects.deals.*`, `crm.objects.companies.*`, + `crm.schemas.*`, and note/engagement scopes for `hubspotAddNote`). +3. Copy the access token into the action's `access_token` config. + +### Webhooks (triggers) + +The triggers use the shared `Rest` (webhook) event pattern. Point a HubSpot app +**webhook subscription** at the URL generated for the trigger. HubSpot delivers +a JSON array of change events; each event is exposed to the flow as a +`HUBSPOT_WEBHOOK_EVENT`. To verify signatures, configure `client_secret`. + +## Triggers + +| Identifier | Fires on | +|------------|----------| +| `HubSpotContactCreatedWebhook` | `contact.creation` | +| `HubSpotDealCreatedWebhook` | `deal.creation` | +| `HubSpotDealStageChangedWebhook` | `deal.propertyChange` on `dealstage` | +| `HubSpotFormSubmittedWebhook` | form submission (lead capture) | + +## Functions + +| Identifier | Signature | Description | +|------------|-----------|-------------| +| `hubspotCreateContact` | `(Email, PropertiesJson?): HUBSPOT_CONTACT` | Create a contact. | +| `hubspotUpdateContact` | `(ContactId, PropertiesJson): HUBSPOT_CONTACT` | Update a contact. | +| `hubspotGetContactByEmail` | `(Email): HUBSPOT_CONTACT` | Look up a contact by email. | +| `hubspotCreateDeal` | `(Name, Pipeline, Stage, Amount?, PropertiesJson?): HUBSPOT_DEAL` | Create a deal. | +| `hubspotUpdateDeal` | `(DealId, PropertiesJson): HUBSPOT_DEAL` | Update a deal. | +| `hubspotCreateCompany` | `(Name, PropertiesJson?): HUBSPOT_COMPANY` | Create a company. | +| `hubspotAddNote` | `(Body, PropertiesJson?): HUBSPOT_NOTE` | Create a note engagement. | +| `hubspotAssociate` | `(FromObjectType, FromId, ToObjectType, ToId): BOOLEAN` | Create the default association between two objects. | +| `hubspotSearchObjects` | `(ObjectType, Query): HUBSPOT_SEARCH_RESULT` | Full-text search a CRM object type. | + +### Property maps + +HubSpot CRM properties are a dynamic key/value bag, so functions accept extra +properties as a **JSON object string** (e.g. +`{"firstname":"Ada","lifecyclestage":"lead"}`) rather than a fixed set of typed +parameters. Values are coerced to strings, matching the HubSpot API. + +## Data types + +`HUBSPOT_CONTACT`, `HUBSPOT_DEAL`, `HUBSPOT_COMPANY`, `HUBSPOT_NOTE` (all share +the SDK's `SimplePublicObject` envelope: `id`, `properties`, timestamps, +`archived`), plus `HUBSPOT_SEARCH_RESULT` and `HUBSPOT_WEBHOOK_EVENT`. + +## Development + +```bash +npm install +npm run typecheck +npm run build +npm run test +``` diff --git a/actions/hubspot-action/package.json b/actions/hubspot-action/package.json new file mode 100644 index 0000000..dc734eb --- /dev/null +++ b/actions/hubspot-action/package.json @@ -0,0 +1,25 @@ +{ + "name": "@code0-tech/hubspot-action", + "version": "1.0.0", + "private": true, + "type": "module", + "main": "dist/index.js", + "scripts": { + "dev": "tsx watch src/index.ts", + "typecheck": "tsc --noEmit", + "build": "vite build", + "test": "vitest run", + "start": "node dist/index.js" + }, + "dependencies": { + "@code0-tech/hercules": "^1.1.1", + "@hubspot/api-client": "^14.0.0" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "vite": "^8.0.3", + "vitest": "^4.1.10" + } +} diff --git a/actions/hubspot-action/src/data_types/hubspotCompany.ts b/actions/hubspot-action/src/data_types/hubspotCompany.ts new file mode 100644 index 0000000..a73b2e4 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotCompany.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { hubSpotObjectSchema } from "./hubspotObjectBase.js"; + +export const HubSpotCompanySchema = hubSpotObjectSchema(); +export type HubSpotCompany = z.infer; + +@Identifier("HUBSPOT_COMPANY") +@Name({ code: "en-US", content: "HubSpot company" }) +@DisplayMessage({ code: "en-US", content: "HubSpot company" }) +@Schema(HubSpotCompanySchema) +export class HubSpotCompanyDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotContact.ts b/actions/hubspot-action/src/data_types/hubspotContact.ts new file mode 100644 index 0000000..49d88dd --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotContact.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { hubSpotObjectSchema } from "./hubspotObjectBase.js"; + +export const HubSpotContactSchema = hubSpotObjectSchema(); +export type HubSpotContact = z.infer; + +@Identifier("HUBSPOT_CONTACT") +@Name({ code: "en-US", content: "HubSpot contact" }) +@DisplayMessage({ code: "en-US", content: "HubSpot contact" }) +@Schema(HubSpotContactSchema) +export class HubSpotContactDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotDeal.ts b/actions/hubspot-action/src/data_types/hubspotDeal.ts new file mode 100644 index 0000000..2cd2c4f --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotDeal.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { hubSpotObjectSchema } from "./hubspotObjectBase.js"; + +export const HubSpotDealSchema = hubSpotObjectSchema(); +export type HubSpotDeal = z.infer; + +@Identifier("HUBSPOT_DEAL") +@Name({ code: "en-US", content: "HubSpot deal" }) +@DisplayMessage({ code: "en-US", content: "HubSpot deal" }) +@Schema(HubSpotDealSchema) +export class HubSpotDealDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotNote.ts b/actions/hubspot-action/src/data_types/hubspotNote.ts new file mode 100644 index 0000000..2c94ffc --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotNote.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { hubSpotObjectSchema } from "./hubspotObjectBase.js"; + +export const HubSpotNoteSchema = hubSpotObjectSchema(); +export type HubSpotNote = z.infer; + +@Identifier("HUBSPOT_NOTE") +@Name({ code: "en-US", content: "HubSpot note" }) +@DisplayMessage({ code: "en-US", content: "HubSpot note" }) +@Schema(HubSpotNoteSchema) +export class HubSpotNoteDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotObjectBase.ts b/actions/hubspot-action/src/data_types/hubspotObjectBase.ts new file mode 100644 index 0000000..53718d4 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotObjectBase.ts @@ -0,0 +1,24 @@ +import { z } from "zod"; + +/** + * Base shape shared by all HubSpot CRM objects returned by the official + * `@hubspot/api-client` SDK (its `SimplePublicObject`): a stable `id`, a flat + * bag of string `properties`, lifecycle timestamps, and an `archived` flag. + * + * HubSpot CRM objects (contacts, deals, companies, notes, ...) all share this + * envelope and differ only in which property keys are populated, so we model + * the SDK's response type once and reuse it for every object data type rather + * than duplicating a near-identical schema per object. + */ +export const hubSpotObjectSchema = () => + z.object({ + id: z.string().describe("The unique HubSpot object id."), + properties: z + .record(z.string(), z.string().nullable()) + .describe("Flat map of HubSpot property names to their (string) values."), + createdAt: z.string().nullable().optional().describe("ISO-8601 creation timestamp."), + updatedAt: z.string().nullable().optional().describe("ISO-8601 last-update timestamp."), + archived: z.boolean().nullable().optional().describe("Whether the object is archived."), + }); + +export type HubSpotObject = z.infer>; diff --git a/actions/hubspot-action/src/data_types/hubspotSearchResult.ts b/actions/hubspot-action/src/data_types/hubspotSearchResult.ts new file mode 100644 index 0000000..61dc7d6 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotSearchResult.ts @@ -0,0 +1,15 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { hubSpotObjectSchema } from "./hubspotObjectBase.js"; + +export const HubSpotSearchResultSchema = z.object({ + total: z.number().describe("Total number of objects matching the search."), + results: z.array(hubSpotObjectSchema()).describe("The page of matching objects."), +}); +export type HubSpotSearchResult = z.infer; + +@Identifier("HUBSPOT_SEARCH_RESULT") +@Name({ code: "en-US", content: "HubSpot search result" }) +@DisplayMessage({ code: "en-US", content: "HubSpot search result (${total} matches)" }) +@Schema(HubSpotSearchResultSchema) +export class HubSpotSearchResultDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts b/actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts new file mode 100644 index 0000000..e067d32 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts @@ -0,0 +1,32 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; + +/** + * A single HubSpot app-webhook change event. HubSpot delivers webhook + * subscriptions as a JSON array of these event objects; the Rest trigger + * exposes the individual event to the flow. The schema is intentionally + * permissive (most fields optional) because the exact set of fields depends on + * the `subscriptionType` (property-change events carry `propertyName` / + * `propertyValue`, creation events do not). + * See https://developers.hubspot.com/docs/api/webhooks + */ +export const HubSpotWebhookEventSchema = z.object({ + eventId: z.number().optional(), + subscriptionId: z.number().optional(), + portalId: z.number().optional(), + appId: z.number().optional(), + occurredAt: z.number().optional(), + subscriptionType: z.string().optional(), + attemptNumber: z.number().optional(), + objectId: z.number().optional(), + changeSource: z.string().optional(), + changeFlag: z.string().optional(), + propertyName: z.string().optional(), + propertyValue: z.string().optional(), +}); +export type HubSpotWebhookEvent = z.infer; + +@Identifier("HUBSPOT_WEBHOOK_EVENT") +@Name({ code: "en-US", content: "HubSpot webhook event" }) +@Schema(HubSpotWebhookEventSchema) +export class HubSpotWebhookEventDataType {} diff --git a/actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts b/actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts new file mode 100644 index 0000000..450809d --- /dev/null +++ b/actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts @@ -0,0 +1,23 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules"; + +@Identifier("HubSpotContactCreatedWebhook") +@DisplayIcon("simple:hubspot") +@Name({ code: "en-US", content: "HubSpot contact created" }) +@Description({ code: "en-US", content: "Triggered when a new contact is created in HubSpot (subscription type contact.creation)." }) +@DisplayMessage({ code: "en-US", content: "HubSpot contact created on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST" +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json" +}) +export class HubSpotContactCreatedWebhook extends Rest {} diff --git a/actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts b/actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts new file mode 100644 index 0000000..ad6bc22 --- /dev/null +++ b/actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts @@ -0,0 +1,23 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules"; + +@Identifier("HubSpotDealCreatedWebhook") +@DisplayIcon("simple:hubspot") +@Name({ code: "en-US", content: "HubSpot deal created" }) +@Description({ code: "en-US", content: "Triggered when a new deal is created in HubSpot (subscription type deal.creation)." }) +@DisplayMessage({ code: "en-US", content: "HubSpot deal created on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST" +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json" +}) +export class HubSpotDealCreatedWebhook extends Rest {} diff --git a/actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts b/actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts new file mode 100644 index 0000000..0bee297 --- /dev/null +++ b/actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts @@ -0,0 +1,23 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules"; + +@Identifier("HubSpotDealStageChangedWebhook") +@DisplayIcon("simple:hubspot") +@Name({ code: "en-US", content: "HubSpot deal stage changed" }) +@Description({ code: "en-US", content: "Triggered when a deal's stage changes in HubSpot (subscription type deal.propertyChange on dealstage)." }) +@DisplayMessage({ code: "en-US", content: "HubSpot deal stage changed on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST" +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json" +}) +export class HubSpotDealStageChangedWebhook extends Rest {} diff --git a/actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts b/actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts new file mode 100644 index 0000000..e4d1dad --- /dev/null +++ b/actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts @@ -0,0 +1,23 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules"; + +@Identifier("HubSpotFormSubmittedWebhook") +@DisplayIcon("simple:hubspot") +@Name({ code: "en-US", content: "HubSpot form submitted" }) +@Description({ code: "en-US", content: "Triggered when a HubSpot form is submitted (lead capture). Delivered as a HubSpot webhook event." }) +@DisplayMessage({ code: "en-US", content: "HubSpot form submitted on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST" +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json" +}) +export class HubSpotFormSubmittedWebhook extends Rest {} diff --git a/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts new file mode 100644 index 0000000..d3b2e0c --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts @@ -0,0 +1,26 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { addNote } from "../helpers.js"; +import { HubSpotNote } from "../data_types/hubspotNote.js"; + +@Identifier("hubspotAddNote") +@DisplayIcon("simple:hubspot") +@Signature("(Body: string, PropertiesJson?: string): HUBSPOT_NOTE") +@Name({ code: "en-US", content: "Add note" }) +@DisplayMessage({ code: "en-US", content: "Add HubSpot note" }) +@Documentation({ code: "en-US", content: "Creates a HubSpot note engagement with the given body. The note timestamp defaults to now. Extra properties may be passed as a JSON object string." }) +@Description({ code: "en-US", content: "Creates a HubSpot note." }) +@Parameter({ runtimeName: "Body", name: [{ code: "en-US", content: "Body" }], description: [{ code: "en-US", content: "The note text (hs_note_body)." }] }) +@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional note properties." }], optional: true }) +export class HubSpotAddNoteFunction { + async run(context: FunctionContext, Body: string, PropertiesJson?: string): Promise { + try { + return await addNote(Body, PropertiesJson, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_CREATING_HUBSPOT_NOTE", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotAssociateFunction.ts b/actions/hubspot-action/src/functions/hubspotAssociateFunction.ts new file mode 100644 index 0000000..e87c4a0 --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotAssociateFunction.ts @@ -0,0 +1,27 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { associate } from "../helpers.js"; + +@Identifier("hubspotAssociate") +@DisplayIcon("simple:hubspot") +@Signature("(FromObjectType: string, FromId: string, ToObjectType: string, ToId: string): BOOLEAN") +@Name({ code: "en-US", content: "Associate objects" }) +@DisplayMessage({ code: "en-US", content: "Associate HubSpot ${FromObjectType} ${FromId} with ${ToObjectType} ${ToId}" }) +@Documentation({ code: "en-US", content: "Creates the default association between two HubSpot CRM objects (e.g. contact and deal) using the v4 associations API." }) +@Description({ code: "en-US", content: "Associates two HubSpot CRM objects." }) +@Parameter({ runtimeName: "FromObjectType", name: [{ code: "en-US", content: "From object type" }], description: [{ code: "en-US", content: "The source object type (e.g. contacts, deals, companies)." }] }) +@Parameter({ runtimeName: "FromId", name: [{ code: "en-US", content: "From id" }], description: [{ code: "en-US", content: "The source object id." }] }) +@Parameter({ runtimeName: "ToObjectType", name: [{ code: "en-US", content: "To object type" }], description: [{ code: "en-US", content: "The target object type (e.g. contacts, deals, companies)." }] }) +@Parameter({ runtimeName: "ToId", name: [{ code: "en-US", content: "To id" }], description: [{ code: "en-US", content: "The target object id." }] }) +export class HubSpotAssociateFunction { + async run(context: FunctionContext, FromObjectType: string, FromId: string, ToObjectType: string, ToId: string): Promise { + try { + return await associate(FromObjectType, FromId, ToObjectType, ToId, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_ASSOCIATING_HUBSPOT_OBJECTS", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts new file mode 100644 index 0000000..3fe3518 --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts @@ -0,0 +1,26 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { createCompany } from "../helpers.js"; +import { HubSpotCompany } from "../data_types/hubspotCompany.js"; + +@Identifier("hubspotCreateCompany") +@DisplayIcon("simple:hubspot") +@Signature("(Name: string, PropertiesJson?: string): HUBSPOT_COMPANY") +@Name({ code: "en-US", content: "Create company" }) +@DisplayMessage({ code: "en-US", content: "Create HubSpot company ${Name}" }) +@Documentation({ code: "en-US", content: "Creates a new HubSpot company. Pass additional properties (e.g. domain, industry) as a JSON object string." }) +@Description({ code: "en-US", content: "Creates a new HubSpot company." }) +@Parameter({ runtimeName: "Name", name: [{ code: "en-US", content: "Name" }], description: [{ code: "en-US", content: "The company name." }] }) +@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional company properties." }], optional: true }) +export class HubSpotCreateCompanyFunction { + async run(context: FunctionContext, Name: string, PropertiesJson?: string): Promise { + try { + return await createCompany(Name, PropertiesJson, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_CREATING_HUBSPOT_COMPANY", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts new file mode 100644 index 0000000..ac0e3b4 --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts @@ -0,0 +1,26 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { createContact } from "../helpers.js"; +import { HubSpotContact } from "../data_types/hubspotContact.js"; + +@Identifier("hubspotCreateContact") +@DisplayIcon("simple:hubspot") +@Signature("(Email: string, PropertiesJson?: string): HUBSPOT_CONTACT") +@Name({ code: "en-US", content: "Create contact" }) +@DisplayMessage({ code: "en-US", content: "Create HubSpot contact ${Email}" }) +@Documentation({ code: "en-US", content: "Creates a new contact in HubSpot with the given email. Pass additional properties as a JSON object string (e.g. {\"firstname\":\"Ada\"})." }) +@Description({ code: "en-US", content: "Creates a new HubSpot contact." }) +@Parameter({ runtimeName: "Email", name: [{ code: "en-US", content: "Email" }], description: [{ code: "en-US", content: "The email address of the contact (used as the primary identifier)." }] }) +@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional HubSpot contact properties." }], optional: true }) +export class HubSpotCreateContactFunction { + async run(context: FunctionContext, Email: string, PropertiesJson?: string): Promise { + try { + return await createContact(Email, PropertiesJson, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_CREATING_HUBSPOT_CONTACT", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts new file mode 100644 index 0000000..0afa59e --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts @@ -0,0 +1,29 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { createDeal } from "../helpers.js"; +import { HubSpotDeal } from "../data_types/hubspotDeal.js"; + +@Identifier("hubspotCreateDeal") +@DisplayIcon("simple:hubspot") +@Signature("(Name: string, Pipeline: string, Stage: string, Amount?: string, PropertiesJson?: string): HUBSPOT_DEAL") +@Name({ code: "en-US", content: "Create deal" }) +@DisplayMessage({ code: "en-US", content: "Create HubSpot deal ${Name}" }) +@Documentation({ code: "en-US", content: "Creates a new HubSpot deal in the given pipeline and stage. Amount and extra properties are optional." }) +@Description({ code: "en-US", content: "Creates a new HubSpot deal." }) +@Parameter({ runtimeName: "Name", name: [{ code: "en-US", content: "Name" }], description: [{ code: "en-US", content: "The deal name (dealname)." }] }) +@Parameter({ runtimeName: "Pipeline", name: [{ code: "en-US", content: "Pipeline" }], description: [{ code: "en-US", content: "The pipeline id the deal belongs to." }] }) +@Parameter({ runtimeName: "Stage", name: [{ code: "en-US", content: "Stage" }], description: [{ code: "en-US", content: "The deal stage id (dealstage)." }] }) +@Parameter({ runtimeName: "Amount", name: [{ code: "en-US", content: "Amount" }], description: [{ code: "en-US", content: "Optional deal amount." }], optional: true }) +@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional deal properties." }], optional: true }) +export class HubSpotCreateDealFunction { + async run(context: FunctionContext, Name: string, Pipeline: string, Stage: string, Amount?: string, PropertiesJson?: string): Promise { + try { + return await createDeal(Name, Pipeline, Stage, Amount, PropertiesJson, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_CREATING_HUBSPOT_DEAL", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts b/actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts new file mode 100644 index 0000000..3a9693d --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts @@ -0,0 +1,25 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { getContactByEmail } from "../helpers.js"; +import { HubSpotContact } from "../data_types/hubspotContact.js"; + +@Identifier("hubspotGetContactByEmail") +@DisplayIcon("simple:hubspot") +@Signature("(Email: string): HUBSPOT_CONTACT") +@Name({ code: "en-US", content: "Get contact by email" }) +@DisplayMessage({ code: "en-US", content: "Get HubSpot contact ${Email}" }) +@Documentation({ code: "en-US", content: "Looks up a single HubSpot contact by email using the CRM search API. Fails if no contact matches." }) +@Description({ code: "en-US", content: "Fetches a HubSpot contact by email." }) +@Parameter({ runtimeName: "Email", name: [{ code: "en-US", content: "Email" }], description: [{ code: "en-US", content: "The email address to look up." }] }) +export class HubSpotGetContactByEmailFunction { + async run(context: FunctionContext, Email: string): Promise { + try { + return await getContactByEmail(Email, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_SEARCHING_HUBSPOT_CONTACT", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts b/actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts new file mode 100644 index 0000000..a8a8c66 --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts @@ -0,0 +1,26 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { searchObjects } from "../helpers.js"; +import { HubSpotSearchResult } from "../data_types/hubspotSearchResult.js"; + +@Identifier("hubspotSearchObjects") +@DisplayIcon("simple:hubspot") +@Signature("(ObjectType: string, Query: string): HUBSPOT_SEARCH_RESULT") +@Name({ code: "en-US", content: "Search objects" }) +@DisplayMessage({ code: "en-US", content: "Search HubSpot ${ObjectType} for ${Query}" }) +@Documentation({ code: "en-US", content: "Runs a full-text search against a HubSpot CRM object type (e.g. contacts, deals, companies) and returns up to 25 matches." }) +@Description({ code: "en-US", content: "Searches HubSpot CRM objects." }) +@Parameter({ runtimeName: "ObjectType", name: [{ code: "en-US", content: "Object type" }], description: [{ code: "en-US", content: "The CRM object type to search (e.g. contacts, deals, companies)." }] }) +@Parameter({ runtimeName: "Query", name: [{ code: "en-US", content: "Query" }], description: [{ code: "en-US", content: "The free-text search query." }] }) +export class HubSpotSearchObjectsFunction { + async run(context: FunctionContext, ObjectType: string, Query: string): Promise { + try { + return await searchObjects(ObjectType, Query, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_SEARCHING_HUBSPOT_OBJECTS", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts new file mode 100644 index 0000000..75494f5 --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts @@ -0,0 +1,26 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { updateContact } from "../helpers.js"; +import { HubSpotContact } from "../data_types/hubspotContact.js"; + +@Identifier("hubspotUpdateContact") +@DisplayIcon("simple:hubspot") +@Signature("(ContactId: string, PropertiesJson: string): HUBSPOT_CONTACT") +@Name({ code: "en-US", content: "Update contact" }) +@DisplayMessage({ code: "en-US", content: "Update HubSpot contact ${ContactId}" }) +@Documentation({ code: "en-US", content: "Updates an existing HubSpot contact. Provide the properties to change as a JSON object string." }) +@Description({ code: "en-US", content: "Updates an existing HubSpot contact." }) +@Parameter({ runtimeName: "ContactId", name: [{ code: "en-US", content: "Contact id" }], description: [{ code: "en-US", content: "The HubSpot id of the contact to update." }] }) +@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "JSON object of HubSpot contact properties to set." }] }) +export class HubSpotUpdateContactFunction { + async run(context: FunctionContext, ContactId: string, PropertiesJson: string): Promise { + try { + return await updateContact(ContactId, PropertiesJson, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_UPDATING_HUBSPOT_CONTACT", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts new file mode 100644 index 0000000..1a55ced --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts @@ -0,0 +1,26 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { updateDeal } from "../helpers.js"; +import { HubSpotDeal } from "../data_types/hubspotDeal.js"; + +@Identifier("hubspotUpdateDeal") +@DisplayIcon("simple:hubspot") +@Signature("(DealId: string, PropertiesJson: string): HUBSPOT_DEAL") +@Name({ code: "en-US", content: "Update deal" }) +@DisplayMessage({ code: "en-US", content: "Update HubSpot deal ${DealId}" }) +@Documentation({ code: "en-US", content: "Updates an existing HubSpot deal. Provide the properties to change (e.g. dealstage, amount) as a JSON object string." }) +@Description({ code: "en-US", content: "Updates an existing HubSpot deal." }) +@Parameter({ runtimeName: "DealId", name: [{ code: "en-US", content: "Deal id" }], description: [{ code: "en-US", content: "The HubSpot id of the deal to update." }] }) +@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "JSON object of HubSpot deal properties to set." }] }) +export class HubSpotUpdateDealFunction { + async run(context: FunctionContext, DealId: string, PropertiesJson: string): Promise { + try { + return await updateDeal(DealId, PropertiesJson, context); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throw new RuntimeError("ERROR_UPDATING_HUBSPOT_DEAL", error instanceof Error ? error.message : "unknown error"); + } + } +} diff --git a/actions/hubspot-action/src/helpers.ts b/actions/hubspot-action/src/helpers.ts new file mode 100644 index 0000000..98e6868 --- /dev/null +++ b/actions/hubspot-action/src/helpers.ts @@ -0,0 +1,262 @@ +import { FunctionContext, RuntimeError } from "@code0-tech/hercules"; +import { Client } from "@hubspot/api-client"; +import { HubSpotContact, HubSpotContactSchema } from "./data_types/hubspotContact.js"; +import { HubSpotDeal, HubSpotDealSchema } from "./data_types/hubspotDeal.js"; +import { HubSpotCompany, HubSpotCompanySchema } from "./data_types/hubspotCompany.js"; +import { HubSpotNote, HubSpotNoteSchema } from "./data_types/hubspotNote.js"; +import { HubSpotSearchResult, HubSpotSearchResultSchema } from "./data_types/hubspotSearchResult.js"; + +/** + * Builds an authenticated HubSpot API client from the action config. Uses a + * private-app access token (Bearer) as configured on the action. + */ +export function getClient(context: FunctionContext): Client { + const accessToken = context.matchedConfig.findConfig("access_token") as string; + if (!accessToken) { + throw new RuntimeError( + "MISSING_HUBSPOT_ACCESS_TOKEN", + "A HubSpot access_token must be configured for this action." + ); + } + return new Client({ accessToken }); +} + +/** + * Parses a JSON object string into a flat HubSpot property map. HubSpot CRM + * properties are a dynamic bag of key/value pairs, so functions accept them as + * a JSON object string (e.g. `{"firstname":"Ada","lifecyclestage":"lead"}`) + * rather than a fixed set of typed parameters. Values are coerced to strings, + * which is what the HubSpot API expects. + */ +export function parseProperties( + json: string | undefined, + field = "properties" +): Record { + if (!json || json.trim() === "") return {}; + let parsed: unknown; + try { + parsed = JSON.parse(json); + } catch { + throw new RuntimeError( + "INVALID_HUBSPOT_PROPERTIES", + `The ${field} value must be a valid JSON object string.` + ); + } + if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { + throw new RuntimeError( + "INVALID_HUBSPOT_PROPERTIES", + `The ${field} value must be a JSON object of property name/value pairs.` + ); + } + const out: Record = {}; + for (const [key, value] of Object.entries(parsed as Record)) { + if (value === null || value === undefined) continue; + out[key] = typeof value === "string" ? value : String(value); + } + return out; +} + +/** + * Normalises the SDK's `SimplePublicObject` (Date timestamps, optional fields) + * into the plain shape expected by the zod object schemas. + */ +function toPlainObject(obj: { + id: string; + properties: { [key: string]: string | null } | Record; + createdAt?: Date; + updatedAt?: Date; + archived?: boolean; +}) { + return { + id: obj.id, + properties: obj.properties ?? {}, + createdAt: obj.createdAt ? new Date(obj.createdAt).toISOString() : null, + updatedAt: obj.updatedAt ? new Date(obj.updatedAt).toISOString() : null, + archived: obj.archived ?? null, + }; +} + +/** Maps a HubSpot SDK/ApiException error into a stable RuntimeError. */ +export function throwHubSpotError(error: unknown, code: string): never { + const anyErr = error as { code?: number; body?: unknown; message?: string }; + const status = anyErr?.code; + const detail = + (anyErr?.body && typeof anyErr.body === "object" + ? JSON.stringify(anyErr.body) + : anyErr?.message) ?? "unknown error"; + console.error("HubSpot API error:", status, detail); + throw new RuntimeError(code, `HubSpot API error ${status ?? ""}: ${detail}`); +} + +export async function createContact( + email: string, + propertiesJson: string | undefined, + context: FunctionContext +): Promise { + const client = getClient(context); + const properties = { email, ...parseProperties(propertiesJson) }; + try { + // `any` on the request payload only: the SDK's create input type is + // version-specific; the response is validated with zod below. + const res = await client.crm.contacts.basicApi.create({ properties, associations: [] } as any); + return HubSpotContactSchema.parse(toPlainObject(res)); + } catch (error) { + throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_CONTACT"); + } +} + +export async function updateContact( + contactId: string, + propertiesJson: string, + context: FunctionContext +): Promise { + const client = getClient(context); + const properties = parseProperties(propertiesJson); + try { + const res = await client.crm.contacts.basicApi.update(contactId, { properties } as any); + return HubSpotContactSchema.parse(toPlainObject(res)); + } catch (error) { + throwHubSpotError(error, "ERROR_UPDATING_HUBSPOT_CONTACT"); + } +} + +export async function getContactByEmail( + email: string, + context: FunctionContext +): Promise { + const client = getClient(context); + const searchRequest: any = { + filterGroups: [{ filters: [{ propertyName: "email", operator: "EQ", value: email }] }], + properties: ["email", "firstname", "lastname", "lifecyclestage"], + limit: 1, + }; + try { + const res = await client.crm.contacts.searchApi.doSearch(searchRequest); + const first = res.results?.[0]; + if (!first) { + throw new RuntimeError( + "HUBSPOT_CONTACT_NOT_FOUND", + `No HubSpot contact found with email ${email}.` + ); + } + return HubSpotContactSchema.parse(toPlainObject(first)); + } catch (error) { + if (error instanceof RuntimeError) throw error; + throwHubSpotError(error, "ERROR_SEARCHING_HUBSPOT_CONTACT"); + } +} + +export async function createDeal( + name: string, + pipeline: string, + stage: string, + amount: string | undefined, + propertiesJson: string | undefined, + context: FunctionContext +): Promise { + const client = getClient(context); + const properties: Record = { + dealname: name, + pipeline, + dealstage: stage, + ...(amount ? { amount } : {}), + ...parseProperties(propertiesJson), + }; + try { + const res = await client.crm.deals.basicApi.create({ properties, associations: [] } as any); + return HubSpotDealSchema.parse(toPlainObject(res)); + } catch (error) { + throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_DEAL"); + } +} + +export async function updateDeal( + dealId: string, + propertiesJson: string, + context: FunctionContext +): Promise { + const client = getClient(context); + const properties = parseProperties(propertiesJson); + try { + const res = await client.crm.deals.basicApi.update(dealId, { properties } as any); + return HubSpotDealSchema.parse(toPlainObject(res)); + } catch (error) { + throwHubSpotError(error, "ERROR_UPDATING_HUBSPOT_DEAL"); + } +} + +export async function createCompany( + name: string, + propertiesJson: string | undefined, + context: FunctionContext +): Promise { + const client = getClient(context); + const properties = { name, ...parseProperties(propertiesJson) }; + try { + const res = await client.crm.companies.basicApi.create({ properties, associations: [] } as any); + return HubSpotCompanySchema.parse(toPlainObject(res)); + } catch (error) { + throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_COMPANY"); + } +} + +export async function addNote( + body: string, + propertiesJson: string | undefined, + context: FunctionContext +): Promise { + const client = getClient(context); + const properties: Record = { + hs_note_body: body, + hs_timestamp: new Date().toISOString(), + ...parseProperties(propertiesJson), + }; + try { + const res = await client.crm.objects.notes.basicApi.create({ properties, associations: [] } as any); + return HubSpotNoteSchema.parse(toPlainObject(res)); + } catch (error) { + throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_NOTE"); + } +} + +export async function associate( + fromObjectType: string, + fromId: string, + toObjectType: string, + toId: string, + context: FunctionContext +): Promise { + const client = getClient(context); + try { + // Uses the default association between the two object types (v4 + // associations API), which avoids hard-coding version-specific + // association type ids. + await client.crm.associations.v4.basicApi.createDefault( + fromObjectType, + fromId, + toObjectType, + toId + ); + return true; + } catch (error) { + throwHubSpotError(error, "ERROR_ASSOCIATING_HUBSPOT_OBJECTS"); + } +} + +export async function searchObjects( + objectType: string, + query: string, + context: FunctionContext +): Promise { + const client = getClient(context); + const searchRequest: any = { query, limit: 25 }; + try { + const res = await client.crm.objects.searchApi.doSearch(objectType, searchRequest); + return HubSpotSearchResultSchema.parse({ + total: res.total ?? res.results?.length ?? 0, + results: (res.results ?? []).map((r: any) => toPlainObject(r)), + }); + } catch (error) { + throwHubSpotError(error, "ERROR_SEARCHING_HUBSPOT_OBJECTS"); + } +} diff --git a/actions/hubspot-action/src/index.ts b/actions/hubspot-action/src/index.ts new file mode 100644 index 0000000..1935206 --- /dev/null +++ b/actions/hubspot-action/src/index.ts @@ -0,0 +1,106 @@ +import "reflect-metadata"; +import { Action, CodeZeroEvent } from "@code0-tech/hercules"; + +import { HubSpotContactDataType } from "./data_types/hubspotContact.js"; +import { HubSpotDealDataType } from "./data_types/hubspotDeal.js"; +import { HubSpotCompanyDataType } from "./data_types/hubspotCompany.js"; +import { HubSpotNoteDataType } from "./data_types/hubspotNote.js"; +import { HubSpotSearchResultDataType } from "./data_types/hubspotSearchResult.js"; +import { HubSpotWebhookEventDataType } from "./data_types/hubspotWebhookEvent.js"; + +import { HubSpotContactCreatedWebhook } from "./events/hubspotContactCreatedWebhook.js"; +import { HubSpotDealCreatedWebhook } from "./events/hubspotDealCreatedWebhook.js"; +import { HubSpotDealStageChangedWebhook } from "./events/hubspotDealStageChangedWebhook.js"; +import { HubSpotFormSubmittedWebhook } from "./events/hubspotFormSubmittedWebhook.js"; + +import { HubSpotCreateContactFunction } from "./functions/hubspotCreateContactFunction.js"; +import { HubSpotUpdateContactFunction } from "./functions/hubspotUpdateContactFunction.js"; +import { HubSpotGetContactByEmailFunction } from "./functions/hubspotGetContactByEmailFunction.js"; +import { HubSpotCreateDealFunction } from "./functions/hubspotCreateDealFunction.js"; +import { HubSpotUpdateDealFunction } from "./functions/hubspotUpdateDealFunction.js"; +import { HubSpotCreateCompanyFunction } from "./functions/hubspotCreateCompanyFunction.js"; +import { HubSpotAddNoteFunction } from "./functions/hubspotAddNoteFunction.js"; +import { HubSpotAssociateFunction } from "./functions/hubspotAssociateFunction.js"; +import { HubSpotSearchObjectsFunction } from "./functions/hubspotSearchObjectsFunction.js"; + +const action = new Action( + process.env.ACTION_ID ?? "hubspot-action", + process.env.VERSION ?? "1.0.0", + process.env.AQUILA_URL ?? "127.0.0.1:8081", + "code0-tech", + "simple:hubspot", + "HubSpot CRM integration: react to contact/deal/company webhooks and create, update, search, associate, and annotate CRM records via the HubSpot CRM v3 API.", + [{ code: "en-US", content: "HubSpot" }], + [ + { + identifier: "access_token", + type: "TEXT", + name: [{ code: "en-US", content: "Access token" }], + description: [{ code: "en-US", content: "Private-app access token (Bearer) used to authenticate with the HubSpot CRM API." }], + linkedDataTypes: ["TEXT"], + }, + { + identifier: "app_id", + type: "TEXT", + defaultValue: "", + name: [{ code: "en-US", content: "App id" }], + description: [{ code: "en-US", content: "Optional HubSpot app id, used when managing webhook subscriptions." }], + linkedDataTypes: ["TEXT"], + }, + { + identifier: "client_secret", + type: "TEXT", + defaultValue: "", + name: [{ code: "en-US", content: "Client secret" }], + description: [{ code: "en-US", content: "Optional HubSpot app client secret, used to validate the X-HubSpot-Signature on inbound webhooks." }], + linkedDataTypes: ["TEXT"], + }, + ] +); + +action.registerDataTypeClass(HubSpotContactDataType); +action.registerDataTypeClass(HubSpotDealDataType); +action.registerDataTypeClass(HubSpotCompanyDataType); +action.registerDataTypeClass(HubSpotNoteDataType); +action.registerDataTypeClass(HubSpotSearchResultDataType); +action.registerDataTypeClass(HubSpotWebhookEventDataType); + +action.registerEventClass(HubSpotContactCreatedWebhook); +action.registerEventClass(HubSpotDealCreatedWebhook); +action.registerEventClass(HubSpotDealStageChangedWebhook); +action.registerEventClass(HubSpotFormSubmittedWebhook); + +action.registerRuntimeFunction(HubSpotCreateContactFunction); +action.registerRuntimeFunction(HubSpotUpdateContactFunction); +action.registerRuntimeFunction(HubSpotGetContactByEmailFunction); +action.registerRuntimeFunction(HubSpotCreateDealFunction); +action.registerRuntimeFunction(HubSpotUpdateDealFunction); +action.registerRuntimeFunction(HubSpotCreateCompanyFunction); +action.registerRuntimeFunction(HubSpotAddNoteFunction); +action.registerRuntimeFunction(HubSpotAssociateFunction); +action.registerRuntimeFunction(HubSpotSearchObjectsFunction); + +action.on(CodeZeroEvent.connected, () => { + console.log("Connected to aquila"); +}); + +action.on(CodeZeroEvent.error, (error: Error) => { + console.error("Stream error:", error.message); + console.log("Attempting to reconnect in 5s..."); + setTimeout(() => { + action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((err: Error) => { + action.emit(CodeZeroEvent.error, err); + }); + }, 5000); +}); + +action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((err: Error) => { + action.emit(CodeZeroEvent.error, err); +}); + +action.on(CodeZeroEvent.moduleUpdated, (message: any) => { + console.dir(message, { depth: null }); + console.dir(action.configs.values(), { depth: null }); +}); + +export { action }; diff --git a/actions/hubspot-action/test/index.test.ts b/actions/hubspot-action/test/index.test.ts new file mode 100644 index 0000000..def1252 --- /dev/null +++ b/actions/hubspot-action/test/index.test.ts @@ -0,0 +1,71 @@ +import "reflect-metadata"; +import { describe, expect, it } from "vitest"; +import { HubSpotContactSchema } from "../src/data_types/hubspotContact.js"; +import { HubSpotSearchResultSchema } from "../src/data_types/hubspotSearchResult.js"; +import { HubSpotWebhookEventSchema } from "../src/data_types/hubspotWebhookEvent.js"; +import { parseProperties } from "../src/helpers.js"; + +describe("HubSpotContactSchema", () => { + it("parses a representative HubSpot object response", () => { + const response = { + id: "512", + properties: { email: "ada@example.com", firstname: "Ada", lastname: null }, + createdAt: "2026-07-23T12:00:00.000Z", + updatedAt: "2026-07-23T12:05:00.000Z", + archived: false, + }; + const parsed = HubSpotContactSchema.parse(response); + expect(parsed.id).toEqual("512"); + expect(parsed.properties.email).toEqual("ada@example.com"); + expect(parsed.properties.lastname).toBeNull(); + }); + + it("rejects an object without an id", () => { + expect(() => HubSpotContactSchema.parse({ properties: {} })).toThrow(); + }); +}); + +describe("HubSpotSearchResultSchema", () => { + it("parses a search result with a total and results array", () => { + const parsed = HubSpotSearchResultSchema.parse({ + total: 1, + results: [{ id: "1", properties: { name: "Acme" } }], + }); + expect(parsed.total).toEqual(1); + expect(parsed.results).toHaveLength(1); + }); +}); + +describe("HubSpotWebhookEventSchema", () => { + it("parses a property-change webhook event", () => { + const parsed = HubSpotWebhookEventSchema.parse({ + objectId: 123, + subscriptionType: "deal.propertyChange", + propertyName: "dealstage", + propertyValue: "closedwon", + }); + expect(parsed.propertyName).toEqual("dealstage"); + }); +}); + +describe("parseProperties", () => { + it("returns an empty object for empty input", () => { + expect(parseProperties(undefined)).toEqual({}); + expect(parseProperties("")).toEqual({}); + }); + + it("parses a JSON object and stringifies values", () => { + expect(parseProperties('{"firstname":"Ada","amount":42}')).toEqual({ + firstname: "Ada", + amount: "42", + }); + }); + + it("throws on invalid JSON", () => { + expect(() => parseProperties("not json")).toThrow(); + }); + + it("throws when JSON is not an object", () => { + expect(() => parseProperties("[1,2,3]")).toThrow(); + }); +}); diff --git a/actions/hubspot-action/tsconfig.json b/actions/hubspot-action/tsconfig.json new file mode 100644 index 0000000..65d780f --- /dev/null +++ b/actions/hubspot-action/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "Bundler", + "declaration": true, + "outDir": "dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "allowImportingTsExtensions": true, + "noEmit": true, + "baseUrl": ".", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "types": ["node", "vite/client"] + }, + "include": [ + "src/**/*", + "test/**/*", + "vite.config.ts" + ] +} diff --git a/actions/hubspot-action/vite.config.ts b/actions/hubspot-action/vite.config.ts new file mode 100644 index 0000000..5790d9b --- /dev/null +++ b/actions/hubspot-action/vite.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vite'; +import { resolve } from 'path'; + +export default defineConfig({ + build: { + target: "node18", + ssr: resolve(__dirname, 'src/index.ts'), + rollupOptions: { + external: (id) => + [ + 'fs', + 'path', + 'typescript', + '@code0-tech/hercules', + '@hubspot/api-client' + ].includes(id) || id.startsWith('node:') || id.startsWith('@hubspot/') + } + } +}); From e669e0cbf7951c0872b9c82b2132fc41b8dcac30 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 1 Nov 2026 18:40:30 +0100 Subject: [PATCH 2/6] fix: add missing package-lock.json for hubspot-action CI runs `npm ci` which requires a committed lockfile; it was absent so the test-node job failed. Co-Authored-By: Claude Opus 4.8 --- actions/hubspot-action/package-lock.json | 3657 ++++++++++++++++++++++ 1 file changed, 3657 insertions(+) create mode 100644 actions/hubspot-action/package-lock.json diff --git a/actions/hubspot-action/package-lock.json b/actions/hubspot-action/package-lock.json new file mode 100644 index 0000000..8ea2695 --- /dev/null +++ b/actions/hubspot-action/package-lock.json @@ -0,0 +1,3657 @@ +{ + "name": "@code0-tech/hubspot-action", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@code0-tech/hubspot-action", + "version": "1.0.0", + "dependencies": { + "@code0-tech/hercules": "^1.1.1", + "@hubspot/api-client": "^14.0.0" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "vite": "^8.0.3", + "vitest": "^4.1.10" + } + }, + "node_modules/@clack/core": { + "version": "1.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.0.0-alpha.4.tgz", + "integrity": "sha512-VCtU+vjyKPMSakVrB9q1bOnXN7QW/w4+YQDQCOF59GrzydW+169i0fVx/qzRRXJgt8KGj/pZZ/JxXroFZIDByg==", + "license": "MIT", + "peer": true, + "dependencies": { + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@clack/prompts": { + "version": "1.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.0.0-alpha.4.tgz", + "integrity": "sha512-KnmtDF2xQGoI5AlBme9akHtvCRV0RKAARUXHBQO2tMwnY8B08/4zPWigT7uLK25UPrMCEqnyQPkKRjNdhPbf8g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/core": "1.0.0-alpha.4", + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@code0-tech/hercules": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.7.2.tgz", + "integrity": "sha512-xRfolLdKOWC+oiNa7XRo8EeQSylwgq6XkcLhB0YocU8XeEc7qSaHWKJSNnhIDLOmAZzpa7OmpxZj6YFeweUqJg==", + "license": "ISC", + "bin": { + "hercules": "bin/hercules.js" + }, + "peerDependencies": { + "@code0-tech/tucana": "0.0.83", + "@grpc/grpc-js": "^1.14.3", + "@protobuf-ts/grpc-backend": "^2.11.1", + "@protobuf-ts/grpc-transport": "^2.11.1", + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "reflect-metadata": "^0.2.2", + "ts-morph": "^28.0.0", + "ts-to-zod": "^5.1.0", + "zod": "^4.4.3", + "zod-to-ts": "^2.1.0" + } + }, + "node_modules/@code0-tech/tucana": { + "version": "0.0.83", + "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.83.tgz", + "integrity": "sha512-scBOjgf3oIQF8pUlskqPHqfzPvgCJgG1+/tt9RAKWZ1IdCdSqTRG768uEVeTjpuryiGRiO0p8r4bCXNEQNRtRg==", + "license": "MIT", + "peer": true + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.7.tgz", + "integrity": "sha512-W4W/fcBMGRVtG6dW2c7cw2mnpS3hvbBd+oQXjh2iYFTZDk1JJmcNqkM5KSaPubQpamlUUurrlb7G1s9NJeERmQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.1.tgz", + "integrity": "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@hubspot/api-client": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@hubspot/api-client/-/api-client-14.1.2.tgz", + "integrity": "sha512-yJVxaKDL3whPKiwca8WywVBL12DurGz1kNQYmmlF7ED/M+Q82T7PqKWmI2YHFHppkS6AjyOZ6k38A9K7GSRmKw==", + "license": "ISC", + "dependencies": { + "@types/node": "*", + "bottleneck": "^2.19.5", + "es6-promise": "^4.2.4", + "form-data": "^4.0.6", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@oclif/core": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.14.0.tgz", + "integrity": "sha512-QCJIZoVJxV7jywgVAUlsQwl3dr3Sa21kfi5z9KrYolbexWJUtFSEtMoNiBWojD05mYycLnB50gp/VxlGdaOCRA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^4.3.2", + "ansis": "^3.17.0", + "clean-stack": "^3.0.1", + "cli-spinners": "^2.9.2", + "debug": "^4.4.3", + "ejs": "^6", + "get-package-type": "^0.1.0", + "indent-string": "^4.0.0", + "lilconfig": "^3.1.3", + "minimatch": "^10.2.5", + "semver": "^7.8.1", + "string-width": "^4.2.3", + "supports-color": "^8", + "tinyglobby": "^0.2.17", + "widest-line": "^3.1.0", + "wordwrap": "^1.0.0", + "wrap-ansi": "^7.0.0", + "wsl-utils": "^0.4.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@protobuf-ts/grpc-backend": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-backend/-/grpc-backend-2.11.1.tgz", + "integrity": "sha512-llAkJ03SlR/+p70YBTMOAQqdkXWghsTWwlPuGXC+Hj99hDQq6fa2CoVePPqbcn7A7/aLBcPG/9Ag3yqlltldxw==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.8.22" + } + }, + "node_modules/@protobuf-ts/grpc-transport": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-transport/-/grpc-transport-2.11.1.tgz", + "integrity": "sha512-l6wrcFffY+tuNnuyrNCkRM8hDIsAZVLA8Mn7PKdVyYxITosYh60qW663p9kL6TWXYuDCL3oxH8ih3vLKTDyhtg==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.6.0" + } + }, + "node_modules/@protobuf-ts/runtime": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz", + "integrity": "sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==", + "license": "(Apache-2.0 AND BSD-3-Clause)", + "peer": true + }, + "node_modules/@protobuf-ts/runtime-rpc": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.11.1.tgz", + "integrity": "sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", + "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz", + "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz", + "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz", + "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.16.tgz", + "integrity": "sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.16.tgz", + "integrity": "sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.16.tgz", + "integrity": "sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.16.tgz", + "integrity": "sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.16.tgz", + "integrity": "sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.16.tgz", + "integrity": "sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.16.tgz", + "integrity": "sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.16.tgz", + "integrity": "sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.16.tgz", + "integrity": "sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.16.tgz", + "integrity": "sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.16.tgz", + "integrity": "sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.16.tgz", + "integrity": "sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.16.tgz", + "integrity": "sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.16.tgz", + "integrity": "sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.16.tgz", + "integrity": "sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@ts-morph/common": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.29.0.tgz", + "integrity": "sha512-35oUmphHbJvQ/+UTwFNme/t2p3FoKiGJ5auTjjpNTop2dyREspirjMy82PLSC1pnDJ8ah1GU98hwpVt64YXQsg==", + "license": "MIT", + "peer": true, + "dependencies": { + "minimatch": "^10.0.1", + "path-browserify": "^1.0.1", + "tinyglobby": "^0.2.14" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@typescript/vfs": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.5.tgz", + "integrity": "sha512-gobLHQLmvQGJInFk31NvgMd1uYzRXsd8qgnOssyLD055R2QPnw1ubRbBQ4+T+5qC7IQVuYXdvNDE2G7tMDVHgw==", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.4.3" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/@vitest/expect": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.12.tgz", + "integrity": "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.12.tgz", + "integrity": "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.12", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.12.tgz", + "integrity": "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.12.tgz", + "integrity": "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.12", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.12.tgz", + "integrity": "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.12", + "@vitest/utils": "4.1.12", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.12.tgz", + "integrity": "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.12.tgz", + "integrity": "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.12", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.5.0.tgz", + "integrity": "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ansis": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/ansis/-/ansis-3.17.0.tgz", + "integrity": "sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "peer": true, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clean-stack": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "license": "MIT", + "peer": true, + "dependencies": { + "escape-string-regexp": "4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "license": "MIT", + "peer": true, + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", + "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", + "license": "MIT", + "peer": true, + "dependencies": { + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.3.0.tgz", + "integrity": "sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/code-block-writer": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", + "license": "MIT", + "peer": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT", + "peer": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "license": "MIT", + "peer": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ejs": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-6.0.1.tgz", + "integrity": "sha512-UaaM14yby8U3k02ihS1Bmj5Kz2d7CCQM1scxpgs4Mhkq8F1wR2gl3+Ts4h5Ne4Mnt7M9m4Dw7jsuMr3+xO4vZA==", + "license": "Apache-2.0", + "peer": true, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.12.18" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", + "peer": true + }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT", + "peer": true + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "peer": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.7.0.tgz", + "integrity": "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", + "peer": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lilconfig": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.4.tgz", + "integrity": "sha512-zJZyBmQhArDRefuWTypZxwDpFDIYmrj8ypSBvwGD5P13Y95s6DjzKgu4DVdGbeQa5PDEsAOCAPNk4X+QOR006w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/listr2": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz", + "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==", + "license": "MIT", + "peer": true, + "dependencies": { + "cli-truncate": "^5.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT", + "peer": true + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT", + "peer": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", + "license": "MIT", + "peer": true, + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT", + "peer": true + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "license": "BlueOak-1.0.0", + "peer": true, + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "peer": true + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/obug": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", + "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "license": "MIT", + "peer": true + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz", + "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/powershell-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz", + "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/protobufjs": { + "version": "7.6.6", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.6.tgz", + "integrity": "sha512-dYDWdjSl5RNb7SgPxGQcRU+GtvP7s2fpkrY0r432PcOIaZ0/rBcxEZnQN67iJhFuQiVw754JDoPruPCNdGsbjg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.1", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "license": "MIT", + "peer": true, + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT", + "peer": true + }, + "node_modules/rolldown": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.16.tgz", + "integrity": "sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.16", + "@rolldown/binding-android-arm64": "1.2.16", + "@rolldown/binding-darwin-arm64": "1.2.16", + "@rolldown/binding-darwin-x64": "1.2.16", + "@rolldown/binding-freebsd-x64": "1.2.16", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.16", + "@rolldown/binding-linux-arm64-gnu": "1.2.16", + "@rolldown/binding-linux-arm64-musl": "1.2.16", + "@rolldown/binding-linux-ppc64-gnu": "1.2.16", + "@rolldown/binding-linux-s390x-gnu": "1.2.16", + "@rolldown/binding-linux-x64-gnu": "1.2.16", + "@rolldown/binding-linux-x64-musl": "1.2.16", + "@rolldown/binding-openharmony-arm64": "1.2.16", + "@rolldown/binding-win32-arm64-msvc": "1.2.16", + "@rolldown/binding-win32-x64-msvc": "1.2.16" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT", + "peer": true + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/slice-ansi": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", + "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/text-camel-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-camel-case/-/text-camel-case-1.2.11.tgz", + "integrity": "sha512-2ZsM/gOlB1tyza+8lGLvs6gtPuZ9qEYuKPa+gwo38m65wkY4k323SK4hT7ku8r5wIKyspUYIWSk1aB9/Jjxr7A==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-pascal-case": "^1.2.11" + } + }, + "node_modules/text-capital-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-capital-case/-/text-capital-case-1.2.11.tgz", + "integrity": "sha512-30A7B7+VUvevEmPE0xWK1Z2z0ncl/JTjSUBLfjpoXrkwuPpmNTVbjHShRTN3cX9GIuZn/P3jvR+TO9JiTZcl8A==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-case/-/text-case-1.2.11.tgz", + "integrity": "sha512-LbdWNQeuXWbfav+pxBxvaefkziffMYeSA53BHp52cgJa9rjiC0dkjum9AKrH8iQWoQJ4InGPSGexLeerGFaZ1Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-camel-case": "^1.2.11", + "text-capital-case": "^1.2.11", + "text-constant-case": "^1.2.11", + "text-dot-case": "^1.2.11", + "text-header-case": "^1.2.11", + "text-is-lower-case": "^1.2.11", + "text-is-upper-case": "^1.2.11", + "text-kebab-case": "^1.2.11", + "text-lower-case": "^1.2.11", + "text-lower-case-first": "^1.2.11", + "text-no-case": "^1.2.11", + "text-param-case": "^1.2.11", + "text-pascal-case": "^1.2.11", + "text-path-case": "^1.2.11", + "text-sentence-case": "^1.2.11", + "text-snake-case": "^1.2.11", + "text-swap-case": "^1.2.11", + "text-title-case": "^1.2.11", + "text-upper-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-constant-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-constant-case/-/text-constant-case-1.2.11.tgz", + "integrity": "sha512-XnTBILsa7UpMWncUCchqIybZlg15FUcrlyNaWIJ8ybPy54qcoN513EXFswueyizuAgyJFXPCwwSFbSji6kw/Uw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case": "^1.2.11" + } + }, + "node_modules/text-dot-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-dot-case/-/text-dot-case-1.2.11.tgz", + "integrity": "sha512-7SLKiT45KZO0qad0+p+GvC0+F+6pZ851HJcTcBJiSF88HsK/e1qErlGLtVBT6hkTHIaAj48WfSyQr4lZRv1xJQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-header-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-header-case/-/text-header-case-1.2.11.tgz", + "integrity": "sha512-7OBHd2g7X+aH6rXMC3cANFh6yvhXjXkyumw2NaRwJRIk343pP2e1SQCTCfowPDmmi8wkZVqz1fdWNq5LwvcBOQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-capital-case": "^1.2.11" + } + }, + "node_modules/text-is-lower-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-is-lower-case/-/text-is-lower-case-1.2.11.tgz", + "integrity": "sha512-dBqPAkNmX7eTM7ZbS3D/UBCQ5i9EXt5tujF2wIGGbZ1+aN8bY7Qda4mDpxgd6Hbzf/z10uQWRNzupl99wFQ8CQ==", + "license": "MIT", + "peer": true + }, + "node_modules/text-is-upper-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-is-upper-case/-/text-is-upper-case-1.2.11.tgz", + "integrity": "sha512-MZeUIYEYfKZ2FSeg0vnHCH4mHXLgGzes+iz2K+4BYnhnkEa2svKA1nNjQAqTUiVNHOPqPCuzmUr1LsyQZ73uyA==", + "license": "MIT", + "peer": true + }, + "node_modules/text-kebab-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-kebab-case/-/text-kebab-case-1.2.11.tgz", + "integrity": "sha512-RIg9iN6VwH+JrX9dFdm1nd1efPGR9LjNc0CiQz496sQETeKGkDEzxES/ZzxbkerrAL2DFEMGdLXckzDz1OEDBQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-lower-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-lower-case/-/text-lower-case-1.2.11.tgz", + "integrity": "sha512-txTy6y0y8M23Lhf0mk8WcvXTqlf4OQ3AGnDsRB6o3uMNfIa0CJDol2s1PdKNa63rt5B2277zkZCCn6Xeq//big==", + "license": "MIT", + "peer": true + }, + "node_modules/text-lower-case-first": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-lower-case-first/-/text-lower-case-first-1.2.11.tgz", + "integrity": "sha512-QR483XLyuyIpq8tKu1ds3Q1jfsgfaa/p9rtoQKHe6Rv5ah9ic/SUzTGN0MQ7UIS9APADd8SUPn5TTh1Z2/ACyg==", + "license": "MIT", + "peer": true + }, + "node_modules/text-no-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-no-case/-/text-no-case-1.2.11.tgz", + "integrity": "sha512-wazS7FEq0Ct3aJzeE8MEMcSs0eW4+/X/fwdotv/rG66bLS+g1T0pa0gUsbBGjjLFs191AIXVIry+bYE0uaaBBQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-lower-case": "^1.2.11" + } + }, + "node_modules/text-param-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-param-case/-/text-param-case-1.2.11.tgz", + "integrity": "sha512-3EMMAMLSz/mJXOnATNnrS+dZAvghpq09VhOVYDOkUnbm5zlYc6iU5AZOKVDpiAVVllQ9P1h5IKVZzsEYrdIRGw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-pascal-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-pascal-case/-/text-pascal-case-1.2.11.tgz", + "integrity": "sha512-BNhQ1O/g/Q4dH5gPyLIJLDLDknl2dipBwV629ScsiZCKJaCLGXYhTXp23rp9Htg3O5OSSsiU3mqDKq+pBmwTSw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-path-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-path-case/-/text-path-case-1.2.11.tgz", + "integrity": "sha512-FsJU4BmMdtLtmnBK/XRJPqTwLF8yFiTEClHjxlQjSAG5Xt9R4p6D1WNaM1CI2dG5Lr4rsFM4jiVC620m0AsRbw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-sentence-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-sentence-case/-/text-sentence-case-1.2.11.tgz", + "integrity": "sha512-ApiVsvdLy+Wb8x7mZRVuoy8VO12jJ22G2djVM3ZZbUhXVIkqGgHxmiXRwdhRPoWGojK9n53m7jviJgBVNdRn+g==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-snake-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-snake-case/-/text-snake-case-1.2.11.tgz", + "integrity": "sha512-NOEQvjyyVABB41SS8dUx423Y6hWS+Z4TrAAJg1xzCkOD3q9y0JtdJjCvCA1FWI8oDu+HiIOp/N446uDM8j54XQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-swap-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-swap-case/-/text-swap-case-1.2.11.tgz", + "integrity": "sha512-PBmC5xvZdDZ4suikydpeXH0s4JV2XHelMj9/OEXEbA3oLpdV2A+B4BspVDWVw7C2Gi5eCareqk/7EE8I1/WwgQ==", + "license": "MIT", + "peer": true + }, + "node_modules/text-title-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-title-case/-/text-title-case-1.2.11.tgz", + "integrity": "sha512-V1GZy0XlqdkYUQm0tqm1jqtYlXJqFVMreBCTUReOaz8d/JbozTSpZrcakIeV8+1bN7LsvfhPFhA5zREiax6YIA==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-upper-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-upper-case/-/text-upper-case-1.2.11.tgz", + "integrity": "sha512-BfTL7yB1YIRlVGNdZUvno013hOq2cRs07fDR2ApppOXRDuKrEmsLDEY82xXlDzQHELp0jexqkI+NeyPIl6MtMw==", + "license": "MIT", + "peer": true + }, + "node_modules/text-upper-case-first": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-upper-case-first/-/text-upper-case-first-1.2.11.tgz", + "integrity": "sha512-vgfbwKo8TEJbRsapR9LWWvIJRnv8u9aXVa6cyYOAQQmurCx54Cnt59x5fKdiq+hFaBJ51AbzCgMpbP3p65/pHQ==", + "license": "MIT", + "peer": true + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyrainbow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ts-morph": { + "version": "28.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-28.0.0.tgz", + "integrity": "sha512-Wp3tnZ2bzwxyTZMtgWVzXDfm7lB1Drz+y9DmmYH/L702PQhPyVrp3pkou3yIz4qjS14GY9kcpmLiOOMvl8oG1g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@ts-morph/common": "~0.29.0", + "code-block-writer": "^13.0.3" + } + }, + "node_modules/ts-to-zod": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-5.1.0.tgz", + "integrity": "sha512-giqqlvRHunlJqG9tBL/KAO3wWIVZGF//mZiWLKm/fdQnKnz4EN2mtiK5cugN9slytBkdMEXQIaLvMzIScbhhFw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/prompts": "1.0.0-alpha.4", + "@oclif/core": "^4.5.4", + "@typescript/vfs": "^1.5.0", + "chokidar": "^4.0.3", + "listr2": "^9.0.4", + "slash": "^5.1.0", + "text-case": "^1.2.4", + "tslib": "^2.3.1", + "tsutils": "^3.21.0", + "typescript": "^5.2.2", + "zod": "^4.1.5" + }, + "bin": { + "ts-to-zod": "bin/run" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "license": "0BSD", + "peer": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD", + "peer": true + }, + "node_modules/tsx": { + "version": "4.23.15", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", + "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz", + "integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.30", + "rolldown": "~1.2.14", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.12.tgz", + "integrity": "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.12", + "@vitest/mocker": "4.1.12", + "@vitest/pretty-format": "4.1.12", + "@vitest/runner": "4.1.12", + "@vitest/snapshot": "4.1.12", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.12", + "@vitest/browser-preview": "4.1.12", + "@vitest/browser-webdriverio": "^4.1.11", + "@vitest/coverage-istanbul": "4.1.12", + "@vitest/coverage-v8": "4.1.12", + "@vitest/ui": "4.1.12", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "license": "MIT", + "peer": true, + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "license": "MIT", + "peer": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wsl-utils": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.4.0.tgz", + "integrity": "sha512-9YmF+2sFEd+T7TkwlmE337F0IVzfDvDknhtpBQxxXzEOfgPphGlFYpyx0cTuCIFj8/p+sqwBYAeGxOMNSzPPDA==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-wsl": "^3.1.0", + "powershell-utils": "^0.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "license": "MIT", + "peer": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-ts": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-2.1.0.tgz", + "integrity": "sha512-jZP1GokTqR99FLmtGU+B9acjD9u/R++b++Vxe1sWpBQDd82/9/j5LyLZZ7/Oy3h2nxcz5NihikgX4D0hhdu3+g==", + "license": "MIT", + "peer": true, + "peerDependencies": { + "typescript": "^5 || ^6", + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} From 941d22cede5cd2294305dd536c9c7bf9da0115d7 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Fri, 27 Nov 2026 20:30:29 +0100 Subject: [PATCH 3/6] feat(hubspot-action): complete HubSpot action per #41 --- actions/hubspot-action/Dockerfile | 8 +- actions/hubspot-action/README.md | 109 ++++-- actions/hubspot-action/manifest.json | 13 + actions/hubspot-action/package-lock.json | 29 +- actions/hubspot-action/package.json | 9 +- .../src/data_types/hubspotAssociation.ts | 22 ++ .../hubspotCompanyCreatedWebhookPayload.ts | 21 ++ .../hubspotContactCreatedWebhookPayload.ts | 21 ++ ...potContactPropertyChangedWebhookPayload.ts | 22 ++ .../hubspotDealCreatedWebhookPayload.ts | 21 ++ .../hubspotDealStageChangedWebhookPayload.ts | 22 ++ .../hubspotFormSubmittedWebhookPayload.ts | 33 ++ .../src/data_types/hubspotPropertyMap.ts | 15 + .../src/data_types/hubspotSearchFilter.ts | 28 ++ .../src/data_types/hubspotWebhookEvent.ts | 8 +- .../events/hubspotCompanyCreatedWebhook.ts | 23 ++ .../events/hubspotContactCreatedWebhook.ts | 8 +- .../hubspotContactPropertyChangedWebhook.ts | 23 ++ .../src/events/hubspotDealCreatedWebhook.ts | 8 +- .../events/hubspotDealStageChangedWebhook.ts | 8 +- .../src/events/hubspotFormSubmittedWebhook.ts | 10 +- .../src/functions/hubspotAddNoteFunction.ts | 19 +- .../src/functions/hubspotAssociateFunction.ts | 11 +- .../functions/hubspotCreateCompanyFunction.ts | 13 +- .../functions/hubspotCreateContactFunction.ts | 13 +- .../functions/hubspotCreateDealFunction.ts | 11 +- .../hubspotGetContactByEmailFunction.ts | 7 +- .../functions/hubspotSearchObjectsFunction.ts | 17 +- .../functions/hubspotUpdateContactFunction.ts | 13 +- .../functions/hubspotUpdateDealFunction.ts | 13 +- .../hubspotVerifyWebhookSignatureFunction.ts | 31 ++ .../hubspotCreateAssociationTypeFunction.ts | 30 ++ .../utils/hubspotCreatePropertyMapFunction.ts | 21 ++ .../hubspotCreateSearchFilterFunction.ts | 44 +++ actions/hubspot-action/src/helpers.ts | 338 ++++++++++++++---- actions/hubspot-action/src/index.ts | 59 +-- actions/hubspot-action/test/helpers.test.ts | 114 ++++++ 37 files changed, 988 insertions(+), 227 deletions(-) create mode 100644 actions/hubspot-action/manifest.json create mode 100644 actions/hubspot-action/src/data_types/hubspotAssociation.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotCompanyCreatedWebhookPayload.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotContactCreatedWebhookPayload.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotContactPropertyChangedWebhookPayload.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotDealCreatedWebhookPayload.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotDealStageChangedWebhookPayload.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotFormSubmittedWebhookPayload.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotPropertyMap.ts create mode 100644 actions/hubspot-action/src/data_types/hubspotSearchFilter.ts create mode 100644 actions/hubspot-action/src/events/hubspotCompanyCreatedWebhook.ts create mode 100644 actions/hubspot-action/src/events/hubspotContactPropertyChangedWebhook.ts create mode 100644 actions/hubspot-action/src/functions/hubspotVerifyWebhookSignatureFunction.ts create mode 100644 actions/hubspot-action/src/functions/utils/hubspotCreateAssociationTypeFunction.ts create mode 100644 actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts create mode 100644 actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts create mode 100644 actions/hubspot-action/test/helpers.test.ts diff --git a/actions/hubspot-action/Dockerfile b/actions/hubspot-action/Dockerfile index 5871953..e4c1568 100644 --- a/actions/hubspot-action/Dockerfile +++ b/actions/hubspot-action/Dockerfile @@ -1,10 +1,14 @@ -FROM node:24.10.0-alpine +FROM node:24-alpine WORKDIR /app COPY package.json package-lock.json* ./ -RUN npm install +# Pins npm to the version package.json declares, so the lock is read by the +# same npm that wrote it. +RUN corepack enable npm + +RUN npm ci COPY . . diff --git a/actions/hubspot-action/README.md b/actions/hubspot-action/README.md index 30cb960..19e737e 100644 --- a/actions/hubspot-action/README.md +++ b/actions/hubspot-action/README.md @@ -8,17 +8,17 @@ annotate CRM records through the official ## Configuration -Configured via the action's `ConfigurationDefinition`s: +The action has no global configuration and reads no environment variables +beyond the shared Hercules ones. Credentials are passed per node, only where +they are needed: -| Identifier | Type | Required | Description | -|------------|------|----------|-------------| -| `access_token` | TEXT | yes | Private-app access token (Bearer) for the HubSpot CRM API. | -| `app_id` | TEXT | no | HubSpot app id, used when managing webhook subscriptions. | -| `client_secret` | TEXT | no | HubSpot app client secret, used to validate the `X-HubSpot-Signature` on inbound webhooks. | +| Parameter | Used by | Description | +|-----------|---------|-------------| +| `AccessToken` | every CRM function (first parameter) | Private-app access token (Bearer) of the HubSpot account to use. | +| `ClientSecret` | `hubspotVerifyWebhookSignature` | Client secret of the HubSpot app that sends the webhooks. | -Beyond the shared Hercules variables (`HERCULES_AUTH_TOKEN`, -`HERCULES_AQUILA_URL`, `HERCULES_ACTION_ID`, `HERCULES_SDK_VERSION`), the only -provider-specific credential required is the HubSpot private-app access token. +The triggers need no credentials. The utils (`hubspotCreate*` builders) don't +call HubSpot and take no token. ### Creating a private app @@ -26,50 +26,83 @@ provider-specific credential required is the HubSpot private-app access token. 2. Create a private app and grant the CRM scopes you need (`crm.objects.contacts.*`, `crm.objects.deals.*`, `crm.objects.companies.*`, `crm.schemas.*`, and note/engagement scopes for `hubspotAddNote`). -3. Copy the access token into the action's `access_token` config. +3. Pass the access token as `AccessToken` to the HubSpot nodes (ideally from a + flow secret or variable rather than typed into every node). ### Webhooks (triggers) The triggers use the shared `Rest` (webhook) event pattern. Point a HubSpot app -**webhook subscription** at the URL generated for the trigger. HubSpot delivers -a JSON array of change events; each event is exposed to the flow as a -`HUBSPOT_WEBHOOK_EVENT`. To verify signatures, configure `client_secret`. +**webhook subscription** at the URL generated for the trigger. HubSpot batches +events, so the payload of every CRM trigger is a JSON **array** of change +events (up to 100 per request). + +The watched property of `HubSpotContactPropertyChangedWebhook` is chosen on the +HubSpot subscription (`contact.propertyChange` + property name); webhook +triggers cannot carry extra settings. The changed property and its new value +are in each event's `propertyName` / `propertyValue`. + +HubSpot has no app webhook subscription for form submissions. For +`HubSpotFormSubmittedWebhook`, create a HubSpot **workflow** with a +"Form submission" enrollment trigger and a **Send a webhook** action (POST, +JSON) that points at the trigger URL. + +#### Verifying signatures + +Call `hubspotVerifyWebhookSignature` at the start of the flow with the trigger +input and branch on the result. It supports v3 (`X-HubSpot-Signature-v3`, +rejected when older than 5 minutes) and v1/v2 (`X-HubSpot-Signature`), using the `ClientSecret` you pass in. v2 and +v3 sign the request URL too, so pass the exact public URL HubSpot called as +`RequestUrl`. The trigger only exposes the parsed body, so it is re-serialised +with `JSON.stringify`. This matches the compact JSON HubSpot sends. ## Triggers -| Identifier | Fires on | -|------------|----------| -| `HubSpotContactCreatedWebhook` | `contact.creation` | -| `HubSpotDealCreatedWebhook` | `deal.creation` | -| `HubSpotDealStageChangedWebhook` | `deal.propertyChange` on `dealstage` | -| `HubSpotFormSubmittedWebhook` | form submission (lead capture) | +| Identifier | Fires on | Payload | +|------------|----------|---------| +| `HubSpotContactCreatedWebhook` | `contact.creation` | `HubSpotContactCreatedWebhookPayload` | +| `HubSpotContactPropertyChangedWebhook` | `contact.propertyChange` | `HubSpotContactPropertyChangedWebhookPayload` | +| `HubSpotDealCreatedWebhook` | `deal.creation` | `HubSpotDealCreatedWebhookPayload` | +| `HubSpotDealStageChangedWebhook` | `deal.propertyChange` on `dealstage` | `HubSpotDealStageChangedWebhookPayload` | +| `HubSpotCompanyCreatedWebhook` | `company.creation` | `HubSpotCompanyCreatedWebhookPayload` | +| `HubSpotFormSubmittedWebhook` | form submission (via workflow webhook) | `HubSpotFormSubmittedWebhookPayload` | ## Functions | Identifier | Signature | Description | |------------|-----------|-------------| -| `hubspotCreateContact` | `(Email, PropertiesJson?): HUBSPOT_CONTACT` | Create a contact. | -| `hubspotUpdateContact` | `(ContactId, PropertiesJson): HUBSPOT_CONTACT` | Update a contact. | -| `hubspotGetContactByEmail` | `(Email): HUBSPOT_CONTACT` | Look up a contact by email. | -| `hubspotCreateDeal` | `(Name, Pipeline, Stage, Amount?, PropertiesJson?): HUBSPOT_DEAL` | Create a deal. | -| `hubspotUpdateDeal` | `(DealId, PropertiesJson): HUBSPOT_DEAL` | Update a deal. | -| `hubspotCreateCompany` | `(Name, PropertiesJson?): HUBSPOT_COMPANY` | Create a company. | -| `hubspotAddNote` | `(Body, PropertiesJson?): HUBSPOT_NOTE` | Create a note engagement. | -| `hubspotAssociate` | `(FromObjectType, FromId, ToObjectType, ToId): BOOLEAN` | Create the default association between two objects. | -| `hubspotSearchObjects` | `(ObjectType, Query): HUBSPOT_SEARCH_RESULT` | Full-text search a CRM object type. | - -### Property maps - -HubSpot CRM properties are a dynamic key/value bag, so functions accept extra -properties as a **JSON object string** (e.g. -`{"firstname":"Ada","lifecyclestage":"lead"}`) rather than a fixed set of typed -parameters. Values are coerced to strings, matching the HubSpot API. +| `hubspotCreateContact` | `(AccessToken, Email, Properties?): HUBSPOT_CONTACT` | Create a contact. | +| `hubspotUpdateContact` | `(AccessToken, ContactId, Properties): HUBSPOT_CONTACT` | Update a contact. | +| `hubspotGetContactByEmail` | `(AccessToken, Email): HUBSPOT_CONTACT` | Look up a contact by email. | +| `hubspotCreateDeal` | `(AccessToken, Name, Pipeline, Stage, Amount?, Properties?): HUBSPOT_DEAL` | Create a deal. | +| `hubspotUpdateDeal` | `(AccessToken, DealId, Properties): HUBSPOT_DEAL` | Update a deal. | +| `hubspotCreateCompany` | `(AccessToken, Name, Properties?): HUBSPOT_COMPANY` | Create a company. | +| `hubspotAssociate` | `(AccessToken, FromObjectType, FromId, ToObjectType, ToId, AssociationType?): BOOLEAN` | Associate two objects; default association unless a type is given. | +| `hubspotAddNote` | `(AccessToken, ObjectType, ObjectId, Body, Properties?): HUBSPOT_NOTE` | Create a note and attach it to a contact, deal, company, ... | +| `hubspotSearchObjects` | `(AccessToken, ObjectType, Filters, Query?, Properties?, Limit?): HUBSPOT_SEARCH_RESULT` | CRM search; all filters must match (AND). | +| `hubspotVerifyWebhookSignature` | `(ClientSecret, Input, RequestUrl?): BOOLEAN` | Validate the signature of an inbound HubSpot webhook. | + +`Properties` is a `HUBSPOT_PROPERTY_MAP`. A JSON object string is accepted as +well, for backwards compatibility. + +### Utils + +Data-type builders, like the GLS `create*` utils: + +| Identifier | Signature | Description | +|------------|-----------|-------------| +| `hubspotCreatePropertyMap` | `(Names: LIST, Values: LIST): HUBSPOT_PROPERTY_MAP` | Build a property map from parallel name/value lists. | +| `hubspotCreateSearchFilter` | `(PropertyName, Operator, Value?, Values?, HighValue?): HUBSPOT_SEARCH_FILTER` | Build a search filter (`EQ`, `GT`, `IN`, `BETWEEN`, `CONTAINS_TOKEN`, ...). | +| `hubspotCreateAssociationType` | `(AssociationTypeId, AssociationCategory?): HUBSPOT_ASSOCIATION` | Build an association type or label for `hubspotAssociate`. | ## Data types -`HUBSPOT_CONTACT`, `HUBSPOT_DEAL`, `HUBSPOT_COMPANY`, `HUBSPOT_NOTE` (all share -the SDK's `SimplePublicObject` envelope: `id`, `properties`, timestamps, -`archived`), plus `HUBSPOT_SEARCH_RESULT` and `HUBSPOT_WEBHOOK_EVENT`. +- `HUBSPOT_CONTACT`, `HUBSPOT_DEAL`, `HUBSPOT_COMPANY`, `HUBSPOT_NOTE`: all + share the SDK's `SimplePublicObject` envelope (`id`, `properties`, + timestamps, `archived`). +- `HUBSPOT_SEARCH_RESULT`, `HUBSPOT_SEARCH_FILTER`, `HUBSPOT_ASSOCIATION`, + `HUBSPOT_PROPERTY_MAP`. +- `HUBSPOT_WEBHOOK_EVENT` (a single change event) and one payload type per + trigger (see [Triggers](#triggers)). ## Development diff --git a/actions/hubspot-action/manifest.json b/actions/hubspot-action/manifest.json new file mode 100644 index 0000000..3486ddb --- /dev/null +++ b/actions/hubspot-action/manifest.json @@ -0,0 +1,13 @@ +{ + "name": "hubspot", + "identifier": "hubspot-action", + "description": "HubSpot CRM integration: react to contact, deal, company and form webhooks and create, update, search, associate and annotate CRM records.", + "deployment": { + "docker": { + "image": "ghcr.io/code0-tech/centaurus/ci-builds/hubspot-action" + } + }, + "dependencies": [ + "rest-action" + ] +} diff --git a/actions/hubspot-action/package-lock.json b/actions/hubspot-action/package-lock.json index 8ea2695..9db3a22 100644 --- a/actions/hubspot-action/package-lock.json +++ b/actions/hubspot-action/package-lock.json @@ -8,8 +8,9 @@ "name": "@code0-tech/hubspot-action", "version": "1.0.0", "dependencies": { - "@code0-tech/hercules": "^1.1.1", - "@hubspot/api-client": "^14.0.0" + "@code0-tech/hercules": "^1.9.0", + "@hubspot/api-client": "^14.0.0", + "zod": "4.4.3" }, "devDependencies": { "@types/node": "^22.0.0", @@ -17,6 +18,9 @@ "typescript": "^5.9.3", "vite": "^8.0.3", "vitest": "^4.1.10" + }, + "engines": { + "npm": ">=11.21.3" } }, "node_modules/@clack/core": { @@ -43,15 +47,15 @@ } }, "node_modules/@code0-tech/hercules": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.7.2.tgz", - "integrity": "sha512-xRfolLdKOWC+oiNa7XRo8EeQSylwgq6XkcLhB0YocU8XeEc7qSaHWKJSNnhIDLOmAZzpa7OmpxZj6YFeweUqJg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.9.0.tgz", + "integrity": "sha512-Hd5MzOz+qT+3HF0nUHNIHMPVlXwogOmtZp4guiTlo5cW/x/i5sBWs9PB6VX6aKjsNbDmPehNR+PzpB45Ncl4NA==", "license": "ISC", "bin": { "hercules": "bin/hercules.js" }, "peerDependencies": { - "@code0-tech/tucana": "0.0.83", + "@code0-tech/tucana": "0.0.86", "@grpc/grpc-js": "^1.14.3", "@protobuf-ts/grpc-backend": "^2.11.1", "@protobuf-ts/grpc-transport": "^2.11.1", @@ -65,9 +69,9 @@ } }, "node_modules/@code0-tech/tucana": { - "version": "0.0.83", - "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.83.tgz", - "integrity": "sha512-scBOjgf3oIQF8pUlskqPHqfzPvgCJgG1+/tt9RAKWZ1IdCdSqTRG768uEVeTjpuryiGRiO0p8r4bCXNEQNRtRg==", + "version": "0.0.86", + "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.86.tgz", + "integrity": "sha512-CUIjP837mXM8T6ILwRCZNKTTARt/i12JxjQw3YPB03Hn2L96aineDVOE4XxjxCRzMJRE9+aZZtwh0jZuzbKWVg==", "license": "MIT", "peer": true }, @@ -3633,11 +3637,10 @@ } }, "node_modules/zod": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", - "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/actions/hubspot-action/package.json b/actions/hubspot-action/package.json index dc734eb..ec03b5f 100644 --- a/actions/hubspot-action/package.json +++ b/actions/hubspot-action/package.json @@ -3,6 +3,10 @@ "version": "1.0.0", "private": true, "type": "module", + "packageManager": "npm@11.21.3", + "engines": { + "npm": ">=11.21.3" + }, "main": "dist/index.js", "scripts": { "dev": "tsx watch src/index.ts", @@ -12,8 +16,9 @@ "start": "node dist/index.js" }, "dependencies": { - "@code0-tech/hercules": "^1.1.1", - "@hubspot/api-client": "^14.0.0" + "@code0-tech/hercules": "^1.9.0", + "@hubspot/api-client": "^14.0.0", + "zod": "4.4.3" }, "devDependencies": { "@types/node": "^22.0.0", diff --git a/actions/hubspot-action/src/data_types/hubspotAssociation.ts b/actions/hubspot-action/src/data_types/hubspotAssociation.ts new file mode 100644 index 0000000..42feb0a --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotAssociation.ts @@ -0,0 +1,22 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; + +/** + * An association type (label) between two HubSpot CRM objects, as used by the + * v4 associations API. `HUBSPOT_DEFINED` covers the built-in types (e.g. 3 = + * deal to contact), `USER_DEFINED` covers custom association labels. + * See https://developers.hubspot.com/docs/api/crm/associations + */ +export const HubSpotAssociationSchema = z.object({ + associationCategory: z + .enum(["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"]) + .describe("Who defined the association type."), + associationTypeId: z.number().describe("The numeric association type id."), +}); +export type HubSpotAssociation = z.infer; + +@Identifier("HUBSPOT_ASSOCIATION") +@Name({ code: "en-US", content: "HubSpot association type" }) +@DisplayMessage({ code: "en-US", content: "HubSpot association ${associationCategory} ${associationTypeId}" }) +@Schema(HubSpotAssociationSchema) +export class HubSpotAssociationDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotCompanyCreatedWebhookPayload.ts b/actions/hubspot-action/src/data_types/hubspotCompanyCreatedWebhookPayload.ts new file mode 100644 index 0000000..a4480a0 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotCompanyCreatedWebhookPayload.ts @@ -0,0 +1,21 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { HubSpotWebhookEventSchema } from "./hubspotWebhookEvent.js"; + +/** + * Body of a HubSpot `company.creation` webhook delivery. HubSpot batches events, so + * the body is a JSON array of change events (up to 100 per request). + */ +export const HubSpotCompanyCreatedWebhookPayloadSchema = z.array( + HubSpotWebhookEventSchema.extend({ + subscriptionType: z.string().describe("The subscription type (`company.creation`)."), + objectId: z.number().describe("The id of the created company."), + + }) +); +export type HubSpotCompanyCreatedWebhookPayload = z.infer; + +@Identifier("HubSpotCompanyCreatedWebhookPayload") +@Name({ code: "en-US", content: "HubSpot company created webhook payload" }) +@Schema(HubSpotCompanyCreatedWebhookPayloadSchema) +export class HubSpotCompanyCreatedWebhookPayloadDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotContactCreatedWebhookPayload.ts b/actions/hubspot-action/src/data_types/hubspotContactCreatedWebhookPayload.ts new file mode 100644 index 0000000..f5ff792 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotContactCreatedWebhookPayload.ts @@ -0,0 +1,21 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { HubSpotWebhookEventSchema } from "./hubspotWebhookEvent.js"; + +/** + * Body of a HubSpot `contact.creation` webhook delivery. HubSpot batches events, so + * the body is a JSON array of change events (up to 100 per request). + */ +export const HubSpotContactCreatedWebhookPayloadSchema = z.array( + HubSpotWebhookEventSchema.extend({ + subscriptionType: z.string().describe("The subscription type (`contact.creation`)."), + objectId: z.number().describe("The id of the created contact."), + + }) +); +export type HubSpotContactCreatedWebhookPayload = z.infer; + +@Identifier("HubSpotContactCreatedWebhookPayload") +@Name({ code: "en-US", content: "HubSpot contact created webhook payload" }) +@Schema(HubSpotContactCreatedWebhookPayloadSchema) +export class HubSpotContactCreatedWebhookPayloadDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotContactPropertyChangedWebhookPayload.ts b/actions/hubspot-action/src/data_types/hubspotContactPropertyChangedWebhookPayload.ts new file mode 100644 index 0000000..3eaf6b7 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotContactPropertyChangedWebhookPayload.ts @@ -0,0 +1,22 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { HubSpotWebhookEventSchema } from "./hubspotWebhookEvent.js"; + +/** + * Body of a HubSpot `contact.propertyChange` webhook delivery. HubSpot batches events, so + * the body is a JSON array of change events (up to 100 per request). + */ +export const HubSpotContactPropertyChangedWebhookPayloadSchema = z.array( + HubSpotWebhookEventSchema.extend({ + subscriptionType: z.string().describe("The subscription type (`contact.propertyChange`)."), + objectId: z.number().describe("The id of the changed contact."), + propertyName: z.string().describe("The name of the changed property."), + propertyValue: z.string().describe("The new value of the property."), + }) +); +export type HubSpotContactPropertyChangedWebhookPayload = z.infer; + +@Identifier("HubSpotContactPropertyChangedWebhookPayload") +@Name({ code: "en-US", content: "HubSpot contact property changed webhook payload" }) +@Schema(HubSpotContactPropertyChangedWebhookPayloadSchema) +export class HubSpotContactPropertyChangedWebhookPayloadDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotDealCreatedWebhookPayload.ts b/actions/hubspot-action/src/data_types/hubspotDealCreatedWebhookPayload.ts new file mode 100644 index 0000000..7d0d161 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotDealCreatedWebhookPayload.ts @@ -0,0 +1,21 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { HubSpotWebhookEventSchema } from "./hubspotWebhookEvent.js"; + +/** + * Body of a HubSpot `deal.creation` webhook delivery. HubSpot batches events, so + * the body is a JSON array of change events (up to 100 per request). + */ +export const HubSpotDealCreatedWebhookPayloadSchema = z.array( + HubSpotWebhookEventSchema.extend({ + subscriptionType: z.string().describe("The subscription type (`deal.creation`)."), + objectId: z.number().describe("The id of the created deal."), + + }) +); +export type HubSpotDealCreatedWebhookPayload = z.infer; + +@Identifier("HubSpotDealCreatedWebhookPayload") +@Name({ code: "en-US", content: "HubSpot deal created webhook payload" }) +@Schema(HubSpotDealCreatedWebhookPayloadSchema) +export class HubSpotDealCreatedWebhookPayloadDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotDealStageChangedWebhookPayload.ts b/actions/hubspot-action/src/data_types/hubspotDealStageChangedWebhookPayload.ts new file mode 100644 index 0000000..453f63d --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotDealStageChangedWebhookPayload.ts @@ -0,0 +1,22 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { HubSpotWebhookEventSchema } from "./hubspotWebhookEvent.js"; + +/** + * Body of a HubSpot `deal.propertyChange` webhook delivery. HubSpot batches events, so + * the body is a JSON array of change events (up to 100 per request). + */ +export const HubSpotDealStageChangedWebhookPayloadSchema = z.array( + HubSpotWebhookEventSchema.extend({ + subscriptionType: z.string().describe("The subscription type (`deal.propertyChange`)."), + objectId: z.number().describe("The id of the changed deal."), + propertyName: z.string().describe("The name of the changed property."), + propertyValue: z.string().describe("The new value of the property."), + }) +); +export type HubSpotDealStageChangedWebhookPayload = z.infer; + +@Identifier("HubSpotDealStageChangedWebhookPayload") +@Name({ code: "en-US", content: "HubSpot deal stage changed webhook payload" }) +@Schema(HubSpotDealStageChangedWebhookPayloadSchema) +export class HubSpotDealStageChangedWebhookPayloadDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotFormSubmittedWebhookPayload.ts b/actions/hubspot-action/src/data_types/hubspotFormSubmittedWebhookPayload.ts new file mode 100644 index 0000000..9edf317 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotFormSubmittedWebhookPayload.ts @@ -0,0 +1,33 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; + +/** + * Body of a HubSpot form-submission webhook. HubSpot has no app webhook + * subscription for form submissions, so this is sent by a HubSpot workflow + * ("Form submission" enrollment trigger + "Send a webhook" action). The body + * depends on how the workflow action is configured, so every field is + * optional: the form/page metadata, the submitted field values, and/or the + * enrolled contact's properties. + */ +export const HubSpotFormSubmittedWebhookPayloadSchema = z.object({ + portalId: z.number().optional().describe("The HubSpot account (portal) id."), + formId: z.string().optional().describe("The id (GUID) of the submitted form."), + objectId: z.number().optional().describe("The id of the contact created or updated by the submission."), + submittedAt: z.number().optional().describe("Submission time in epoch milliseconds."), + pageUrl: z.string().optional().describe("The URL of the page the form was submitted on."), + pageName: z.string().optional().describe("The title of the page the form was submitted on."), + values: z + .array(z.object({ name: z.string(), value: z.string() })) + .optional() + .describe("The submitted form fields."), + properties: z + .record(z.string(), z.string().nullable()) + .optional() + .describe("Properties of the enrolled contact, if the workflow sends them."), +}); +export type HubSpotFormSubmittedWebhookPayload = z.infer; + +@Identifier("HubSpotFormSubmittedWebhookPayload") +@Name({ code: "en-US", content: "HubSpot form submitted webhook payload" }) +@Schema(HubSpotFormSubmittedWebhookPayloadSchema) +export class HubSpotFormSubmittedWebhookPayloadDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotPropertyMap.ts b/actions/hubspot-action/src/data_types/hubspotPropertyMap.ts new file mode 100644 index 0000000..9dbe3c0 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotPropertyMap.ts @@ -0,0 +1,15 @@ +import { Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; + +/** + * A flat map of HubSpot property names to values. HubSpot CRM properties are a + * dynamic key/value bag, so create/update functions take one of these instead + * of a fixed set of typed parameters. Build one with `hubspotCreatePropertyMap`. + */ +export const HubSpotPropertyMapSchema = z.record(z.string(), z.string()); +export type HubSpotPropertyMap = z.infer; + +@Identifier("HUBSPOT_PROPERTY_MAP") +@Name({ code: "en-US", content: "HubSpot property map" }) +@Schema(HubSpotPropertyMapSchema) +export class HubSpotPropertyMapDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotSearchFilter.ts b/actions/hubspot-action/src/data_types/hubspotSearchFilter.ts new file mode 100644 index 0000000..e0217d8 --- /dev/null +++ b/actions/hubspot-action/src/data_types/hubspotSearchFilter.ts @@ -0,0 +1,28 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; + +export const HUBSPOT_FILTER_OPERATORS = [ + "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", + "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN", +] as const; + +/** + * A single CRM search filter. `value` is used by the comparison operators, + * `values` by IN / NOT_IN, and `value` + `highValue` by BETWEEN. + * HAS_PROPERTY / NOT_HAS_PROPERTY take no value. + * See https://developers.hubspot.com/docs/api/crm/search + */ +export const HubSpotSearchFilterSchema = z.object({ + propertyName: z.string().describe("The property to filter on."), + operator: z.enum(HUBSPOT_FILTER_OPERATORS).describe("The comparison operator."), + value: z.string().optional().describe("The value to compare against."), + values: z.array(z.string()).optional().describe("The values for IN / NOT_IN."), + highValue: z.string().optional().describe("The upper bound for BETWEEN."), +}); +export type HubSpotSearchFilter = z.infer; + +@Identifier("HUBSPOT_SEARCH_FILTER") +@Name({ code: "en-US", content: "HubSpot search filter" }) +@DisplayMessage({ code: "en-US", content: "HubSpot filter ${propertyName} ${operator}" }) +@Schema(HubSpotSearchFilterSchema) +export class HubSpotSearchFilterDataType {} diff --git a/actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts b/actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts index e067d32..facb5b2 100644 --- a/actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts +++ b/actions/hubspot-action/src/data_types/hubspotWebhookEvent.ts @@ -3,10 +3,10 @@ import { z } from "zod"; /** * A single HubSpot app-webhook change event. HubSpot delivers webhook - * subscriptions as a JSON array of these event objects; the Rest trigger - * exposes the individual event to the flow. The schema is intentionally - * permissive (most fields optional) because the exact set of fields depends on - * the `subscriptionType` (property-change events carry `propertyName` / + * subscriptions as a JSON array of these event objects (see the per-trigger + * `*WebhookPayload` types). The schema is intentionally permissive (most + * fields optional) because the exact set of fields depends on the + * `subscriptionType` (property-change events carry `propertyName` / * `propertyValue`, creation events do not). * See https://developers.hubspot.com/docs/api/webhooks */ diff --git a/actions/hubspot-action/src/events/hubspotCompanyCreatedWebhook.ts b/actions/hubspot-action/src/events/hubspotCompanyCreatedWebhook.ts new file mode 100644 index 0000000..5862ede --- /dev/null +++ b/actions/hubspot-action/src/events/hubspotCompanyCreatedWebhook.ts @@ -0,0 +1,23 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules"; + +@Identifier("HubSpotCompanyCreatedWebhook") +@DisplayIcon("simple:hubspot") +@Name({ code: "en-US", content: "HubSpot company created" }) +@Description({ code: "en-US", content: "Triggered when a new company is created in HubSpot (subscription type company.creation)." }) +@DisplayMessage({ code: "en-US", content: "HubSpot company created on ${http_url}" }) +@Signature("(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE, input_schema?: HubSpotCompanyCreatedWebhookPayload): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true +}) +@EventSetting({ + identifier: "http_method", + hidden: true, + defaultValue: "POST" +}) +@EventSetting({ + identifier: "http_schema", + hidden: true, + defaultValue: "application/json" +}) +export class HubSpotCompanyCreatedWebhook extends Rest {} diff --git a/actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts b/actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts index 450809d..086b703 100644 --- a/actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts +++ b/actions/hubspot-action/src/events/hubspotContactCreatedWebhook.ts @@ -4,19 +4,19 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @DisplayIcon("simple:hubspot") @Name({ code: "en-US", content: "HubSpot contact created" }) @Description({ code: "en-US", content: "Triggered when a new contact is created in HubSpot (subscription type contact.creation)." }) -@DisplayMessage({ code: "en-US", content: "HubSpot contact created on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@DisplayMessage({ code: "en-US", content: "HubSpot contact created on ${http_url}" }) +@Signature("(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE, input_schema?: HubSpotContactCreatedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST" }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json" }) diff --git a/actions/hubspot-action/src/events/hubspotContactPropertyChangedWebhook.ts b/actions/hubspot-action/src/events/hubspotContactPropertyChangedWebhook.ts new file mode 100644 index 0000000..1e3f40f --- /dev/null +++ b/actions/hubspot-action/src/events/hubspotContactPropertyChangedWebhook.ts @@ -0,0 +1,23 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules"; + +@Identifier("HubSpotContactPropertyChangedWebhook") +@DisplayIcon("simple:hubspot") +@Name({ code: "en-US", content: "HubSpot contact property changed" }) +@Description({ code: "en-US", content: "Triggered when a watched contact property changes in HubSpot (subscription type contact.propertyChange). The watched property is chosen on the HubSpot webhook subscription; the changed property name and new value are in the payload (propertyName / propertyValue)." }) +@DisplayMessage({ code: "en-US", content: "HubSpot contact property changed on ${http_url}" }) +@Signature("(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE, input_schema?: HubSpotContactPropertyChangedWebhookPayload): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true +}) +@EventSetting({ + identifier: "http_method", + hidden: true, + defaultValue: "POST" +}) +@EventSetting({ + identifier: "http_schema", + hidden: true, + defaultValue: "application/json" +}) +export class HubSpotContactPropertyChangedWebhook extends Rest {} diff --git a/actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts b/actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts index ad6bc22..165ca93 100644 --- a/actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts +++ b/actions/hubspot-action/src/events/hubspotDealCreatedWebhook.ts @@ -4,19 +4,19 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @DisplayIcon("simple:hubspot") @Name({ code: "en-US", content: "HubSpot deal created" }) @Description({ code: "en-US", content: "Triggered when a new deal is created in HubSpot (subscription type deal.creation)." }) -@DisplayMessage({ code: "en-US", content: "HubSpot deal created on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@DisplayMessage({ code: "en-US", content: "HubSpot deal created on ${http_url}" }) +@Signature("(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE, input_schema?: HubSpotDealCreatedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST" }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json" }) diff --git a/actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts b/actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts index 0bee297..b369aea 100644 --- a/actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts +++ b/actions/hubspot-action/src/events/hubspotDealStageChangedWebhook.ts @@ -4,19 +4,19 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @DisplayIcon("simple:hubspot") @Name({ code: "en-US", content: "HubSpot deal stage changed" }) @Description({ code: "en-US", content: "Triggered when a deal's stage changes in HubSpot (subscription type deal.propertyChange on dealstage)." }) -@DisplayMessage({ code: "en-US", content: "HubSpot deal stage changed on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@DisplayMessage({ code: "en-US", content: "HubSpot deal stage changed on ${http_url}" }) +@Signature("(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE, input_schema?: HubSpotDealStageChangedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST" }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json" }) diff --git a/actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts b/actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts index e4d1dad..f33592d 100644 --- a/actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts +++ b/actions/hubspot-action/src/events/hubspotFormSubmittedWebhook.ts @@ -3,20 +3,20 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Identifier("HubSpotFormSubmittedWebhook") @DisplayIcon("simple:hubspot") @Name({ code: "en-US", content: "HubSpot form submitted" }) -@Description({ code: "en-US", content: "Triggered when a HubSpot form is submitted (lead capture). Delivered as a HubSpot webhook event." }) -@DisplayMessage({ code: "en-US", content: "HubSpot form submitted on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: HUBSPOT_WEBHOOK_EVENT): REST_ADAPTER_INPUT") +@Description({ code: "en-US", content: "Triggered when a HubSpot form is submitted (lead capture). Sent by a HubSpot workflow with a form-submission trigger and a 'Send a webhook' action." }) +@DisplayMessage({ code: "en-US", content: "HubSpot form submitted on ${http_url}" }) +@Signature("(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE, input_schema?: HubSpotFormSubmittedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST" }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json" }) diff --git a/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts index d3b2e0c..dd080f2 100644 --- a/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts @@ -2,22 +2,25 @@ import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature, } from "@code0-tech/hercules"; -import { addNote } from "../helpers.js"; +import { addNote, PropertiesInput } from "../helpers.js"; import { HubSpotNote } from "../data_types/hubspotNote.js"; @Identifier("hubspotAddNote") @DisplayIcon("simple:hubspot") -@Signature("(Body: string, PropertiesJson?: string): HUBSPOT_NOTE") +@Signature("(AccessToken: string, ObjectType: string, ObjectId: string, Body: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_NOTE") @Name({ code: "en-US", content: "Add note" }) -@DisplayMessage({ code: "en-US", content: "Add HubSpot note" }) -@Documentation({ code: "en-US", content: "Creates a HubSpot note engagement with the given body. The note timestamp defaults to now. Extra properties may be passed as a JSON object string." }) -@Description({ code: "en-US", content: "Creates a HubSpot note." }) +@DisplayMessage({ code: "en-US", content: "Add HubSpot note to ${ObjectType} ${ObjectId}" }) +@Documentation({ code: "en-US", content: "Creates a HubSpot note with the given body and attaches it to a CRM object (e.g. a contact, deal or company) using the default note association. The note timestamp defaults to now. Extra note properties may be passed as a property map." }) +@Description({ code: "en-US", content: "Adds a note to a HubSpot CRM object." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) +@Parameter({ runtimeName: "ObjectType", name: [{ code: "en-US", content: "Object type" }], description: [{ code: "en-US", content: "The type of the object to attach the note to (e.g. contacts, deals, companies)." }] }) +@Parameter({ runtimeName: "ObjectId", name: [{ code: "en-US", content: "Object id" }], description: [{ code: "en-US", content: "The id of the object to attach the note to." }] }) @Parameter({ runtimeName: "Body", name: [{ code: "en-US", content: "Body" }], description: [{ code: "en-US", content: "The note text (hs_note_body)." }] }) -@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional note properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional note properties." }], optional: true }) export class HubSpotAddNoteFunction { - async run(context: FunctionContext, Body: string, PropertiesJson?: string): Promise { + async run(_context: FunctionContext, AccessToken: string, ObjectType: string, ObjectId: string, Body: string, Properties?: PropertiesInput): Promise { try { - return await addNote(Body, PropertiesJson, context); + return await addNote(ObjectType, ObjectId, Body, Properties, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_CREATING_HUBSPOT_NOTE", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotAssociateFunction.ts b/actions/hubspot-action/src/functions/hubspotAssociateFunction.ts index e87c4a0..817a57f 100644 --- a/actions/hubspot-action/src/functions/hubspotAssociateFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotAssociateFunction.ts @@ -3,22 +3,25 @@ import { Identifier, Name, Parameter, RuntimeError, Signature, } from "@code0-tech/hercules"; import { associate } from "../helpers.js"; +import { HubSpotAssociation } from "../data_types/hubspotAssociation.js"; @Identifier("hubspotAssociate") @DisplayIcon("simple:hubspot") -@Signature("(FromObjectType: string, FromId: string, ToObjectType: string, ToId: string): BOOLEAN") +@Signature("(AccessToken: string, FromObjectType: string, FromId: string, ToObjectType: string, ToId: string, AssociationType?: HUBSPOT_ASSOCIATION): BOOLEAN") @Name({ code: "en-US", content: "Associate objects" }) @DisplayMessage({ code: "en-US", content: "Associate HubSpot ${FromObjectType} ${FromId} with ${ToObjectType} ${ToId}" }) -@Documentation({ code: "en-US", content: "Creates the default association between two HubSpot CRM objects (e.g. contact and deal) using the v4 associations API." }) +@Documentation({ code: "en-US", content: "Associates two HubSpot CRM objects (e.g. a contact with a deal or company) using the v4 associations API. Without an association type the default association between the two object types is created; pass one (see Create association type) to use a specific type or custom label." }) @Description({ code: "en-US", content: "Associates two HubSpot CRM objects." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "FromObjectType", name: [{ code: "en-US", content: "From object type" }], description: [{ code: "en-US", content: "The source object type (e.g. contacts, deals, companies)." }] }) @Parameter({ runtimeName: "FromId", name: [{ code: "en-US", content: "From id" }], description: [{ code: "en-US", content: "The source object id." }] }) @Parameter({ runtimeName: "ToObjectType", name: [{ code: "en-US", content: "To object type" }], description: [{ code: "en-US", content: "The target object type (e.g. contacts, deals, companies)." }] }) @Parameter({ runtimeName: "ToId", name: [{ code: "en-US", content: "To id" }], description: [{ code: "en-US", content: "The target object id." }] }) +@Parameter({ runtimeName: "AssociationType", name: [{ code: "en-US", content: "Association type" }], description: [{ code: "en-US", content: "Optional association type or label. Leave empty for the default association." }], optional: true }) export class HubSpotAssociateFunction { - async run(context: FunctionContext, FromObjectType: string, FromId: string, ToObjectType: string, ToId: string): Promise { + async run(_context: FunctionContext, AccessToken: string, FromObjectType: string, FromId: string, ToObjectType: string, ToId: string, AssociationType?: HubSpotAssociation): Promise { try { - return await associate(FromObjectType, FromId, ToObjectType, ToId, context); + return await associate(FromObjectType, FromId, ToObjectType, ToId, AssociationType, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_ASSOCIATING_HUBSPOT_OBJECTS", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts index 3fe3518..ec29864 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts @@ -2,22 +2,23 @@ import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature, } from "@code0-tech/hercules"; -import { createCompany } from "../helpers.js"; +import { createCompany, PropertiesInput } from "../helpers.js"; import { HubSpotCompany } from "../data_types/hubspotCompany.js"; @Identifier("hubspotCreateCompany") @DisplayIcon("simple:hubspot") -@Signature("(Name: string, PropertiesJson?: string): HUBSPOT_COMPANY") +@Signature("(AccessToken: string, Name: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_COMPANY") @Name({ code: "en-US", content: "Create company" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot company ${Name}" }) -@Documentation({ code: "en-US", content: "Creates a new HubSpot company. Pass additional properties (e.g. domain, industry) as a JSON object string." }) +@Documentation({ code: "en-US", content: "Creates a new HubSpot company. Pass additional properties (e.g. domain, industry) as a property map." }) @Description({ code: "en-US", content: "Creates a new HubSpot company." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "Name", name: [{ code: "en-US", content: "Name" }], description: [{ code: "en-US", content: "The company name." }] }) -@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional company properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional company properties." }], optional: true }) export class HubSpotCreateCompanyFunction { - async run(context: FunctionContext, Name: string, PropertiesJson?: string): Promise { + async run(_context: FunctionContext, AccessToken: string, Name: string, Properties?: PropertiesInput): Promise { try { - return await createCompany(Name, PropertiesJson, context); + return await createCompany(Name, Properties, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_CREATING_HUBSPOT_COMPANY", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts index ac0e3b4..8b007e0 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts @@ -2,22 +2,23 @@ import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature, } from "@code0-tech/hercules"; -import { createContact } from "../helpers.js"; +import { createContact, PropertiesInput } from "../helpers.js"; import { HubSpotContact } from "../data_types/hubspotContact.js"; @Identifier("hubspotCreateContact") @DisplayIcon("simple:hubspot") -@Signature("(Email: string, PropertiesJson?: string): HUBSPOT_CONTACT") +@Signature("(AccessToken: string, Email: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_CONTACT") @Name({ code: "en-US", content: "Create contact" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot contact ${Email}" }) -@Documentation({ code: "en-US", content: "Creates a new contact in HubSpot with the given email. Pass additional properties as a JSON object string (e.g. {\"firstname\":\"Ada\"})." }) +@Documentation({ code: "en-US", content: "Creates a new contact in HubSpot with the given email. Pass additional properties as a property map (e.g. {\"firstname\":\"Ada\"})." }) @Description({ code: "en-US", content: "Creates a new HubSpot contact." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "Email", name: [{ code: "en-US", content: "Email" }], description: [{ code: "en-US", content: "The email address of the contact (used as the primary identifier)." }] }) -@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional HubSpot contact properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional HubSpot contact properties." }], optional: true }) export class HubSpotCreateContactFunction { - async run(context: FunctionContext, Email: string, PropertiesJson?: string): Promise { + async run(_context: FunctionContext, AccessToken: string, Email: string, Properties?: PropertiesInput): Promise { try { - return await createContact(Email, PropertiesJson, context); + return await createContact(Email, Properties, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_CREATING_HUBSPOT_CONTACT", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts index 0afa59e..530a665 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts @@ -2,25 +2,26 @@ import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature, } from "@code0-tech/hercules"; -import { createDeal } from "../helpers.js"; +import { createDeal, PropertiesInput } from "../helpers.js"; import { HubSpotDeal } from "../data_types/hubspotDeal.js"; @Identifier("hubspotCreateDeal") @DisplayIcon("simple:hubspot") -@Signature("(Name: string, Pipeline: string, Stage: string, Amount?: string, PropertiesJson?: string): HUBSPOT_DEAL") +@Signature("(AccessToken: string, Name: string, Pipeline: string, Stage: string, Amount?: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_DEAL") @Name({ code: "en-US", content: "Create deal" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot deal ${Name}" }) @Documentation({ code: "en-US", content: "Creates a new HubSpot deal in the given pipeline and stage. Amount and extra properties are optional." }) @Description({ code: "en-US", content: "Creates a new HubSpot deal." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "Name", name: [{ code: "en-US", content: "Name" }], description: [{ code: "en-US", content: "The deal name (dealname)." }] }) @Parameter({ runtimeName: "Pipeline", name: [{ code: "en-US", content: "Pipeline" }], description: [{ code: "en-US", content: "The pipeline id the deal belongs to." }] }) @Parameter({ runtimeName: "Stage", name: [{ code: "en-US", content: "Stage" }], description: [{ code: "en-US", content: "The deal stage id (dealstage)." }] }) @Parameter({ runtimeName: "Amount", name: [{ code: "en-US", content: "Amount" }], description: [{ code: "en-US", content: "Optional deal amount." }], optional: true }) -@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "Optional JSON object of additional deal properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional deal properties." }], optional: true }) export class HubSpotCreateDealFunction { - async run(context: FunctionContext, Name: string, Pipeline: string, Stage: string, Amount?: string, PropertiesJson?: string): Promise { + async run(_context: FunctionContext, AccessToken: string, Name: string, Pipeline: string, Stage: string, Amount?: string, Properties?: PropertiesInput): Promise { try { - return await createDeal(Name, Pipeline, Stage, Amount, PropertiesJson, context); + return await createDeal(Name, Pipeline, Stage, Amount, Properties, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_CREATING_HUBSPOT_DEAL", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts b/actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts index 3a9693d..63ce91c 100644 --- a/actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotGetContactByEmailFunction.ts @@ -7,16 +7,17 @@ import { HubSpotContact } from "../data_types/hubspotContact.js"; @Identifier("hubspotGetContactByEmail") @DisplayIcon("simple:hubspot") -@Signature("(Email: string): HUBSPOT_CONTACT") +@Signature("(AccessToken: string, Email: string): HUBSPOT_CONTACT") @Name({ code: "en-US", content: "Get contact by email" }) @DisplayMessage({ code: "en-US", content: "Get HubSpot contact ${Email}" }) @Documentation({ code: "en-US", content: "Looks up a single HubSpot contact by email using the CRM search API. Fails if no contact matches." }) @Description({ code: "en-US", content: "Fetches a HubSpot contact by email." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "Email", name: [{ code: "en-US", content: "Email" }], description: [{ code: "en-US", content: "The email address to look up." }] }) export class HubSpotGetContactByEmailFunction { - async run(context: FunctionContext, Email: string): Promise { + async run(_context: FunctionContext, AccessToken: string, Email: string): Promise { try { - return await getContactByEmail(Email, context); + return await getContactByEmail(Email, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_SEARCHING_HUBSPOT_CONTACT", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts b/actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts index a8a8c66..b380dff 100644 --- a/actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotSearchObjectsFunction.ts @@ -4,20 +4,25 @@ import { } from "@code0-tech/hercules"; import { searchObjects } from "../helpers.js"; import { HubSpotSearchResult } from "../data_types/hubspotSearchResult.js"; +import { HubSpotSearchFilter } from "../data_types/hubspotSearchFilter.js"; @Identifier("hubspotSearchObjects") @DisplayIcon("simple:hubspot") -@Signature("(ObjectType: string, Query: string): HUBSPOT_SEARCH_RESULT") +@Signature("(AccessToken: string, ObjectType: string, Filters: LIST, Query?: string, Properties?: LIST, Limit?: number): HUBSPOT_SEARCH_RESULT") @Name({ code: "en-US", content: "Search objects" }) -@DisplayMessage({ code: "en-US", content: "Search HubSpot ${ObjectType} for ${Query}" }) -@Documentation({ code: "en-US", content: "Runs a full-text search against a HubSpot CRM object type (e.g. contacts, deals, companies) and returns up to 25 matches." }) +@DisplayMessage({ code: "en-US", content: "Search HubSpot ${ObjectType}" }) +@Documentation({ code: "en-US", content: "Searches a HubSpot CRM object type (e.g. contacts, deals, companies) with the CRM search API. All filters must match (AND); build them with Create search filter. An optional free-text query narrows the result further. Returns up to Limit matches (default 25, max 200)." }) @Description({ code: "en-US", content: "Searches HubSpot CRM objects." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "ObjectType", name: [{ code: "en-US", content: "Object type" }], description: [{ code: "en-US", content: "The CRM object type to search (e.g. contacts, deals, companies)." }] }) -@Parameter({ runtimeName: "Query", name: [{ code: "en-US", content: "Query" }], description: [{ code: "en-US", content: "The free-text search query." }] }) +@Parameter({ runtimeName: "Filters", name: [{ code: "en-US", content: "Filters" }], description: [{ code: "en-US", content: "The filters an object must all match. May be empty if a query is given." }] }) +@Parameter({ runtimeName: "Query", name: [{ code: "en-US", content: "Query" }], description: [{ code: "en-US", content: "Optional free-text search query." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional list of properties to return for each object. Defaults to the standard HubSpot set." }], optional: true }) +@Parameter({ runtimeName: "Limit", name: [{ code: "en-US", content: "Limit" }], description: [{ code: "en-US", content: "Optional maximum number of results (1-200, default 25)." }], optional: true }) export class HubSpotSearchObjectsFunction { - async run(context: FunctionContext, ObjectType: string, Query: string): Promise { + async run(_context: FunctionContext, AccessToken: string, ObjectType: string, Filters: HubSpotSearchFilter[], Query?: string, Properties?: string[], Limit?: number): Promise { try { - return await searchObjects(ObjectType, Query, context); + return await searchObjects(ObjectType, Filters, Query, Properties, Limit, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_SEARCHING_HUBSPOT_OBJECTS", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts index 75494f5..46966bc 100644 --- a/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts @@ -2,22 +2,23 @@ import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature, } from "@code0-tech/hercules"; -import { updateContact } from "../helpers.js"; +import { updateContact, PropertiesInput } from "../helpers.js"; import { HubSpotContact } from "../data_types/hubspotContact.js"; @Identifier("hubspotUpdateContact") @DisplayIcon("simple:hubspot") -@Signature("(ContactId: string, PropertiesJson: string): HUBSPOT_CONTACT") +@Signature("(AccessToken: string, ContactId: string, Properties: HUBSPOT_PROPERTY_MAP): HUBSPOT_CONTACT") @Name({ code: "en-US", content: "Update contact" }) @DisplayMessage({ code: "en-US", content: "Update HubSpot contact ${ContactId}" }) -@Documentation({ code: "en-US", content: "Updates an existing HubSpot contact. Provide the properties to change as a JSON object string." }) +@Documentation({ code: "en-US", content: "Updates an existing HubSpot contact. Provide the properties to change as a property map." }) @Description({ code: "en-US", content: "Updates an existing HubSpot contact." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "ContactId", name: [{ code: "en-US", content: "Contact id" }], description: [{ code: "en-US", content: "The HubSpot id of the contact to update." }] }) -@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "JSON object of HubSpot contact properties to set." }] }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Property map (see Create property map) of HubSpot contact properties to set." }] }) export class HubSpotUpdateContactFunction { - async run(context: FunctionContext, ContactId: string, PropertiesJson: string): Promise { + async run(_context: FunctionContext, AccessToken: string, ContactId: string, Properties: PropertiesInput): Promise { try { - return await updateContact(ContactId, PropertiesJson, context); + return await updateContact(ContactId, Properties, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_UPDATING_HUBSPOT_CONTACT", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts index 1a55ced..05c41c0 100644 --- a/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts @@ -2,22 +2,23 @@ import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature, } from "@code0-tech/hercules"; -import { updateDeal } from "../helpers.js"; +import { updateDeal, PropertiesInput } from "../helpers.js"; import { HubSpotDeal } from "../data_types/hubspotDeal.js"; @Identifier("hubspotUpdateDeal") @DisplayIcon("simple:hubspot") -@Signature("(DealId: string, PropertiesJson: string): HUBSPOT_DEAL") +@Signature("(AccessToken: string, DealId: string, Properties: HUBSPOT_PROPERTY_MAP): HUBSPOT_DEAL") @Name({ code: "en-US", content: "Update deal" }) @DisplayMessage({ code: "en-US", content: "Update HubSpot deal ${DealId}" }) -@Documentation({ code: "en-US", content: "Updates an existing HubSpot deal. Provide the properties to change (e.g. dealstage, amount) as a JSON object string." }) +@Documentation({ code: "en-US", content: "Updates an existing HubSpot deal. Provide the properties to change (e.g. dealstage, amount) as a property map." }) @Description({ code: "en-US", content: "Updates an existing HubSpot deal." }) +@Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "DealId", name: [{ code: "en-US", content: "Deal id" }], description: [{ code: "en-US", content: "The HubSpot id of the deal to update." }] }) -@Parameter({ runtimeName: "PropertiesJson", name: [{ code: "en-US", content: "Properties (JSON)" }], description: [{ code: "en-US", content: "JSON object of HubSpot deal properties to set." }] }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Property map (see Create property map) of HubSpot deal properties to set." }] }) export class HubSpotUpdateDealFunction { - async run(context: FunctionContext, DealId: string, PropertiesJson: string): Promise { + async run(_context: FunctionContext, AccessToken: string, DealId: string, Properties: PropertiesInput): Promise { try { - return await updateDeal(DealId, PropertiesJson, context); + return await updateDeal(DealId, Properties, AccessToken); } catch (error) { if (error instanceof RuntimeError) throw error; throw new RuntimeError("ERROR_UPDATING_HUBSPOT_DEAL", error instanceof Error ? error.message : "unknown error"); diff --git a/actions/hubspot-action/src/functions/hubspotVerifyWebhookSignatureFunction.ts b/actions/hubspot-action/src/functions/hubspotVerifyWebhookSignatureFunction.ts new file mode 100644 index 0000000..f3a5bda --- /dev/null +++ b/actions/hubspot-action/src/functions/hubspotVerifyWebhookSignatureFunction.ts @@ -0,0 +1,31 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { verifyWebhookSignature } from "../helpers.js"; + +interface RestAdapterInput { + payload?: unknown; + headers?: Record; +} + +@Identifier("hubspotVerifyWebhookSignature") +@DisplayIcon("simple:hubspot") +@Signature("(ClientSecret: string, Input: REST_ADAPTER_INPUT, RequestUrl?: string): BOOLEAN") +@Name({ code: "en-US", content: "Verify webhook signature" }) +@DisplayMessage({ code: "en-US", content: "Verify HubSpot webhook signature" }) +@Documentation({ code: "en-US", content: "Checks the X-HubSpot-Signature(-v3) header of an incoming HubSpot webhook against the client secret of the HubSpot app. Pass the trigger input unchanged. v3 and v2 signatures also cover the request URL, so RequestUrl must be the exact public URL HubSpot called. v3 requests older than 5 minutes are rejected. The body is re-serialised from the parsed payload, which matches the compact JSON HubSpot sends." }) +@Description({ code: "en-US", content: "Returns true if a HubSpot webhook request carries a valid signature." }) +@Parameter({ runtimeName: "ClientSecret", name: [{ code: "en-US", content: "Client secret" }], description: [{ code: "en-US", content: "The client secret of the HubSpot app that sends the webhooks." }] }) +@Parameter({ runtimeName: "Input", name: [{ code: "en-US", content: "Webhook input" }], description: [{ code: "en-US", content: "The input of the HubSpot webhook trigger (payload and headers)." }] }) +@Parameter({ runtimeName: "RequestUrl", name: [{ code: "en-US", content: "Request URL" }], description: [{ code: "en-US", content: "The full public URL HubSpot sent the webhook to. Required for v2/v3 signatures." }], optional: true }) +export class HubSpotVerifyWebhookSignatureFunction { + run(_context: FunctionContext, ClientSecret: string, Input: RestAdapterInput, RequestUrl?: string): boolean { + const clientSecret = ClientSecret?.trim(); + if (!clientSecret) { + throw new RuntimeError("MISSING_HUBSPOT_CLIENT_SECRET", "No HubSpot client secret was given."); + } + // HubSpot always delivers webhooks with POST. + return verifyWebhookSignature(clientSecret, Input?.headers, Input?.payload, "POST", RequestUrl); + } +} diff --git a/actions/hubspot-action/src/functions/utils/hubspotCreateAssociationTypeFunction.ts b/actions/hubspot-action/src/functions/utils/hubspotCreateAssociationTypeFunction.ts new file mode 100644 index 0000000..029d240 --- /dev/null +++ b/actions/hubspot-action/src/functions/utils/hubspotCreateAssociationTypeFunction.ts @@ -0,0 +1,30 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { HubSpotAssociation, HubSpotAssociationSchema } from "../../data_types/hubspotAssociation.js"; + +@Identifier("hubspotCreateAssociationType") +@DisplayIcon("simple:hubspot") +@Signature("(AssociationTypeId: number, AssociationCategory?: string): HUBSPOT_ASSOCIATION") +@Name({ code: "en-US", content: "Create association type" }) +@DisplayMessage({ code: "en-US", content: "Create HubSpot association type ${AssociationTypeId}" }) +@Documentation({ code: "en-US", content: "Builds a HubSpot association type (`HUBSPOT_ASSOCIATION`) for Associate objects. Category is HUBSPOT_DEFINED (default) for built-in types, or USER_DEFINED / INTEGRATOR_DEFINED for custom association labels. The type ids are listed in the HubSpot associations API docs." }) +@Description({ code: "en-US", content: "Creates a HubSpot association type." }) +@Parameter({ runtimeName: "AssociationTypeId", name: [{ code: "en-US", content: "Association type id" }], description: [{ code: "en-US", content: "The numeric association type id, e.g. 3 for deal to contact." }] }) +@Parameter({ runtimeName: "AssociationCategory", name: [{ code: "en-US", content: "Category" }], description: [{ code: "en-US", content: "HUBSPOT_DEFINED (default), USER_DEFINED or INTEGRATOR_DEFINED." }], optional: true }) +export class HubSpotCreateAssociationTypeFunction { + run(_context: unknown, AssociationTypeId: number, AssociationCategory?: string): HubSpotAssociation { + const parsed = HubSpotAssociationSchema.safeParse({ + associationCategory: (AssociationCategory || "HUBSPOT_DEFINED").toUpperCase(), + associationTypeId: Number(AssociationTypeId), + }); + if (!parsed.success || !Number.isInteger(parsed.data.associationTypeId)) { + throw new RuntimeError( + "INVALID_HUBSPOT_ASSOCIATION_TYPE", + "Use an integer association type id and a category of HUBSPOT_DEFINED, USER_DEFINED or INTEGRATOR_DEFINED." + ); + } + return parsed.data; + } +} diff --git a/actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts b/actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts new file mode 100644 index 0000000..8c364c1 --- /dev/null +++ b/actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts @@ -0,0 +1,21 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, + Identifier, Name, Parameter, Signature, +} from "@code0-tech/hercules"; +import { createPropertyMap } from "../../helpers.js"; +import { HubSpotPropertyMap } from "../../data_types/hubspotPropertyMap.js"; + +@Identifier("hubspotCreatePropertyMap") +@DisplayIcon("simple:hubspot") +@Signature("(Names: LIST, Values: LIST): HUBSPOT_PROPERTY_MAP") +@Name({ code: "en-US", content: "Create property map" }) +@DisplayMessage({ code: "en-US", content: "Create HubSpot property map" }) +@Documentation({ code: "en-US", content: "Builds a HubSpot property map (`HUBSPOT_PROPERTY_MAP`) from a list of internal property names (e.g. firstname, lifecyclestage) and a list of values at the same positions. Use it for the Properties parameter of the create/update functions." }) +@Description({ code: "en-US", content: "Creates a HubSpot property map." }) +@Parameter({ runtimeName: "Names", name: [{ code: "en-US", content: "Names" }], description: [{ code: "en-US", content: "The internal HubSpot property names." }] }) +@Parameter({ runtimeName: "Values", name: [{ code: "en-US", content: "Values" }], description: [{ code: "en-US", content: "The values, in the same order as the names." }] }) +export class HubSpotCreatePropertyMapFunction { + run(_context: unknown, Names: string[], Values: string[]): HubSpotPropertyMap { + return createPropertyMap(Names, Values); + } +} diff --git a/actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts b/actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts new file mode 100644 index 0000000..cd8e83a --- /dev/null +++ b/actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts @@ -0,0 +1,44 @@ +import { + Description, DisplayIcon, DisplayMessage, Documentation, + Identifier, Name, Parameter, RuntimeError, Signature, +} from "@code0-tech/hercules"; +import { + HUBSPOT_FILTER_OPERATORS, HubSpotSearchFilter, HubSpotSearchFilterSchema, +} from "../../data_types/hubspotSearchFilter.js"; + +@Identifier("hubspotCreateSearchFilter") +@DisplayIcon("simple:hubspot") +@Signature("(PropertyName: string, Operator: string, Value?: string, Values?: LIST, HighValue?: string): HUBSPOT_SEARCH_FILTER") +@Name({ code: "en-US", content: "Create search filter" }) +@DisplayMessage({ code: "en-US", content: "Create HubSpot filter ${PropertyName} ${Operator}" }) +@Documentation({ code: "en-US", content: `Builds a filter for Search objects. Operators: ${HUBSPOT_FILTER_OPERATORS.join(", ")}. Comparison operators use Value, IN / NOT_IN use Values, BETWEEN uses Value and HighValue, HAS_PROPERTY / NOT_HAS_PROPERTY need no value.` }) +@Description({ code: "en-US", content: "Creates a HubSpot search filter." }) +@Parameter({ runtimeName: "PropertyName", name: [{ code: "en-US", content: "Property name" }], description: [{ code: "en-US", content: "The internal name of the property to filter on." }] }) +@Parameter({ runtimeName: "Operator", name: [{ code: "en-US", content: "Operator" }], description: [{ code: "en-US", content: "The comparison operator, e.g. EQ, GT, IN, CONTAINS_TOKEN." }] }) +@Parameter({ runtimeName: "Value", name: [{ code: "en-US", content: "Value" }], description: [{ code: "en-US", content: "The value to compare against (also the lower bound for BETWEEN)." }], optional: true }) +@Parameter({ runtimeName: "Values", name: [{ code: "en-US", content: "Values" }], description: [{ code: "en-US", content: "The values for IN / NOT_IN." }], optional: true }) +@Parameter({ runtimeName: "HighValue", name: [{ code: "en-US", content: "High value" }], description: [{ code: "en-US", content: "The upper bound for BETWEEN." }], optional: true }) +export class HubSpotCreateSearchFilterFunction { + run(_context: unknown, PropertyName: string, Operator: string, Value?: string, Values?: string[], HighValue?: string): HubSpotSearchFilter { + const operator = (Operator ?? "").toUpperCase(); + if (!(HUBSPOT_FILTER_OPERATORS as readonly string[]).includes(operator)) { + throw new RuntimeError( + "INVALID_HUBSPOT_SEARCH_FILTER", + `Unknown operator "${Operator}". Use one of: ${HUBSPOT_FILTER_OPERATORS.join(", ")}.` + ); + } + if (["IN", "NOT_IN"].includes(operator) && !(Values && Values.length)) { + throw new RuntimeError("INVALID_HUBSPOT_SEARCH_FILTER", `${operator} needs at least one entry in Values.`); + } + if (operator === "BETWEEN" && (Value === undefined || HighValue === undefined)) { + throw new RuntimeError("INVALID_HUBSPOT_SEARCH_FILTER", "BETWEEN needs Value and HighValue."); + } + return HubSpotSearchFilterSchema.parse({ + propertyName: PropertyName, + operator, + ...(Value !== undefined && Value !== null ? { value: String(Value) } : {}), + ...(Values && Values.length ? { values: Values.map(String) } : {}), + ...(HighValue !== undefined && HighValue !== null ? { highValue: String(HighValue) } : {}), + }); + } +} diff --git a/actions/hubspot-action/src/helpers.ts b/actions/hubspot-action/src/helpers.ts index 98e6868..8713481 100644 --- a/actions/hubspot-action/src/helpers.ts +++ b/actions/hubspot-action/src/helpers.ts @@ -1,51 +1,65 @@ -import { FunctionContext, RuntimeError } from "@code0-tech/hercules"; +import { RuntimeError } from "@code0-tech/hercules"; import { Client } from "@hubspot/api-client"; +import { createHash, createHmac, timingSafeEqual } from "node:crypto"; import { HubSpotContact, HubSpotContactSchema } from "./data_types/hubspotContact.js"; import { HubSpotDeal, HubSpotDealSchema } from "./data_types/hubspotDeal.js"; import { HubSpotCompany, HubSpotCompanySchema } from "./data_types/hubspotCompany.js"; import { HubSpotNote, HubSpotNoteSchema } from "./data_types/hubspotNote.js"; import { HubSpotSearchResult, HubSpotSearchResultSchema } from "./data_types/hubspotSearchResult.js"; +import { HubSpotAssociation, HubSpotAssociationSchema } from "./data_types/hubspotAssociation.js"; +import { HubSpotSearchFilter, HubSpotSearchFilterSchema } from "./data_types/hubspotSearchFilter.js"; +import { HubSpotPropertyMap } from "./data_types/hubspotPropertyMap.js"; /** - * Builds an authenticated HubSpot API client from the action config. Uses a - * private-app access token (Bearer) as configured on the action. + * Extra properties as passed by a flow: normally a `HUBSPOT_PROPERTY_MAP` + * object, but a JSON object string is accepted as well. */ -export function getClient(context: FunctionContext): Client { - const accessToken = context.matchedConfig.findConfig("access_token") as string; - if (!accessToken) { +export type PropertiesInput = HubSpotPropertyMap | Record | string | null | undefined; + +/** + * Builds an authenticated HubSpot API client from the private-app access + * token (Bearer) passed to the node. Every node brings its own token, so one + * action instance can talk to any number of HubSpot accounts. + */ +export function getClient(accessToken: string): Client { + const token = accessToken?.trim(); + if (!token) { throw new RuntimeError( "MISSING_HUBSPOT_ACCESS_TOKEN", - "A HubSpot access_token must be configured for this action." + "No HubSpot access token was given." ); } - return new Client({ accessToken }); + return new Client({ accessToken: token }); } /** - * Parses a JSON object string into a flat HubSpot property map. HubSpot CRM + * Normalises extra properties into a flat HubSpot property map. HubSpot CRM * properties are a dynamic bag of key/value pairs, so functions accept them as - * a JSON object string (e.g. `{"firstname":"Ada","lifecyclestage":"lead"}`) - * rather than a fixed set of typed parameters. Values are coerced to strings, - * which is what the HubSpot API expects. + * a `HUBSPOT_PROPERTY_MAP` (see `hubspotCreatePropertyMap`) or, for + * convenience, a JSON object string (e.g. `{"firstname":"Ada"}`). Values are + * coerced to strings, which is what the HubSpot API expects. */ export function parseProperties( - json: string | undefined, + input: PropertiesInput, field = "properties" ): Record { - if (!json || json.trim() === "") return {}; - let parsed: unknown; - try { - parsed = JSON.parse(json); - } catch { - throw new RuntimeError( - "INVALID_HUBSPOT_PROPERTIES", - `The ${field} value must be a valid JSON object string.` - ); + if (input === null || input === undefined) return {}; + let parsed: unknown = input; + if (typeof input === "string") { + if (input.trim() === "") return {}; + try { + parsed = JSON.parse(input); + } catch { + throw new RuntimeError( + "INVALID_HUBSPOT_PROPERTIES", + `The ${field} value must be a property map or a valid JSON object string.` + ); + } } if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { throw new RuntimeError( "INVALID_HUBSPOT_PROPERTIES", - `The ${field} value must be a JSON object of property name/value pairs.` + `The ${field} value must be an object of property name/value pairs.` ); } const out: Record = {}; @@ -56,6 +70,28 @@ export function parseProperties( return out; } +/** Builds a property map from two parallel lists of property names and values. */ +export function createPropertyMap(names: string[], values: string[]): HubSpotPropertyMap { + if (!Array.isArray(names) || !Array.isArray(values)) { + throw new RuntimeError("INVALID_HUBSPOT_PROPERTIES", "Names and values must be lists."); + } + if (names.length !== values.length) { + throw new RuntimeError( + "INVALID_HUBSPOT_PROPERTIES", + `Got ${names.length} property names but ${values.length} values; both lists must have the same length.` + ); + } + const out: HubSpotPropertyMap = {}; + names.forEach((name, i) => { + if (!name) { + throw new RuntimeError("INVALID_HUBSPOT_PROPERTIES", `Property name at position ${i} is empty.`); + } + const value = values[i]; + out[name] = value === null || value === undefined ? "" : String(value); + }); + return out; +} + /** * Normalises the SDK's `SimplePublicObject` (Date timestamps, optional fields) * into the plain shape expected by the zod object schemas. @@ -77,7 +113,7 @@ function toPlainObject(obj: { } /** Maps a HubSpot SDK/ApiException error into a stable RuntimeError. */ -export function throwHubSpotError(error: unknown, code: string): never { +export function throwHubSpotError(error: unknown, code: string, context?: string): never { const anyErr = error as { code?: number; body?: unknown; message?: string }; const status = anyErr?.code; const detail = @@ -85,20 +121,21 @@ export function throwHubSpotError(error: unknown, code: string): never { ? JSON.stringify(anyErr.body) : anyErr?.message) ?? "unknown error"; console.error("HubSpot API error:", status, detail); - throw new RuntimeError(code, `HubSpot API error ${status ?? ""}: ${detail}`); + const prefix = context ? `${context}. ` : ""; + throw new RuntimeError(code, `${prefix}HubSpot API error ${status ?? ""}: ${detail}`); } export async function createContact( email: string, - propertiesJson: string | undefined, - context: FunctionContext + properties: PropertiesInput, + accessToken: string ): Promise { - const client = getClient(context); - const properties = { email, ...parseProperties(propertiesJson) }; + const client = getClient(accessToken); + const props = { email, ...parseProperties(properties) }; try { // `any` on the request payload only: the SDK's create input type is // version-specific; the response is validated with zod below. - const res = await client.crm.contacts.basicApi.create({ properties, associations: [] } as any); + const res = await client.crm.contacts.basicApi.create({ properties: props, associations: [] } as any); return HubSpotContactSchema.parse(toPlainObject(res)); } catch (error) { throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_CONTACT"); @@ -107,13 +144,13 @@ export async function createContact( export async function updateContact( contactId: string, - propertiesJson: string, - context: FunctionContext + properties: PropertiesInput, + accessToken: string ): Promise { - const client = getClient(context); - const properties = parseProperties(propertiesJson); + const client = getClient(accessToken); + const props = parseProperties(properties); try { - const res = await client.crm.contacts.basicApi.update(contactId, { properties } as any); + const res = await client.crm.contacts.basicApi.update(contactId, { properties: props } as any); return HubSpotContactSchema.parse(toPlainObject(res)); } catch (error) { throwHubSpotError(error, "ERROR_UPDATING_HUBSPOT_CONTACT"); @@ -122,9 +159,9 @@ export async function updateContact( export async function getContactByEmail( email: string, - context: FunctionContext + accessToken: string ): Promise { - const client = getClient(context); + const client = getClient(accessToken); const searchRequest: any = { filterGroups: [{ filters: [{ propertyName: "email", operator: "EQ", value: email }] }], properties: ["email", "firstname", "lastname", "lifecyclestage"], @@ -151,19 +188,19 @@ export async function createDeal( pipeline: string, stage: string, amount: string | undefined, - propertiesJson: string | undefined, - context: FunctionContext + properties: PropertiesInput, + accessToken: string ): Promise { - const client = getClient(context); - const properties: Record = { + const client = getClient(accessToken); + const props: Record = { dealname: name, pipeline, dealstage: stage, ...(amount ? { amount } : {}), - ...parseProperties(propertiesJson), + ...parseProperties(properties), }; try { - const res = await client.crm.deals.basicApi.create({ properties, associations: [] } as any); + const res = await client.crm.deals.basicApi.create({ properties: props, associations: [] } as any); return HubSpotDealSchema.parse(toPlainObject(res)); } catch (error) { throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_DEAL"); @@ -172,13 +209,13 @@ export async function createDeal( export async function updateDeal( dealId: string, - propertiesJson: string, - context: FunctionContext + properties: PropertiesInput, + accessToken: string ): Promise { - const client = getClient(context); - const properties = parseProperties(propertiesJson); + const client = getClient(accessToken); + const props = parseProperties(properties); try { - const res = await client.crm.deals.basicApi.update(dealId, { properties } as any); + const res = await client.crm.deals.basicApi.update(dealId, { properties: props } as any); return HubSpotDealSchema.parse(toPlainObject(res)); } catch (error) { throwHubSpotError(error, "ERROR_UPDATING_HUBSPOT_DEAL"); @@ -187,36 +224,53 @@ export async function updateDeal( export async function createCompany( name: string, - propertiesJson: string | undefined, - context: FunctionContext + properties: PropertiesInput, + accessToken: string ): Promise { - const client = getClient(context); - const properties = { name, ...parseProperties(propertiesJson) }; + const client = getClient(accessToken); + const props = { name, ...parseProperties(properties) }; try { - const res = await client.crm.companies.basicApi.create({ properties, associations: [] } as any); + const res = await client.crm.companies.basicApi.create({ properties: props, associations: [] } as any); return HubSpotCompanySchema.parse(toPlainObject(res)); } catch (error) { throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_COMPANY"); } } +/** + * Creates a note and attaches it to a CRM object (contact, deal, company, ...) + * via the default note association for that object type. + */ export async function addNote( + objectType: string, + objectId: string, body: string, - propertiesJson: string | undefined, - context: FunctionContext + properties: PropertiesInput, + accessToken: string ): Promise { - const client = getClient(context); - const properties: Record = { + const client = getClient(accessToken); + const props: Record = { hs_note_body: body, hs_timestamp: new Date().toISOString(), - ...parseProperties(propertiesJson), + ...parseProperties(properties), }; + let note: HubSpotNote; try { - const res = await client.crm.objects.notes.basicApi.create({ properties, associations: [] } as any); - return HubSpotNoteSchema.parse(toPlainObject(res)); + const res = await client.crm.objects.notes.basicApi.create({ properties: props, associations: [] } as any); + note = HubSpotNoteSchema.parse(toPlainObject(res)); } catch (error) { throwHubSpotError(error, "ERROR_CREATING_HUBSPOT_NOTE"); } + try { + await client.crm.associations.v4.basicApi.createDefault("notes", note.id, objectType, objectId); + } catch (error) { + throwHubSpotError( + error, + "ERROR_ASSOCIATING_HUBSPOT_NOTE", + `Note ${note.id} was created but could not be attached to ${objectType} ${objectId}` + ); + } + return note; } export async function associate( @@ -224,32 +278,82 @@ export async function associate( fromId: string, toObjectType: string, toId: string, - context: FunctionContext + associationType: HubSpotAssociation | null | undefined, + accessToken: string ): Promise { - const client = getClient(context); + const client = getClient(accessToken); + let spec: HubSpotAssociation | undefined; + if (associationType) { + const parsed = HubSpotAssociationSchema.safeParse(associationType); + if (!parsed.success) { + throw new RuntimeError( + "INVALID_HUBSPOT_ASSOCIATION_TYPE", + "The association type needs an associationCategory and a numeric associationTypeId." + ); + } + spec = parsed.data; + } try { - // Uses the default association between the two object types (v4 - // associations API), which avoids hard-coding version-specific - // association type ids. - await client.crm.associations.v4.basicApi.createDefault( - fromObjectType, - fromId, - toObjectType, - toId - ); + if (spec) { + // Explicit association type / label (v4 associations API). + await client.crm.associations.v4.basicApi.create( + fromObjectType, + fromId, + toObjectType, + toId, + [spec] as any + ); + } else { + // Default association between the two object types, which avoids + // hard-coding association type ids. + await client.crm.associations.v4.basicApi.createDefault( + fromObjectType, + fromId, + toObjectType, + toId + ); + } return true; } catch (error) { throwHubSpotError(error, "ERROR_ASSOCIATING_HUBSPOT_OBJECTS"); } } +/** + * Searches a CRM object type via the CRM search API. All filters are combined + * with AND (one filter group); `query` optionally adds a full-text search. + */ export async function searchObjects( objectType: string, - query: string, - context: FunctionContext + filters: HubSpotSearchFilter[] | null | undefined, + query: string | undefined, + properties: string[] | undefined, + limit: number | undefined, + accessToken: string ): Promise { - const client = getClient(context); - const searchRequest: any = { query, limit: 25 }; + const parsedFilters: HubSpotSearchFilter[] = []; + for (const filter of filters ?? []) { + const parsed = HubSpotSearchFilterSchema.safeParse(filter); + if (!parsed.success) { + throw new RuntimeError( + "INVALID_HUBSPOT_SEARCH_FILTER", + "Every filter needs a propertyName and a valid operator (build them with hubspotCreateSearchFilter)." + ); + } + parsedFilters.push(parsed.data); + } + if (parsedFilters.length === 0 && !query) { + throw new RuntimeError("INVALID_HUBSPOT_SEARCH_FILTER", "Provide at least one filter or a query."); + } + const searchRequest: any = { + filterGroups: parsedFilters.length ? [{ filters: parsedFilters }] : [], + // The CRM search API returns at most 200 results per page. + limit: Math.min(Math.max(Math.trunc(limit ?? 25), 1), 200), + }; + if (query) searchRequest.query = query; + if (properties && properties.length) searchRequest.properties = properties; + + const client = getClient(accessToken); try { const res = await client.crm.objects.searchApi.doSearch(objectType, searchRequest); return HubSpotSearchResultSchema.parse({ @@ -260,3 +364,87 @@ export async function searchObjects( throwHubSpotError(error, "ERROR_SEARCHING_HUBSPOT_OBJECTS"); } } + +/** Max age of a v3 signed request before it is rejected (HubSpot uses 5 minutes). */ +const MAX_SIGNATURE_AGE_MS = 5 * 60 * 1000; + +function safeEqual(a: string, b: string): boolean { + const ab = Buffer.from(a); + const bb = Buffer.from(b); + return ab.length === bb.length && timingSafeEqual(ab, bb); +} + +function headerValue(headers: Record | null | undefined, name: string): string | undefined { + if (!headers) return undefined; + const key = Object.keys(headers).find((k) => k.toLowerCase() === name); + const value = key === undefined ? undefined : headers[key]; + if (Array.isArray(value)) return value[0] === undefined ? undefined : String(value[0]); + return value === undefined || value === null ? undefined : String(value); +} + +/** HubSpot decodes these URL-encoded characters before signing a v3 request. */ +const V3_DECODED: Record = { + "%3A": ":", "%2F": "/", "%3F": "?", "%40": "@", "%21": "!", "%24": "$", + "%27": "'", "%28": "(", "%29": ")", "%2A": "*", "%2C": ",", "%3B": ";", +}; + +function decodeV3Uri(uri: string): string { + return uri.replace(/%(3A|2F|3F|40|21|24|27|28|29|2A|2C|3B)/gi, (m) => V3_DECODED[m.toUpperCase()]); +} + +/** + * Verifies the signature HubSpot puts on webhook requests, using the app's + * client secret. Supports v3 (`X-HubSpot-Signature-v3`, preferred) as well as + * v1/v2 (`X-HubSpot-Signature` + `X-HubSpot-Signature-Version`). + * + * The webhook trigger hands the flow the parsed body, not the raw bytes, so a + * non-string payload is re-serialised with `JSON.stringify`. That matches + * HubSpot's compact JSON; a body formatted differently fails verification. + * v2 and v3 also sign the request URL, so `requestUrl` must be the exact public + * URL HubSpot called (including the query string). + * See https://developers.hubspot.com/docs/api/webhooks/validating-requests + */ +export function verifyWebhookSignature( + clientSecret: string, + headers: Record | null | undefined, + payload: unknown, + method: string | undefined, + requestUrl: string | undefined, + now: number = Date.now() +): boolean { + const body = typeof payload === "string" ? payload : JSON.stringify(payload ?? ""); + const httpMethod = (method || "POST").toUpperCase(); + + const v3 = headerValue(headers, "x-hubspot-signature-v3"); + if (v3) { + const timestamp = headerValue(headers, "x-hubspot-request-timestamp"); + if (!timestamp || !requestUrl) { + throw new RuntimeError( + "INVALID_HUBSPOT_SIGNATURE_INPUT", + "v3 signatures need the X-HubSpot-Request-Timestamp header and the request URL." + ); + } + if (!(Math.abs(now - Number(timestamp)) <= MAX_SIGNATURE_AGE_MS)) return false; + const expected = createHmac("sha256", clientSecret) + .update(httpMethod + decodeV3Uri(requestUrl) + body + timestamp, "utf8") + .digest("base64"); + return safeEqual(expected, v3); + } + + const signature = headerValue(headers, "x-hubspot-signature"); + if (!signature) return false; + const version = (headerValue(headers, "x-hubspot-signature-version") ?? "v1").toLowerCase(); + let source: string; + if (version === "v1") { + source = clientSecret + body; + } else if (version === "v2") { + if (!requestUrl) { + throw new RuntimeError("INVALID_HUBSPOT_SIGNATURE_INPUT", "v2 signatures need the request URL."); + } + source = clientSecret + httpMethod + requestUrl + body; + } else { + return false; + } + const expected = createHash("sha256").update(source, "utf8").digest("hex"); + return safeEqual(expected, signature.toLowerCase()); +} diff --git a/actions/hubspot-action/src/index.ts b/actions/hubspot-action/src/index.ts index 1935206..afe8dd3 100644 --- a/actions/hubspot-action/src/index.ts +++ b/actions/hubspot-action/src/index.ts @@ -6,11 +6,22 @@ import { HubSpotDealDataType } from "./data_types/hubspotDeal.js"; import { HubSpotCompanyDataType } from "./data_types/hubspotCompany.js"; import { HubSpotNoteDataType } from "./data_types/hubspotNote.js"; import { HubSpotSearchResultDataType } from "./data_types/hubspotSearchResult.js"; +import { HubSpotSearchFilterDataType } from "./data_types/hubspotSearchFilter.js"; +import { HubSpotAssociationDataType } from "./data_types/hubspotAssociation.js"; +import { HubSpotPropertyMapDataType } from "./data_types/hubspotPropertyMap.js"; import { HubSpotWebhookEventDataType } from "./data_types/hubspotWebhookEvent.js"; +import { HubSpotContactCreatedWebhookPayloadDataType } from "./data_types/hubspotContactCreatedWebhookPayload.js"; +import { HubSpotContactPropertyChangedWebhookPayloadDataType } from "./data_types/hubspotContactPropertyChangedWebhookPayload.js"; +import { HubSpotDealCreatedWebhookPayloadDataType } from "./data_types/hubspotDealCreatedWebhookPayload.js"; +import { HubSpotDealStageChangedWebhookPayloadDataType } from "./data_types/hubspotDealStageChangedWebhookPayload.js"; +import { HubSpotCompanyCreatedWebhookPayloadDataType } from "./data_types/hubspotCompanyCreatedWebhookPayload.js"; +import { HubSpotFormSubmittedWebhookPayloadDataType } from "./data_types/hubspotFormSubmittedWebhookPayload.js"; import { HubSpotContactCreatedWebhook } from "./events/hubspotContactCreatedWebhook.js"; +import { HubSpotContactPropertyChangedWebhook } from "./events/hubspotContactPropertyChangedWebhook.js"; import { HubSpotDealCreatedWebhook } from "./events/hubspotDealCreatedWebhook.js"; import { HubSpotDealStageChangedWebhook } from "./events/hubspotDealStageChangedWebhook.js"; +import { HubSpotCompanyCreatedWebhook } from "./events/hubspotCompanyCreatedWebhook.js"; import { HubSpotFormSubmittedWebhook } from "./events/hubspotFormSubmittedWebhook.js"; import { HubSpotCreateContactFunction } from "./functions/hubspotCreateContactFunction.js"; @@ -22,6 +33,10 @@ import { HubSpotCreateCompanyFunction } from "./functions/hubspotCreateCompanyFu import { HubSpotAddNoteFunction } from "./functions/hubspotAddNoteFunction.js"; import { HubSpotAssociateFunction } from "./functions/hubspotAssociateFunction.js"; import { HubSpotSearchObjectsFunction } from "./functions/hubspotSearchObjectsFunction.js"; +import { HubSpotVerifyWebhookSignatureFunction } from "./functions/hubspotVerifyWebhookSignatureFunction.js"; +import { HubSpotCreatePropertyMapFunction } from "./functions/utils/hubspotCreatePropertyMapFunction.js"; +import { HubSpotCreateSearchFilterFunction } from "./functions/utils/hubspotCreateSearchFilterFunction.js"; +import { HubSpotCreateAssociationTypeFunction } from "./functions/utils/hubspotCreateAssociationTypeFunction.js"; const action = new Action( process.env.ACTION_ID ?? "hubspot-action", @@ -29,45 +44,33 @@ const action = new Action( process.env.AQUILA_URL ?? "127.0.0.1:8081", "code0-tech", "simple:hubspot", - "HubSpot CRM integration: react to contact/deal/company webhooks and create, update, search, associate, and annotate CRM records via the HubSpot CRM v3 API.", + "HubSpot CRM integration: react to contact/deal/company/form webhooks and create, update, search, associate, and annotate CRM records via the HubSpot CRM v3 API.", [{ code: "en-US", content: "HubSpot" }], - [ - { - identifier: "access_token", - type: "TEXT", - name: [{ code: "en-US", content: "Access token" }], - description: [{ code: "en-US", content: "Private-app access token (Bearer) used to authenticate with the HubSpot CRM API." }], - linkedDataTypes: ["TEXT"], - }, - { - identifier: "app_id", - type: "TEXT", - defaultValue: "", - name: [{ code: "en-US", content: "App id" }], - description: [{ code: "en-US", content: "Optional HubSpot app id, used when managing webhook subscriptions." }], - linkedDataTypes: ["TEXT"], - }, - { - identifier: "client_secret", - type: "TEXT", - defaultValue: "", - name: [{ code: "en-US", content: "Client secret" }], - description: [{ code: "en-US", content: "Optional HubSpot app client secret, used to validate the X-HubSpot-Signature on inbound webhooks." }], - linkedDataTypes: ["TEXT"], - }, - ] + [] ); +// Data types first: events and functions reference them in their signatures. +action.registerDataTypeClass(HubSpotPropertyMapDataType); action.registerDataTypeClass(HubSpotContactDataType); action.registerDataTypeClass(HubSpotDealDataType); action.registerDataTypeClass(HubSpotCompanyDataType); action.registerDataTypeClass(HubSpotNoteDataType); action.registerDataTypeClass(HubSpotSearchResultDataType); +action.registerDataTypeClass(HubSpotSearchFilterDataType); +action.registerDataTypeClass(HubSpotAssociationDataType); action.registerDataTypeClass(HubSpotWebhookEventDataType); +action.registerDataTypeClass(HubSpotContactCreatedWebhookPayloadDataType); +action.registerDataTypeClass(HubSpotContactPropertyChangedWebhookPayloadDataType); +action.registerDataTypeClass(HubSpotDealCreatedWebhookPayloadDataType); +action.registerDataTypeClass(HubSpotDealStageChangedWebhookPayloadDataType); +action.registerDataTypeClass(HubSpotCompanyCreatedWebhookPayloadDataType); +action.registerDataTypeClass(HubSpotFormSubmittedWebhookPayloadDataType); action.registerEventClass(HubSpotContactCreatedWebhook); +action.registerEventClass(HubSpotContactPropertyChangedWebhook); action.registerEventClass(HubSpotDealCreatedWebhook); action.registerEventClass(HubSpotDealStageChangedWebhook); +action.registerEventClass(HubSpotCompanyCreatedWebhook); action.registerEventClass(HubSpotFormSubmittedWebhook); action.registerRuntimeFunction(HubSpotCreateContactFunction); @@ -79,6 +82,10 @@ action.registerRuntimeFunction(HubSpotCreateCompanyFunction); action.registerRuntimeFunction(HubSpotAddNoteFunction); action.registerRuntimeFunction(HubSpotAssociateFunction); action.registerRuntimeFunction(HubSpotSearchObjectsFunction); +action.registerRuntimeFunction(HubSpotVerifyWebhookSignatureFunction); +action.registerRuntimeFunction(HubSpotCreatePropertyMapFunction); +action.registerRuntimeFunction(HubSpotCreateSearchFilterFunction); +action.registerRuntimeFunction(HubSpotCreateAssociationTypeFunction); action.on(CodeZeroEvent.connected, () => { console.log("Connected to aquila"); diff --git a/actions/hubspot-action/test/helpers.test.ts b/actions/hubspot-action/test/helpers.test.ts new file mode 100644 index 0000000..f3ec4e2 --- /dev/null +++ b/actions/hubspot-action/test/helpers.test.ts @@ -0,0 +1,114 @@ +import "reflect-metadata"; +import { createHash, createHmac } from "node:crypto"; +import { describe, expect, it } from "vitest"; +import { createPropertyMap, parseProperties, verifyWebhookSignature } from "../src/helpers.js"; +import { HubSpotCreateSearchFilterFunction } from "../src/functions/utils/hubspotCreateSearchFilterFunction.js"; +import { HubSpotCreateAssociationTypeFunction } from "../src/functions/utils/hubspotCreateAssociationTypeFunction.js"; +import { HubSpotDealStageChangedWebhookPayloadSchema } from "../src/data_types/hubspotDealStageChangedWebhookPayload.js"; +import { HubSpotFormSubmittedWebhookPayloadSchema } from "../src/data_types/hubspotFormSubmittedWebhookPayload.js"; + +describe("property maps", () => { + it("builds a map from parallel lists", () => { + expect(createPropertyMap(["firstname", "lifecyclestage"], ["Ada", "lead"])).toEqual({ + firstname: "Ada", + lifecyclestage: "lead", + }); + }); + + it("rejects lists of different length", () => { + expect(() => createPropertyMap(["a", "b"], ["1"])).toThrow(); + }); + + it("accepts a property map object as well as a JSON string", () => { + expect(parseProperties({ firstname: "Ada", amount: 42 })).toEqual({ firstname: "Ada", amount: "42" }); + expect(parseProperties('{"firstname":"Ada"}')).toEqual({ firstname: "Ada" }); + }); +}); + +describe("hubspotCreateSearchFilter", () => { + const fn = new HubSpotCreateSearchFilterFunction(); + + it("builds an EQ filter and normalises the operator", () => { + expect(fn.run(undefined, "email", "eq", "ada@example.com")).toEqual({ + propertyName: "email", + operator: "EQ", + value: "ada@example.com", + }); + }); + + it("rejects unknown operators and IN without values", () => { + expect(() => fn.run(undefined, "email", "LIKE", "x")).toThrow(); + expect(() => fn.run(undefined, "dealstage", "IN")).toThrow(); + }); +}); + +describe("hubspotCreateAssociationType", () => { + const fn = new HubSpotCreateAssociationTypeFunction(); + + it("defaults to HUBSPOT_DEFINED", () => { + expect(fn.run(undefined, 3)).toEqual({ associationCategory: "HUBSPOT_DEFINED", associationTypeId: 3 }); + }); + + it("rejects invalid categories and ids", () => { + expect(() => fn.run(undefined, 3, "SOMETHING")).toThrow(); + expect(() => fn.run(undefined, 1.5)).toThrow(); + }); +}); + +describe("webhook payloads", () => { + it("parses a batched deal stage change delivery", () => { + const parsed = HubSpotDealStageChangedWebhookPayloadSchema.parse([ + { objectId: 1, subscriptionType: "deal.propertyChange", propertyName: "dealstage", propertyValue: "closedwon" }, + { objectId: 2, subscriptionType: "deal.propertyChange", propertyName: "dealstage", propertyValue: "appointmentscheduled" }, + ]); + expect(parsed).toHaveLength(2); + }); + + it("rejects a property change without the property name", () => { + expect(() => + HubSpotDealStageChangedWebhookPayloadSchema.parse([{ objectId: 1, subscriptionType: "deal.propertyChange" }]) + ).toThrow(); + }); + + it("parses a form submission payload", () => { + const parsed = HubSpotFormSubmittedWebhookPayloadSchema.parse({ + formId: "abc", + values: [{ name: "email", value: "ada@example.com" }], + }); + expect(parsed.values?.[0].value).toEqual("ada@example.com"); + }); +}); + +describe("verifyWebhookSignature", () => { + const secret = "test-secret"; + const payload = [{ eventId: 1, objectId: 123, subscriptionType: "contact.creation" }]; + const body = JSON.stringify(payload); + const url = "https://hooks.example.com/hubspot?x=1"; + + it("accepts a valid v1 signature and rejects a tampered body", () => { + const signature = createHash("sha256").update(secret + body).digest("hex"); + const headers = { "X-HubSpot-Signature": signature, "X-HubSpot-Signature-Version": "v1" }; + expect(verifyWebhookSignature(secret, headers, payload, "POST", undefined)).toBe(true); + expect(verifyWebhookSignature(secret, headers, [{ ...payload[0], objectId: 999 }], "POST", undefined)).toBe(false); + }); + + it("accepts a valid v2 signature", () => { + const signature = createHash("sha256").update(secret + "POST" + url + body).digest("hex"); + const headers = { "x-hubspot-signature": signature, "x-hubspot-signature-version": "v2" }; + expect(verifyWebhookSignature(secret, headers, payload, "POST", url)).toBe(true); + }); + + it("accepts a fresh v3 signature and rejects a stale one", () => { + const now = 1_800_000_000_000; + const timestamp = String(now - 1000); + const signature = createHmac("sha256", secret).update("POST" + url + body + timestamp).digest("base64"); + const headers = { "x-hubspot-signature-v3": signature, "x-hubspot-request-timestamp": timestamp }; + expect(verifyWebhookSignature(secret, headers, payload, "POST", url, now)).toBe(true); + expect(verifyWebhookSignature(secret, headers, payload, "POST", url, now + 10 * 60 * 1000)).toBe(false); + expect(verifyWebhookSignature("wrong", headers, payload, "POST", url, now)).toBe(false); + }); + + it("returns false without a signature header", () => { + expect(verifyWebhookSignature(secret, {}, payload, "POST", url)).toBe(false); + }); +}); From 6edfde9ef2dee0887de1ef2e79cd89637a3b9567 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Mon, 30 Nov 2026 17:09:07 +0100 Subject: [PATCH 4/6] refactor(hubspot-action): take properties as key/value object --- actions/hubspot-action/README.md | 10 +- .../src/data_types/hubspotPropertyMap.ts | 15 -- .../src/functions/hubspotAddNoteFunction.ts | 6 +- .../functions/hubspotCreateCompanyFunction.ts | 6 +- .../functions/hubspotCreateContactFunction.ts | 6 +- .../functions/hubspotCreateDealFunction.ts | 4 +- .../functions/hubspotUpdateContactFunction.ts | 6 +- .../functions/hubspotUpdateDealFunction.ts | 6 +- .../utils/hubspotCreatePropertyMapFunction.ts | 21 --- actions/hubspot-action/src/helpers.ts | 34 +--- actions/hubspot-action/src/index.ts | 166 +++++++++--------- actions/hubspot-action/test/helpers.test.ts | 17 +- 12 files changed, 112 insertions(+), 185 deletions(-) delete mode 100644 actions/hubspot-action/src/data_types/hubspotPropertyMap.ts delete mode 100644 actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts diff --git a/actions/hubspot-action/README.md b/actions/hubspot-action/README.md index 19e737e..61311bd 100644 --- a/actions/hubspot-action/README.md +++ b/actions/hubspot-action/README.md @@ -81,8 +81,10 @@ with `JSON.stringify`. This matches the compact JSON HubSpot sends. | `hubspotSearchObjects` | `(AccessToken, ObjectType, Filters, Query?, Properties?, Limit?): HUBSPOT_SEARCH_RESULT` | CRM search; all filters must match (AND). | | `hubspotVerifyWebhookSignature` | `(ClientSecret, Input, RequestUrl?): BOOLEAN` | Validate the signature of an inbound HubSpot webhook. | -`Properties` is a `HUBSPOT_PROPERTY_MAP`. A JSON object string is accepted as -well, for backwards compatibility. +`Properties` is an `OBJECT<{ [key: string]: string }>`: key/value pairs of +internal HubSpot property name and value, e.g. `dealstage` → `closedwon`, +`amount` → `1500`. All values are text. A JSON object string is accepted as +well. ### Utils @@ -90,7 +92,6 @@ Data-type builders, like the GLS `create*` utils: | Identifier | Signature | Description | |------------|-----------|-------------| -| `hubspotCreatePropertyMap` | `(Names: LIST, Values: LIST): HUBSPOT_PROPERTY_MAP` | Build a property map from parallel name/value lists. | | `hubspotCreateSearchFilter` | `(PropertyName, Operator, Value?, Values?, HighValue?): HUBSPOT_SEARCH_FILTER` | Build a search filter (`EQ`, `GT`, `IN`, `BETWEEN`, `CONTAINS_TOKEN`, ...). | | `hubspotCreateAssociationType` | `(AssociationTypeId, AssociationCategory?): HUBSPOT_ASSOCIATION` | Build an association type or label for `hubspotAssociate`. | @@ -99,8 +100,7 @@ Data-type builders, like the GLS `create*` utils: - `HUBSPOT_CONTACT`, `HUBSPOT_DEAL`, `HUBSPOT_COMPANY`, `HUBSPOT_NOTE`: all share the SDK's `SimplePublicObject` envelope (`id`, `properties`, timestamps, `archived`). -- `HUBSPOT_SEARCH_RESULT`, `HUBSPOT_SEARCH_FILTER`, `HUBSPOT_ASSOCIATION`, - `HUBSPOT_PROPERTY_MAP`. +- `HUBSPOT_SEARCH_RESULT`, `HUBSPOT_SEARCH_FILTER`, `HUBSPOT_ASSOCIATION`. - `HUBSPOT_WEBHOOK_EVENT` (a single change event) and one payload type per trigger (see [Triggers](#triggers)). diff --git a/actions/hubspot-action/src/data_types/hubspotPropertyMap.ts b/actions/hubspot-action/src/data_types/hubspotPropertyMap.ts deleted file mode 100644 index 9dbe3c0..0000000 --- a/actions/hubspot-action/src/data_types/hubspotPropertyMap.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Identifier, Name, Schema } from "@code0-tech/hercules"; -import { z } from "zod"; - -/** - * A flat map of HubSpot property names to values. HubSpot CRM properties are a - * dynamic key/value bag, so create/update functions take one of these instead - * of a fixed set of typed parameters. Build one with `hubspotCreatePropertyMap`. - */ -export const HubSpotPropertyMapSchema = z.record(z.string(), z.string()); -export type HubSpotPropertyMap = z.infer; - -@Identifier("HUBSPOT_PROPERTY_MAP") -@Name({ code: "en-US", content: "HubSpot property map" }) -@Schema(HubSpotPropertyMapSchema) -export class HubSpotPropertyMapDataType {} diff --git a/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts index dd080f2..c02c0c7 100644 --- a/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts @@ -7,16 +7,16 @@ import { HubSpotNote } from "../data_types/hubspotNote.js"; @Identifier("hubspotAddNote") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, ObjectType: string, ObjectId: string, Body: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_NOTE") +@Signature("(AccessToken: string, ObjectType: string, ObjectId: string, Body: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_NOTE") @Name({ code: "en-US", content: "Add note" }) @DisplayMessage({ code: "en-US", content: "Add HubSpot note to ${ObjectType} ${ObjectId}" }) -@Documentation({ code: "en-US", content: "Creates a HubSpot note with the given body and attaches it to a CRM object (e.g. a contact, deal or company) using the default note association. The note timestamp defaults to now. Extra note properties may be passed as a property map." }) +@Documentation({ code: "en-US", content: "Creates a HubSpot note with the given body and attaches it to a CRM object (e.g. a contact, deal or company) using the default note association. The note timestamp defaults to now. Extra note properties may be passed as key/value pairs (internal property name -> value)." }) @Description({ code: "en-US", content: "Adds a note to a HubSpot CRM object." }) @Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "ObjectType", name: [{ code: "en-US", content: "Object type" }], description: [{ code: "en-US", content: "The type of the object to attach the note to (e.g. contacts, deals, companies)." }] }) @Parameter({ runtimeName: "ObjectId", name: [{ code: "en-US", content: "Object id" }], description: [{ code: "en-US", content: "The id of the object to attach the note to." }] }) @Parameter({ runtimeName: "Body", name: [{ code: "en-US", content: "Body" }], description: [{ code: "en-US", content: "The note text (hs_note_body)." }] }) -@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional note properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional additional note properties as key/value pairs: internal property name -> value." }], optional: true }) export class HubSpotAddNoteFunction { async run(_context: FunctionContext, AccessToken: string, ObjectType: string, ObjectId: string, Body: string, Properties?: PropertiesInput): Promise { try { diff --git a/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts index ec29864..1fa574e 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts @@ -7,14 +7,14 @@ import { HubSpotCompany } from "../data_types/hubspotCompany.js"; @Identifier("hubspotCreateCompany") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, Name: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_COMPANY") +@Signature("(AccessToken: string, Name: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_COMPANY") @Name({ code: "en-US", content: "Create company" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot company ${Name}" }) -@Documentation({ code: "en-US", content: "Creates a new HubSpot company. Pass additional properties (e.g. domain, industry) as a property map." }) +@Documentation({ code: "en-US", content: "Creates a new HubSpot company. Pass additional properties (e.g. domain, industry) as key/value pairs (internal property name -> value)." }) @Description({ code: "en-US", content: "Creates a new HubSpot company." }) @Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "Name", name: [{ code: "en-US", content: "Name" }], description: [{ code: "en-US", content: "The company name." }] }) -@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional company properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional additional company properties as key/value pairs: internal property name -> value (e.g. domain -> example.com)." }], optional: true }) export class HubSpotCreateCompanyFunction { async run(_context: FunctionContext, AccessToken: string, Name: string, Properties?: PropertiesInput): Promise { try { diff --git a/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts index 8b007e0..6cc0b94 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts @@ -7,14 +7,14 @@ import { HubSpotContact } from "../data_types/hubspotContact.js"; @Identifier("hubspotCreateContact") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, Email: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_CONTACT") +@Signature("(AccessToken: string, Email: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_CONTACT") @Name({ code: "en-US", content: "Create contact" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot contact ${Email}" }) -@Documentation({ code: "en-US", content: "Creates a new contact in HubSpot with the given email. Pass additional properties as a property map (e.g. {\"firstname\":\"Ada\"})." }) +@Documentation({ code: "en-US", content: "Creates a new contact in HubSpot with the given email. Pass additional properties as key/value pairs (e.g. firstname -> Ada)." }) @Description({ code: "en-US", content: "Creates a new HubSpot contact." }) @Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "Email", name: [{ code: "en-US", content: "Email" }], description: [{ code: "en-US", content: "The email address of the contact (used as the primary identifier)." }] }) -@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional HubSpot contact properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional additional contact properties as key/value pairs: internal property name -> value (e.g. firstname -> Ada)." }], optional: true }) export class HubSpotCreateContactFunction { async run(_context: FunctionContext, AccessToken: string, Email: string, Properties?: PropertiesInput): Promise { try { diff --git a/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts index 530a665..c43261a 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts @@ -7,7 +7,7 @@ import { HubSpotDeal } from "../data_types/hubspotDeal.js"; @Identifier("hubspotCreateDeal") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, Name: string, Pipeline: string, Stage: string, Amount?: string, Properties?: HUBSPOT_PROPERTY_MAP): HUBSPOT_DEAL") +@Signature("(AccessToken: string, Name: string, Pipeline: string, Stage: string, Amount?: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_DEAL") @Name({ code: "en-US", content: "Create deal" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot deal ${Name}" }) @Documentation({ code: "en-US", content: "Creates a new HubSpot deal in the given pipeline and stage. Amount and extra properties are optional." }) @@ -17,7 +17,7 @@ import { HubSpotDeal } from "../data_types/hubspotDeal.js"; @Parameter({ runtimeName: "Pipeline", name: [{ code: "en-US", content: "Pipeline" }], description: [{ code: "en-US", content: "The pipeline id the deal belongs to." }] }) @Parameter({ runtimeName: "Stage", name: [{ code: "en-US", content: "Stage" }], description: [{ code: "en-US", content: "The deal stage id (dealstage)." }] }) @Parameter({ runtimeName: "Amount", name: [{ code: "en-US", content: "Amount" }], description: [{ code: "en-US", content: "Optional deal amount." }], optional: true }) -@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional property map (see Create property map) of additional deal properties." }], optional: true }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Optional additional deal properties as key/value pairs: internal property name -> value (e.g. closedate -> 2026-12-31)." }], optional: true }) export class HubSpotCreateDealFunction { async run(_context: FunctionContext, AccessToken: string, Name: string, Pipeline: string, Stage: string, Amount?: string, Properties?: PropertiesInput): Promise { try { diff --git a/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts index 46966bc..66deae0 100644 --- a/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts @@ -7,14 +7,14 @@ import { HubSpotContact } from "../data_types/hubspotContact.js"; @Identifier("hubspotUpdateContact") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, ContactId: string, Properties: HUBSPOT_PROPERTY_MAP): HUBSPOT_CONTACT") +@Signature("(AccessToken: string, ContactId: string, Properties: OBJECT<{ [key: string]: string }>): HUBSPOT_CONTACT") @Name({ code: "en-US", content: "Update contact" }) @DisplayMessage({ code: "en-US", content: "Update HubSpot contact ${ContactId}" }) -@Documentation({ code: "en-US", content: "Updates an existing HubSpot contact. Provide the properties to change as a property map." }) +@Documentation({ code: "en-US", content: "Updates an existing HubSpot contact. Provide the properties to change as key/value pairs (internal property name -> value)." }) @Description({ code: "en-US", content: "Updates an existing HubSpot contact." }) @Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "ContactId", name: [{ code: "en-US", content: "Contact id" }], description: [{ code: "en-US", content: "The HubSpot id of the contact to update." }] }) -@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Property map (see Create property map) of HubSpot contact properties to set." }] }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Contact properties to set as key/value pairs: internal property name -> value (e.g. lifecyclestage -> customer)." }] }) export class HubSpotUpdateContactFunction { async run(_context: FunctionContext, AccessToken: string, ContactId: string, Properties: PropertiesInput): Promise { try { diff --git a/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts index 05c41c0..e17d449 100644 --- a/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts @@ -7,14 +7,14 @@ import { HubSpotDeal } from "../data_types/hubspotDeal.js"; @Identifier("hubspotUpdateDeal") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, DealId: string, Properties: HUBSPOT_PROPERTY_MAP): HUBSPOT_DEAL") +@Signature("(AccessToken: string, DealId: string, Properties: OBJECT<{ [key: string]: string }>): HUBSPOT_DEAL") @Name({ code: "en-US", content: "Update deal" }) @DisplayMessage({ code: "en-US", content: "Update HubSpot deal ${DealId}" }) -@Documentation({ code: "en-US", content: "Updates an existing HubSpot deal. Provide the properties to change (e.g. dealstage, amount) as a property map." }) +@Documentation({ code: "en-US", content: "Updates an existing HubSpot deal. Provide the properties to change (e.g. dealstage, amount) as key/value pairs (internal property name -> value)." }) @Description({ code: "en-US", content: "Updates an existing HubSpot deal." }) @Parameter({ runtimeName: "AccessToken", name: [{ code: "en-US", content: "Access token" }], description: [{ code: "en-US", content: "Private-app access token (Bearer) of the HubSpot account to use." }] }) @Parameter({ runtimeName: "DealId", name: [{ code: "en-US", content: "Deal id" }], description: [{ code: "en-US", content: "The HubSpot id of the deal to update." }] }) -@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Property map (see Create property map) of HubSpot deal properties to set." }] }) +@Parameter({ runtimeName: "Properties", name: [{ code: "en-US", content: "Properties" }], description: [{ code: "en-US", content: "Deal properties to set as key/value pairs: internal property name -> value (e.g. dealstage -> closedwon, amount -> 1500)." }] }) export class HubSpotUpdateDealFunction { async run(_context: FunctionContext, AccessToken: string, DealId: string, Properties: PropertiesInput): Promise { try { diff --git a/actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts b/actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts deleted file mode 100644 index 8c364c1..0000000 --- a/actions/hubspot-action/src/functions/utils/hubspotCreatePropertyMapFunction.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { - Description, DisplayIcon, DisplayMessage, Documentation, - Identifier, Name, Parameter, Signature, -} from "@code0-tech/hercules"; -import { createPropertyMap } from "../../helpers.js"; -import { HubSpotPropertyMap } from "../../data_types/hubspotPropertyMap.js"; - -@Identifier("hubspotCreatePropertyMap") -@DisplayIcon("simple:hubspot") -@Signature("(Names: LIST, Values: LIST): HUBSPOT_PROPERTY_MAP") -@Name({ code: "en-US", content: "Create property map" }) -@DisplayMessage({ code: "en-US", content: "Create HubSpot property map" }) -@Documentation({ code: "en-US", content: "Builds a HubSpot property map (`HUBSPOT_PROPERTY_MAP`) from a list of internal property names (e.g. firstname, lifecyclestage) and a list of values at the same positions. Use it for the Properties parameter of the create/update functions." }) -@Description({ code: "en-US", content: "Creates a HubSpot property map." }) -@Parameter({ runtimeName: "Names", name: [{ code: "en-US", content: "Names" }], description: [{ code: "en-US", content: "The internal HubSpot property names." }] }) -@Parameter({ runtimeName: "Values", name: [{ code: "en-US", content: "Values" }], description: [{ code: "en-US", content: "The values, in the same order as the names." }] }) -export class HubSpotCreatePropertyMapFunction { - run(_context: unknown, Names: string[], Values: string[]): HubSpotPropertyMap { - return createPropertyMap(Names, Values); - } -} diff --git a/actions/hubspot-action/src/helpers.ts b/actions/hubspot-action/src/helpers.ts index 8713481..8b71f99 100644 --- a/actions/hubspot-action/src/helpers.ts +++ b/actions/hubspot-action/src/helpers.ts @@ -8,13 +8,13 @@ import { HubSpotNote, HubSpotNoteSchema } from "./data_types/hubspotNote.js"; import { HubSpotSearchResult, HubSpotSearchResultSchema } from "./data_types/hubspotSearchResult.js"; import { HubSpotAssociation, HubSpotAssociationSchema } from "./data_types/hubspotAssociation.js"; import { HubSpotSearchFilter, HubSpotSearchFilterSchema } from "./data_types/hubspotSearchFilter.js"; -import { HubSpotPropertyMap } from "./data_types/hubspotPropertyMap.js"; /** - * Extra properties as passed by a flow: normally a `HUBSPOT_PROPERTY_MAP` - * object, but a JSON object string is accepted as well. + * Extra properties as passed by a flow: normally an `OBJECT` of key/value + * pairs (internal property name -> value), but a JSON object string is + * accepted as well. */ -export type PropertiesInput = HubSpotPropertyMap | Record | string | null | undefined; +export type PropertiesInput = Record | string | null | undefined; /** * Builds an authenticated HubSpot API client from the private-app access @@ -35,8 +35,8 @@ export function getClient(accessToken: string): Client { /** * Normalises extra properties into a flat HubSpot property map. HubSpot CRM * properties are a dynamic bag of key/value pairs, so functions accept them as - * a `HUBSPOT_PROPERTY_MAP` (see `hubspotCreatePropertyMap`) or, for - * convenience, a JSON object string (e.g. `{"firstname":"Ada"}`). Values are + * an `OBJECT<{ [key: string]: string }>` or, for convenience, a JSON object + * string (e.g. `{"firstname":"Ada"}`). Values are * coerced to strings, which is what the HubSpot API expects. */ export function parseProperties( @@ -70,28 +70,6 @@ export function parseProperties( return out; } -/** Builds a property map from two parallel lists of property names and values. */ -export function createPropertyMap(names: string[], values: string[]): HubSpotPropertyMap { - if (!Array.isArray(names) || !Array.isArray(values)) { - throw new RuntimeError("INVALID_HUBSPOT_PROPERTIES", "Names and values must be lists."); - } - if (names.length !== values.length) { - throw new RuntimeError( - "INVALID_HUBSPOT_PROPERTIES", - `Got ${names.length} property names but ${values.length} values; both lists must have the same length.` - ); - } - const out: HubSpotPropertyMap = {}; - names.forEach((name, i) => { - if (!name) { - throw new RuntimeError("INVALID_HUBSPOT_PROPERTIES", `Property name at position ${i} is empty.`); - } - const value = values[i]; - out[name] = value === null || value === undefined ? "" : String(value); - }); - return out; -} - /** * Normalises the SDK's `SimplePublicObject` (Date timestamps, optional fields) * into the plain shape expected by the zod object schemas. diff --git a/actions/hubspot-action/src/index.ts b/actions/hubspot-action/src/index.ts index afe8dd3..aa8ae3f 100644 --- a/actions/hubspot-action/src/index.ts +++ b/actions/hubspot-action/src/index.ts @@ -1,42 +1,40 @@ -import "reflect-metadata"; -import { Action, CodeZeroEvent } from "@code0-tech/hercules"; +import "reflect-metadata" +import { Action, CodeZeroEvent } from "@code0-tech/hercules" -import { HubSpotContactDataType } from "./data_types/hubspotContact.js"; -import { HubSpotDealDataType } from "./data_types/hubspotDeal.js"; -import { HubSpotCompanyDataType } from "./data_types/hubspotCompany.js"; -import { HubSpotNoteDataType } from "./data_types/hubspotNote.js"; -import { HubSpotSearchResultDataType } from "./data_types/hubspotSearchResult.js"; -import { HubSpotSearchFilterDataType } from "./data_types/hubspotSearchFilter.js"; -import { HubSpotAssociationDataType } from "./data_types/hubspotAssociation.js"; -import { HubSpotPropertyMapDataType } from "./data_types/hubspotPropertyMap.js"; -import { HubSpotWebhookEventDataType } from "./data_types/hubspotWebhookEvent.js"; -import { HubSpotContactCreatedWebhookPayloadDataType } from "./data_types/hubspotContactCreatedWebhookPayload.js"; -import { HubSpotContactPropertyChangedWebhookPayloadDataType } from "./data_types/hubspotContactPropertyChangedWebhookPayload.js"; -import { HubSpotDealCreatedWebhookPayloadDataType } from "./data_types/hubspotDealCreatedWebhookPayload.js"; -import { HubSpotDealStageChangedWebhookPayloadDataType } from "./data_types/hubspotDealStageChangedWebhookPayload.js"; -import { HubSpotCompanyCreatedWebhookPayloadDataType } from "./data_types/hubspotCompanyCreatedWebhookPayload.js"; -import { HubSpotFormSubmittedWebhookPayloadDataType } from "./data_types/hubspotFormSubmittedWebhookPayload.js"; +import { HubSpotContactDataType } from "./data_types/hubspotContact.js" +import { HubSpotDealDataType } from "./data_types/hubspotDeal.js" +import { HubSpotCompanyDataType } from "./data_types/hubspotCompany.js" +import { HubSpotNoteDataType } from "./data_types/hubspotNote.js" +import { HubSpotSearchResultDataType } from "./data_types/hubspotSearchResult.js" +import { HubSpotSearchFilterDataType } from "./data_types/hubspotSearchFilter.js" +import { HubSpotAssociationDataType } from "./data_types/hubspotAssociation.js" +import { HubSpotWebhookEventDataType } from "./data_types/hubspotWebhookEvent.js" +import { HubSpotContactCreatedWebhookPayloadDataType } from "./data_types/hubspotContactCreatedWebhookPayload.js" +import { HubSpotContactPropertyChangedWebhookPayloadDataType } from "./data_types/hubspotContactPropertyChangedWebhookPayload.js" +import { HubSpotDealCreatedWebhookPayloadDataType } from "./data_types/hubspotDealCreatedWebhookPayload.js" +import { HubSpotDealStageChangedWebhookPayloadDataType } from "./data_types/hubspotDealStageChangedWebhookPayload.js" +import { HubSpotCompanyCreatedWebhookPayloadDataType } from "./data_types/hubspotCompanyCreatedWebhookPayload.js" +import { HubSpotFormSubmittedWebhookPayloadDataType } from "./data_types/hubspotFormSubmittedWebhookPayload.js" -import { HubSpotContactCreatedWebhook } from "./events/hubspotContactCreatedWebhook.js"; -import { HubSpotContactPropertyChangedWebhook } from "./events/hubspotContactPropertyChangedWebhook.js"; -import { HubSpotDealCreatedWebhook } from "./events/hubspotDealCreatedWebhook.js"; -import { HubSpotDealStageChangedWebhook } from "./events/hubspotDealStageChangedWebhook.js"; -import { HubSpotCompanyCreatedWebhook } from "./events/hubspotCompanyCreatedWebhook.js"; -import { HubSpotFormSubmittedWebhook } from "./events/hubspotFormSubmittedWebhook.js"; +import { HubSpotContactCreatedWebhook } from "./events/hubspotContactCreatedWebhook.js" +import { HubSpotContactPropertyChangedWebhook } from "./events/hubspotContactPropertyChangedWebhook.js" +import { HubSpotDealCreatedWebhook } from "./events/hubspotDealCreatedWebhook.js" +import { HubSpotDealStageChangedWebhook } from "./events/hubspotDealStageChangedWebhook.js" +import { HubSpotCompanyCreatedWebhook } from "./events/hubspotCompanyCreatedWebhook.js" +import { HubSpotFormSubmittedWebhook } from "./events/hubspotFormSubmittedWebhook.js" -import { HubSpotCreateContactFunction } from "./functions/hubspotCreateContactFunction.js"; -import { HubSpotUpdateContactFunction } from "./functions/hubspotUpdateContactFunction.js"; -import { HubSpotGetContactByEmailFunction } from "./functions/hubspotGetContactByEmailFunction.js"; -import { HubSpotCreateDealFunction } from "./functions/hubspotCreateDealFunction.js"; -import { HubSpotUpdateDealFunction } from "./functions/hubspotUpdateDealFunction.js"; -import { HubSpotCreateCompanyFunction } from "./functions/hubspotCreateCompanyFunction.js"; -import { HubSpotAddNoteFunction } from "./functions/hubspotAddNoteFunction.js"; -import { HubSpotAssociateFunction } from "./functions/hubspotAssociateFunction.js"; -import { HubSpotSearchObjectsFunction } from "./functions/hubspotSearchObjectsFunction.js"; -import { HubSpotVerifyWebhookSignatureFunction } from "./functions/hubspotVerifyWebhookSignatureFunction.js"; -import { HubSpotCreatePropertyMapFunction } from "./functions/utils/hubspotCreatePropertyMapFunction.js"; -import { HubSpotCreateSearchFilterFunction } from "./functions/utils/hubspotCreateSearchFilterFunction.js"; -import { HubSpotCreateAssociationTypeFunction } from "./functions/utils/hubspotCreateAssociationTypeFunction.js"; +import { HubSpotCreateContactFunction } from "./functions/hubspotCreateContactFunction.js" +import { HubSpotUpdateContactFunction } from "./functions/hubspotUpdateContactFunction.js" +import { HubSpotGetContactByEmailFunction } from "./functions/hubspotGetContactByEmailFunction.js" +import { HubSpotCreateDealFunction } from "./functions/hubspotCreateDealFunction.js" +import { HubSpotUpdateDealFunction } from "./functions/hubspotUpdateDealFunction.js" +import { HubSpotCreateCompanyFunction } from "./functions/hubspotCreateCompanyFunction.js" +import { HubSpotAddNoteFunction } from "./functions/hubspotAddNoteFunction.js" +import { HubSpotAssociateFunction } from "./functions/hubspotAssociateFunction.js" +import { HubSpotSearchObjectsFunction } from "./functions/hubspotSearchObjectsFunction.js" +import { HubSpotVerifyWebhookSignatureFunction } from "./functions/hubspotVerifyWebhookSignatureFunction.js" +import { HubSpotCreateSearchFilterFunction } from "./functions/utils/hubspotCreateSearchFilterFunction.js" +import { HubSpotCreateAssociationTypeFunction } from "./functions/utils/hubspotCreateAssociationTypeFunction.js" const action = new Action( process.env.ACTION_ID ?? "hubspot-action", @@ -47,67 +45,65 @@ const action = new Action( "HubSpot CRM integration: react to contact/deal/company/form webhooks and create, update, search, associate, and annotate CRM records via the HubSpot CRM v3 API.", [{ code: "en-US", content: "HubSpot" }], [] -); +) // Data types first: events and functions reference them in their signatures. -action.registerDataTypeClass(HubSpotPropertyMapDataType); -action.registerDataTypeClass(HubSpotContactDataType); -action.registerDataTypeClass(HubSpotDealDataType); -action.registerDataTypeClass(HubSpotCompanyDataType); -action.registerDataTypeClass(HubSpotNoteDataType); -action.registerDataTypeClass(HubSpotSearchResultDataType); -action.registerDataTypeClass(HubSpotSearchFilterDataType); -action.registerDataTypeClass(HubSpotAssociationDataType); -action.registerDataTypeClass(HubSpotWebhookEventDataType); -action.registerDataTypeClass(HubSpotContactCreatedWebhookPayloadDataType); -action.registerDataTypeClass(HubSpotContactPropertyChangedWebhookPayloadDataType); -action.registerDataTypeClass(HubSpotDealCreatedWebhookPayloadDataType); -action.registerDataTypeClass(HubSpotDealStageChangedWebhookPayloadDataType); -action.registerDataTypeClass(HubSpotCompanyCreatedWebhookPayloadDataType); -action.registerDataTypeClass(HubSpotFormSubmittedWebhookPayloadDataType); +action.registerDataTypeClass(HubSpotContactDataType) +action.registerDataTypeClass(HubSpotDealDataType) +action.registerDataTypeClass(HubSpotCompanyDataType) +action.registerDataTypeClass(HubSpotNoteDataType) +action.registerDataTypeClass(HubSpotSearchResultDataType) +action.registerDataTypeClass(HubSpotSearchFilterDataType) +action.registerDataTypeClass(HubSpotAssociationDataType) +action.registerDataTypeClass(HubSpotWebhookEventDataType) +action.registerDataTypeClass(HubSpotContactCreatedWebhookPayloadDataType) +action.registerDataTypeClass(HubSpotContactPropertyChangedWebhookPayloadDataType) +action.registerDataTypeClass(HubSpotDealCreatedWebhookPayloadDataType) +action.registerDataTypeClass(HubSpotDealStageChangedWebhookPayloadDataType) +action.registerDataTypeClass(HubSpotCompanyCreatedWebhookPayloadDataType) +action.registerDataTypeClass(HubSpotFormSubmittedWebhookPayloadDataType) -action.registerEventClass(HubSpotContactCreatedWebhook); -action.registerEventClass(HubSpotContactPropertyChangedWebhook); -action.registerEventClass(HubSpotDealCreatedWebhook); -action.registerEventClass(HubSpotDealStageChangedWebhook); -action.registerEventClass(HubSpotCompanyCreatedWebhook); -action.registerEventClass(HubSpotFormSubmittedWebhook); +action.registerEventClass(HubSpotContactCreatedWebhook) +action.registerEventClass(HubSpotContactPropertyChangedWebhook) +action.registerEventClass(HubSpotDealCreatedWebhook) +action.registerEventClass(HubSpotDealStageChangedWebhook) +action.registerEventClass(HubSpotCompanyCreatedWebhook) +action.registerEventClass(HubSpotFormSubmittedWebhook) -action.registerRuntimeFunction(HubSpotCreateContactFunction); -action.registerRuntimeFunction(HubSpotUpdateContactFunction); -action.registerRuntimeFunction(HubSpotGetContactByEmailFunction); -action.registerRuntimeFunction(HubSpotCreateDealFunction); -action.registerRuntimeFunction(HubSpotUpdateDealFunction); -action.registerRuntimeFunction(HubSpotCreateCompanyFunction); -action.registerRuntimeFunction(HubSpotAddNoteFunction); -action.registerRuntimeFunction(HubSpotAssociateFunction); -action.registerRuntimeFunction(HubSpotSearchObjectsFunction); -action.registerRuntimeFunction(HubSpotVerifyWebhookSignatureFunction); -action.registerRuntimeFunction(HubSpotCreatePropertyMapFunction); -action.registerRuntimeFunction(HubSpotCreateSearchFilterFunction); -action.registerRuntimeFunction(HubSpotCreateAssociationTypeFunction); +action.registerRuntimeFunction(HubSpotCreateContactFunction) +action.registerRuntimeFunction(HubSpotUpdateContactFunction) +action.registerRuntimeFunction(HubSpotGetContactByEmailFunction) +action.registerRuntimeFunction(HubSpotCreateDealFunction) +action.registerRuntimeFunction(HubSpotUpdateDealFunction) +action.registerRuntimeFunction(HubSpotCreateCompanyFunction) +action.registerRuntimeFunction(HubSpotAddNoteFunction) +action.registerRuntimeFunction(HubSpotAssociateFunction) +action.registerRuntimeFunction(HubSpotSearchObjectsFunction) +action.registerRuntimeFunction(HubSpotVerifyWebhookSignatureFunction) +action.registerRuntimeFunction(HubSpotCreateSearchFilterFunction) +action.registerRuntimeFunction(HubSpotCreateAssociationTypeFunction) action.on(CodeZeroEvent.connected, () => { - console.log("Connected to aquila"); -}); + console.log("Connected to aquila") +}) action.on(CodeZeroEvent.error, (error: Error) => { - console.error("Stream error:", error.message); - console.log("Attempting to reconnect in 5s..."); + console.error("Stream error:", error.message) + console.log("Attempting to reconnect in 5s...") setTimeout(() => { action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((err: Error) => { - action.emit(CodeZeroEvent.error, err); - }); - }, 5000); -}); + action.emit(CodeZeroEvent.error, err) + }) + }, 5000) +}) action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((err: Error) => { - action.emit(CodeZeroEvent.error, err); -}); + action.emit(CodeZeroEvent.error, err) +}) action.on(CodeZeroEvent.moduleUpdated, (message: any) => { - console.dir(message, { depth: null }); - console.dir(action.configs.values(), { depth: null }); -}); + console.dir(message, { depth: null }) + console.dir(action.configs.values(), { depth: null }) +}) -export { action }; +export { action } diff --git a/actions/hubspot-action/test/helpers.test.ts b/actions/hubspot-action/test/helpers.test.ts index f3ec4e2..0996848 100644 --- a/actions/hubspot-action/test/helpers.test.ts +++ b/actions/hubspot-action/test/helpers.test.ts @@ -1,25 +1,14 @@ import "reflect-metadata"; import { createHash, createHmac } from "node:crypto"; import { describe, expect, it } from "vitest"; -import { createPropertyMap, parseProperties, verifyWebhookSignature } from "../src/helpers.js"; +import { parseProperties, verifyWebhookSignature } from "../src/helpers.js"; import { HubSpotCreateSearchFilterFunction } from "../src/functions/utils/hubspotCreateSearchFilterFunction.js"; import { HubSpotCreateAssociationTypeFunction } from "../src/functions/utils/hubspotCreateAssociationTypeFunction.js"; import { HubSpotDealStageChangedWebhookPayloadSchema } from "../src/data_types/hubspotDealStageChangedWebhookPayload.js"; import { HubSpotFormSubmittedWebhookPayloadSchema } from "../src/data_types/hubspotFormSubmittedWebhookPayload.js"; -describe("property maps", () => { - it("builds a map from parallel lists", () => { - expect(createPropertyMap(["firstname", "lifecyclestage"], ["Ada", "lead"])).toEqual({ - firstname: "Ada", - lifecyclestage: "lead", - }); - }); - - it("rejects lists of different length", () => { - expect(() => createPropertyMap(["a", "b"], ["1"])).toThrow(); - }); - - it("accepts a property map object as well as a JSON string", () => { +describe("properties", () => { + it("accepts a key/value object as well as a JSON string", () => { expect(parseProperties({ firstname: "Ada", amount: 42 })).toEqual({ firstname: "Ada", amount: "42" }); expect(parseProperties('{"firstname":"Ada"}')).toEqual({ firstname: "Ada" }); }); From 259570556f2c34b53afee9f82a7f48a427506cc4 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Mon, 30 Nov 2026 17:18:01 +0100 Subject: [PATCH 5/6] feat(hubspot-action): accept numbers and booleans as property values --- actions/hubspot-action/README.md | 8 ++++---- .../src/functions/hubspotAddNoteFunction.ts | 2 +- .../src/functions/hubspotCreateCompanyFunction.ts | 2 +- .../src/functions/hubspotCreateContactFunction.ts | 2 +- .../src/functions/hubspotCreateDealFunction.ts | 2 +- .../src/functions/hubspotUpdateContactFunction.ts | 2 +- .../src/functions/hubspotUpdateDealFunction.ts | 2 +- actions/hubspot-action/src/helpers.ts | 2 +- actions/hubspot-action/test/helpers.test.ts | 6 +++++- 9 files changed, 16 insertions(+), 12 deletions(-) diff --git a/actions/hubspot-action/README.md b/actions/hubspot-action/README.md index 61311bd..99b2d10 100644 --- a/actions/hubspot-action/README.md +++ b/actions/hubspot-action/README.md @@ -81,10 +81,10 @@ with `JSON.stringify`. This matches the compact JSON HubSpot sends. | `hubspotSearchObjects` | `(AccessToken, ObjectType, Filters, Query?, Properties?, Limit?): HUBSPOT_SEARCH_RESULT` | CRM search; all filters must match (AND). | | `hubspotVerifyWebhookSignature` | `(ClientSecret, Input, RequestUrl?): BOOLEAN` | Validate the signature of an inbound HubSpot webhook. | -`Properties` is an `OBJECT<{ [key: string]: string }>`: key/value pairs of -internal HubSpot property name and value, e.g. `dealstage` → `closedwon`, -`amount` → `1500`. All values are text. A JSON object string is accepted as -well. +`Properties` is an `OBJECT<{ [key: string]: string | number | boolean }>`: +key/value pairs of internal HubSpot property name and value, e.g. `dealstage` +→ `closedwon`, `amount` → `1500`. Values may be text, numbers or booleans; they +are sent to HubSpot as text. A JSON object string is accepted as well. ### Utils diff --git a/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts index c02c0c7..51e3369 100644 --- a/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotAddNoteFunction.ts @@ -7,7 +7,7 @@ import { HubSpotNote } from "../data_types/hubspotNote.js"; @Identifier("hubspotAddNote") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, ObjectType: string, ObjectId: string, Body: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_NOTE") +@Signature("(AccessToken: string, ObjectType: string, ObjectId: string, Body: string, Properties?: OBJECT<{ [key: string]: string | number | boolean }>): HUBSPOT_NOTE") @Name({ code: "en-US", content: "Add note" }) @DisplayMessage({ code: "en-US", content: "Add HubSpot note to ${ObjectType} ${ObjectId}" }) @Documentation({ code: "en-US", content: "Creates a HubSpot note with the given body and attaches it to a CRM object (e.g. a contact, deal or company) using the default note association. The note timestamp defaults to now. Extra note properties may be passed as key/value pairs (internal property name -> value)." }) diff --git a/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts index 1fa574e..5c2c82c 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateCompanyFunction.ts @@ -7,7 +7,7 @@ import { HubSpotCompany } from "../data_types/hubspotCompany.js"; @Identifier("hubspotCreateCompany") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, Name: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_COMPANY") +@Signature("(AccessToken: string, Name: string, Properties?: OBJECT<{ [key: string]: string | number | boolean }>): HUBSPOT_COMPANY") @Name({ code: "en-US", content: "Create company" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot company ${Name}" }) @Documentation({ code: "en-US", content: "Creates a new HubSpot company. Pass additional properties (e.g. domain, industry) as key/value pairs (internal property name -> value)." }) diff --git a/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts index 6cc0b94..0f8580a 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateContactFunction.ts @@ -7,7 +7,7 @@ import { HubSpotContact } from "../data_types/hubspotContact.js"; @Identifier("hubspotCreateContact") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, Email: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_CONTACT") +@Signature("(AccessToken: string, Email: string, Properties?: OBJECT<{ [key: string]: string | number | boolean }>): HUBSPOT_CONTACT") @Name({ code: "en-US", content: "Create contact" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot contact ${Email}" }) @Documentation({ code: "en-US", content: "Creates a new contact in HubSpot with the given email. Pass additional properties as key/value pairs (e.g. firstname -> Ada)." }) diff --git a/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts index c43261a..8f4734e 100644 --- a/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotCreateDealFunction.ts @@ -7,7 +7,7 @@ import { HubSpotDeal } from "../data_types/hubspotDeal.js"; @Identifier("hubspotCreateDeal") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, Name: string, Pipeline: string, Stage: string, Amount?: string, Properties?: OBJECT<{ [key: string]: string }>): HUBSPOT_DEAL") +@Signature("(AccessToken: string, Name: string, Pipeline: string, Stage: string, Amount?: string, Properties?: OBJECT<{ [key: string]: string | number | boolean }>): HUBSPOT_DEAL") @Name({ code: "en-US", content: "Create deal" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot deal ${Name}" }) @Documentation({ code: "en-US", content: "Creates a new HubSpot deal in the given pipeline and stage. Amount and extra properties are optional." }) diff --git a/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts index 66deae0..83b7cc4 100644 --- a/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotUpdateContactFunction.ts @@ -7,7 +7,7 @@ import { HubSpotContact } from "../data_types/hubspotContact.js"; @Identifier("hubspotUpdateContact") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, ContactId: string, Properties: OBJECT<{ [key: string]: string }>): HUBSPOT_CONTACT") +@Signature("(AccessToken: string, ContactId: string, Properties: OBJECT<{ [key: string]: string | number | boolean }>): HUBSPOT_CONTACT") @Name({ code: "en-US", content: "Update contact" }) @DisplayMessage({ code: "en-US", content: "Update HubSpot contact ${ContactId}" }) @Documentation({ code: "en-US", content: "Updates an existing HubSpot contact. Provide the properties to change as key/value pairs (internal property name -> value)." }) diff --git a/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts index e17d449..6826d26 100644 --- a/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts +++ b/actions/hubspot-action/src/functions/hubspotUpdateDealFunction.ts @@ -7,7 +7,7 @@ import { HubSpotDeal } from "../data_types/hubspotDeal.js"; @Identifier("hubspotUpdateDeal") @DisplayIcon("simple:hubspot") -@Signature("(AccessToken: string, DealId: string, Properties: OBJECT<{ [key: string]: string }>): HUBSPOT_DEAL") +@Signature("(AccessToken: string, DealId: string, Properties: OBJECT<{ [key: string]: string | number | boolean }>): HUBSPOT_DEAL") @Name({ code: "en-US", content: "Update deal" }) @DisplayMessage({ code: "en-US", content: "Update HubSpot deal ${DealId}" }) @Documentation({ code: "en-US", content: "Updates an existing HubSpot deal. Provide the properties to change (e.g. dealstage, amount) as key/value pairs (internal property name -> value)." }) diff --git a/actions/hubspot-action/src/helpers.ts b/actions/hubspot-action/src/helpers.ts index 8b71f99..e361699 100644 --- a/actions/hubspot-action/src/helpers.ts +++ b/actions/hubspot-action/src/helpers.ts @@ -35,7 +35,7 @@ export function getClient(accessToken: string): Client { /** * Normalises extra properties into a flat HubSpot property map. HubSpot CRM * properties are a dynamic bag of key/value pairs, so functions accept them as - * an `OBJECT<{ [key: string]: string }>` or, for convenience, a JSON object + * an `OBJECT<{ [key: string]: string | number | boolean }>` or, for convenience, a JSON object * string (e.g. `{"firstname":"Ada"}`). Values are * coerced to strings, which is what the HubSpot API expects. */ diff --git a/actions/hubspot-action/test/helpers.test.ts b/actions/hubspot-action/test/helpers.test.ts index 0996848..ef4c649 100644 --- a/actions/hubspot-action/test/helpers.test.ts +++ b/actions/hubspot-action/test/helpers.test.ts @@ -9,7 +9,11 @@ import { HubSpotFormSubmittedWebhookPayloadSchema } from "../src/data_types/hubs describe("properties", () => { it("accepts a key/value object as well as a JSON string", () => { - expect(parseProperties({ firstname: "Ada", amount: 42 })).toEqual({ firstname: "Ada", amount: "42" }); + expect(parseProperties({ firstname: "Ada", amount: 42, hs_is_closed: true })).toEqual({ + firstname: "Ada", + amount: "42", + hs_is_closed: "true", + }); expect(parseProperties('{"firstname":"Ada"}')).toEqual({ firstname: "Ada" }); }); }); From 9308bff07baa4a89f449f07c3b4f3c9be421d464 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Mon, 30 Nov 2026 18:07:12 +0100 Subject: [PATCH 6/6] feat(hubspot-action): pick search filter operator from a dropdown --- actions/hubspot-action/README.md | 4 ++-- .../src/data_types/hubspotSearchFilter.ts | 15 ++++++++++++++- .../utils/hubspotCreateSearchFilterFunction.ts | 4 ++-- actions/hubspot-action/src/index.ts | 3 ++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/actions/hubspot-action/README.md b/actions/hubspot-action/README.md index 99b2d10..c6b8ed7 100644 --- a/actions/hubspot-action/README.md +++ b/actions/hubspot-action/README.md @@ -92,7 +92,7 @@ Data-type builders, like the GLS `create*` utils: | Identifier | Signature | Description | |------------|-----------|-------------| -| `hubspotCreateSearchFilter` | `(PropertyName, Operator, Value?, Values?, HighValue?): HUBSPOT_SEARCH_FILTER` | Build a search filter (`EQ`, `GT`, `IN`, `BETWEEN`, `CONTAINS_TOKEN`, ...). | +| `hubspotCreateSearchFilter` | `(PropertyName, Operator: HUBSPOT_SEARCH_OPERATOR, Value?, Values?, HighValue?): HUBSPOT_SEARCH_FILTER` | Build a search filter; the operator (`EQ`, `GT`, `IN`, `BETWEEN`, `CONTAINS_TOKEN`, ...) is picked from a dropdown. | | `hubspotCreateAssociationType` | `(AssociationTypeId, AssociationCategory?): HUBSPOT_ASSOCIATION` | Build an association type or label for `hubspotAssociate`. | ## Data types @@ -100,7 +100,7 @@ Data-type builders, like the GLS `create*` utils: - `HUBSPOT_CONTACT`, `HUBSPOT_DEAL`, `HUBSPOT_COMPANY`, `HUBSPOT_NOTE`: all share the SDK's `SimplePublicObject` envelope (`id`, `properties`, timestamps, `archived`). -- `HUBSPOT_SEARCH_RESULT`, `HUBSPOT_SEARCH_FILTER`, `HUBSPOT_ASSOCIATION`. +- `HUBSPOT_SEARCH_RESULT`, `HUBSPOT_SEARCH_FILTER`, `HUBSPOT_SEARCH_OPERATOR`, `HUBSPOT_ASSOCIATION`. - `HUBSPOT_WEBHOOK_EVENT` (a single change event) and one payload type per trigger (see [Triggers](#triggers)). diff --git a/actions/hubspot-action/src/data_types/hubspotSearchFilter.ts b/actions/hubspot-action/src/data_types/hubspotSearchFilter.ts index e0217d8..de7bc58 100644 --- a/actions/hubspot-action/src/data_types/hubspotSearchFilter.ts +++ b/actions/hubspot-action/src/data_types/hubspotSearchFilter.ts @@ -6,6 +6,19 @@ export const HUBSPOT_FILTER_OPERATORS = [ "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN", ] as const; +/** + * The comparison operator of a search filter. A data type of its own so the + * editor offers the operators as a dropdown. + */ +export const HubSpotSearchOperatorSchema = z.enum(HUBSPOT_FILTER_OPERATORS); +export type HubSpotSearchOperator = z.infer; + +@Identifier("HUBSPOT_SEARCH_OPERATOR") +@Name({ code: "en-US", content: "HubSpot search operator" }) +@DisplayMessage({ code: "en-US", content: "HubSpot search operator" }) +@Schema(HubSpotSearchOperatorSchema) +export class HubSpotSearchOperatorDataType {} + /** * A single CRM search filter. `value` is used by the comparison operators, * `values` by IN / NOT_IN, and `value` + `highValue` by BETWEEN. @@ -14,7 +27,7 @@ export const HUBSPOT_FILTER_OPERATORS = [ */ export const HubSpotSearchFilterSchema = z.object({ propertyName: z.string().describe("The property to filter on."), - operator: z.enum(HUBSPOT_FILTER_OPERATORS).describe("The comparison operator."), + operator: HubSpotSearchOperatorSchema.describe("The comparison operator."), value: z.string().optional().describe("The value to compare against."), values: z.array(z.string()).optional().describe("The values for IN / NOT_IN."), highValue: z.string().optional().describe("The upper bound for BETWEEN."), diff --git a/actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts b/actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts index cd8e83a..5efb96f 100644 --- a/actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts +++ b/actions/hubspot-action/src/functions/utils/hubspotCreateSearchFilterFunction.ts @@ -8,13 +8,13 @@ import { @Identifier("hubspotCreateSearchFilter") @DisplayIcon("simple:hubspot") -@Signature("(PropertyName: string, Operator: string, Value?: string, Values?: LIST, HighValue?: string): HUBSPOT_SEARCH_FILTER") +@Signature("(PropertyName: string, Operator: HUBSPOT_SEARCH_OPERATOR, Value?: string, Values?: LIST, HighValue?: string): HUBSPOT_SEARCH_FILTER") @Name({ code: "en-US", content: "Create search filter" }) @DisplayMessage({ code: "en-US", content: "Create HubSpot filter ${PropertyName} ${Operator}" }) @Documentation({ code: "en-US", content: `Builds a filter for Search objects. Operators: ${HUBSPOT_FILTER_OPERATORS.join(", ")}. Comparison operators use Value, IN / NOT_IN use Values, BETWEEN uses Value and HighValue, HAS_PROPERTY / NOT_HAS_PROPERTY need no value.` }) @Description({ code: "en-US", content: "Creates a HubSpot search filter." }) @Parameter({ runtimeName: "PropertyName", name: [{ code: "en-US", content: "Property name" }], description: [{ code: "en-US", content: "The internal name of the property to filter on." }] }) -@Parameter({ runtimeName: "Operator", name: [{ code: "en-US", content: "Operator" }], description: [{ code: "en-US", content: "The comparison operator, e.g. EQ, GT, IN, CONTAINS_TOKEN." }] }) +@Parameter({ runtimeName: "Operator", name: [{ code: "en-US", content: "Operator" }], description: [{ code: "en-US", content: "The comparison operator: EQ / NEQ (equal / not equal), LT / LTE / GT / GTE (less / greater than), BETWEEN, IN / NOT_IN, HAS_PROPERTY / NOT_HAS_PROPERTY, CONTAINS_TOKEN / NOT_CONTAINS_TOKEN." }] }) @Parameter({ runtimeName: "Value", name: [{ code: "en-US", content: "Value" }], description: [{ code: "en-US", content: "The value to compare against (also the lower bound for BETWEEN)." }], optional: true }) @Parameter({ runtimeName: "Values", name: [{ code: "en-US", content: "Values" }], description: [{ code: "en-US", content: "The values for IN / NOT_IN." }], optional: true }) @Parameter({ runtimeName: "HighValue", name: [{ code: "en-US", content: "High value" }], description: [{ code: "en-US", content: "The upper bound for BETWEEN." }], optional: true }) diff --git a/actions/hubspot-action/src/index.ts b/actions/hubspot-action/src/index.ts index aa8ae3f..35e2297 100644 --- a/actions/hubspot-action/src/index.ts +++ b/actions/hubspot-action/src/index.ts @@ -6,7 +6,7 @@ import { HubSpotDealDataType } from "./data_types/hubspotDeal.js" import { HubSpotCompanyDataType } from "./data_types/hubspotCompany.js" import { HubSpotNoteDataType } from "./data_types/hubspotNote.js" import { HubSpotSearchResultDataType } from "./data_types/hubspotSearchResult.js" -import { HubSpotSearchFilterDataType } from "./data_types/hubspotSearchFilter.js" +import { HubSpotSearchFilterDataType, HubSpotSearchOperatorDataType } from "./data_types/hubspotSearchFilter.js" import { HubSpotAssociationDataType } from "./data_types/hubspotAssociation.js" import { HubSpotWebhookEventDataType } from "./data_types/hubspotWebhookEvent.js" import { HubSpotContactCreatedWebhookPayloadDataType } from "./data_types/hubspotContactCreatedWebhookPayload.js" @@ -53,6 +53,7 @@ action.registerDataTypeClass(HubSpotDealDataType) action.registerDataTypeClass(HubSpotCompanyDataType) action.registerDataTypeClass(HubSpotNoteDataType) action.registerDataTypeClass(HubSpotSearchResultDataType) +action.registerDataTypeClass(HubSpotSearchOperatorDataType) action.registerDataTypeClass(HubSpotSearchFilterDataType) action.registerDataTypeClass(HubSpotAssociationDataType) action.registerDataTypeClass(HubSpotWebhookEventDataType)