Skip to content

WebhookListResponse and WebhookInfo types don't match FM API response #126

@eluce2

Description

@eluce2

Bug

WebhookListResponse and WebhookInfo type definitions in @proofkit/fmodata don't match what the FM Data API actually returns, forcing consumers to use as unknown as double casts.

Issues

1. WebhookListResponse property casing is wrong

// Current type (wrong)
export interface WebhookListResponse {
  Status: string;      // actual API returns `status`
  WebHook: WebhookInfo[];  // actual API returns `webhooks`
}

Consumer workaround:

const result = await ctx.fm.webhook.list();
return result as unknown as { status: string; webhooks: WebhookInfo[] };

2. Source vs dist .d.ts mismatch for WebhookInfo

Source (src/client/webhook-builder.ts):

export interface WebhookInfo {
  webHookID: number;  // camelCase 'H'
  // no `webhook` property
  url: string;
  ...
}

Dist (dist/esm/client/webhook-builder.d.ts):

export interface WebhookInfo {
  webhookID: number;  // lowercase 'h' — different!
  webhook: string;    // extra property not in source
  url: string;
  ...
}

The built types don't match the source types — webHookID vs webhookID and an extra webhook field in dist only.

Expected

Types should match the actual FM Data API response shape so consumers don't need casts. Source and dist types should also be in sync.

Version

@proofkit/fmodata@0.1.0-beta.30

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions