-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from Microsoft/sdk_readme
Initial checkin for SDK readme
- Loading branch information
Showing
3 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# CodePush Management SDK (Node.js) | ||
|
||
A JavaScript library for programmatically managing your CodePush account (e.g. creating apps, promoting releases), which allows authoring Node.js-based build and/or deployment scripts, without needing to shell out to the [CLI](https://github.com/Microsoft/code-push/blob/master/cli/README.md). | ||
|
||
|
||
## Getting Started | ||
|
||
1. Create an access key to authenticate with the CodePush server using the following CodePush CLI command: | ||
|
||
```shell | ||
code-push access-key add "DESCRIPTION_OF_THE_KEY" | ||
``` | ||
|
||
If you already created a key that you want to use here, then you can retrieve it by running `code-push access-key ls` and using the value of the `Key` column for the key you wish to use. | ||
|
||
2. Install the management SDK by running `npm install code-push --save` | ||
|
||
3. Import it using the following statement (using ES6 syntax as applicable): | ||
|
||
```javascript | ||
var CodePush = require("code-push"); | ||
``` | ||
|
||
4. Create an instance of the `CodePush` class, passing it the access key you created or retrieved in step #1: | ||
|
||
```javascript | ||
var codePush = new CodePush("YOUR_ACCESS_KEY"); | ||
``` | ||
|
||
5. Begin automating the management of your account! For more details on what you can do with this `codePush` object, refer to the API reference section below. | ||
|
||
## API Reference | ||
|
||
The `code-push` module exports a single class (typically referred to as `CodePush`), which represents a proxy to the CodePush account management REST API. This class has a single constructor for authenticating with the CodePush service, and a collection of instance methods that correspond to the commands in the management [CLI](https://github.com/Microsoft/code-push/blob/master/cli/README.md), which allow you to programmatically control every aspect of your CodePush account. | ||
|
||
### Constructors | ||
|
||
- __CodePush(accessKey: string)__ - Creates a new instance of the CodePush management SDK, using the specified access key to authenticated with the server. | ||
|
||
### Methods | ||
|
||
- __addAccessKey(description: string): Promise<AccessKey>__ - Creates a new access key with the specified description (e.g. "VSTS CI"). | ||
|
||
- __addApp(appName: string): Promise<App>__ - Creates a new CodePush app with the specified name. | ||
|
||
- __addCollaborator(appName: string, email: string): Promise<void>__ - Adds the specified CodePush user as a collaborator to the specified CodePush app. | ||
|
||
- __addDeployment(appName: string, deploymentName: string): Promise<Deployment>__ - Creates a new deployment with the specified name, and associated with the specified app. | ||
|
||
- __getAccessKey(accessKey: string): Promise<AccessKey>__ - Retrieves the metadata about the specific access key. | ||
|
||
- __getAccessKeys(): Promise<AccessKey[]>__ - Retrieves the list of access keys associated with your CodePush account. | ||
|
||
- __getApp(appName: string): Promise<App>__ - Retrieves the metadata about the specified app. | ||
|
||
- __getApps(): Promise<App[]>__ - Retrieves the list of apps associated with your CodePush account. | ||
|
||
- __getCollaborators(appName: string): Promise<CollaboratorMap>__ - Retrieves the list of collaborators associated with the specified app. | ||
|
||
- __getDeployment(appName: string, deploymentName: string): Promise<Deployment>__ - Retrieves the metadata for the specified app deployment. | ||
|
||
- __getDeploymentHistory(appName: string, deploymentName: string): Promise<Package[]>__ - Retrieves the list of releases that have been made to the specified app deployment. | ||
|
||
- __getDeploymentMetrics(appName: string, deploymentName): Promise<DeploymentMetrics>__ - Retrieves the installation metrics for the specified app deployment. | ||
|
||
- __getDeployments(appName: string): Promose<Deployment[]>__ - Retrieves the list of deployments associated with the specified app. | ||
|
||
- __promote(appName: string, sourceDeploymentName: string, destDeploymentName: string): Promise<void>__ - Promotes the latest release from one deployment to another for the specified app. | ||
|
||
- __release(appName: string, deploymentName: string, updateContentsPath: string, targetBinaryVersion: string, description?: string, isMandatory: boolean = false): Promise<void>__ - Releases a new update to the specified deployment. | ||
|
||
- __removeAccessKey(accessKey: string): Promise<void>__ - Removes the specified access key from your CodePush account. | ||
|
||
- __removeApp(appName: string): Promise<void>__ - Deletes the specified CodePush app from your account. | ||
|
||
- __removeCollaborator(appName: string, email: string): Promise<void>__ - Removes the specified account as a collaborator from the specified app. | ||
|
||
- __removeDeployment(appName: string, deploymentName: string): Promise<void>__ - Removes the specified deployment from the specified app. | ||
|
||
- __renameApp(oldAppName: string, newAppName: string): Promise<void>__ - Renames an existing app. | ||
|
||
- __renameDeployment(appName: string, oldDeploymentName: string, newDeploymentName: string): Promise<void>__ - Renames an existing deployment within the specified app. | ||
|
||
- __rollback(appName: string, deploymentName: string, targetRelease?: string): Promise<void>__ - Rolls back the latest release within the specified deployment. Optionally allows you to target a specific release in the deployment's history, as opposed to rolling to the previous release. | ||
- __transferApp(appName: string, email: string): Promise<void>__ - Transfers the ownership of the specified app to the specified account. |