Conversation
| mockedAxios.mockRestore(); | ||
| }); | ||
|
|
||
| it('Returns a 200 when Entity is present in the request body', async () => { |
There was a problem hiding this comment.
I assume if no Entity is provided in the request body, we still want the call to succeed? Just calling this out here because I'm not 100% what circumstances lead to this happening, or what the expected behavior is.
There was a problem hiding this comment.
Yes, if no entity is provided in the body, the entity in the entity token is used. Passing an entity in the body allows a title to execute a function as a player, for example. But if the title just wanted to execute a function as itself, it can just pass its entity token as normal and not specify an entity in the request body. Most functions are called by players, but we have some cases where customers are calling using a title entity token (see #9)
|
Thanks for submitting this PR. I will try to get to it soon, but it might not be until January as I'm taking time off starting early next week. |
Hello!
Thanks for the documentation explaining how to debug our PlayFab ExecuteFunction calls locally. It's been super helpful!
We've decided to use TypeScript for our functions, but still want to be able to debug locally. To this end, I've added support for debugging with TypeScript.
I based my TypeScript code off the csharp file provided by this repo. However, I decided it was best to proceed slightly differently with the TypeScript implementation.
Because I wanted to be sure that the code I'm providing is tested, I thought it might make sense to create a project specifically for the ExecuteFunction implementation. In this way it's possible to include a test suite, and to provide versioning to end users.
The intention is that this code can be injected via an npm repository . I suppose I'd remove my npm package and y'all could manage publishing to your own npm package so that I'm not the only person with publishing credentials 😅
After installing the npm package, one just needs to create a function.json file and a small js wrap around the imported function (this is all explained in the included readme)
I also added the function.json file and everything else needed to run this locally as a stand-alone project— I'm not sure this is beneficial 🤷
Thanks for considering my PR!