Joshlha / reified-client-api

Typescript wrapper API for ZAFClient
https://www.npmjs.com/package/reified-client-api
MIT License
9 stars 1 forks source link

add return type for invoke(instances.create) #1

Closed bkw closed 9 months ago

bkw commented 11 months ago

Hi,

first off: thanks a lot for creating this, I've been wanting to write something similar for a long time but never got around to it. I'll try to contribute where I can.

I noticed that the result for client.invoke(Core.Actions.instances.create), {...}) was typed as any[], when in reality it looks like this:

{
  "errors": {},
  "instances.create": [
    {
      "host": "zendesk",
      "product": "support",
      "location": "modal",
      "instanceGuid": "56a969a5-826c-4989-8be7-9cea6eb1e4d4",
      "account": {
        "subdomain": "[readcated]"
      },
      "status": "created"
    }
  ]
}

I attached my proposed remedy, reusing the extracted type from the Instances property.

Hope you find this useful, looking forward to your comments, keen to make any required changes to get this marged.

Joshlha commented 10 months ago

Hi @bkw!

Thanks for this PR. I've been working on other project lately and seemed to have missed this. I will get back to you as I review it.

It's very likely I overlooked some of the types, since I just read from the documentation while writing this API. Thanks again for the contribution!

Joshlha commented 9 months ago

Thanks for your contribution!

bkw commented 7 months ago

Hey @Joshlha , I just noticed that the fixed version doesn't seem to have been published yet. Is there anything I can help with?

Joshlha commented 7 months ago

@bkw Release has been published! Was holding out to see if there would be any other fixes but it's safe to assume we're good for now. Thanks for the reminder.