Webhook creation via node sdk failing, but no TS errors

I want to create webhooks using the node SDK (^22.3.1-rc.3), but running into an issue where the error i get on creation says that the request body is missing eventAction.

const webhookParams = {
      subscription_url: subscriptionUrl,
      event_action: '*',
      event_object: '*'
    };

    const doesWebhookExists = await this.checkIfWebhookExists(webhookParams as AddWebhookRequest);

    if (!doesWebhookExists) {
      console.log('Webook does not exist yet');

      await this.webhookApi
        .addWebhook(webhookParams as WebhooksApiAddWebhookRequest)
        .then(response => {
          console.log(response);
          return {
            subscriptionUrl: response.data?.subscription_url || subscriptionUrl,
            status: 'active',
            description
          };
        })
        .catch(error => console.error(error));
    }

The error I’m getting:

{
  success: false,
  status: 'error',
  code: 'ERR_SCHEMA_VALIDATION_FAILED',
  message: "body must have required property 'eventAction'"
}

What’s strange is that the error is mentioning eventAction in camelcase, while the types are using underscores. I tried changing webhookParams to use camelcase, bypassing the types, but that did not work either. Am I calling the addWebhook method wrong?

Ok, very short-lived question. I was indeed not calling the addWebhook method properly, instead I needed to do:

await this.webhookApi
        .addWebhook({
            AddWebhookRequest: webhookParams as AddWebhookRequest
        } as WebhooksApiAddWebhookRequest)

Figured it out after going through the Types and piecing practices together mentioned in this guide: client-nodejs/migration.md at typescript-rc · pipedrive/client-nodejs · GitHub

I appreciate the SDK is still in beta, but what I think would have been helpful here is a more descriptive error message. It initially sounded like there was a case issue.