# @appcd/plugin-titanium

> Titanium SDK service for the Appc Daemon.

Latest version **1.8.2** (published 2021-01-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @appcd/plugin-titanium
pnpm add @appcd/plugin-titanium
yarn add @appcd/plugin-titanium
bun add @appcd/plugin-titanium
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.8.2 |
| Published | 2021-01-26 |
| First published | 2019-03-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 225 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Appcelerator, Inc. |
| Maintainers | appcd-admin, cb1kenobi, awam, janvennemann |

## Links

- npm: https://www.npmjs.com/package/@appcd/plugin-titanium
- Repository: https://github.com/appcelerator/appcd-plugin-titanium
- Homepage: https://github.com/appcelerator/appc-daemon
- Issues: https://github.com/appcelerator/appcd-plugin-titanium/issues
- npm.io page: https://npm.io/package/@appcd/plugin-titanium

## Dependencies (15)

- [tmp](https://npm.io/package/tmp.md) ^0.2.1
- [gawk](https://npm.io/package/gawk.md) ^5.0.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [yauzl](https://npm.io/package/yauzl.md) ^2.10.0
- [cli-kit](https://npm.io/package/cli-kit.md) ^1.9.3
- [prompts](https://npm.io/package/prompts.md) ^2.4.0
- [filesize](https://npm.io/package/filesize.md) ^6.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.1.0
- [get-port](https://npm.io/package/get-port.md) ^5.1.1
- [pluralize](https://npm.io/package/pluralize.md) ^8.0.0
- [dateformat](https://npm.io/package/dateformat.md) ^4.5.0
- [titaniumlib](https://npm.io/package/titaniumlib.md) ^3.0.1
- [sort-object-keys](https://npm.io/package/sort-object-keys.md) ^1.1.3
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.19
- [node-pty-prebuilt-multiarch](https://npm.io/package/node-pty-prebuilt-multiarch.md) ^0.9.0

## Recent versions

- 1.8.2 (latest) — 2021-01-26
- 1.8.1 — 2020-01-15
- 1.8.0 — 2020-01-14
- 1.7.0 — 2020-01-13
- 1.6.0 — 2019-08-15
- 1.5.0 — 2019-06-06
- 1.4.0 — 2019-03-29

## README

# @appcd/plugin-titanium

Titanium SDK services for the Appc Daemon.

## Services

 * [SDKs](#SDKs)
   - [`/sdk/list/installed`](#sdklistinstalled)
   - [`/sdk/list/locations`](#sdklistlocations)
   - [`/sdk/list/releases`](#sdklistreleases)
   - [`/sdk/list/branches`](#sdklistbranches)
   - [`/sdk/list/builds/:branch?`](#sdklistbuildsbranch)
   - [`/sdk/install/:name?`](#sdkinstallname)
   - [`/sdk/uninstall/:name?`](#sdkuninstallname)
 * [Modules](#Modules)
   - [`/modules/list/locations`](#moduleslistlocations)
   - [`/modules/list/installed`](#moduleslistinstalled)
 * [CLI](#CLI)
   - [`/cli`](#cli)
   - [`/cli/schema`](#clischema)

## SDKs

The `/sdk` service provides Titanium SDK information and management.

### `/sdk/list/installed`

Returns a list of installed Titanium SDKs across all installation locations. This endpoint supports
subscriptions.

> :bulb: Note: `/sdk` and `/sdk/list` forward to `/sdk/list/installed`.

#### API Usage

```js
const { response } = await appcd.call('/titanium/latest/sdk/list/installed');
console.log(response);
```

#### CLI Usage

```sh
$ appcd exec /titanium/latest/sdk/list/installed
{
  "status": 200,
  "message": [
    {
      "name": "7.0.1.GA",
      "path": "/Users/jeff/Library/Application Support/Titanium/mobilesdk/osx/7.0.1.GA",
      "manifest": {
        "name": "7.0.1.v20171218104141",
        "version": "7.0.1",
        "timestamp": "12/18/2017 18:48",
        "githash": "f5ae7e5",
        "moduleAPIVersion": {
          "iphone": "2",
          "android": "4",
          "windows": "4"
        },
        "platforms": [
          "iphone",
          "android"
        ]
      }
    },
    {
      "name": "7.1.0.GA",
      "path": "/Users/jeff/Library/Application Support/Titanium/mobilesdk/osx/7.1.0.GA",
      "manifest": {
        "name": "7.1.0.v20180314133955",
        "version": "7.1.0",
        "timestamp": "3/14/2018 20:46",
        "githash": "df92fbf",
        "moduleAPIVersion": {
          "iphone": "2",
          "android": "4",
          "windows": "4"
        },
        "platforms": [
          "iphone",
          "android"
        ]
      }
    }
  ]
}
```

To listen for changes, pass in the `--subscribe` flag:

```sh
$ appcd exec /titanium/latest/sdk/list/installed --subscribe
```

### `/sdk/list/releases`

Returns a list of all available Titanium SDK GA releases.

#### API Usage

```js
const { response } = await appcd.call('/titanium/latest/sdk/list/releases');
console.log(response);
```

#### CLI Usage

```sh
$ appcd exec /titanium/latest/sdk/list/releases
{
  "status": 200,
  "message": {
    "7.1.0.GA": {
      "version": "7.1.0",
      "url": "http://builds.appcelerator.com/mobile-releases/7.1.0/mobilesdk-7.1.0.GA-osx.zip"
    },
    "7.0.2.GA": {
      "version": "7.0.2",
      "url": "http://builds.appcelerator.com/mobile-releases/7.0.2/mobilesdk-7.0.2.GA-osx.zip"
    },
    "7.0.1.GA": {
      "version": "7.0.1",
      "url": "http://builds.appcelerator.com/mobile-releases/7.0.1/mobilesdk-7.0.1.GA-osx.zip"
    },
    "7.0.0.GA": {
      "version": "7.0.0",
      "url": "http://builds.appcelerator.com/mobile-releases/7.0.0/mobilesdk-7.0.0.GA-osx.zip"
    },
    <snip>
  }
}
```

### `/sdk/list/branches`

Returns a list of continuous integration branches and which one is the default.

#### API Usage

```js
const { response } = await appcd.call('/titanium/latest/sdk/list/branches');
console.log(response);
```

#### CLI Usage

```sh
$ appcd exec /titanium/latest/sdk/list/ci-branches
{
  "status": 200,
  "message": {
    "defaultBranch": "master",
    "branches": [
      "master",
      "3_5_X",
      "4_0_X",
      "4_1_X",
      "5_0_X",
      "5_1_X",
      "5_1_1",
      "5_2_X",
      "5_3_X",
      "5_4_X",
      "5_5_X",
      "6_0_X",
      "6_1_X",
      "6_2_X",
      "6_2_1",
      "6_3_X",
      "7_0_X",
      "7_1_X"
    ]
  }
}
```

### `/sdk/list/builds/:branch?`

Returns a map of continuous integration builds for the `master` branch or a specific branch.

#### API Usage

```js
let { response } = await appcd.call('/titanium/latest/sdk/list/builds');
console.log(response);

({ response } = await appcd.call('/titanium/latest/sdk/list/builds/master'));
console.log(response);

({ response } = await appcd.call('/titanium/latest/sdk/list/builds/7_1_X'));
console.log(response);
```

#### CLI Usage

```sh
$ appcd exec /titanium/latest/sdk/list/branches/7_1_X
{
  "status": 200,
  "message": {
    <snip>
    "7.1.1.v20180404110450": {
      "version": "7.1.1",
      "ts": "20180404110450",
      "githash": "32d9e223b920d6ea868bf4167493d9bd0c5fcde5",
      "date": "2018-04-04T16:04:50.000Z",
      "url": "http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.1.v20180404110450-osx.zip"
    },
    "7.1.1.v20180404140210": {
      "version": "7.1.1",
      "ts": "20180404140210",
      "githash": "32d9e223b920d6ea868bf4167493d9bd0c5fcde5",
      "date": "2018-04-04T19:02:10.000Z",
      "url": "http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.1.v20180404140210-osx.zip"
    }
  }
}
```

### `/sdk/install/:name?`

Installs the latest Titanium SDK GA release or a specific release, CI build, CI branch build, URL,
or local `.zip` file.

The `/sdk/install` endpoint returns a streamed response that emits the `data`, `end`, and `error` events.

#### CLI Usage

Installing the latest GA release:

```js
const { response } = await appcd.call('/titanium/latest/sdk/install');

response.on('data', evt => {
  console.log(evt);
});
```

```sh
$ appcd exec /titanium/latest/sdk/install
```

```sh
$ appcd exec /titanium/latest/sdk/install/latest
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "latest" }'
```

#### API Usage

Installing the latest GA release with progress events:

```js
const { response } = await appcd.call('/titanium/latest/sdk/install', {
  data: {
    progress: true
  }
});

response.on('data', evt => {
  console.log(evt);
});
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "progress": true }'
```

```sh
$ appcd exec /titanium/latest/sdk/install/latest '{ "progress": true }'
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "progress": true, "uri": "latest" }'
```

Installing a specific GA release:

```sh
$ appcd exec /titanium/latest/sdk/install/7.0.2
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "7.0.2" }'
```

```sh
$ appcd exec /titanium/latest/sdk/install/7.0.2.GA
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "7.0.2.GA" }'
```

Installing an SDK from a remote URL:

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "http://builds.appcelerator.com/mobile-releases/7.1.0/mobilesdk-7.1.0.GA-osx.zip" }'
```

Installing the latest CI build for a given branch:

```sh
$ appcd exec /titanium/latest/sdk/install/master
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "master" }'
```

```sh
$ appcd exec /titanium/latest/sdk/install/7_0_X
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "7_0_X" }'
```

Installing a specific CI build by name or by branch+name:

```sh
$ appcd exec /titanium/latest/sdk/install/7.2.0.v20180403153400
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "7.2.0.v20180403153400"}'
```

```sh
$ appcd exec /titanium/latest/sdk/install/master:7.2.0.v20180403153400
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "master:7.2.0.v20180403153400" }'
```

Installing a specific CI build by git hash:

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "f9819892048c1056e4dafde22ccd1d59afae8941" }'
```

Installing from a local archive:

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "/path/to/some/titanium-dist.zip" }'
```

```sh
$ appcd exec /titanium/latest/sdk/install '{ "uri": "file:///path/to/some/titanium-dist.zip" }'
```

### `/sdk/uninstall/:name?`

Uninstalls a specific Titanium SDK.

```js
const { response } = await appcd.call('/titanium/latest/sdk/uninstall/7.0.0.GA');
console.log(response);
```

```js
const { response } = await appcd.call('/titanium/latest/sdk/uninstall', { uri: '7.0.0.GA' });
console.log(response);
```

```js
const { response } = await appcd.call('/titanium/latest/sdk/uninstall', { uri: '/path/to/7.0.0.GA' });
console.log(response);
```

```sh
$ appcd exec /titanium/latest/sdk/uninstall/7.0.0.GA
```

```sh
$ appcd exec /titanium/latest/sdk/uninstall '{"uri": "7.0.0.GA"}'
```

```sh
$ appcd exec /titanium/latest/sdk/uninstall '{"uri": "/path/to/7.0.0.GA"}'
```

## Modules

The `/modules` service provides information about native Titanium Modules.

### `/modules/list/locations`

Returns a list of all directories where Titanium Modules may be installed. The first path is the
default location.

#### API Usage

```js
const { response } = await appcd.call('/titanium/latest/modules/list/locations');
console.log(response);
```

#### CLI Usage

```sh
$ appcd exec /titanium/latest/modules/list/locations
{
  "status": 200,
  "message": [
    "/Users/jeff/Library/Application Support/Titanium/modules",
    "/Library/Application Support/Titanium/modules"
  ]
}
```

### `/modules/list/installed`

Returns a list of installed Titanium Modules across all installation locations. This endpoint
supports subscriptions.

> :bulb: Note: `/modules` and `/modules/list` forward to `/modules/list/installed`.

#### API Usage

```js
const { response } = await appcd.call('/titanium/latest/modules/list/installed');
console.log(response);
```

#### CLI Usage

```sh
$ appcd exec /titanium/latest/modules/list/installed
{
  "status": 200,
  "message": {
    "ios": {
      "hyperloop": {
        "3.0.3": {
          "path": "/Users/jeff/Library/Application Support/Titanium/modules/windows/hyperloop/3.0.3",
          "platform": "windows",
          "version": "3.0.3",
          "apiversion": 4,
          "architectures": "ARM x86",
          "description": "hyperloop",
          "author": "Appcelerator",
          "license": "Appcelerator Commercial License",
          "copyright": "Copyright (c) 2016-Present Appcelerator, Inc.",
          "name": "hyperloop",
          "moduleid": "hyperloop",
          "moduleIdAsIdentifier": "Hyperloop",
          "classname": "HyperloopModule",
          "guid": "bdaca69f-b316-4ce6-9065-7a61e1dafa39",
          "minsdk": "7.0.0"
        }
      }
    }
  }
}
```

To listen for changes, pass in the `--subscribe` flag:

```sh
$ appcd exec /titanium/latest/module/list/installed --subscribe
```

## CLI

The `/cli` service process requests from the Titanium CLI.

### `/cli`

Returns the CLI session server URL.

#### API Usage

Display the help:

```js
const { response } = await appcd.call('/titanium/latest/cli');

response.on('data', ({ url }) => {
  console.log(`Next, open a WebSocket to ${url}`);
});
```

### `/cli/schema`

Returns a JSON object describing the available Titanium CLI commands and options.

#### API Usage

```js
const { response } = await appcd.call('/titanium/latest/cli/schema');
console.log(response);
```

## Legal

This project is open source under the [Apache Public License v2][1] and is developed by
[Axway, Inc](http://www.axway.com/) and the community. Please read the [`LICENSE`][1] file included
in this distribution for more information.

[1]: https://github.com/appcelerator/appcd-plugin-titanium/blob/master/LICENSE

---
_Source: https://npm.io/package/@appcd/plugin-titanium · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
