[SR-Users] Stubs for KEMI Javascript

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 15 14:34:53 CET 2021


It is fine if you want to do it manually, but you have to watch closely the
commits of the source code.

If you have python3 and kamailio source tree cloned, you can check what is
generated for lua by:

cd misc/tools/kemi/lua/
python3 kemiksrlib.py ../../../../../kamailio

Then KSR.lua is generated in that folder. Not a python developer here, but
it should be easy to change to output a different format, as I also did in
this specific case. Might help to get something that you can copy&paste to
be easier overall. Note that you have to take the latest master of the
tool, I just pushed a fix for it.

Cheers,
Daniel


On Fri, Jan 15, 2021 at 11:46 AM Nicki Otte <duckay at live.com> wrote:

> It is very well Indeed manually generated.
>
> I scrapped the KEMI documentation site, and used REGEX/Excel magic to
> convert them to proper TS interfaces.
>
> I thought to myself, make a program that could convert the C Header files,
> but the other way was easier.
>
> But yes, it has the flaw of being manually maintained. But that is my
> hurtle 😝
>
> // Nicki Bo Otte
>
>
>
> *From: *Daniel-Constantin Mierla <miconda at gmail.com>
> *Sent: *15. januar 2021 11:34
> *To: *Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
> *Subject: *Re: [SR-Users] Stubs for KEMI Javascript
>
>
>
> Is the list of function prototypes auto-generated with some tool, or has
> to be maintained manually?
>
>
>
> I did something similar for lua, to be able to check for syntax errors
> with a lua linter, and there I started the python tool that generates the
> KEMI docs, adjusting for these specific needs -- you can see more at:
>
>
>
>   * https://github.com/kamailio/kamailio/tree/master/misc/tools/kemi/lua
>
>
>
> The python tool for kemi docs is at:
>
>
>
>   *
> https://github.com/kamailio/kamailio-docs/tree/master/kamailio-kemi-framework/tools
>
>
>
> Maybe it's useful to reuse in this case as well.
>
>
>
> Cheers,
> Daniel
>
>
>
> On Fri, Jan 15, 2021 at 11:12 AM Nicki Otte <duckay at live.com> wrote:
>
> Haven’t had the pleasure yet to test it out in those IDE’s, but i’ll take
> the time soon.
> Will return with an answer soon.
>
> // Nicki Bo Otte
>
>
>
>
>
> *From: *Daniel-Constantin Mierla <miconda at gmail.com>
> *Sent: *15. januar 2021 11:06
> *To: *Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
> *Subject: *Re: [SR-Users] Stubs for KEMI Javascript
>
>
>
> Hello,
>
>
>
> thanks for sharing, looks really cool! I will prepare and post a news
> article on kamailio.org to expose it to the larger community.
>
>
>
> Do you know if this kind of extension is somehow compatible with VSCode or
> Atom editors? I am asking because I know their extensions are also in
> JavaScript/TypeScript.
>
>
>
> Cheers,
> Daniel
>
>
>
>
>
>
>
> On Fri, Jan 15, 2021 at 10:43 AM Nicki Otte <Duckay at live.com> wrote:
>
> Hi everyone.
>
>
>
> I wanted all of you to know, that I have made JavaScript stubs, for
> autocompletion in IDE’s, for those of you that use KEMI JavaScript.
>
> Specifically tested on Jetbrains PHPStorm/Webstorm.
>
>
>
> The stubs are available for free at my GitHub page.
>
>
>
> The link is https://github.com/captainDuckay/Kamailio-javascript-stubs
>
>
>
> My main language isn't typescript or JavaScript, and this is one of my
> first public releases.
>
> With that said though, I am open for critics, or even guidance.
>
>
>
> I hope it's usable for you.
>
> // Nicki Bo Otte
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
>
> --
>
> Daniel-Constantin Mierla - https://www.asipto.com
>
> https://twitter.com/miconda - https://www.linkedin.com/in/miconda
>
> Kamailio Advanced Training - https://www.asipto.com/u/kat
>
>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
>
> --
>
> Daniel-Constantin Mierla - https://www.asipto.com
>
> https://twitter.com/miconda - https://www.linkedin.com/in/miconda
>
> Kamailio Advanced Training - https://www.asipto.com/u/kat
>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>


-- 
Daniel-Constantin Mierla - https://www.asipto.com
https://twitter.com/miconda - https://www.linkedin.com/in/miconda
Kamailio Advanced Training - https://www.asipto.com/u/kat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210115/429cab94/attachment.htm>


More information about the sr-users mailing list