eas-cli 12.5.1 → 12.5.2
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 +66 -62
- package/build/build/build.js +4 -4
- package/build/commandUtils/flags.d.ts +10 -0
- package/build/commandUtils/flags.js +15 -8
- package/build/commands/env/create.d.ts +3 -1
- package/build/commands/env/create.js +106 -74
- package/build/commands/env/delete.d.ts +2 -2
- package/build/commands/env/delete.js +37 -26
- package/build/commands/env/exec.js +2 -1
- package/build/commands/env/get.d.ts +2 -2
- package/build/commands/env/get.js +40 -26
- package/build/commands/env/link.d.ts +4 -2
- package/build/commands/env/link.js +53 -14
- package/build/commands/env/list.d.ts +1 -2
- package/build/commands/env/list.js +49 -42
- package/build/commands/env/pull.js +1 -1
- package/build/commands/env/unlink.d.ts +3 -2
- package/build/commands/env/unlink.js +48 -21
- package/build/commands/env/update.d.ts +4 -2
- package/build/commands/env/update.js +68 -66
- package/build/commands/update/index.js +0 -1
- package/build/commands/worker/deploy.js +31 -11
- package/build/graphql/generated.d.ts +87 -15
- package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +13 -22
- package/build/graphql/mutations/EnvironmentVariableMutation.js +18 -2
- package/build/graphql/queries/EnvironmentVariablesQuery.d.ts +13 -7
- package/build/graphql/queries/EnvironmentVariablesQuery.js +21 -9
- package/build/graphql/types/EnvironmentVariable.js +2 -1
- package/build/update/republish.js +1 -0
- package/build/utils/prompts.d.ts +15 -3
- package/build/utils/prompts.js +33 -8
- package/build/utils/variableUtils.d.ts +4 -0
- package/build/utils/variableUtils.js +31 -0
- package/build/worker/assets.d.ts +6 -1
- package/build/worker/assets.js +1 -2
- package/build/worker/upload.d.ts +1 -0
- package/build/worker/upload.js +25 -1
- package/oclif.manifest.json +70 -41
- package/package.json +3 -3
- package/build/utils/formatVariable.d.ts +0 -2
- package/build/utils/formatVariable.js +0 -16
|
@@ -43,6 +43,19 @@ class WorkerDeploy extends EasCommand_1.default {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
async function finalizeDeployAsync(deployParams) {
|
|
47
|
+
const finalizeDeployUrl = new URL('/deploy/finalize', deployParams.baseURL);
|
|
48
|
+
finalizeDeployUrl.searchParams.set('token', deployParams.token);
|
|
49
|
+
const result = await (0, upload_1.callUploadApiAsync)(finalizeDeployUrl, {
|
|
50
|
+
method: 'POST',
|
|
51
|
+
headers: {
|
|
52
|
+
accept: 'application/json',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
if (!result || typeof result !== 'object' || !('success' in result) || !result.success) {
|
|
56
|
+
throw new Error('Deploy failed: Incomplete asset uploads. Please try again');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
46
59
|
async function uploadTarballAsync(tarPath, uploadUrl) {
|
|
47
60
|
const { response } = await (0, upload_1.uploadAsync)({
|
|
48
61
|
url: uploadUrl,
|
|
@@ -64,24 +77,30 @@ class WorkerDeploy extends EasCommand_1.default {
|
|
|
64
77
|
if (!json.success || !json.result || typeof json.result !== 'object') {
|
|
65
78
|
throw new Error(json.message ? `Upload failed: ${json.message}` : 'Upload failed!');
|
|
66
79
|
}
|
|
67
|
-
|
|
80
|
+
const { id, fullName, token } = json.result;
|
|
81
|
+
if (typeof token !== 'string') {
|
|
82
|
+
throw new Error('Upload failed: API failed to return a deployment token');
|
|
83
|
+
}
|
|
84
|
+
else if (typeof id !== 'string') {
|
|
85
|
+
throw new Error('Upload failed: API failed to return a deployment identifier');
|
|
86
|
+
}
|
|
87
|
+
else if (typeof fullName !== 'string') {
|
|
88
|
+
throw new Error('Upload failed: API failed to return a script name');
|
|
89
|
+
}
|
|
90
|
+
const baseURL = new URL('/', uploadUrl).toString();
|
|
91
|
+
return { id, fullName, baseURL, token };
|
|
68
92
|
}
|
|
69
93
|
}
|
|
70
|
-
async function uploadAssetsAsync(assetMap,
|
|
71
|
-
if (typeof uploads !== 'object' || !uploads) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
// TODO(@kitten): Batch and upload multiple files in parallel
|
|
94
|
+
async function uploadAssetsAsync(assetMap, deployParams) {
|
|
75
95
|
const uploadParams = [];
|
|
76
96
|
const assetPath = projectDist.type === 'server' ? projectDist.clientPath : projectDist.path;
|
|
77
97
|
if (!assetPath) {
|
|
78
98
|
return;
|
|
79
99
|
}
|
|
80
100
|
for await (const asset of WorkerAssets.listAssetMapFilesAsync(assetPath, assetMap)) {
|
|
81
|
-
const uploadURL =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
101
|
+
const uploadURL = new URL(`/asset/${asset.sha512}`, deployParams.baseURL);
|
|
102
|
+
uploadURL.searchParams.set('token', deployParams.token);
|
|
103
|
+
uploadParams.push({ url: uploadURL.toString(), filePath: asset.path });
|
|
85
104
|
}
|
|
86
105
|
const progress = {
|
|
87
106
|
total: uploadParams.length,
|
|
@@ -147,7 +166,8 @@ class WorkerDeploy extends EasCommand_1.default {
|
|
|
147
166
|
progress.fail('Failed to create deployment');
|
|
148
167
|
throw error;
|
|
149
168
|
}
|
|
150
|
-
await uploadAssetsAsync(assetMap, deployResult
|
|
169
|
+
await uploadAssetsAsync(assetMap, deployResult);
|
|
170
|
+
await finalizeDeployAsync(deployResult);
|
|
151
171
|
let deploymentAlias = null;
|
|
152
172
|
if (flags.aliasName) {
|
|
153
173
|
progress = (0, ora_1.ora)((0, chalk_1.default) `Assigning alias {bold ${flags.aliasName}} to deployment`).start();
|
|
@@ -371,6 +371,7 @@ export type AccountEnvironmentSecretsArgs = {
|
|
|
371
371
|
* data and settings. Actors may own and be members of accounts.
|
|
372
372
|
*/
|
|
373
373
|
export type AccountEnvironmentVariablesArgs = {
|
|
374
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
374
375
|
filterNames?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
375
376
|
};
|
|
376
377
|
/**
|
|
@@ -378,6 +379,7 @@ export type AccountEnvironmentVariablesArgs = {
|
|
|
378
379
|
* data and settings. Actors may own and be members of accounts.
|
|
379
380
|
*/
|
|
380
381
|
export type AccountEnvironmentVariablesIncludingSensitiveArgs = {
|
|
382
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
381
383
|
filterNames?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
382
384
|
};
|
|
383
385
|
/**
|
|
@@ -2799,9 +2801,11 @@ export type CreateEnvironmentSecretInput = {
|
|
|
2799
2801
|
value: Scalars['String']['input'];
|
|
2800
2802
|
};
|
|
2801
2803
|
export type CreateEnvironmentVariableInput = {
|
|
2802
|
-
environment
|
|
2804
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
2805
|
+
environments?: InputMaybe<Array<EnvironmentVariableEnvironment>>;
|
|
2803
2806
|
name: Scalars['String']['input'];
|
|
2804
2807
|
overwrite?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2808
|
+
type?: InputMaybe<EnvironmentSecretType>;
|
|
2805
2809
|
value: Scalars['String']['input'];
|
|
2806
2810
|
visibility: EnvironmentVariableVisibility;
|
|
2807
2811
|
};
|
|
@@ -2856,8 +2860,10 @@ export type CreateServerlessFunctionUploadUrlResult = {
|
|
|
2856
2860
|
url: Scalars['String']['output'];
|
|
2857
2861
|
};
|
|
2858
2862
|
export type CreateSharedEnvironmentVariableInput = {
|
|
2863
|
+
environments?: InputMaybe<Array<EnvironmentVariableEnvironment>>;
|
|
2859
2864
|
name: Scalars['String']['input'];
|
|
2860
2865
|
overwrite?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2866
|
+
type?: InputMaybe<EnvironmentSecretType>;
|
|
2861
2867
|
value: Scalars['String']['input'];
|
|
2862
2868
|
visibility: EnvironmentVariableVisibility;
|
|
2863
2869
|
};
|
|
@@ -3307,13 +3313,23 @@ export type EnvironmentVariable = {
|
|
|
3307
3313
|
apps: Array<App>;
|
|
3308
3314
|
createdAt: Scalars['DateTime']['output'];
|
|
3309
3315
|
environment?: Maybe<EnvironmentVariableEnvironment>;
|
|
3316
|
+
environments?: Maybe<Array<EnvironmentVariableEnvironment>>;
|
|
3310
3317
|
id: Scalars['ID']['output'];
|
|
3318
|
+
linkedEnvironments?: Maybe<Array<EnvironmentVariableEnvironment>>;
|
|
3311
3319
|
name: Scalars['String']['output'];
|
|
3312
3320
|
scope: EnvironmentVariableScope;
|
|
3321
|
+
type: EnvironmentSecretType;
|
|
3313
3322
|
updatedAt: Scalars['DateTime']['output'];
|
|
3314
3323
|
value?: Maybe<Scalars['String']['output']>;
|
|
3315
3324
|
visibility?: Maybe<EnvironmentVariableVisibility>;
|
|
3316
3325
|
};
|
|
3326
|
+
export type EnvironmentVariableLinkedEnvironmentsArgs = {
|
|
3327
|
+
appFullName?: InputMaybe<Scalars['String']['input']>;
|
|
3328
|
+
appId?: InputMaybe<Scalars['String']['input']>;
|
|
3329
|
+
};
|
|
3330
|
+
export type EnvironmentVariableValueArgs = {
|
|
3331
|
+
includeFileContent?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3332
|
+
};
|
|
3317
3333
|
export declare enum EnvironmentVariableEnvironment {
|
|
3318
3334
|
Development = "DEVELOPMENT",
|
|
3319
3335
|
Preview = "PREVIEW",
|
|
@@ -3337,6 +3353,8 @@ export type EnvironmentVariableMutation = {
|
|
|
3337
3353
|
linkSharedEnvironmentVariable: EnvironmentVariable;
|
|
3338
3354
|
/** Unlink shared environment variable */
|
|
3339
3355
|
unlinkSharedEnvironmentVariable: EnvironmentVariable;
|
|
3356
|
+
/** Update an environment variable */
|
|
3357
|
+
updateEnvironmentVariable: EnvironmentVariable;
|
|
3340
3358
|
};
|
|
3341
3359
|
export type EnvironmentVariableMutationCreateBulkEnvironmentVariablesForAccountArgs = {
|
|
3342
3360
|
accountId: Scalars['ID']['input'];
|
|
@@ -3362,14 +3380,17 @@ export type EnvironmentVariableMutationLinkBulkSharedEnvironmentVariablesArgs =
|
|
|
3362
3380
|
};
|
|
3363
3381
|
export type EnvironmentVariableMutationLinkSharedEnvironmentVariableArgs = {
|
|
3364
3382
|
appId: Scalars['ID']['input'];
|
|
3365
|
-
environment
|
|
3383
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
3366
3384
|
environmentVariableId: Scalars['ID']['input'];
|
|
3367
3385
|
};
|
|
3368
3386
|
export type EnvironmentVariableMutationUnlinkSharedEnvironmentVariableArgs = {
|
|
3369
3387
|
appId: Scalars['ID']['input'];
|
|
3370
|
-
environment
|
|
3388
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
3371
3389
|
environmentVariableId: Scalars['ID']['input'];
|
|
3372
3390
|
};
|
|
3391
|
+
export type EnvironmentVariableMutationUpdateEnvironmentVariableArgs = {
|
|
3392
|
+
environmentVariableData: UpdateEnvironmentVariableInput;
|
|
3393
|
+
};
|
|
3373
3394
|
export declare enum EnvironmentVariableScope {
|
|
3374
3395
|
Project = "PROJECT",
|
|
3375
3396
|
Shared = "SHARED"
|
|
@@ -3384,14 +3405,24 @@ export type EnvironmentVariableWithSecret = {
|
|
|
3384
3405
|
apps: Array<App>;
|
|
3385
3406
|
createdAt: Scalars['DateTime']['output'];
|
|
3386
3407
|
environment?: Maybe<EnvironmentVariableEnvironment>;
|
|
3408
|
+
environments?: Maybe<Array<EnvironmentVariableEnvironment>>;
|
|
3387
3409
|
id: Scalars['ID']['output'];
|
|
3410
|
+
linkedEnvironments?: Maybe<Array<EnvironmentVariableEnvironment>>;
|
|
3388
3411
|
name: Scalars['String']['output'];
|
|
3389
3412
|
scope: EnvironmentVariableScope;
|
|
3390
3413
|
sensitive: Scalars['Boolean']['output'];
|
|
3414
|
+
type: EnvironmentSecretType;
|
|
3391
3415
|
updatedAt: Scalars['DateTime']['output'];
|
|
3392
3416
|
value?: Maybe<Scalars['String']['output']>;
|
|
3393
3417
|
visibility: EnvironmentVariableVisibility;
|
|
3394
3418
|
};
|
|
3419
|
+
export type EnvironmentVariableWithSecretLinkedEnvironmentsArgs = {
|
|
3420
|
+
appFullName?: InputMaybe<Scalars['String']['input']>;
|
|
3421
|
+
appId?: InputMaybe<Scalars['String']['input']>;
|
|
3422
|
+
};
|
|
3423
|
+
export type EnvironmentVariableWithSecretValueArgs = {
|
|
3424
|
+
includeFileContent?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3425
|
+
};
|
|
3395
3426
|
export type EstimatedOverageAndCost = {
|
|
3396
3427
|
__typename?: 'EstimatedOverageAndCost';
|
|
3397
3428
|
id: Scalars['ID']['output'];
|
|
@@ -4192,7 +4223,7 @@ export type LineDataset = {
|
|
|
4192
4223
|
};
|
|
4193
4224
|
export type LinkSharedEnvironmentVariableInput = {
|
|
4194
4225
|
appId: Scalars['ID']['input'];
|
|
4195
|
-
environment
|
|
4226
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
4196
4227
|
environmentVariableId: Scalars['ID']['input'];
|
|
4197
4228
|
};
|
|
4198
4229
|
export type LogsTimespan = {
|
|
@@ -5561,6 +5592,14 @@ export type UpdateDeploymentsConnection = {
|
|
|
5561
5592
|
edges: Array<UpdateDeploymentEdge>;
|
|
5562
5593
|
pageInfo: PageInfo;
|
|
5563
5594
|
};
|
|
5595
|
+
export type UpdateEnvironmentVariableInput = {
|
|
5596
|
+
environments?: InputMaybe<Array<EnvironmentVariableEnvironment>>;
|
|
5597
|
+
id: Scalars['ID']['input'];
|
|
5598
|
+
name?: InputMaybe<Scalars['String']['input']>;
|
|
5599
|
+
type?: InputMaybe<EnvironmentSecretType>;
|
|
5600
|
+
value?: InputMaybe<Scalars['String']['input']>;
|
|
5601
|
+
visibility?: InputMaybe<EnvironmentVariableVisibility>;
|
|
5602
|
+
};
|
|
5564
5603
|
export type UpdateGitHubBuildTriggerInput = {
|
|
5565
5604
|
autoSubmit: Scalars['Boolean']['input'];
|
|
5566
5605
|
buildProfile: Scalars['String']['input'];
|
|
@@ -10766,7 +10805,7 @@ export type DeleteEnvironmentSecretMutation = {
|
|
|
10766
10805
|
};
|
|
10767
10806
|
export type LinkSharedEnvironmentVariableMutationVariables = Exact<{
|
|
10768
10807
|
appId: Scalars['ID']['input'];
|
|
10769
|
-
environment
|
|
10808
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
10770
10809
|
environmentVariableId: Scalars['ID']['input'];
|
|
10771
10810
|
}>;
|
|
10772
10811
|
export type LinkSharedEnvironmentVariableMutation = {
|
|
@@ -10778,8 +10817,9 @@ export type LinkSharedEnvironmentVariableMutation = {
|
|
|
10778
10817
|
id: string;
|
|
10779
10818
|
name: string;
|
|
10780
10819
|
value?: string | null;
|
|
10781
|
-
|
|
10820
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
10782
10821
|
createdAt: any;
|
|
10822
|
+
updatedAt: any;
|
|
10783
10823
|
scope: EnvironmentVariableScope;
|
|
10784
10824
|
visibility?: EnvironmentVariableVisibility | null;
|
|
10785
10825
|
};
|
|
@@ -10787,7 +10827,7 @@ export type LinkSharedEnvironmentVariableMutation = {
|
|
|
10787
10827
|
};
|
|
10788
10828
|
export type UnlinkSharedEnvironmentVariableMutationVariables = Exact<{
|
|
10789
10829
|
appId: Scalars['ID']['input'];
|
|
10790
|
-
environment
|
|
10830
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
10791
10831
|
environmentVariableId: Scalars['ID']['input'];
|
|
10792
10832
|
}>;
|
|
10793
10833
|
export type UnlinkSharedEnvironmentVariableMutation = {
|
|
@@ -10799,8 +10839,9 @@ export type UnlinkSharedEnvironmentVariableMutation = {
|
|
|
10799
10839
|
id: string;
|
|
10800
10840
|
name: string;
|
|
10801
10841
|
value?: string | null;
|
|
10802
|
-
|
|
10842
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
10803
10843
|
createdAt: any;
|
|
10844
|
+
updatedAt: any;
|
|
10804
10845
|
scope: EnvironmentVariableScope;
|
|
10805
10846
|
visibility?: EnvironmentVariableVisibility | null;
|
|
10806
10847
|
};
|
|
@@ -10819,8 +10860,9 @@ export type CreateEnvironmentVariableForAccountMutation = {
|
|
|
10819
10860
|
id: string;
|
|
10820
10861
|
name: string;
|
|
10821
10862
|
value?: string | null;
|
|
10822
|
-
|
|
10863
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
10823
10864
|
createdAt: any;
|
|
10865
|
+
updatedAt: any;
|
|
10824
10866
|
scope: EnvironmentVariableScope;
|
|
10825
10867
|
visibility?: EnvironmentVariableVisibility | null;
|
|
10826
10868
|
};
|
|
@@ -10839,8 +10881,29 @@ export type CreateEnvironmentVariableForAppMutation = {
|
|
|
10839
10881
|
id: string;
|
|
10840
10882
|
name: string;
|
|
10841
10883
|
value?: string | null;
|
|
10842
|
-
|
|
10884
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
10843
10885
|
createdAt: any;
|
|
10886
|
+
updatedAt: any;
|
|
10887
|
+
scope: EnvironmentVariableScope;
|
|
10888
|
+
visibility?: EnvironmentVariableVisibility | null;
|
|
10889
|
+
};
|
|
10890
|
+
};
|
|
10891
|
+
};
|
|
10892
|
+
export type UpdateEnvironmentVariableMutationVariables = Exact<{
|
|
10893
|
+
input: UpdateEnvironmentVariableInput;
|
|
10894
|
+
}>;
|
|
10895
|
+
export type UpdateEnvironmentVariableMutation = {
|
|
10896
|
+
__typename?: 'RootMutation';
|
|
10897
|
+
environmentVariable: {
|
|
10898
|
+
__typename?: 'EnvironmentVariableMutation';
|
|
10899
|
+
updateEnvironmentVariable: {
|
|
10900
|
+
__typename?: 'EnvironmentVariable';
|
|
10901
|
+
id: string;
|
|
10902
|
+
name: string;
|
|
10903
|
+
value?: string | null;
|
|
10904
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
10905
|
+
createdAt: any;
|
|
10906
|
+
updatedAt: any;
|
|
10844
10907
|
scope: EnvironmentVariableScope;
|
|
10845
10908
|
visibility?: EnvironmentVariableVisibility | null;
|
|
10846
10909
|
};
|
|
@@ -12036,7 +12099,7 @@ export type EnvironmentSecretsByAppIdQuery = {
|
|
|
12036
12099
|
export type EnvironmentVariablesIncludingSensitiveByAppIdQueryVariables = Exact<{
|
|
12037
12100
|
appId: Scalars['String']['input'];
|
|
12038
12101
|
filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
12039
|
-
environment
|
|
12102
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
12040
12103
|
}>;
|
|
12041
12104
|
export type EnvironmentVariablesIncludingSensitiveByAppIdQuery = {
|
|
12042
12105
|
__typename?: 'RootQuery';
|
|
@@ -12050,6 +12113,7 @@ export type EnvironmentVariablesIncludingSensitiveByAppIdQuery = {
|
|
|
12050
12113
|
id: string;
|
|
12051
12114
|
name: string;
|
|
12052
12115
|
value?: string | null;
|
|
12116
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
12053
12117
|
}>;
|
|
12054
12118
|
};
|
|
12055
12119
|
};
|
|
@@ -12057,7 +12121,7 @@ export type EnvironmentVariablesIncludingSensitiveByAppIdQuery = {
|
|
|
12057
12121
|
export type EnvironmentVariablesByAppIdQueryVariables = Exact<{
|
|
12058
12122
|
appId: Scalars['String']['input'];
|
|
12059
12123
|
filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
12060
|
-
environment
|
|
12124
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
12061
12125
|
}>;
|
|
12062
12126
|
export type EnvironmentVariablesByAppIdQuery = {
|
|
12063
12127
|
__typename?: 'RootQuery';
|
|
@@ -12069,10 +12133,12 @@ export type EnvironmentVariablesByAppIdQuery = {
|
|
|
12069
12133
|
environmentVariables: Array<{
|
|
12070
12134
|
__typename?: 'EnvironmentVariable';
|
|
12071
12135
|
id: string;
|
|
12136
|
+
linkedEnvironments?: Array<EnvironmentVariableEnvironment> | null;
|
|
12072
12137
|
name: string;
|
|
12073
12138
|
value?: string | null;
|
|
12074
|
-
|
|
12139
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
12075
12140
|
createdAt: any;
|
|
12141
|
+
updatedAt: any;
|
|
12076
12142
|
scope: EnvironmentVariableScope;
|
|
12077
12143
|
visibility?: EnvironmentVariableVisibility | null;
|
|
12078
12144
|
}>;
|
|
@@ -12082,6 +12148,7 @@ export type EnvironmentVariablesByAppIdQuery = {
|
|
|
12082
12148
|
export type EnvironmentVariablesSharedQueryVariables = Exact<{
|
|
12083
12149
|
appId: Scalars['String']['input'];
|
|
12084
12150
|
filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
12151
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
12085
12152
|
}>;
|
|
12086
12153
|
export type EnvironmentVariablesSharedQuery = {
|
|
12087
12154
|
__typename?: 'RootQuery';
|
|
@@ -12096,10 +12163,12 @@ export type EnvironmentVariablesSharedQuery = {
|
|
|
12096
12163
|
environmentVariables: Array<{
|
|
12097
12164
|
__typename?: 'EnvironmentVariable';
|
|
12098
12165
|
id: string;
|
|
12166
|
+
linkedEnvironments?: Array<EnvironmentVariableEnvironment> | null;
|
|
12099
12167
|
name: string;
|
|
12100
12168
|
value?: string | null;
|
|
12101
|
-
|
|
12169
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
12102
12170
|
createdAt: any;
|
|
12171
|
+
updatedAt: any;
|
|
12103
12172
|
scope: EnvironmentVariableScope;
|
|
12104
12173
|
visibility?: EnvironmentVariableVisibility | null;
|
|
12105
12174
|
}>;
|
|
@@ -12110,6 +12179,7 @@ export type EnvironmentVariablesSharedQuery = {
|
|
|
12110
12179
|
export type EnvironmentVariablesSharedWithSensitiveQueryVariables = Exact<{
|
|
12111
12180
|
appId: Scalars['String']['input'];
|
|
12112
12181
|
filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
|
|
12182
|
+
environment?: InputMaybe<EnvironmentVariableEnvironment>;
|
|
12113
12183
|
}>;
|
|
12114
12184
|
export type EnvironmentVariablesSharedWithSensitiveQuery = {
|
|
12115
12185
|
__typename?: 'RootQuery';
|
|
@@ -12126,6 +12196,7 @@ export type EnvironmentVariablesSharedWithSensitiveQuery = {
|
|
|
12126
12196
|
id: string;
|
|
12127
12197
|
name: string;
|
|
12128
12198
|
value?: string | null;
|
|
12199
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
12129
12200
|
}>;
|
|
12130
12201
|
};
|
|
12131
12202
|
};
|
|
@@ -12986,8 +13057,9 @@ export type EnvironmentVariableFragment = {
|
|
|
12986
13057
|
id: string;
|
|
12987
13058
|
name: string;
|
|
12988
13059
|
value?: string | null;
|
|
12989
|
-
|
|
13060
|
+
environments?: Array<EnvironmentVariableEnvironment> | null;
|
|
12990
13061
|
createdAt: any;
|
|
13062
|
+
updatedAt: any;
|
|
12991
13063
|
scope: EnvironmentVariableScope;
|
|
12992
13064
|
visibility?: EnvironmentVariableVisibility | null;
|
|
12993
13065
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { EnvironmentVariableFragment, EnvironmentVariableVisibility } from '../generated';
|
|
3
|
-
type
|
|
4
|
-
value
|
|
2
|
+
import { EnvironmentSecretType, EnvironmentVariableEnvironment, EnvironmentVariableFragment, EnvironmentVariableVisibility } from '../generated';
|
|
3
|
+
type CreateVariableArgs = {
|
|
4
|
+
value: string;
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
visibility: EnvironmentVariableVisibility;
|
|
7
|
+
environments: EnvironmentVariableEnvironment[];
|
|
8
|
+
type: EnvironmentSecretType;
|
|
8
9
|
};
|
|
9
10
|
export type EnvironmentVariablePushInput = {
|
|
10
11
|
name: string;
|
|
@@ -14,23 +15,13 @@ export type EnvironmentVariablePushInput = {
|
|
|
14
15
|
overwrite?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare const EnvironmentVariableMutation: {
|
|
17
|
-
linkSharedEnvironmentVariableAsync(graphqlClient: ExpoGraphqlClient, environmentVariableId: string, appId: string, environment
|
|
18
|
-
unlinkSharedEnvironmentVariableAsync(graphqlClient: ExpoGraphqlClient, environmentVariableId: string, appId: string, environment
|
|
19
|
-
createSharedVariableAsync(graphqlClient: ExpoGraphqlClient, input:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} | UpdateVariableArgs, accountId: string): Promise<EnvironmentVariableFragment>;
|
|
25
|
-
createForAppAsync(graphqlClient: ExpoGraphqlClient, input: {
|
|
26
|
-
name: string;
|
|
27
|
-
value?: string;
|
|
28
|
-
environment: string;
|
|
29
|
-
visibility: EnvironmentVariableVisibility;
|
|
30
|
-
overwrite?: boolean;
|
|
31
|
-
} | (UpdateVariableArgs & {
|
|
32
|
-
environment: string;
|
|
33
|
-
}), appId: string): Promise<EnvironmentVariableFragment>;
|
|
18
|
+
linkSharedEnvironmentVariableAsync(graphqlClient: ExpoGraphqlClient, environmentVariableId: string, appId: string, environment?: EnvironmentVariableEnvironment): Promise<EnvironmentVariableFragment>;
|
|
19
|
+
unlinkSharedEnvironmentVariableAsync(graphqlClient: ExpoGraphqlClient, environmentVariableId: string, appId: string, environment?: EnvironmentVariableEnvironment): Promise<EnvironmentVariableFragment>;
|
|
20
|
+
createSharedVariableAsync(graphqlClient: ExpoGraphqlClient, input: CreateVariableArgs, accountId: string): Promise<EnvironmentVariableFragment>;
|
|
21
|
+
createForAppAsync(graphqlClient: ExpoGraphqlClient, input: CreateVariableArgs, appId: string): Promise<EnvironmentVariableFragment>;
|
|
22
|
+
updateAsync(graphqlClient: ExpoGraphqlClient, input: Partial<CreateVariableArgs> & {
|
|
23
|
+
id: string;
|
|
24
|
+
}): Promise<EnvironmentVariableFragment>;
|
|
34
25
|
deleteAsync(graphqlClient: ExpoGraphqlClient, id: string): Promise<{
|
|
35
26
|
id: string;
|
|
36
27
|
}>;
|
|
@@ -12,7 +12,7 @@ exports.EnvironmentVariableMutation = {
|
|
|
12
12
|
.mutation((0, graphql_tag_1.default) `
|
|
13
13
|
mutation LinkSharedEnvironmentVariable(
|
|
14
14
|
$appId: ID!
|
|
15
|
-
$environment: EnvironmentVariableEnvironment
|
|
15
|
+
$environment: EnvironmentVariableEnvironment
|
|
16
16
|
$environmentVariableId: ID!
|
|
17
17
|
) {
|
|
18
18
|
environmentVariable {
|
|
@@ -36,7 +36,7 @@ exports.EnvironmentVariableMutation = {
|
|
|
36
36
|
.mutation((0, graphql_tag_1.default) `
|
|
37
37
|
mutation UnlinkSharedEnvironmentVariable(
|
|
38
38
|
$appId: ID!
|
|
39
|
-
$environment: EnvironmentVariableEnvironment
|
|
39
|
+
$environment: EnvironmentVariableEnvironment
|
|
40
40
|
$environmentVariableId: ID!
|
|
41
41
|
) {
|
|
42
42
|
environmentVariable {
|
|
@@ -96,6 +96,22 @@ exports.EnvironmentVariableMutation = {
|
|
|
96
96
|
.toPromise());
|
|
97
97
|
return data.environmentVariable.createEnvironmentVariableForApp;
|
|
98
98
|
},
|
|
99
|
+
async updateAsync(graphqlClient, input) {
|
|
100
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
101
|
+
.mutation((0, graphql_tag_1.default) `
|
|
102
|
+
mutation UpdateEnvironmentVariable($input: UpdateEnvironmentVariableInput!) {
|
|
103
|
+
environmentVariable {
|
|
104
|
+
updateEnvironmentVariable(environmentVariableData: $input) {
|
|
105
|
+
id
|
|
106
|
+
...EnvironmentVariableFragment
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
${(0, graphql_1.print)(EnvironmentVariable_1.EnvironmentVariableFragmentNode)}
|
|
111
|
+
`, { input })
|
|
112
|
+
.toPromise());
|
|
113
|
+
return data.environmentVariable.updateEnvironmentVariable;
|
|
114
|
+
},
|
|
99
115
|
async deleteAsync(graphqlClient, id) {
|
|
100
116
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
101
117
|
.mutation((0, graphql_tag_1.default) `
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { EnvironmentVariableFragment } from '../generated';
|
|
2
|
+
import { EnvironmentVariableEnvironment, EnvironmentVariableFragment } from '../generated';
|
|
3
|
+
type EnvironmentVariableWithLinkedEnvironments = EnvironmentVariableFragment & {
|
|
4
|
+
linkedEnvironments?: EnvironmentVariableEnvironment[] | null;
|
|
5
|
+
};
|
|
3
6
|
export declare const EnvironmentVariablesQuery: {
|
|
4
7
|
byAppIdWithSensitiveAsync(graphqlClient: ExpoGraphqlClient, { appId, environment, filterNames, }: {
|
|
5
8
|
appId: string;
|
|
6
|
-
environment
|
|
9
|
+
environment?: EnvironmentVariableEnvironment | undefined;
|
|
7
10
|
filterNames?: string[] | undefined;
|
|
8
11
|
}): Promise<EnvironmentVariableFragment[]>;
|
|
9
12
|
byAppIdAsync(graphqlClient: ExpoGraphqlClient, { appId, environment, filterNames, }: {
|
|
10
13
|
appId: string;
|
|
11
|
-
environment
|
|
14
|
+
environment?: EnvironmentVariableEnvironment | undefined;
|
|
12
15
|
filterNames?: string[] | undefined;
|
|
13
|
-
}): Promise<
|
|
14
|
-
sharedAsync(graphqlClient: ExpoGraphqlClient, { appId, filterNames }: {
|
|
16
|
+
}): Promise<EnvironmentVariableWithLinkedEnvironments[]>;
|
|
17
|
+
sharedAsync(graphqlClient: ExpoGraphqlClient, { appId, filterNames, environment, }: {
|
|
15
18
|
appId: string;
|
|
16
19
|
filterNames?: string[] | undefined;
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
environment?: EnvironmentVariableEnvironment | undefined;
|
|
21
|
+
}): Promise<EnvironmentVariableWithLinkedEnvironments[]>;
|
|
22
|
+
sharedWithSensitiveAsync(graphqlClient: ExpoGraphqlClient, { appId, filterNames, environment, }: {
|
|
19
23
|
appId: string;
|
|
20
24
|
filterNames?: string[] | undefined;
|
|
25
|
+
environment?: EnvironmentVariableEnvironment | undefined;
|
|
21
26
|
}): Promise<EnvironmentVariableFragment[]>;
|
|
22
27
|
};
|
|
28
|
+
export {};
|
|
@@ -13,7 +13,7 @@ exports.EnvironmentVariablesQuery = {
|
|
|
13
13
|
query EnvironmentVariablesIncludingSensitiveByAppId(
|
|
14
14
|
$appId: String!
|
|
15
15
|
$filterNames: [String!]
|
|
16
|
-
$environment: EnvironmentVariableEnvironment
|
|
16
|
+
$environment: EnvironmentVariableEnvironment
|
|
17
17
|
) {
|
|
18
18
|
app {
|
|
19
19
|
byId(appId: $appId) {
|
|
@@ -25,6 +25,7 @@ exports.EnvironmentVariablesQuery = {
|
|
|
25
25
|
id
|
|
26
26
|
name
|
|
27
27
|
value
|
|
28
|
+
environments
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -39,13 +40,14 @@ exports.EnvironmentVariablesQuery = {
|
|
|
39
40
|
query EnvironmentVariablesByAppId(
|
|
40
41
|
$appId: String!
|
|
41
42
|
$filterNames: [String!]
|
|
42
|
-
$environment: EnvironmentVariableEnvironment
|
|
43
|
+
$environment: EnvironmentVariableEnvironment
|
|
43
44
|
) {
|
|
44
45
|
app {
|
|
45
46
|
byId(appId: $appId) {
|
|
46
47
|
id
|
|
47
48
|
environmentVariables(filterNames: $filterNames, environment: $environment) {
|
|
48
49
|
id
|
|
50
|
+
linkedEnvironments(appId: $appId)
|
|
49
51
|
...EnvironmentVariableFragment
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -56,17 +58,22 @@ exports.EnvironmentVariablesQuery = {
|
|
|
56
58
|
.toPromise());
|
|
57
59
|
return data.app?.byId.environmentVariables ?? [];
|
|
58
60
|
},
|
|
59
|
-
async sharedAsync(graphqlClient, { appId, filterNames }) {
|
|
61
|
+
async sharedAsync(graphqlClient, { appId, filterNames, environment, }) {
|
|
60
62
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
61
63
|
.query((0, graphql_tag_1.default) `
|
|
62
|
-
query EnvironmentVariablesShared(
|
|
64
|
+
query EnvironmentVariablesShared(
|
|
65
|
+
$appId: String!
|
|
66
|
+
$filterNames: [String!]
|
|
67
|
+
$environment: EnvironmentVariableEnvironment
|
|
68
|
+
) {
|
|
63
69
|
app {
|
|
64
70
|
byId(appId: $appId) {
|
|
65
71
|
id
|
|
66
72
|
ownerAccount {
|
|
67
73
|
id
|
|
68
|
-
environmentVariables(filterNames: $filterNames) {
|
|
74
|
+
environmentVariables(filterNames: $filterNames, environment: $environment) {
|
|
69
75
|
id
|
|
76
|
+
linkedEnvironments(appId: $appId)
|
|
70
77
|
...EnvironmentVariableFragment
|
|
71
78
|
}
|
|
72
79
|
}
|
|
@@ -74,32 +81,37 @@ exports.EnvironmentVariablesQuery = {
|
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
83
|
${(0, graphql_1.print)(EnvironmentVariable_1.EnvironmentVariableFragmentNode)}
|
|
77
|
-
`, { appId, filterNames }, { additionalTypenames: ['EnvironmentVariable'] })
|
|
84
|
+
`, { appId, filterNames, environment }, { additionalTypenames: ['EnvironmentVariable'] })
|
|
78
85
|
.toPromise());
|
|
79
86
|
return data.app?.byId.ownerAccount.environmentVariables ?? [];
|
|
80
87
|
},
|
|
81
|
-
async sharedWithSensitiveAsync(graphqlClient, { appId, filterNames }) {
|
|
88
|
+
async sharedWithSensitiveAsync(graphqlClient, { appId, filterNames, environment, }) {
|
|
82
89
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
83
90
|
.query((0, graphql_tag_1.default) `
|
|
84
91
|
query EnvironmentVariablesSharedWithSensitive(
|
|
85
92
|
$appId: String!
|
|
86
93
|
$filterNames: [String!]
|
|
94
|
+
$environment: EnvironmentVariableEnvironment
|
|
87
95
|
) {
|
|
88
96
|
app {
|
|
89
97
|
byId(appId: $appId) {
|
|
90
98
|
id
|
|
91
99
|
ownerAccount {
|
|
92
100
|
id
|
|
93
|
-
environmentVariablesIncludingSensitive(
|
|
101
|
+
environmentVariablesIncludingSensitive(
|
|
102
|
+
filterNames: $filterNames
|
|
103
|
+
environment: $environment
|
|
104
|
+
) {
|
|
94
105
|
id
|
|
95
106
|
name
|
|
96
107
|
value
|
|
108
|
+
environments
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
}
|
|
100
112
|
}
|
|
101
113
|
}
|
|
102
|
-
`, { appId, filterNames }, { additionalTypenames: ['EnvironmentVariableWithSecret'] })
|
|
114
|
+
`, { appId, filterNames, environment }, { additionalTypenames: ['EnvironmentVariableWithSecret'] })
|
|
103
115
|
.toPromise());
|
|
104
116
|
return data.app?.byId.ownerAccount.environmentVariablesIncludingSensitive ?? [];
|
|
105
117
|
},
|
|
@@ -29,6 +29,7 @@ async function republishAsync({ graphqlClient, app, updatesToPublish, targetBran
|
|
|
29
29
|
(0, assert_1.default)(updatesToPublish.every(isSameGroup), 'All updates being republished must belong to the same update group');
|
|
30
30
|
(0, assert_1.default)(updatesToPublish.every(u => u.isRollBackToEmbedded) ||
|
|
31
31
|
updatesToPublish.every(u => !u.isRollBackToEmbedded), 'All updates must either be roll back to embedded updates or not');
|
|
32
|
+
(0, assert_1.default)(!updatesToPublish.some(u => !!u.rolloutControlUpdate), 'Cannot republish an update that is being rolled-out. Either complete the update rollout and then republish or publish a new rollout update.');
|
|
32
33
|
const { runtimeVersion } = arbitraryUpdate;
|
|
33
34
|
// If codesigning was created for the original update, we need to add it to the republish.
|
|
34
35
|
// If one wishes to not sign the republish or sign with a different key, a normal publish should
|
package/build/utils/prompts.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { EnvironmentVariableEnvironment } from '../graphql/generated';
|
|
2
|
-
export declare function
|
|
1
|
+
import { EnvironmentVariableEnvironment, EnvironmentVariableVisibility } from '../graphql/generated';
|
|
2
|
+
export declare function promptVariableVisibilityAsync(nonInteractive: boolean, selectedVisibility?: EnvironmentVariableVisibility | null): Promise<EnvironmentVariableVisibility>;
|
|
3
|
+
type EnvironmentPromptArgs = {
|
|
4
|
+
nonInteractive: boolean;
|
|
5
|
+
selectedEnvironments?: EnvironmentVariableEnvironment[];
|
|
6
|
+
availableEnvironments?: EnvironmentVariableEnvironment[];
|
|
7
|
+
};
|
|
8
|
+
export declare function promptVariableEnvironmentAsync(input: EnvironmentPromptArgs & {
|
|
9
|
+
multiple: true;
|
|
10
|
+
}): Promise<EnvironmentVariableEnvironment[]>;
|
|
11
|
+
export declare function promptVariableEnvironmentAsync(input: EnvironmentPromptArgs & {
|
|
12
|
+
multiple?: false;
|
|
13
|
+
}): Promise<EnvironmentVariableEnvironment>;
|
|
3
14
|
export declare function promptVariableValueAsync({ nonInteractive, required, hidden, initial, }: {
|
|
4
15
|
nonInteractive: boolean;
|
|
5
16
|
required?: boolean;
|
|
6
17
|
initial?: string | null;
|
|
7
18
|
hidden?: boolean;
|
|
8
19
|
}): Promise<string>;
|
|
9
|
-
export declare function promptVariableNameAsync(nonInteractive: boolean): Promise<string>;
|
|
20
|
+
export declare function promptVariableNameAsync(nonInteractive: boolean, initialValue?: string): Promise<string>;
|
|
21
|
+
export {};
|