# Class: IpaHub

Defined in: [src/library/IpaHub.ts:25](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L25)

Manage IPA sources, paired devices, installations, and updates. Create an instance with [getIpaHub](https://ipa-hub.giladgd.com/docs/api/functions/getIpaHub.md).

## Accessors

### dataDir {#datadir}

#### Get Signature

```ts
get dataDir(): string;
```

Defined in: [src/library/IpaHub.ts:56](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L56)

The resolved data directory, including any compatibility fallback. Inactive instances do not create it.

##### Returns

`string`

## Methods

### checkUpdate() {#checkupdate}

```ts
checkUpdate(
   device, 
   bundleId, 
   options?
): Promise<UpdateCheck>;
```

Defined in: [src/library/IpaHub.ts:133](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L133)

Check a tracked app's recorded update channel; prefetch optionally downloads the update without installing.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device` | `string` |
| `bundleId` | `string` |
| `options?` | [`CheckUpdateOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/CheckUpdateOptions.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UpdateCheck`](https://ipa-hub.giladgd.com/docs/api/type-aliases/UpdateCheck.md)\>

***

### dispose() {#dispose}

```ts
dispose(): Promise<void>;
```

Defined in: [src/library/IpaHub.ts:61](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L61)

Release this instance's resources after its outstanding operations have finished.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>

***

### getAppRelease() {#getapprelease}

```ts
getAppRelease(device, bundleId): Promise<ReleaseInfo | undefined>;
```

Defined in: [src/library/IpaHub.ts:128](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L128)

Read the installed release's notes and publication date, when the app came from a repository.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device` | `string` |
| `bundleId` | `string` |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ReleaseInfo`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ReleaseInfo.md) \| `undefined`\>

***

### getDeviceInfo() {#getdeviceinfo}

```ts
getDeviceInfo(
   device?, 
   filter?, 
   interaction?
): Promise<DeviceInfo>;
```

Defined in: [src/library/IpaHub.ts:76](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L76)

Inspect a paired device and the apps installed on it through ipa-hub.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device?` | `string` |
| `filter?` | [`DeviceFilter`](https://ipa-hub.giladgd.com/docs/api/type-aliases/DeviceFilter.md) |
| `interaction?` | [`Interaction`](https://ipa-hub.giladgd.com/docs/api/type-aliases/Interaction.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`DeviceInfo`](https://ipa-hub.giladgd.com/docs/api/type-aliases/DeviceInfo.md)\>

***

### install() {#install}

```ts
install(options, interaction?): Promise<InstallResult>;
```

Defined in: [src/library/IpaHub.ts:113](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L113)

Download, sign, and install an app using the same workflow as `ipa-hub install`.
Delegates to a compatible running server unless bypassServer is true.
The caller handles publisher trust confirmation. Ambiguous choices use the
selection callback or throw [SelectionRequired](https://ipa-hub.giladgd.com/docs/api/classes/SelectionRequired.md); no terminal prompts are shown.
Source access tokens are saved privately for future updates and omitted from results.
App Manager enrollment URLs, when requested, contain credentials for that device.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | [`InstallOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/InstallOptions.md) |
| `interaction?` | [`Interaction`](https://ipa-hub.giladgd.com/docs/api/type-aliases/Interaction.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`InstallResult`](https://ipa-hub.giladgd.com/docs/api/type-aliases/InstallResult.md)\>

***

### installManager() {#installmanager}

```ts
installManager(options?, interaction?): Promise<ManagerInstallResult>;
```

Defined in: [src/library/IpaHub.ts:157](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L157)

Enroll App Manager on an iPhone/iPad, starting an already installed service when necessary.
Keep this instance alive and call waitForManagerInstallation with the result to finish setup.
The personal URL contains a temporary key, replaced when the Home Screen app connects.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options?` | [`ManagerInstallOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ManagerInstallOptions.md) |
| `interaction?` | [`Interaction`](https://ipa-hub.giladgd.com/docs/api/type-aliases/Interaction.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ManagerInstallResult`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ManagerInstallResult.md)\>

***

### listApps() {#listapps}

```ts
listApps(device): Promise<InstalledApp[]>;
```

Defined in: [src/library/IpaHub.ts:118](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L118)

List apps installed through ipa-hub on a device. Does not expose the underlying storage records.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device` | `string` |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`InstalledApp`](https://ipa-hub.giladgd.com/docs/api/type-aliases/InstalledApp.md)[]\>

***

### listDevices() {#listdevices}

```ts
listDevices(filter?): Promise<Device[]>;
```

Defined in: [src/library/IpaHub.ts:66](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L66)

List paired devices. Use all to include unavailable devices, or includeSimulators for Simulator destinations.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `filter?` | [`DeviceFilter`](https://ipa-hub.giladgd.com/docs/api/type-aliases/DeviceFilter.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Device`](https://ipa-hub.giladgd.com/docs/api/type-aliases/Device.md)[]\>

***

### listReleases() {#listreleases}

```ts
listReleases(source, options?): Promise<ReleasePage>;
```

Defined in: [src/library/IpaHub.ts:88](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L88)

List one page of repository releases. Pass nextPage back as page to continue.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `source` | `string` |
| `options?` | [`ListReleasesOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ListReleasesOptions.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ReleasePage`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ReleasePage.md)\>

***

### listTeams() {#listteams}

```ts
listTeams(): Promise<Team[]>;
```

Defined in: [src/library/IpaHub.ts:71](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L71)

List signing teams, local identities, and provisioning profiles discovered from the Mac's Xcode setup.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Team`](https://ipa-hub.giladgd.com/docs/api/type-aliases/Team.md)[]\>

***

### pull() {#pull}

```ts
pull(options, interaction?): Promise<PullResult>;
```

Defined in: [src/library/IpaHub.ts:99](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L99)

Download an IPA into the managed cache, or return a local file unchanged. Ambiguous assets use the selection callback.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | [`PullOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/PullOptions.md) |
| `interaction?` | [`Interaction`](https://ipa-hub.giladgd.com/docs/api/type-aliases/Interaction.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PullResult`](https://ipa-hub.giladgd.com/docs/api/type-aliases/PullResult.md)\>

***

### resolve() {#resolve}

```ts
resolve(source, options?): Promise<ResolvedSource>;
```

Defined in: [src/library/IpaHub.ts:83](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L83)

Browse a source's release and matching IPA assets without downloading them. A release may have no matching assets.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `source` | `string` |
| `options?` | [`ResolveOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ResolveOptions.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ResolvedSource`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ResolvedSource.md)\>

***

### setAutomaticSignatureRefresh() {#setautomaticsignaturerefresh}

```ts
setAutomaticSignatureRefresh(
   device, 
   bundleId, 
   enabled
): Promise<InstalledApp>;
```

Defined in: [src/library/IpaHub.ts:123](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L123)

Enable or disable the server's hourly signature refresh for a tracked app.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device` | `string` |
| `bundleId` | `string` |
| `enabled` | `boolean` |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`InstalledApp`](https://ipa-hub.giladgd.com/docs/api/type-aliases/InstalledApp.md)\>

***

### updateApp() {#updateapp}

```ts
updateApp(
   device, 
   bundleId, 
   options?
): Promise<InstallResult>;
```

Defined in: [src/library/IpaHub.ts:138](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L138)

Install an available update, or renew the current release with resign: true. Delegates to a running server by default.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device` | `string` |
| `bundleId` | `string` |
| `options?` | [`UpdateAppOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/UpdateAppOptions.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`InstallResult`](https://ipa-hub.giladgd.com/docs/api/type-aliases/InstallResult.md)\>

***

### updateApps() {#updateapps}

```ts
updateApps(device, options?): Promise<AppUpdateResult[]>;
```

Defined in: [src/library/IpaHub.ts:143](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L143)

Update or re-sign all tracked apps on a device, returning each success, failure, or skipped app.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device` | `string` |
| `options?` | [`UpdateAllAppsOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/UpdateAllAppsOptions.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`AppUpdateResult`](https://ipa-hub.giladgd.com/docs/api/type-aliases/AppUpdateResult.md)[]\>

***

### waitForManagerInstallation() {#waitformanagerinstallation}

```ts
waitForManagerInstallation(result, interaction?): Promise<void>;
```

Defined in: [src/library/IpaHub.ts:162](https://github.com/giladgd/ipa-hub/blob/master/src/library/IpaHub.ts#L162)

Wait for the Home Screen app to confirm its permanent key. Aborting or disposing cancels unfinished setup.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `result` | [`ManagerInstallResult`](https://ipa-hub.giladgd.com/docs/api/type-aliases/ManagerInstallResult.md) |
| `interaction?` | [`Interaction`](https://ipa-hub.giladgd.com/docs/api/type-aliases/Interaction.md) |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>

