-
-
Notifications
You must be signed in to change notification settings - Fork 11
Provide typescript definitions for data objects and functions #134
Comments
.... and if we built some of our validation code in typescript instead of plain js, we might see some sizeable benefit as well |
We could write definitions for every function exposed by MWS-Advanced and add it to DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped). |
i started in, but it's a daunting task lol :-D mostly it's translating the jsdoc documentation into typescript.. which is often a translation of the MWS documentation. also, the library takes a lot of liberties with / advantage of how loosely typed javascript is... |
… seems we might be able to auto-generate a bunch of this with tsc command line options. good to know, some things were added in typescript 3.7 to allow for it outputting .d.ts from jsdoc |
I've added auto-built typescript defs files. It's clearly not where it needs to be to be really useful, but at least it's a start. :) |
I've just done a really quick conversion for mws-simple to become typescript, and i'll probably use that as a blueprint to allow for the integration of typescript code into this repo |
... i have an inkling that i might find a way to convert the XSD files from Amazon into typescript types and ship them with mws-simple... |
There is a utility called 'cxsd' that will convert an entire tree of XSD files. Unfortunately, there doesn't seem to be a complete catalog of all the XSD files that define the MWS system. There is a github repo, but it's not official, not complete, and was last updated 4 years ago. I'm able to get the process started by using that repo, serving it locally, editing in a targetNamespace="urn:mws" attribute on the amzn-envelope file .. and then it starts complaining about a lot of other files that are missing. I'm not sure if those are actually available on Amazon's servers, or not.. |
woot. found all the files (they were right there in the same directory, just had to dig out all their filenames, and serve them to myself) I've committed all the XSDs as well as the typescript output of cxsd, to https://github.com/ericblade/mws-simple/tree/xsd next i'm going to see if I can actually make use of this information in some way. |
.. not sure how useful it is. The XSD files that i was able to get from the amazon envelope file, and all the ones that it links to, provides a schema for data, but doesn't really provide a schema for API calls and responses. |
This could take quite a long time, but might really help the world. :-D
The text was updated successfully, but these errors were encountered: