cloudflare / node-cloudflare

Node.js API for Client API
https://cloudflare.github.io/node-cloudflare/
Other
335 stars 92 forks source link

EnterpriseZoneWorkersKV.add: add missing key_name #94

Closed modrzew closed 3 years ago

modrzew commented 3 years ago

I noticed that the EnterpriseZoneWorkersKV.add call doesn't have the key_name argument listed in the docstring, which caused incorrect types to be created in the DefinitelyTyped repo / @types/cloudflare package: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cloudflare/index.d.ts#L111

API docs: https://api.cloudflare.com/#workers-kv-namespace-write-key-value-pair

I've verified that the method works as expected when called with 4 arguments: 3rd argument becomes the :id parameter in the URL, and the 4th becomes PUT request's body.

For clarity's sake, I've also renamed :id positional arguments in paths to :key_name, to match docstrings and the API docs.

Corresponding PR to update DefinitelyTyped: TBA

modrzew commented 3 years ago

Hey @terinjokes, would you be able to review this PR?

terinjokes commented 3 years ago

This package always uses :id to refer to the item being accessed or modified.

modrzew commented 3 years ago

@terinjokes changed in a347997, PTAL again.

modrzew commented 3 years ago

Hey @terinjokes, can you take a look and merge this if it LGTY?

modrzew commented 3 years ago

Hey @terinjokes, can you please take a look at this PR and merge it if it looks good to you? I want to merge https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55026 which is currently blocked by it.

modrzew commented 3 years ago

Hey @terinjokes, pinging again. I want to merge DefinitelyTyped/DefinitelyTyped#55026, can you take a look at this PR? Alternatively, is there anyone else who can merge it?

terinjokes commented 3 years ago

Sorry for the delay. I've been super busy with other projects this month.

Merged as eba8f915b60e14fcc5038289f18ab5604e504d55.

modrzew commented 3 years ago

Thank you! ✨

terinjokes commented 3 years ago

Published as 2.9.1.