dialogflow-fulfillment-nodejs icon indicating copy to clipboard operation
dialogflow-fulfillment-nodejs copied to clipboard

Exports PLATFORMS as Platforms

Open techiejd opened this issue 2 years ago • 1 comments

This is necessary to access Platforms in a .ts file.

For example: new Payload(Platforms.UNSPECIFIED, payload, {rawPayload: true, sendAsMessage: true})

The platforms are not exposed any where publicly. From the js examples I've seen online, most people access the platforms by WebhookClient.Platform. This doesn't work with ts because WebhookClient.Platform is not an explicit method or a field.

The @types/dialogflow-fulfillment exports the platforms.

Without exposing it, we get a run time error because the dialogflow-fulfillment.d.ts is not compiled and the .js does not expose the platforms. So, the solution is to also export it from the .js .

techiejd avatar Aug 19 '22 02:08 techiejd

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Aug 19 '22 02:08 google-cla[bot]