eas-cli 16.16.0 → 16.17.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 +166 -82
- package/build/commands/deploy/alias/delete.d.ts +21 -0
- package/build/commands/deploy/alias/delete.js +98 -0
- package/build/commands/deploy/alias/index.d.ts +21 -0
- package/build/commands/deploy/{alias.js → alias/index.js} +8 -8
- package/build/commands/deploy/{alias.d.ts → delete.d.ts} +4 -4
- package/build/commands/deploy/delete.js +84 -0
- package/build/credentials/ios/IosCredentialsProvider.js +1 -1
- package/build/graphql/generated.d.ts +72 -0
- package/build/worker/deployment.d.ts +23 -1
- package/build/worker/deployment.js +27 -1
- package/build/worker/mutations.d.ts +12 -1
- package/build/worker/mutations.js +33 -0
- package/build/worker/queries.d.ts +8 -1
- package/build/worker/queries.js +42 -0
- package/oclif.manifest.json +112 -32
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import EasCommand from '../../../commandUtils/EasCommand';
|
|
2
|
+
export default class WorkerAliasDelete extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static aliases: string[];
|
|
5
|
+
static state: string;
|
|
6
|
+
static args: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
static contextDefinition: {
|
|
14
|
+
loggedIn: import("../../../commandUtils/context/LoggedInContextField").default;
|
|
15
|
+
projectDir: import("../../../commandUtils/context/ProjectDirContextField").default;
|
|
16
|
+
getDynamicPublicProjectConfigAsync: import("../../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
|
|
17
|
+
getDynamicPrivateProjectConfigAsync: import("../../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
|
|
18
|
+
};
|
|
19
|
+
runAsync(): Promise<void>;
|
|
20
|
+
private sanitizeFlags;
|
|
21
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../../commandUtils/flags");
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
8
|
+
const ora_1 = require("../../../ora");
|
|
9
|
+
const prompts_1 = require("../../../prompts");
|
|
10
|
+
const json_1 = require("../../../utils/json");
|
|
11
|
+
const deployment_1 = require("../../../worker/deployment");
|
|
12
|
+
class WorkerAliasDelete extends EasCommand_1.default {
|
|
13
|
+
static description = 'Delete deployment aliases.';
|
|
14
|
+
static aliases = ['worker:alias:delete'];
|
|
15
|
+
static state = 'preview';
|
|
16
|
+
static args = [{ name: 'ALIAS_NAME' }];
|
|
17
|
+
static flags = {
|
|
18
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
19
|
+
};
|
|
20
|
+
static contextDefinition = {
|
|
21
|
+
...this.ContextOptions.DynamicProjectConfig,
|
|
22
|
+
...this.ContextOptions.ProjectDir,
|
|
23
|
+
...this.ContextOptions.LoggedIn,
|
|
24
|
+
};
|
|
25
|
+
async runAsync() {
|
|
26
|
+
const { args: { ALIAS_NAME: aliasNameFromArg }, flags: rawFlags, } = await this.parse(WorkerAliasDelete);
|
|
27
|
+
const flags = this.sanitizeFlags(rawFlags);
|
|
28
|
+
if (flags.json) {
|
|
29
|
+
(0, json_1.enableJsonOutput)();
|
|
30
|
+
}
|
|
31
|
+
log_1.default.warn('EAS Hosting is still in preview and subject to changes.');
|
|
32
|
+
const { getDynamicPrivateProjectConfigAsync, loggedIn: { graphqlClient }, } = await this.getContextAsync(WorkerAliasDelete, {
|
|
33
|
+
nonInteractive: true,
|
|
34
|
+
withServerSideEnvironment: null,
|
|
35
|
+
});
|
|
36
|
+
const { projectId } = await getDynamicPrivateProjectConfigAsync();
|
|
37
|
+
const aliasName = await resolveDeploymentAliasAsync(flags, graphqlClient, projectId, aliasNameFromArg);
|
|
38
|
+
const isProduction = !aliasName;
|
|
39
|
+
if (!flags.nonInteractive) {
|
|
40
|
+
log_1.default.addNewLineIfNone();
|
|
41
|
+
log_1.default.warn(isProduction
|
|
42
|
+
? `You are about to delete your production alias`
|
|
43
|
+
: `You are about to delete alias: "${aliasName}"`);
|
|
44
|
+
log_1.default.newLine();
|
|
45
|
+
const confirmed = await (0, prompts_1.toggleConfirmAsync)({ message: 'Are you sure you wish to proceed?' });
|
|
46
|
+
if (!confirmed) {
|
|
47
|
+
log_1.default.log('Aborted.');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let progress = null;
|
|
52
|
+
let deleteResult = null;
|
|
53
|
+
try {
|
|
54
|
+
progress = (0, ora_1.ora)((0, chalk_1.default) `Deleting alias {bold ${aliasName ?? 'production'}}`).start();
|
|
55
|
+
deleteResult = await (0, deployment_1.deleteWorkerDeploymentAliasAsync)({
|
|
56
|
+
graphqlClient,
|
|
57
|
+
appId: projectId,
|
|
58
|
+
aliasName,
|
|
59
|
+
});
|
|
60
|
+
progress.text = (0, chalk_1.default) `Deleted alias {bold ${aliasName ?? 'production'}}`;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
progress?.fail((0, chalk_1.default) `Failed to delete alias {bold ${aliasName ?? 'production'}}`);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
progress?.succeed((0, chalk_1.default) `Deleted alias {bold ${aliasName ?? 'production'}}`);
|
|
67
|
+
if (flags.json) {
|
|
68
|
+
(0, json_1.printJsonOnlyOutput)({
|
|
69
|
+
aliasName: deleteResult.aliasName,
|
|
70
|
+
id: deleteResult.id,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
sanitizeFlags(flags) {
|
|
75
|
+
return {
|
|
76
|
+
nonInteractive: flags['non-interactive'],
|
|
77
|
+
json: flags['json'],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.default = WorkerAliasDelete;
|
|
82
|
+
async function resolveDeploymentAliasAsync(flags, graphqlClient, projectId, aliasNameFromArg) {
|
|
83
|
+
if (aliasNameFromArg?.trim()) {
|
|
84
|
+
return aliasNameFromArg.trim().toLowerCase();
|
|
85
|
+
}
|
|
86
|
+
if (flags.nonInteractive) {
|
|
87
|
+
throw new Error('Alias name must be provided in non-interactive mode');
|
|
88
|
+
}
|
|
89
|
+
const alias = await (0, deployment_1.selectWorkerDeploymentAliasOnAppAsync)({
|
|
90
|
+
graphqlClient,
|
|
91
|
+
appId: projectId,
|
|
92
|
+
selectTitle: 'alias to delete',
|
|
93
|
+
});
|
|
94
|
+
if (!alias) {
|
|
95
|
+
throw new Error('No aliases found for this project, create aliases with "eas deploy:alias"');
|
|
96
|
+
}
|
|
97
|
+
return alias.aliasName;
|
|
98
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import EasCommand from '../../../commandUtils/EasCommand';
|
|
2
|
+
export default class WorkerAlias extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static aliases: string[];
|
|
5
|
+
static state: string;
|
|
6
|
+
static flags: {
|
|
7
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
prod: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
alias: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
+
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
+
};
|
|
13
|
+
static contextDefinition: {
|
|
14
|
+
loggedIn: import("../../../commandUtils/context/LoggedInContextField").default;
|
|
15
|
+
projectDir: import("../../../commandUtils/context/ProjectDirContextField").default;
|
|
16
|
+
getDynamicPublicProjectConfigAsync: import("../../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
|
|
17
|
+
getDynamicPrivateProjectConfigAsync: import("../../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
|
|
18
|
+
};
|
|
19
|
+
runAsync(): Promise<void>;
|
|
20
|
+
private sanitizeFlags;
|
|
21
|
+
}
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
-
const EasCommand_1 = tslib_1.__importDefault(require("
|
|
7
|
-
const flags_1 = require("
|
|
8
|
-
const log_1 = tslib_1.__importDefault(require("
|
|
9
|
-
const ora_1 = require("
|
|
10
|
-
const prompts_1 = require("
|
|
11
|
-
const json_1 = require("
|
|
12
|
-
const deployment_1 = require("
|
|
13
|
-
const logs_1 = require("
|
|
6
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
7
|
+
const flags_1 = require("../../../commandUtils/flags");
|
|
8
|
+
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
9
|
+
const ora_1 = require("../../../ora");
|
|
10
|
+
const prompts_1 = require("../../../prompts");
|
|
11
|
+
const json_1 = require("../../../utils/json");
|
|
12
|
+
const deployment_1 = require("../../../worker/deployment");
|
|
13
|
+
const logs_1 = require("../../../worker/utils/logs");
|
|
14
14
|
class WorkerAlias extends EasCommand_1.default {
|
|
15
15
|
static description = 'Assign deployment aliases.';
|
|
16
16
|
static aliases = ['worker:alias', 'deploy:promote'];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
export default class
|
|
2
|
+
export default class WorkerDelete extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
5
|
static state: string;
|
|
6
|
+
static args: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
6
9
|
static flags: {
|
|
7
10
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
11
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
prod: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
alias: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
-
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
12
|
};
|
|
13
13
|
static contextDefinition: {
|
|
14
14
|
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
8
|
+
const ora_1 = require("../../ora");
|
|
9
|
+
const prompts_1 = require("../../prompts");
|
|
10
|
+
const json_1 = require("../../utils/json");
|
|
11
|
+
const deployment_1 = require("../../worker/deployment");
|
|
12
|
+
class WorkerDelete extends EasCommand_1.default {
|
|
13
|
+
static description = 'Delete a deployment.';
|
|
14
|
+
static aliases = ['worker:delete'];
|
|
15
|
+
static state = 'preview';
|
|
16
|
+
static args = [{ name: 'DEPLOYMENT_ID' }];
|
|
17
|
+
static flags = {
|
|
18
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
19
|
+
};
|
|
20
|
+
static contextDefinition = {
|
|
21
|
+
...this.ContextOptions.DynamicProjectConfig,
|
|
22
|
+
...this.ContextOptions.ProjectDir,
|
|
23
|
+
...this.ContextOptions.LoggedIn,
|
|
24
|
+
};
|
|
25
|
+
async runAsync() {
|
|
26
|
+
const { args: { DEPLOYMENT_ID: deploymentIdFromArg }, flags: rawFlags, } = await this.parse(WorkerDelete);
|
|
27
|
+
const flags = this.sanitizeFlags(rawFlags);
|
|
28
|
+
if (flags.json) {
|
|
29
|
+
(0, json_1.enableJsonOutput)();
|
|
30
|
+
}
|
|
31
|
+
log_1.default.warn('EAS Hosting is still in preview and subject to changes.');
|
|
32
|
+
const { getDynamicPrivateProjectConfigAsync, loggedIn: { graphqlClient }, } = await this.getContextAsync(WorkerDelete, {
|
|
33
|
+
nonInteractive: true,
|
|
34
|
+
withServerSideEnvironment: null,
|
|
35
|
+
});
|
|
36
|
+
const { projectId } = await getDynamicPrivateProjectConfigAsync();
|
|
37
|
+
if (!deploymentIdFromArg) {
|
|
38
|
+
if (flags.nonInteractive) {
|
|
39
|
+
throw new Error('Deployment ID must be provided in non-interactive mode');
|
|
40
|
+
}
|
|
41
|
+
throw new Error('Deployment ID is required');
|
|
42
|
+
}
|
|
43
|
+
if (!flags.nonInteractive) {
|
|
44
|
+
log_1.default.addNewLineIfNone();
|
|
45
|
+
log_1.default.warn(`You are about to permanently delete deployment with ID: "${deploymentIdFromArg}"` +
|
|
46
|
+
`\nThis action is irreversible.`);
|
|
47
|
+
log_1.default.newLine();
|
|
48
|
+
const confirmed = await (0, prompts_1.toggleConfirmAsync)({ message: 'Are you sure you wish to proceed?' });
|
|
49
|
+
if (!confirmed) {
|
|
50
|
+
log_1.default.log('Aborted.');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
let progress = null;
|
|
55
|
+
let deleteResult = null;
|
|
56
|
+
try {
|
|
57
|
+
progress = (0, ora_1.ora)((0, chalk_1.default) `Deleting deployment {bold ${deploymentIdFromArg}}`).start();
|
|
58
|
+
deleteResult = await (0, deployment_1.deleteWorkerDeploymentAsync)({
|
|
59
|
+
graphqlClient,
|
|
60
|
+
appId: projectId,
|
|
61
|
+
deploymentIdentifier: deploymentIdFromArg,
|
|
62
|
+
});
|
|
63
|
+
progress.text = (0, chalk_1.default) `Deleted deployment {bold ${deploymentIdFromArg}}`;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
progress?.fail((0, chalk_1.default) `Failed to delete deployment {bold ${deploymentIdFromArg}}`);
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
progress?.succeed((0, chalk_1.default) `Deleted deployment {bold ${deploymentIdFromArg}}`);
|
|
70
|
+
if (flags.json) {
|
|
71
|
+
(0, json_1.printJsonOnlyOutput)({
|
|
72
|
+
deploymentId: deleteResult.deploymentIdentifier,
|
|
73
|
+
id: deleteResult.id,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
sanitizeFlags(flags) {
|
|
78
|
+
return {
|
|
79
|
+
nonInteractive: flags['non-interactive'],
|
|
80
|
+
json: flags['json'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.default = WorkerDelete;
|
|
@@ -69,7 +69,7 @@ class IosCredentialsProvider {
|
|
|
69
69
|
const setupPushKeyAction = new SetUpPushKey_1.SetUpPushKey(appLookupParams);
|
|
70
70
|
const isPushKeySetup = await setupPushKeyAction.isPushKeySetupAsync(ctx);
|
|
71
71
|
if (isPushKeySetup) {
|
|
72
|
-
log_1.default.succeed(`Push Notifications
|
|
72
|
+
log_1.default.succeed(`Push Notifications are set up`);
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
75
|
if (ctx.easJsonCliConfig?.promptToConfigurePushNotifications === false) {
|
|
@@ -3404,6 +3404,7 @@ export type DeploymentsMutation = {
|
|
|
3404
3404
|
createSignedDeploymentUrl: DeploymentSignedUrlResult;
|
|
3405
3405
|
deleteAlias: DeleteAliasResult;
|
|
3406
3406
|
deleteWorkerDeployment: DeleteWorkerDeploymentResult;
|
|
3407
|
+
deleteWorkerDeploymentByIdentifier: DeleteWorkerDeploymentResult;
|
|
3407
3408
|
};
|
|
3408
3409
|
export type DeploymentsMutationAssignAliasArgs = {
|
|
3409
3410
|
aliasName?: InputMaybe<Scalars['WorkerDeploymentIdentifier']['input']>;
|
|
@@ -3421,6 +3422,10 @@ export type DeploymentsMutationDeleteAliasArgs = {
|
|
|
3421
3422
|
export type DeploymentsMutationDeleteWorkerDeploymentArgs = {
|
|
3422
3423
|
workerDeploymentId: Scalars['ID']['input'];
|
|
3423
3424
|
};
|
|
3425
|
+
export type DeploymentsMutationDeleteWorkerDeploymentByIdentifierArgs = {
|
|
3426
|
+
appId: Scalars['ID']['input'];
|
|
3427
|
+
deploymentIdentifier: Scalars['ID']['input'];
|
|
3428
|
+
};
|
|
3424
3429
|
export type DiscordUser = {
|
|
3425
3430
|
__typename?: 'DiscordUser';
|
|
3426
3431
|
discordIdentifier: Scalars['String']['output'];
|
|
@@ -16382,6 +16387,36 @@ export type AssignAliasMutation = {
|
|
|
16382
16387
|
};
|
|
16383
16388
|
};
|
|
16384
16389
|
};
|
|
16390
|
+
export type DeleteAliasMutationVariables = Exact<{
|
|
16391
|
+
appId: Scalars['ID']['input'];
|
|
16392
|
+
aliasName?: InputMaybe<Scalars['WorkerDeploymentIdentifier']['input']>;
|
|
16393
|
+
}>;
|
|
16394
|
+
export type DeleteAliasMutation = {
|
|
16395
|
+
__typename?: 'RootMutation';
|
|
16396
|
+
deployments: {
|
|
16397
|
+
__typename?: 'DeploymentsMutation';
|
|
16398
|
+
deleteAlias: {
|
|
16399
|
+
__typename?: 'DeleteAliasResult';
|
|
16400
|
+
id: string;
|
|
16401
|
+
aliasName?: any | null;
|
|
16402
|
+
};
|
|
16403
|
+
};
|
|
16404
|
+
};
|
|
16405
|
+
export type DeleteDeploymentMutationVariables = Exact<{
|
|
16406
|
+
appId: Scalars['ID']['input'];
|
|
16407
|
+
deploymentIdentifier: Scalars['ID']['input'];
|
|
16408
|
+
}>;
|
|
16409
|
+
export type DeleteDeploymentMutation = {
|
|
16410
|
+
__typename?: 'RootMutation';
|
|
16411
|
+
deployments: {
|
|
16412
|
+
__typename?: 'DeploymentsMutation';
|
|
16413
|
+
deleteWorkerDeploymentByIdentifier: {
|
|
16414
|
+
__typename?: 'DeleteWorkerDeploymentResult';
|
|
16415
|
+
id: string;
|
|
16416
|
+
deploymentIdentifier: any;
|
|
16417
|
+
};
|
|
16418
|
+
};
|
|
16419
|
+
};
|
|
16385
16420
|
export type PaginatedWorkerDeploymentsQueryVariables = Exact<{
|
|
16386
16421
|
appId: Scalars['String']['input'];
|
|
16387
16422
|
first?: InputMaybe<Scalars['Int']['input']>;
|
|
@@ -16435,3 +16470,40 @@ export type SuggestedDevDomainNameQuery = {
|
|
|
16435
16470
|
};
|
|
16436
16471
|
};
|
|
16437
16472
|
};
|
|
16473
|
+
export type PaginatedWorkerDeploymentAliasesQueryVariables = Exact<{
|
|
16474
|
+
appId: Scalars['String']['input'];
|
|
16475
|
+
first?: InputMaybe<Scalars['Int']['input']>;
|
|
16476
|
+
after?: InputMaybe<Scalars['String']['input']>;
|
|
16477
|
+
last?: InputMaybe<Scalars['Int']['input']>;
|
|
16478
|
+
before?: InputMaybe<Scalars['String']['input']>;
|
|
16479
|
+
}>;
|
|
16480
|
+
export type PaginatedWorkerDeploymentAliasesQuery = {
|
|
16481
|
+
__typename?: 'RootQuery';
|
|
16482
|
+
app: {
|
|
16483
|
+
__typename?: 'AppQuery';
|
|
16484
|
+
byId: {
|
|
16485
|
+
__typename?: 'App';
|
|
16486
|
+
id: string;
|
|
16487
|
+
workerDeploymentAliases: {
|
|
16488
|
+
__typename?: 'WorkerDeploymentAliasesConnection';
|
|
16489
|
+
pageInfo: {
|
|
16490
|
+
__typename?: 'PageInfo';
|
|
16491
|
+
hasNextPage: boolean;
|
|
16492
|
+
hasPreviousPage: boolean;
|
|
16493
|
+
startCursor?: string | null;
|
|
16494
|
+
endCursor?: string | null;
|
|
16495
|
+
};
|
|
16496
|
+
edges: Array<{
|
|
16497
|
+
__typename?: 'WorkerDeploymentAliasEdge';
|
|
16498
|
+
cursor: string;
|
|
16499
|
+
node: {
|
|
16500
|
+
__typename?: 'WorkerDeploymentAlias';
|
|
16501
|
+
id: string;
|
|
16502
|
+
aliasName?: any | null;
|
|
16503
|
+
url: string;
|
|
16504
|
+
};
|
|
16505
|
+
}>;
|
|
16506
|
+
};
|
|
16507
|
+
};
|
|
16508
|
+
};
|
|
16509
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeploymentsMutation } from './mutations';
|
|
2
2
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
-
import { WorkerDeploymentFragment } from '../graphql/generated';
|
|
3
|
+
import { WorkerDeploymentAliasFragment, WorkerDeploymentFragment } from '../graphql/generated';
|
|
4
4
|
import { selectPaginatedAsync } from '../utils/relay';
|
|
5
5
|
export declare function getSignedDeploymentUrlAsync(graphqlClient: ExpoGraphqlClient, options: {
|
|
6
6
|
appId: string;
|
|
@@ -37,3 +37,25 @@ export declare function selectWorkerDeploymentOnAppAsync({ graphqlClient, appId,
|
|
|
37
37
|
selectTitle?: string;
|
|
38
38
|
pageSize?: number;
|
|
39
39
|
}): ReturnType<typeof selectPaginatedAsync<WorkerDeploymentFragment>>;
|
|
40
|
+
export declare function deleteWorkerDeploymentAliasAsync({ graphqlClient, appId, aliasName, }: {
|
|
41
|
+
graphqlClient: ExpoGraphqlClient;
|
|
42
|
+
appId: string;
|
|
43
|
+
aliasName: string;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
aliasName?: string;
|
|
46
|
+
id: string;
|
|
47
|
+
}>;
|
|
48
|
+
export declare function selectWorkerDeploymentAliasOnAppAsync({ graphqlClient, appId, selectTitle, pageSize, }: {
|
|
49
|
+
graphqlClient: ExpoGraphqlClient;
|
|
50
|
+
appId: string;
|
|
51
|
+
selectTitle?: string;
|
|
52
|
+
pageSize?: number;
|
|
53
|
+
}): ReturnType<typeof selectPaginatedAsync<WorkerDeploymentAliasFragment>>;
|
|
54
|
+
export declare function deleteWorkerDeploymentAsync({ graphqlClient, appId, deploymentIdentifier, }: {
|
|
55
|
+
graphqlClient: ExpoGraphqlClient;
|
|
56
|
+
appId: string;
|
|
57
|
+
deploymentIdentifier: string;
|
|
58
|
+
}): Promise<{
|
|
59
|
+
deploymentIdentifier: string;
|
|
60
|
+
id: string;
|
|
61
|
+
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selectWorkerDeploymentOnAppAsync = exports.assignWorkerDeploymentProductionAsync = exports.assignWorkerDeploymentAliasAsync = exports.assignDevDomainNameAsync = exports.getSignedDeploymentUrlAsync = void 0;
|
|
3
|
+
exports.deleteWorkerDeploymentAsync = exports.selectWorkerDeploymentAliasOnAppAsync = exports.deleteWorkerDeploymentAliasAsync = exports.selectWorkerDeploymentOnAppAsync = exports.assignWorkerDeploymentProductionAsync = exports.assignWorkerDeploymentAliasAsync = exports.assignDevDomainNameAsync = exports.getSignedDeploymentUrlAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const mutations_1 = require("./mutations");
|
|
@@ -157,3 +157,29 @@ async function selectWorkerDeploymentOnAppAsync({ graphqlClient, appId, selectTi
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
exports.selectWorkerDeploymentOnAppAsync = selectWorkerDeploymentOnAppAsync;
|
|
160
|
+
async function deleteWorkerDeploymentAliasAsync({ graphqlClient, appId, aliasName, }) {
|
|
161
|
+
return await mutations_1.DeploymentsMutation.deleteAliasAsync(graphqlClient, {
|
|
162
|
+
appId,
|
|
163
|
+
aliasName,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
exports.deleteWorkerDeploymentAliasAsync = deleteWorkerDeploymentAliasAsync;
|
|
167
|
+
async function selectWorkerDeploymentAliasOnAppAsync({ graphqlClient, appId, selectTitle, pageSize, }) {
|
|
168
|
+
return await (0, relay_1.selectPaginatedAsync)({
|
|
169
|
+
pageSize: pageSize ?? 25,
|
|
170
|
+
printedType: selectTitle ?? 'worker deployment alias',
|
|
171
|
+
queryAsync: async (queryParams) => await queries_1.DeploymentsQuery.getAllAliasesPaginatedAsync(graphqlClient, {
|
|
172
|
+
...queryParams,
|
|
173
|
+
appId,
|
|
174
|
+
}),
|
|
175
|
+
getTitleAsync: async (alias) => (0, chalk_1.default) `${alias.aliasName ?? 'production'}{dim - ${alias.url}}`,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
exports.selectWorkerDeploymentAliasOnAppAsync = selectWorkerDeploymentAliasOnAppAsync;
|
|
179
|
+
async function deleteWorkerDeploymentAsync({ graphqlClient, appId, deploymentIdentifier, }) {
|
|
180
|
+
return await mutations_1.DeploymentsMutation.deleteWorkerDeploymentAsync(graphqlClient, {
|
|
181
|
+
appId,
|
|
182
|
+
deploymentIdentifier,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
exports.deleteWorkerDeploymentAsync = deleteWorkerDeploymentAsync;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AssignAliasMutation } from '../graphql/generated';
|
|
2
|
+
import { AssignAliasMutation, DeleteAliasResult } from '../graphql/generated';
|
|
3
3
|
export declare const DeploymentsMutation: {
|
|
4
4
|
createSignedDeploymentUrlAsync(graphqlClient: ExpoGraphqlClient, deploymentVariables: {
|
|
5
5
|
appId: string;
|
|
@@ -14,4 +14,15 @@ export declare const DeploymentsMutation: {
|
|
|
14
14
|
deploymentId: string;
|
|
15
15
|
aliasName: string | null;
|
|
16
16
|
}): Promise<AssignAliasMutation['deployments']['assignAlias']>;
|
|
17
|
+
deleteAliasAsync(graphqlClient: ExpoGraphqlClient, deleteAliasVariables: {
|
|
18
|
+
appId: string;
|
|
19
|
+
aliasName: string;
|
|
20
|
+
}): Promise<DeleteAliasResult>;
|
|
21
|
+
deleteWorkerDeploymentAsync(graphqlClient: ExpoGraphqlClient, deleteVariables: {
|
|
22
|
+
appId: string;
|
|
23
|
+
deploymentIdentifier: string;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
deploymentIdentifier: string;
|
|
26
|
+
id: string;
|
|
27
|
+
}>;
|
|
17
28
|
};
|
|
@@ -75,4 +75,37 @@ exports.DeploymentsMutation = {
|
|
|
75
75
|
.toPromise());
|
|
76
76
|
return data.deployments.assignAlias;
|
|
77
77
|
},
|
|
78
|
+
async deleteAliasAsync(graphqlClient, deleteAliasVariables) {
|
|
79
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
80
|
+
.mutation((0, graphql_tag_1.default) `
|
|
81
|
+
mutation DeleteAlias($appId: ID!, $aliasName: WorkerDeploymentIdentifier) {
|
|
82
|
+
deployments {
|
|
83
|
+
deleteAlias(appId: $appId, aliasName: $aliasName) {
|
|
84
|
+
id
|
|
85
|
+
aliasName
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`, deleteAliasVariables)
|
|
90
|
+
.toPromise());
|
|
91
|
+
return data.deployments.deleteAlias;
|
|
92
|
+
},
|
|
93
|
+
async deleteWorkerDeploymentAsync(graphqlClient, deleteVariables) {
|
|
94
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
95
|
+
.mutation((0, graphql_tag_1.default) `
|
|
96
|
+
mutation DeleteDeployment($appId: ID!, $deploymentIdentifier: ID!) {
|
|
97
|
+
deployments {
|
|
98
|
+
deleteWorkerDeploymentByIdentifier(
|
|
99
|
+
appId: $appId
|
|
100
|
+
deploymentIdentifier: $deploymentIdentifier
|
|
101
|
+
) {
|
|
102
|
+
id
|
|
103
|
+
deploymentIdentifier
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`, deleteVariables)
|
|
108
|
+
.toPromise());
|
|
109
|
+
return data.deployments.deleteWorkerDeploymentByIdentifier;
|
|
110
|
+
},
|
|
78
111
|
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { type PaginatedWorkerDeploymentsQueryVariables, SuggestedDevDomainNameQueryVariables, type WorkerDeploymentFragment } from '../graphql/generated';
|
|
2
|
+
import { type PaginatedWorkerDeploymentsQueryVariables, SuggestedDevDomainNameQueryVariables, type WorkerDeploymentAliasFragment, type WorkerDeploymentFragment } from '../graphql/generated';
|
|
3
3
|
import type { Connection } from '../utils/relay';
|
|
4
4
|
export declare const DeploymentsQuery: {
|
|
5
5
|
getAllDeploymentsPaginatedAsync(graphqlClient: ExpoGraphqlClient, { appId, first, after, last, before }: PaginatedWorkerDeploymentsQueryVariables): Promise<Connection<WorkerDeploymentFragment>>;
|
|
6
6
|
getSuggestedDevDomainByAppIdAsync(graphqlClient: ExpoGraphqlClient, { appId }: SuggestedDevDomainNameQueryVariables): Promise<string>;
|
|
7
|
+
getAllAliasesPaginatedAsync(graphqlClient: ExpoGraphqlClient, { appId, first, after, last, before, }: {
|
|
8
|
+
appId: string;
|
|
9
|
+
first?: number | undefined;
|
|
10
|
+
after?: string | undefined;
|
|
11
|
+
last?: number | undefined;
|
|
12
|
+
before?: string | undefined;
|
|
13
|
+
}): Promise<Connection<WorkerDeploymentAliasFragment>>;
|
|
7
14
|
};
|
package/build/worker/queries.js
CHANGED
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const graphql_1 = require("graphql");
|
|
6
6
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
7
|
const WorkerDeployment_1 = require("./fragments/WorkerDeployment");
|
|
8
|
+
const WorkerDeploymentAlias_1 = require("./fragments/WorkerDeploymentAlias");
|
|
8
9
|
const client_1 = require("../graphql/client");
|
|
9
10
|
exports.DeploymentsQuery = {
|
|
10
11
|
async getAllDeploymentsPaginatedAsync(graphqlClient, { appId, first, after, last, before }) {
|
|
@@ -58,4 +59,45 @@ exports.DeploymentsQuery = {
|
|
|
58
59
|
.toPromise());
|
|
59
60
|
return data.app.byId.suggestedDevDomainName;
|
|
60
61
|
},
|
|
62
|
+
async getAllAliasesPaginatedAsync(graphqlClient, { appId, first, after, last, before, }) {
|
|
63
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
64
|
+
.query((0, graphql_tag_1.default) `
|
|
65
|
+
query PaginatedWorkerDeploymentAliases(
|
|
66
|
+
$appId: String!
|
|
67
|
+
$first: Int
|
|
68
|
+
$after: String
|
|
69
|
+
$last: Int
|
|
70
|
+
$before: String
|
|
71
|
+
) {
|
|
72
|
+
app {
|
|
73
|
+
byId(appId: $appId) {
|
|
74
|
+
id
|
|
75
|
+
workerDeploymentAliases(
|
|
76
|
+
first: $first
|
|
77
|
+
after: $after
|
|
78
|
+
last: $last
|
|
79
|
+
before: $before
|
|
80
|
+
) {
|
|
81
|
+
pageInfo {
|
|
82
|
+
hasNextPage
|
|
83
|
+
hasPreviousPage
|
|
84
|
+
startCursor
|
|
85
|
+
endCursor
|
|
86
|
+
}
|
|
87
|
+
edges {
|
|
88
|
+
cursor
|
|
89
|
+
node {
|
|
90
|
+
id
|
|
91
|
+
...WorkerDeploymentAliasFragment
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
${(0, graphql_1.print)(WorkerDeploymentAlias_1.WorkerDeploymentAliasFragmentNode)}
|
|
99
|
+
`, { appId, first, after, last, before }, { additionalTypenames: ['WorkerDeploymentAlias'] })
|
|
100
|
+
.toPromise());
|
|
101
|
+
return data.app.byId.workerDeploymentAliases;
|
|
102
|
+
},
|
|
61
103
|
};
|