I won't submit a pull request because the changes aren't backwards compatible, but very happy to collaborate on any future plans you have for this project.
I've summarised my changes here,
Service ID is passed on requiring the module.
Many of the Fastly methods are designed to be chained together, resulting in deeply nested callbacks. Promises offer a cleaner interface.
(Work in progress) Using fastly.request() results in a lot of string interpolation, which is hard to read. All the API end points deserve their own API, Eg.
So instead of,
fastly.request('PUT', '/service/' + service + '/version/' + lastVersion + '/clone');
We can do this,
fastly.cloneVersion(n); // returns a promise to clone the given VCL
This also makes is easier to create convenience methods at a later date,
Hi, thanks for writing this module.
I've expanded a little on the functionality over in my repo for ft.com.
There's also a sister project that shows an example of a deployment process.
I won't submit a pull request because the changes aren't backwards compatible, but very happy to collaborate on any future plans you have for this project.
I've summarised my changes here,
So instead of,
We can do this,
This also makes is easier to create convenience methods at a later date,