
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
cocoon-cloud-sdk
Advanced tools
Cocoon.io is a cloud service that allows any web developer to build performant mobile native apps/games based on their HTML5 content.
The Cocoon Cloud SDK is the easiest way to integrate the Cocoon.io cloud compiler in any service or app. With this simple API, anyone can authenticate with their Cocoon.io account and create, update and compile HTML5 projects in the cloud programmatically.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
First things first. In order to access the Cocoon.io API you will need a ClientID credential (a ClientSecret too if your code runs in a server). You can contact us at support@cocoon.io to request it.
Other than that, you only need to have NodeJS and NPM installed in your system.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install -y nodejs
Clone the repository.
git clone https://github.com/CocoonIO/cocoon-cloud-sdk.git
And install its dependencies
npm install
The transpiled code should be in the out folder.
The tests are found in spec/tests.
npm test
To inspect the code style of the source code:
npm run inspect-src
To inspect the code style of the tests:
npm run inspect-spec
To use this repo as a NPM module in your project follow these instructions.
As mentioned previously: to access the Cocoon.io API you will need a ClientID credential (a ClientSecret too if your code runs in a server). You can contact us at support@cocoon.io to request it.
Install NodeJS and NPM in your system.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install -y nodejs
Install the module from NPM.
npm install cocoon-cloud-sdk --save
You must use a module bundler like Webpack to use it in a browser. Make sure the node definitions are included if you use typescript
{
"compilerOptions": {
"typeRoots" : ["node_modules/@types"],
"types" : ["node"]
}
}
And import it in your NodeJS or Web project.
import * as cocoonSDK from "cocoon-cloud-sdk";
You can read the documentation at CocoonIO.github.io/cocoon-cloud-sdk.
You can see an example of the usage in sample.
Log In into Cocoon.
const oAuth = new cocoonSDK.OAuth(grantType.Password, CLIENT_ID, CLIENT_SECRET);
oAuth.tokenExchangePassword("john.smith@example.com", "12345678")
.then((response) => {
cocoonSDK.CocoonAPI.setupAPIAccess(response.access_token, response.refresh_token, response.expires_in);
});
Some API Examples. The SDK mimics the Cocoon.io REST API.
The Project API:
//List all projects
cocoonSDK.ProjectAPI.list()
.then((projects) => {
doSomething();
})
.catch((error) => {
fixSomething();
});
//Create a new project by uploading a zip file
cocoonSDK.ProjectAPI.createFromZipUpload(file)
.then((project) => {
doSomething();
})
.catch((error) => {
fixSomething();
});
//Create a new project from a url
cocoonSDK.ProjectAPI.createFromURL("MY_URL")
.then((project) => {
doSomething();
})
.catch((error) => {
fixSomething();
});
//Create a new project from a repository
cocoonSDK.ProjectAPI.createFromRepository({url:"MY_GITHUB_URL", branch:"MY_BRANCH"})
.then((project) => {
doSomething();
})
.catch((error) => {
fixSomething();
});
For Signing Keys:
//List all signing keys
cocoonSDK.SigningKeyAPI.list()
.then((signingKeys) => {
doSomething();
})
.catch((error) => {
fixSomething();
});
//Create a new Android signing key
cocoonSDK.SigningKeyAPI.createAndroid(name, alias, keystore, keystorePassword, certificatePassword)
.then((signingKey) => {
doSomething();
})
.catch((error) => {
fixSomething();
});
The objects returned by the API have their own methods to ease commonly performed tasks.
//Working with a Project object
cocoonSDK.ProjectAPI.get("PROJECT_ID")
.then((project) => {
//project.isCompiling();
//project.updateZip(zipFile);
//project.delete();
//project.assignSigningKey(signingKey);
//...
})
.catch((error) => {
fixSomething();
});
//Working with a Signing Key object
cocoonSDK.SigningKeyAPI.get("SIGNING_KEY_ID")
.then((signingKey) => {
//signingKey.delete();
})
.catch((error) => {
fixSomething();
});
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details
FAQs
Cocoon.io is a cloud service that allows any web developer to build performant mobile native apps/games based on their HTML5 content.
The npm package cocoon-cloud-sdk receives a total of 22 weekly downloads. As such, cocoon-cloud-sdk popularity was classified as not popular.
We found that cocoon-cloud-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.