Including Swagger Codegen Generated JavaScript Module in Freshdesk Serverless project

If I were to use Swagger Codegen (Swagger Documentation) to generate a module containing Client SDK JavaScript code from a Swagger (2.0) file, how should I include the generated module LOCALLY (or I guess otherwise) in a Freshdesk serverless project?

Hey @plloyd

Hope you are safe and doing well!

If I understand correctly, you want to include a javascript module to the serverless app, but you do not want to publish the module to npm, but include it locally in the serverless app and pack it with the app, so it doesn’t have to download the module as a dependency during further invocations or build processes?

I’m safe and well thank you, I hope you are too.

You are correct …

I’m new to Freshdesk development and I have assumed that the 10.18.1 Node.js environment that serverless apps are deployed to is completely under the control of Freshworks, and that only modules already installed by Freshworks would be available.

Having assumed that I could only use modules already installed by Freshworks, I was wondering if modules could be packaged and supplied in the application’s ZIP file that is produced by: fdk pack.

Is it possible to package modules in the application’s ZIP file?
Is it possible to use organisation/private module dependencies in a Freshdesk serverless application?
Are you able to install ANY modules you want into a Freshdesk Node 10.18.1 Serverless environment by specifying dependencies in manifest.json?

If any of the above are possible, do you know if there is any documentation out there on the Freshdesk Developer’s site that I’ve missed that would describe the dependency management in detail and any constraints it would have?

Thanks for your help,

Paul.

Hi Paul,

Hope you’re doing well.

Theoretically, it is possible by adding the modules under the server folder and use it, but not advisable as the app size may increase and might cause some problem. Kindly check by uploading it as a custom app to verify the app size. The limit for app size is 5 MB.

Private module dependencies are not supported, we can download only public packages from NPM.

Any dependencies can be added to the manifest.json file that is available in NPM except for few large sized NPM modules.

3 Likes

These are the answers I needed. Thank you for helping me with my questions Mughela.

Paul.

2 Likes