-
Notifications
You must be signed in to change notification settings - Fork 76
/
create.ts
32 lines (28 loc) · 1.01 KB
/
create.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import EasCommand from '../../commandUtils/EasCommand';
import AppStoreApi from '../../credentials/ios/appstore/AppStoreApi';
import { createContextAsync } from '../../devices/context';
import DeviceManager from '../../devices/manager';
export default class DeviceCreate extends EasCommand {
static override description = 'register new Apple Devices to use for internal distribution';
static override contextDefinition = {
...this.ContextOptions.LoggedIn,
...this.ContextOptions.OptionalProjectConfig,
};
async runAsync(): Promise<void> {
// this command is interactive by design
const {
loggedIn: { actor, graphqlClient },
privateProjectConfig,
} = await this.getContextAsync(DeviceCreate, {
nonInteractive: false,
});
const ctx = await createContextAsync({
appStore: new AppStoreApi(),
user: actor,
graphqlClient,
projectId: privateProjectConfig?.projectId,
});
const manager = new DeviceManager(ctx);
await manager.createAsync();
}
}