mailjet / mailjet-apiv3-nodejs

[API v3] Official Mailjet API v3 NodeJS wrapper
https://dev.mailjet.com
MIT License
232 stars 67 forks source link

invalid type ContactList ,ID property no longer exists in getcontactslists response #262

Closed arekits closed 8 months ago

arekits commented 8 months ago

version: 6.0.3

implementation

import type { ContactList } from 'node-mailjet';
import Mailjet from 'node-mailjet';

   const { body: contactsData } = await mailjet
      .get('contact', { version: 'v3' })
      .id(contactId)
      .action('getcontactslists')
      .request<ContactList.GetContactListResponse>();

Mailjet Contact.d.ts

export declare namespace ContactList {
    export interface ContactList {
        ID: number;
        IsDeleted: boolean;
        Name: string;
        Address: string;
        CreatedAt: string;
        SubscriberCount: number;
    }
   }

according to the library version 6.0.3 getcontactslists action should return ContactList objects with property ID, instead I'm getting ListID

  {
    IsActive: true,
    IsUnsub: false,
    ListID: 10277933,
    SubscribedAt: '2022-12-17T16:14:51Z'
    }

which is correct according to docs but not with to the ContactList types

arekits commented 8 months ago

closing the issue, the library type seems to be correct. I used the wrong one, a correct type should be ContactSubscription.GetContactGetContactsListsResponse

however it's strange, I think it was working this way a few months ago