eas-cli 21.1.0 → 21.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -113
- package/build/commands/simulator/availability.d.ts +14 -0
- package/build/commands/simulator/availability.js +51 -0
- package/build/graphql/generated.d.ts +20 -0
- package/build/graphql/queries/DeviceRunSessionAvailabilityQuery.d.ts +7 -0
- package/build/graphql/queries/DeviceRunSessionAvailabilityQuery.js +33 -0
- package/oclif.manifest.json +2566 -2486
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class SimulatorAvailability extends EasCommand {
|
|
3
|
+
static hidden: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static contextDefinition: {
|
|
10
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
11
|
+
projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
|
|
12
|
+
};
|
|
13
|
+
runAsync(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
5
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
6
|
+
const DeviceRunSessionAvailabilityQuery_1 = require("../../graphql/queries/DeviceRunSessionAvailabilityQuery");
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
8
|
+
const ora_1 = require("../../ora");
|
|
9
|
+
const json_1 = require("../../utils/json");
|
|
10
|
+
class SimulatorAvailability extends EasCommand_1.default {
|
|
11
|
+
static hidden = true;
|
|
12
|
+
static description = '[EXPERIMENTAL] check whether EAS Simulator is enabled for the current project account';
|
|
13
|
+
static flags = {
|
|
14
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
15
|
+
};
|
|
16
|
+
static contextDefinition = {
|
|
17
|
+
...this.ContextOptions.ProjectId,
|
|
18
|
+
...this.ContextOptions.LoggedIn,
|
|
19
|
+
};
|
|
20
|
+
async runAsync() {
|
|
21
|
+
const { flags } = await this.parse(SimulatorAvailability);
|
|
22
|
+
const { json: jsonFlag, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
|
|
23
|
+
if (jsonFlag) {
|
|
24
|
+
(0, json_1.enableJsonOutput)();
|
|
25
|
+
}
|
|
26
|
+
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(SimulatorAvailability, {
|
|
27
|
+
nonInteractive,
|
|
28
|
+
});
|
|
29
|
+
const fetchSpinner = jsonFlag ? null : (0, ora_1.ora)('Checking EAS Simulator availability').start();
|
|
30
|
+
let accountName;
|
|
31
|
+
let available;
|
|
32
|
+
try {
|
|
33
|
+
({ accountName, available } = await DeviceRunSessionAvailabilityQuery_1.DeviceRunSessionAvailabilityQuery.byAppIdAsync(graphqlClient, projectId));
|
|
34
|
+
fetchSpinner?.stop();
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
fetchSpinner?.fail('Failed to check EAS Simulator availability');
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
if (jsonFlag) {
|
|
41
|
+
(0, json_1.printJsonOnlyOutput)({ available, accountName });
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (available) {
|
|
45
|
+
log_1.default.log(`✅ EAS Simulator is enabled for ${accountName}.`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
log_1.default.log(`EAS Simulator isn't available on ${accountName} yet — it's coming soon.`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = SimulatorAvailability;
|
|
@@ -16566,6 +16566,26 @@ export type AccountBillingPeriodQuery = {
|
|
|
16566
16566
|
};
|
|
16567
16567
|
};
|
|
16568
16568
|
};
|
|
16569
|
+
export type SimulatorAvailabilityQueryVariables = Exact<{
|
|
16570
|
+
appId: Scalars['String']['input'];
|
|
16571
|
+
filter?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
16572
|
+
}>;
|
|
16573
|
+
export type SimulatorAvailabilityQuery = {
|
|
16574
|
+
__typename?: 'RootQuery';
|
|
16575
|
+
app: {
|
|
16576
|
+
__typename?: 'AppQuery';
|
|
16577
|
+
byId: {
|
|
16578
|
+
__typename?: 'App';
|
|
16579
|
+
id: string;
|
|
16580
|
+
ownerAccount: {
|
|
16581
|
+
__typename?: 'Account';
|
|
16582
|
+
id: string;
|
|
16583
|
+
name: string;
|
|
16584
|
+
accountFeatureGates: any;
|
|
16585
|
+
};
|
|
16586
|
+
};
|
|
16587
|
+
};
|
|
16588
|
+
};
|
|
16569
16589
|
export type AppByIdQueryVariables = Exact<{
|
|
16570
16590
|
appId: Scalars['String']['input'];
|
|
16571
16591
|
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
export declare const DeviceRunSessionAvailabilityQuery: {
|
|
3
|
+
byAppIdAsync(graphqlClient: ExpoGraphqlClient, appId: string): Promise<{
|
|
4
|
+
accountName: string;
|
|
5
|
+
available: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceRunSessionAvailabilityQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
const client_1 = require("../client");
|
|
7
|
+
const DEVICE_RUN_SESSIONS_GATE = 'device-run-sessions';
|
|
8
|
+
exports.DeviceRunSessionAvailabilityQuery = {
|
|
9
|
+
async byAppIdAsync(graphqlClient, appId) {
|
|
10
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
11
|
+
.query((0, graphql_tag_1.default) `
|
|
12
|
+
query SimulatorAvailabilityQuery($appId: String!, $filter: [String!]) {
|
|
13
|
+
app {
|
|
14
|
+
byId(appId: $appId) {
|
|
15
|
+
id
|
|
16
|
+
ownerAccount {
|
|
17
|
+
id
|
|
18
|
+
name
|
|
19
|
+
accountFeatureGates(filter: $filter)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`, { appId, filter: [DEVICE_RUN_SESSIONS_GATE] }, { additionalTypenames: ['Account'] })
|
|
25
|
+
.toPromise());
|
|
26
|
+
const ownerAccount = data.app.byId.ownerAccount;
|
|
27
|
+
const gates = ownerAccount.accountFeatureGates;
|
|
28
|
+
return {
|
|
29
|
+
accountName: ownerAccount.name,
|
|
30
|
+
available: gates[DEVICE_RUN_SESSIONS_GATE] === true,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
};
|