tim.smith | 2016-08-29 23:12:15 UTC | #1
If you're not interested in kicking some tires, there's nothing to see here. Move along...
Hello determined developer, thanks for sticking around! We're in the process of changing the method names for the SDKs to be more friendly. The easiest way to explain this change is with an example. This:
conversationsApi.patchCallbacksCallbackIdParticipantsParticipantIdCommunicationsCommunicationId(...)
will become this:
conversationsApi.patchCallbackParticipantCommunication(...)
There's 350 of those changes. I didn't want to upgrade my own code by hand, so I wrote a script to do it for me (and you!). I'm looking for people to give this script a try before publishing these changes to the released SDKs. If you're willing to try it out, here's what I need you to do:
Instructions
- Make sure you have node and install the script:
npm install -g purecloud-sdk-upgrade - Generate the operation map for your version:
purecloud-sdk-upgrade genops <old_swagger> <new_swagger>. This maps the old operation IDs to the new shorter IDs. - For old_swagger, use the URL of the swagger.json from the release of the SDK version you're using. To find one one of these, go to the commits page and find the commit by InIn Devops for your vesion and browse the repo at that point (the
< > button on the right). View the swagger.json file, then view the raw contents. For example, here is the swagger.json file for v0.21.1.68 of the Java SDK. - For new_swagger, use this URL (has the new operation IDs): https://raw.githubusercontent.com/MyPureCloud/purecloud_api_sdk_java/API-1859-operation-id-refactoring/swagger-new.json
- Upgrade your code:
purecloud-sdk-upgrade upgrade <source_path> [<path_regex>] [<backup>] [<old_swagger> <new_swagger>] - Documentation for all of the parameters can be found in README.md in the repo.
Upgrading Your Files
When you run the upgrade script, it will make backups of any files it's going to change, upgrade the files in place, and provide a line by line readout of what was changed. The output will look something like this:
<img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/ad23fab719278bd449ab4b0cbb272ecc100c844d.png" width="690" height="490">
Using the New SDK
After upgrading your code, it won't work with the existing SDKs because the method names have changed. You'll need to install the prerelease versions of the SDK to test out the changes:
Feedback
I want to hear what you have to say! I'm specifically looking for any issues you have with the script, anything it missed upgrading, and anything it upgraded incorrectly. I'd also like to hear any general feedback you have as well.
Please reply to this topic or create a new one with any feedback, questions, issues, or comments you have.
Thanks for reading!
system | 2017-08-28 19:26:46 UTC | #2
This post was migrated from the old Developer Forum.
ref: 337