eas-cli 21.7.0 → 21.8.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.
Files changed (41) hide show
  1. package/README.md +216 -121
  2. package/build/analytics/AnalyticsManager.js +3 -0
  3. package/build/analytics/sandbox.d.ts +3 -0
  4. package/build/analytics/sandbox.js +26 -0
  5. package/build/commandUtils/supabase.d.ts +13 -0
  6. package/build/commandUtils/supabase.js +82 -0
  7. package/build/commands/integrations/supabase/connect.d.ts +26 -0
  8. package/build/commands/integrations/supabase/connect.js +404 -0
  9. package/build/commands/integrations/supabase/dashboard.d.ts +14 -0
  10. package/build/commands/integrations/supabase/dashboard.js +69 -0
  11. package/build/commands/integrations/supabase/disconnect.d.ts +15 -0
  12. package/build/commands/integrations/supabase/disconnect.js +87 -0
  13. package/build/environments/defaults.d.ts +2 -0
  14. package/build/environments/defaults.js +5 -0
  15. package/build/environments/resolve.d.ts +10 -0
  16. package/build/environments/resolve.js +67 -0
  17. package/build/environments/variables.d.ts +18 -0
  18. package/build/environments/variables.js +124 -0
  19. package/build/graphql/client.d.ts +8 -0
  20. package/build/graphql/client.js +15 -0
  21. package/build/graphql/generated.d.ts +202 -0
  22. package/build/graphql/mutations/SupabaseMutation.d.ts +14 -0
  23. package/build/graphql/mutations/SupabaseMutation.js +145 -0
  24. package/build/graphql/queries/SupabaseQuery.d.ts +10 -0
  25. package/build/graphql/queries/SupabaseQuery.js +54 -0
  26. package/build/graphql/types/SupabaseConnection.d.ts +8 -0
  27. package/build/graphql/types/SupabaseConnection.js +25 -0
  28. package/build/integrations/shared/envFile.d.ts +7 -0
  29. package/build/integrations/shared/envFile.js +94 -0
  30. package/build/integrations/shared/sdk.d.ts +24 -0
  31. package/build/integrations/shared/sdk.js +87 -0
  32. package/build/integrations/supabase/env.d.ts +14 -0
  33. package/build/integrations/supabase/env.js +68 -0
  34. package/build/integrations/supabase/provision.d.ts +32 -0
  35. package/build/integrations/supabase/provision.js +245 -0
  36. package/build/utils/pollForBackgroundJobReceiptAsync.d.ts +2 -0
  37. package/build/utils/pollForBackgroundJobReceiptAsync.js +11 -2
  38. package/build/utils/prompts.d.ts +0 -1
  39. package/build/utils/prompts.js +6 -17
  40. package/oclif.manifest.json +4257 -3955
  41. package/package.json +4 -3
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const better_opn_1 = tslib_1.__importDefault(require("better-opn"));
5
+ const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
6
+ const flags_1 = require("../../../commandUtils/flags");
7
+ const supabase_1 = require("../../../commandUtils/supabase");
8
+ const SupabaseQuery_1 = require("../../../graphql/queries/SupabaseQuery");
9
+ const log_1 = tslib_1.__importDefault(require("../../../log"));
10
+ const ora_1 = require("../../../ora");
11
+ const json_1 = require("../../../utils/json");
12
+ class IntegrationsSupabaseDashboard extends EasCommand_1.default {
13
+ static description = "open this app's primary Supabase project in the dashboard (or print the URL with --non-interactive)";
14
+ static examples = [
15
+ '<%= config.bin %> <%= command.id %>',
16
+ '<%= config.bin %> <%= command.id %> --non-interactive',
17
+ ];
18
+ static flags = {
19
+ ...flags_1.EasNonInteractiveAndJsonFlags,
20
+ };
21
+ static contextDefinition = {
22
+ ...this.ContextOptions.ProjectConfig,
23
+ };
24
+ async runAsync() {
25
+ const { flags } = await this.parse(IntegrationsSupabaseDashboard);
26
+ const { json: jsonFlag, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
27
+ if (jsonFlag) {
28
+ (0, json_1.enableJsonOutput)();
29
+ }
30
+ const { privateProjectConfig: { projectId, exp }, loggedIn: { graphqlClient }, } = await this.getContextAsync(IntegrationsSupabaseDashboard, {
31
+ nonInteractive,
32
+ withServerSideEnvironment: null,
33
+ });
34
+ const project = await SupabaseQuery_1.SupabaseQuery.getSupabaseProjectByAppIdAsync(graphqlClient, projectId);
35
+ if (!project) {
36
+ if (jsonFlag) {
37
+ (0, json_1.printJsonOnlyOutput)({ dashboardUrl: null });
38
+ }
39
+ else {
40
+ (0, supabase_1.logNoSupabaseProject)(exp.slug);
41
+ }
42
+ return;
43
+ }
44
+ const dashboardUrl = (0, supabase_1.getSupabaseProjectDashboardUrl)(project);
45
+ if (jsonFlag) {
46
+ (0, json_1.printJsonOnlyOutput)({ dashboardUrl });
47
+ return;
48
+ }
49
+ if (nonInteractive) {
50
+ log_1.default.log(dashboardUrl);
51
+ return;
52
+ }
53
+ const spinner = (0, ora_1.ora)('Opening your Supabase dashboard').start();
54
+ try {
55
+ const opened = await (0, better_opn_1.default)(dashboardUrl);
56
+ if (opened) {
57
+ spinner.succeed('Opened your Supabase dashboard');
58
+ }
59
+ else {
60
+ spinner.fail(`Unable to open a web browser. Supabase dashboard: ${dashboardUrl}`);
61
+ }
62
+ }
63
+ catch (error) {
64
+ spinner.fail(`Unable to open a web browser. Supabase dashboard: ${dashboardUrl}`);
65
+ throw error;
66
+ }
67
+ }
68
+ }
69
+ exports.default = IntegrationsSupabaseDashboard;
@@ -0,0 +1,15 @@
1
+ import EasCommand from '../../../commandUtils/EasCommand';
2
+ export default class IntegrationsSupabaseDisconnect extends EasCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ };
10
+ static contextDefinition: {
11
+ loggedIn: import("../../../commandUtils/context/LoggedInContextField").default;
12
+ privateProjectConfig: import("../../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
13
+ };
14
+ runAsync(): Promise<void>;
15
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const core_1 = require("@oclif/core");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
7
+ const flags_1 = require("../../../commandUtils/flags");
8
+ const supabase_1 = require("../../../commandUtils/supabase");
9
+ const SupabaseMutation_1 = require("../../../graphql/mutations/SupabaseMutation");
10
+ const SupabaseQuery_1 = require("../../../graphql/queries/SupabaseQuery");
11
+ const log_1 = tslib_1.__importDefault(require("../../../log"));
12
+ const ora_1 = require("../../../ora");
13
+ const prompts_1 = require("../../../prompts");
14
+ const json_1 = require("../../../utils/json");
15
+ class IntegrationsSupabaseDisconnect extends EasCommand_1.default {
16
+ static description = "remove this app's Supabase project link from EAS (keeps the Supabase project; does not delete EXPO_PUBLIC_SUPABASE_* env vars)";
17
+ static examples = [
18
+ '<%= config.bin %> <%= command.id %>',
19
+ '<%= config.bin %> <%= command.id %> --yes',
20
+ ];
21
+ static flags = {
22
+ ...flags_1.EasNonInteractiveAndJsonFlags,
23
+ yes: core_1.Flags.boolean({
24
+ char: 'y',
25
+ description: 'Skip confirmation prompt',
26
+ default: false,
27
+ }),
28
+ };
29
+ static contextDefinition = {
30
+ ...this.ContextOptions.ProjectConfig,
31
+ };
32
+ async runAsync() {
33
+ const { flags } = await this.parse(IntegrationsSupabaseDisconnect);
34
+ const { yes } = flags;
35
+ const { json: jsonFlag, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
36
+ if (jsonFlag) {
37
+ (0, json_1.enableJsonOutput)();
38
+ }
39
+ const { privateProjectConfig: { projectId, exp }, loggedIn: { graphqlClient }, } = await this.getContextAsync(IntegrationsSupabaseDisconnect, {
40
+ nonInteractive,
41
+ withServerSideEnvironment: null,
42
+ });
43
+ const project = await SupabaseQuery_1.SupabaseQuery.getSupabaseProjectByAppIdAsync(graphqlClient, projectId);
44
+ if (!project) {
45
+ if (jsonFlag) {
46
+ (0, json_1.printJsonOnlyOutput)({ id: null });
47
+ }
48
+ else {
49
+ (0, supabase_1.logNoSupabaseProject)(exp.slug);
50
+ }
51
+ return;
52
+ }
53
+ if (!jsonFlag) {
54
+ log_1.default.addNewLineIfNone();
55
+ log_1.default.log((0, supabase_1.formatSupabaseProject)(project));
56
+ log_1.default.newLine();
57
+ }
58
+ if (!nonInteractive && !yes) {
59
+ const confirmed = await (0, prompts_1.confirmAsync)({
60
+ message: 'Remove this Supabase project link from EAS servers? This does not delete the project on Supabase.',
61
+ });
62
+ if (!confirmed) {
63
+ log_1.default.warn('Canceled removal of the Supabase project link.');
64
+ return;
65
+ }
66
+ }
67
+ else if (!jsonFlag) {
68
+ log_1.default.warn('Removing the Supabase project link from EAS servers. This does not delete the project on Supabase.');
69
+ }
70
+ const spinner = jsonFlag ? null : (0, ora_1.ora)('Removing Supabase project link').start();
71
+ try {
72
+ await SupabaseMutation_1.SupabaseMutation.deleteSupabaseProjectAsync(graphqlClient, project.id);
73
+ spinner?.succeed(`Removed Supabase project ${chalk_1.default.bold((0, supabase_1.formatSupabaseProjectLabel)(project))} from EAS servers`);
74
+ }
75
+ catch (error) {
76
+ spinner?.fail('Failed to remove Supabase project link');
77
+ throw error;
78
+ }
79
+ if (jsonFlag) {
80
+ (0, json_1.printJsonOnlyOutput)({ id: project.id, ref: project.supabaseProjectRef });
81
+ return;
82
+ }
83
+ log_1.default.newLine();
84
+ log_1.default.log(`The ${chalk_1.default.bold('EXPO_PUBLIC_SUPABASE_URL')} and ${chalk_1.default.bold('EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY')} values remain in ${chalk_1.default.bold('.env.local')} and in your EAS environment variables. Remove them if you no longer need them.`);
85
+ }
86
+ }
87
+ exports.default = IntegrationsSupabaseDisconnect;
@@ -0,0 +1,2 @@
1
+ import { DefaultEnvironment } from '../build/utils/environment';
2
+ export declare const DEFAULT_ENVIRONMENTS: DefaultEnvironment[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_ENVIRONMENTS = void 0;
4
+ const environment_1 = require("../build/utils/environment");
5
+ exports.DEFAULT_ENVIRONMENTS = Object.values(environment_1.DefaultEnvironment);
@@ -0,0 +1,10 @@
1
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
2
+ export declare function parseEnvironmentFlag(value: string | undefined): string[] | null;
3
+ /**
4
+ * Resolve requested EAS environment names against what the project already uses.
5
+ * Shared across integrations; pass integration-specific defaults and messages at each callsite.
6
+ */
7
+ export declare function resolveTargetEnvironmentsAsync(graphqlClient: ExpoGraphqlClient, projectId: string, requested: string[], nonInteractive: boolean, { defaultEnvironments, cancelMessage, }: {
8
+ defaultEnvironments: string[];
9
+ cancelMessage: (knownEnvironments: string) => string;
10
+ }): Promise<string[]>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseEnvironmentFlag = parseEnvironmentFlag;
4
+ exports.resolveTargetEnvironmentsAsync = resolveTargetEnvironmentsAsync;
5
+ const prompts_1 = require("../prompts");
6
+ const variables_1 = require("./variables");
7
+ function parseEnvironmentFlag(value) {
8
+ if (value === undefined) {
9
+ return null;
10
+ }
11
+ if (!value.trim()) {
12
+ throw new Error('Pass at least one EAS environment to --environment (e.g. --environment preview).');
13
+ }
14
+ const environments = [
15
+ ...new Set(value
16
+ .split(',')
17
+ .map(part => part.trim().toLowerCase())
18
+ .filter(Boolean)),
19
+ ];
20
+ if (environments.length === 0) {
21
+ throw new Error('Pass at least one EAS environment to --environment (e.g. --environment preview).');
22
+ }
23
+ for (const environment of environments) {
24
+ if (environment.length < 3 || environment.length > 100 || !/^[a-z0-9_-]+$/.test(environment)) {
25
+ throw new Error(`Invalid EAS environment "${environment}". Use 3–100 lowercase letters, numbers, dashes, or underscores.`);
26
+ }
27
+ }
28
+ return environments;
29
+ }
30
+ /**
31
+ * Resolve requested EAS environment names against what the project already uses.
32
+ * Shared across integrations; pass integration-specific defaults and messages at each callsite.
33
+ */
34
+ async function resolveTargetEnvironmentsAsync(graphqlClient, projectId, requested, nonInteractive, { defaultEnvironments, cancelMessage, }) {
35
+ let known = await (0, variables_1.getProjectEnvironmentVariableEnvironmentsAsync)(graphqlClient, projectId);
36
+ if (known.length === 0) {
37
+ known = [...defaultEnvironments];
38
+ }
39
+ const knownSet = new Set(known);
40
+ const unknown = requested.filter(environment => !knownSet.has(environment));
41
+ if (unknown.length === 0) {
42
+ return requested;
43
+ }
44
+ const defaultEnvironmentSet = new Set(defaultEnvironments);
45
+ const hasCustom = unknown.some(environment => !defaultEnvironmentSet.has(environment));
46
+ if (nonInteractive) {
47
+ const hint = hasCustom
48
+ ? 'Custom environments require an Enterprise plan; pass only default environments, or upgrade.'
49
+ : 'Re-run interactively to create them, or pass only existing environments.';
50
+ throw new Error(`EAS environment(s) not found on this project: ${unknown.join(', ')}. Known: ${known.join(', ')}. ${hint}`);
51
+ }
52
+ const listed = unknown.map(environment => `"${environment}"`).join(', ');
53
+ const isPlural = unknown.length > 1;
54
+ const noun = isPlural ? 'environments' : 'environment';
55
+ const verb = isPlural ? 'are' : 'is';
56
+ const customHint = hasCustom
57
+ ? ' Custom environments require an Enterprise plan; values will be written if your account supports them.'
58
+ : '';
59
+ const create = await (0, prompts_1.confirmAsync)({
60
+ message: `EAS ${noun} ${listed} ${verb} not used on this project yet.${customHint} Continue provisioning?`,
61
+ });
62
+ if (!create) {
63
+ throw new Error(cancelMessage(known.join(', ')));
64
+ }
65
+ // Custom environments are created lazily when env vars are written (createForAppAsync).
66
+ return requested;
67
+ }
@@ -0,0 +1,18 @@
1
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
2
+ import { EnvironmentVariableVisibility } from '../graphql/generated';
3
+ import { EnvironmentVariablesQuery } from '../graphql/queries/EnvironmentVariablesQuery';
4
+ export type EnvVar = {
5
+ name: string;
6
+ value: string;
7
+ visibility: EnvironmentVariableVisibility;
8
+ };
9
+ type ProjectScopedEnvVar = Awaited<ReturnType<typeof EnvironmentVariablesQuery.byAppIdAsync>>[number];
10
+ export type EnvVarWriteMode = 'replaceOtherEnvironments' | 'keepOtherEnvironments';
11
+ export declare function getProjectEnvironmentVariableEnvironmentsAsync(graphqlClient: ExpoGraphqlClient, projectId: string): Promise<string[]>;
12
+ export declare function loadProjectScopedEnvVarsAsync(graphqlClient: ExpoGraphqlClient, projectId: string, name: string): Promise<ProjectScopedEnvVar[]>;
13
+ export declare function upsertEnvVarAsync(graphqlClient: ExpoGraphqlClient, projectId: string, envVar: EnvVar, environments: string[], nonInteractive: boolean, overwrite: boolean, { mode, moveConfirmMessage, }: {
14
+ mode: EnvVarWriteMode;
15
+ moveConfirmMessage?: (variableName: string, overlappingEnvironments: string) => string;
16
+ }): Promise<boolean>;
17
+ export declare function upsertEnvVarsSequentiallyAsync(envVars: EnvVar[], upsert: (envVar: EnvVar) => Promise<boolean>): Promise<boolean[]>;
18
+ export {};
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProjectEnvironmentVariableEnvironmentsAsync = getProjectEnvironmentVariableEnvironmentsAsync;
4
+ exports.loadProjectScopedEnvVarsAsync = loadProjectScopedEnvVarsAsync;
5
+ exports.upsertEnvVarAsync = upsertEnvVarAsync;
6
+ exports.upsertEnvVarsSequentiallyAsync = upsertEnvVarsSequentiallyAsync;
7
+ const tslib_1 = require("tslib");
8
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
9
+ const generated_1 = require("../graphql/generated");
10
+ const EnvironmentVariableMutation_1 = require("../graphql/mutations/EnvironmentVariableMutation");
11
+ const EnvironmentVariablesQuery_1 = require("../graphql/queries/EnvironmentVariablesQuery");
12
+ const log_1 = tslib_1.__importDefault(require("../log"));
13
+ const prompts_1 = require("../prompts");
14
+ function coversExactly(environments, target) {
15
+ return environments.length === target.size && environments.every(e => target.has(e));
16
+ }
17
+ async function getProjectEnvironmentVariableEnvironmentsAsync(graphqlClient, projectId) {
18
+ try {
19
+ const environments = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.environmentVariableEnvironmentsAsync(graphqlClient, projectId);
20
+ return environments;
21
+ }
22
+ catch (error) {
23
+ throw new Error('Failed to fetch available environments', { cause: error });
24
+ }
25
+ }
26
+ async function loadProjectScopedEnvVarsAsync(graphqlClient, projectId, name) {
27
+ return (await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdAsync(graphqlClient, {
28
+ appId: projectId,
29
+ filterNames: [name],
30
+ })).filter(variable => variable.scope === generated_1.EnvironmentVariableScope.Project);
31
+ }
32
+ async function upsertEnvVarAsync(graphqlClient, projectId, envVar, environments, nonInteractive, overwrite, { mode, moveConfirmMessage, }) {
33
+ const target = new Set(environments);
34
+ const replacingAll = mode === 'replaceOtherEnvironments';
35
+ const existingRows = await loadProjectScopedEnvVarsAsync(graphqlClient, projectId, envVar.name);
36
+ const coveredRows = [];
37
+ const rowsToShrink = [];
38
+ const takenOverEnvironments = new Set();
39
+ for (const row of existingRows) {
40
+ const rowEnvironments = row.environments ?? [];
41
+ const handedOver = replacingAll
42
+ ? rowEnvironments
43
+ : rowEnvironments.filter(environment => target.has(environment));
44
+ const kept = replacingAll
45
+ ? []
46
+ : rowEnvironments.filter(environment => !target.has(environment));
47
+ if (!replacingAll && handedOver.length === 0) {
48
+ continue;
49
+ }
50
+ handedOver.forEach(environment => takenOverEnvironments.add(environment));
51
+ if (kept.length === 0) {
52
+ coveredRows.push({
53
+ id: row.id,
54
+ value: row.value ?? '',
55
+ environments: rowEnvironments,
56
+ visibility: row.visibility ?? null,
57
+ });
58
+ }
59
+ else {
60
+ rowsToShrink.push({ id: row.id, keptEnvironments: kept });
61
+ }
62
+ }
63
+ // Reuse the first fully covered row so the variable keeps its id; the rest are redundant. Typed
64
+ // explicitly because tsconfig has no noUncheckedIndexedAccess, so index 0 looks always-present.
65
+ const rowToReuse = coveredRows[0];
66
+ const redundantRows = coveredRows.slice(1);
67
+ const takenOver = [...takenOverEnvironments].join(', ') || 'other environments';
68
+ // 2. Get consent. Overwriting is always explicit — --overwrite, or a yes — and only a write that
69
+ // changes nothing at all is exempt. Visibility counts: writing the same value as Public over a
70
+ // Sensitive row would expose it, so that is a change like any other.
71
+ const reusedRowIsIdentical = rowToReuse?.value === envVar.value &&
72
+ rowToReuse.visibility === envVar.visibility &&
73
+ coversExactly(rowToReuse.environments, target);
74
+ const touchesExistingRows = coveredRows.length > 0 || rowsToShrink.length > 0;
75
+ const changesNothing = reusedRowIsIdentical && redundantRows.length === 0 && rowsToShrink.length === 0;
76
+ if (touchesExistingRows && !overwrite && !changesNothing) {
77
+ let message;
78
+ if (rowsToShrink.length > 0 && moveConfirmMessage) {
79
+ message = moveConfirmMessage(envVar.name, takenOver);
80
+ }
81
+ else if (redundantRows.length > 0) {
82
+ message = `EAS has multiple ${envVar.name} variables for this project (including ${takenOver}). Replace them with one value for ${environments.join(', ')}?`;
83
+ }
84
+ else {
85
+ message = `EAS already has ${envVar.name} for ${takenOver}. Overwrite it?`;
86
+ }
87
+ if (nonInteractive || !(await (0, prompts_1.confirmAsync)({ message }))) {
88
+ log_1.default.warn(`Skipped updating EAS environment variable ${chalk_1.default.bold(envVar.name)}${nonInteractive ? ' (pass --overwrite to replace it)' : ''}.`);
89
+ return false;
90
+ }
91
+ }
92
+ // 3. Apply: hand environments over, drop redundant rows, then land the value.
93
+ for (const { id, keptEnvironments } of rowsToShrink) {
94
+ await EnvironmentVariableMutation_1.EnvironmentVariableMutation.updateAsync(graphqlClient, {
95
+ id,
96
+ environments: keptEnvironments,
97
+ });
98
+ }
99
+ for (const { id } of redundantRows) {
100
+ await EnvironmentVariableMutation_1.EnvironmentVariableMutation.deleteAsync(graphqlClient, id);
101
+ }
102
+ const fields = {
103
+ name: envVar.name,
104
+ value: envVar.value,
105
+ environments,
106
+ visibility: envVar.visibility,
107
+ type: generated_1.EnvironmentSecretType.String,
108
+ };
109
+ if (rowToReuse) {
110
+ await EnvironmentVariableMutation_1.EnvironmentVariableMutation.updateAsync(graphqlClient, { id: rowToReuse.id, ...fields });
111
+ }
112
+ else {
113
+ await EnvironmentVariableMutation_1.EnvironmentVariableMutation.createForAppAsync(graphqlClient, fields, projectId);
114
+ }
115
+ log_1.default.withTick(`${rowToReuse ? 'Updated' : 'Created'} EAS environment variable ${chalk_1.default.bold(envVar.name)} for ${environments.join(', ')}`);
116
+ return true;
117
+ }
118
+ async function upsertEnvVarsSequentiallyAsync(envVars, upsert) {
119
+ const written = [];
120
+ for (const envVar of envVars) {
121
+ written.push(await upsert(envVar));
122
+ }
123
+ return written;
124
+ }
@@ -13,4 +13,12 @@ export declare function withErrorHandlingAsync<T>(promise: Promise<OperationResu
13
13
  export declare function withUpgradeRequiredErrorHandlingAsync<T>(promise: Promise<OperationResult<T>>, { featureName }: {
14
14
  featureName: string;
15
15
  }): Promise<T>;
16
+ /**
17
+ * Whether a failed request will keep failing the same way. True only when the server attributes
18
+ * every error to the caller (`errorType: USER`): a rejected input, a missing permission, a
19
+ * resource this account can't see. Server faults, network errors, and anything we can't classify
20
+ * stay retriable, since giving up on those turns a blip into a failed command. Polling loops use
21
+ * this to stop early instead of waiting out their deadline.
22
+ */
23
+ export declare function isPermanentGraphqlError(error: unknown): boolean;
16
24
  export { GraphqlError };
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GraphqlError = exports.EAS_CLI_UPGRADE_REQUIRED_ERROR_CODE = void 0;
4
4
  exports.withErrorHandlingAsync = withErrorHandlingAsync;
5
5
  exports.withUpgradeRequiredErrorHandlingAsync = withUpgradeRequiredErrorHandlingAsync;
6
+ exports.isPermanentGraphqlError = isPermanentGraphqlError;
6
7
  const tslib_1 = require("tslib");
7
8
  const core_1 = require("@urql/core");
8
9
  Object.defineProperty(exports, "GraphqlError", { enumerable: true, get: function () { return core_1.CombinedError; } });
@@ -50,6 +51,20 @@ async function withUpgradeRequiredErrorHandlingAsync(promise, { featureName }) {
50
51
  throw error;
51
52
  }
52
53
  }
54
+ /**
55
+ * Whether a failed request will keep failing the same way. True only when the server attributes
56
+ * every error to the caller (`errorType: USER`): a rejected input, a missing permission, a
57
+ * resource this account can't see. Server faults, network errors, and anything we can't classify
58
+ * stay retriable, since giving up on those turns a blip into a failed command. Polling loops use
59
+ * this to stop early instead of waiting out their deadline.
60
+ */
61
+ function isPermanentGraphqlError(error) {
62
+ if (!(error instanceof core_1.CombinedError) || error.networkError) {
63
+ return false;
64
+ }
65
+ return (error.graphQLErrors.length > 0 &&
66
+ error.graphQLErrors.every(e => e?.extensions?.errorType === 'USER' && !e?.extensions?.isTransient));
67
+ }
53
68
  function isUpgradeRequiredError(error) {
54
69
  if (!(error instanceof core_1.CombinedError)) {
55
70
  return false;
@@ -16433,6 +16433,146 @@ export type RetrySubmissionMutation = {
16433
16433
  };
16434
16434
  };
16435
16435
  };
16436
+ export type BeginSupabaseOAuthMutationVariables = Exact<{
16437
+ input: BeginSupabaseOAuthInput;
16438
+ }>;
16439
+ export type BeginSupabaseOAuthMutation = {
16440
+ __typename?: 'RootMutation';
16441
+ supabaseConnection: {
16442
+ __typename?: 'SupabaseConnectionMutation';
16443
+ beginSupabaseOAuth: {
16444
+ __typename?: 'SupabaseOAuthStart';
16445
+ url: string;
16446
+ };
16447
+ };
16448
+ };
16449
+ export type SetSupabaseConnectionOrganizationMutationVariables = Exact<{
16450
+ input: SetSupabaseConnectionOrganizationInput;
16451
+ }>;
16452
+ export type SetSupabaseConnectionOrganizationMutation = {
16453
+ __typename?: 'RootMutation';
16454
+ supabaseConnection: {
16455
+ __typename?: 'SupabaseConnectionMutation';
16456
+ setSupabaseConnectionOrganization: {
16457
+ __typename?: 'SupabaseConnection';
16458
+ id: string;
16459
+ supabaseOrganizationSlug: string;
16460
+ supabaseOrganizationName: string;
16461
+ createdAt: any;
16462
+ updatedAt: any;
16463
+ };
16464
+ };
16465
+ };
16466
+ export type DisconnectSupabaseMutationVariables = Exact<{
16467
+ id: Scalars['ID']['input'];
16468
+ }>;
16469
+ export type DisconnectSupabaseMutation = {
16470
+ __typename?: 'RootMutation';
16471
+ supabaseConnection: {
16472
+ __typename?: 'SupabaseConnectionMutation';
16473
+ disconnectSupabase: string;
16474
+ };
16475
+ };
16476
+ export type ProvisionSupabaseProjectMutationVariables = Exact<{
16477
+ input: ProvisionSupabaseProjectInput;
16478
+ }>;
16479
+ export type ProvisionSupabaseProjectMutation = {
16480
+ __typename?: 'RootMutation';
16481
+ supabaseProject: {
16482
+ __typename?: 'SupabaseProjectMutation';
16483
+ provisionSupabaseProject: {
16484
+ __typename?: 'BackgroundJobReceipt';
16485
+ id: string;
16486
+ state: BackgroundJobState;
16487
+ tries: number;
16488
+ willRetry: boolean;
16489
+ resultId?: string | null;
16490
+ resultType: BackgroundJobResultType;
16491
+ resultData?: any | null;
16492
+ errorCode?: string | null;
16493
+ errorMessage?: string | null;
16494
+ createdAt: any;
16495
+ updatedAt: any;
16496
+ };
16497
+ };
16498
+ };
16499
+ export type ProvisionAdditionalSupabaseProjectMutationVariables = Exact<{
16500
+ input: ProvisionAdditionalSupabaseProjectInput;
16501
+ }>;
16502
+ export type ProvisionAdditionalSupabaseProjectMutation = {
16503
+ __typename?: 'RootMutation';
16504
+ supabaseProject: {
16505
+ __typename?: 'SupabaseProjectMutation';
16506
+ provisionAdditionalSupabaseProject: {
16507
+ __typename?: 'BackgroundJobReceipt';
16508
+ id: string;
16509
+ state: BackgroundJobState;
16510
+ tries: number;
16511
+ willRetry: boolean;
16512
+ resultId?: string | null;
16513
+ resultType: BackgroundJobResultType;
16514
+ resultData?: any | null;
16515
+ errorCode?: string | null;
16516
+ errorMessage?: string | null;
16517
+ createdAt: any;
16518
+ updatedAt: any;
16519
+ };
16520
+ };
16521
+ };
16522
+ export type LinkSupabaseProjectMutationVariables = Exact<{
16523
+ input: LinkSupabaseProjectInput;
16524
+ }>;
16525
+ export type LinkSupabaseProjectMutation = {
16526
+ __typename?: 'RootMutation';
16527
+ supabaseProject: {
16528
+ __typename?: 'SupabaseProjectMutation';
16529
+ linkSupabaseProject: {
16530
+ __typename?: 'SupabaseProject';
16531
+ id: string;
16532
+ supabaseProjectRef: string;
16533
+ supabaseProjectName: string;
16534
+ supabaseProjectUrl: string;
16535
+ supabaseRegion: string;
16536
+ createdAt: any;
16537
+ updatedAt: any;
16538
+ };
16539
+ };
16540
+ };
16541
+ export type DeleteSupabaseProjectMutationVariables = Exact<{
16542
+ id: Scalars['ID']['input'];
16543
+ }>;
16544
+ export type DeleteSupabaseProjectMutation = {
16545
+ __typename?: 'RootMutation';
16546
+ supabaseProject: {
16547
+ __typename?: 'SupabaseProjectMutation';
16548
+ deleteSupabaseProject: string;
16549
+ };
16550
+ };
16551
+ export type ListSupabaseOrganizationsMutationVariables = Exact<{
16552
+ accountId: Scalars['ID']['input'];
16553
+ }>;
16554
+ export type ListSupabaseOrganizationsMutation = {
16555
+ __typename?: 'RootMutation';
16556
+ supabaseConnection: {
16557
+ __typename?: 'SupabaseConnectionMutation';
16558
+ listSupabaseOrganizations: Array<{
16559
+ __typename?: 'SupabaseOrganization';
16560
+ id: string;
16561
+ slug: string;
16562
+ name: string;
16563
+ }>;
16564
+ };
16565
+ };
16566
+ export type FetchSupabasePublishableKeyMutationVariables = Exact<{
16567
+ appId: Scalars['ID']['input'];
16568
+ }>;
16569
+ export type FetchSupabasePublishableKeyMutation = {
16570
+ __typename?: 'RootMutation';
16571
+ supabaseProject: {
16572
+ __typename?: 'SupabaseProjectMutation';
16573
+ fetchSupabasePublishableKey?: string | null;
16574
+ };
16575
+ };
16436
16576
  export type CreateUploadSessionMutationVariables = Exact<{
16437
16577
  type: UploadSessionType;
16438
16578
  filename?: InputMaybe<Scalars['String']['input']>;
@@ -19648,6 +19788,50 @@ export type GetAllSubmissionsForAppQuery = {
19648
19788
  };
19649
19789
  };
19650
19790
  };
19791
+ export type SupabaseConnectionByAccountIdQueryVariables = Exact<{
19792
+ accountId: Scalars['String']['input'];
19793
+ }>;
19794
+ export type SupabaseConnectionByAccountIdQuery = {
19795
+ __typename?: 'RootQuery';
19796
+ account: {
19797
+ __typename?: 'AccountQuery';
19798
+ byId: {
19799
+ __typename?: 'Account';
19800
+ id: string;
19801
+ supabaseConnection?: {
19802
+ __typename?: 'SupabaseConnection';
19803
+ id: string;
19804
+ supabaseOrganizationSlug: string;
19805
+ supabaseOrganizationName: string;
19806
+ createdAt: any;
19807
+ updatedAt: any;
19808
+ } | null;
19809
+ };
19810
+ };
19811
+ };
19812
+ export type SupabaseProjectByAppIdQueryVariables = Exact<{
19813
+ appId: Scalars['String']['input'];
19814
+ }>;
19815
+ export type SupabaseProjectByAppIdQuery = {
19816
+ __typename?: 'RootQuery';
19817
+ app: {
19818
+ __typename?: 'AppQuery';
19819
+ byId: {
19820
+ __typename?: 'App';
19821
+ id: string;
19822
+ supabaseProject?: {
19823
+ __typename?: 'SupabaseProject';
19824
+ id: string;
19825
+ supabaseProjectRef: string;
19826
+ supabaseProjectName: string;
19827
+ supabaseProjectUrl: string;
19828
+ supabaseRegion: string;
19829
+ createdAt: any;
19830
+ updatedAt: any;
19831
+ } | null;
19832
+ };
19833
+ };
19834
+ };
19651
19835
  export type ViewUpdateGroupInsightsQueryVariables = Exact<{
19652
19836
  groupId: Scalars['ID']['input'];
19653
19837
  timespan: InsightsTimespan;
@@ -21873,6 +22057,24 @@ export type SubmissionWithSubmittedBuildFragment = {
21873
22057
  message?: string | null;
21874
22058
  } | null;
21875
22059
  };
22060
+ export type SupabaseConnectionFragment = {
22061
+ __typename?: 'SupabaseConnection';
22062
+ id: string;
22063
+ supabaseOrganizationSlug: string;
22064
+ supabaseOrganizationName: string;
22065
+ createdAt: any;
22066
+ updatedAt: any;
22067
+ };
22068
+ export type SupabaseProjectFragment = {
22069
+ __typename?: 'SupabaseProject';
22070
+ id: string;
22071
+ supabaseProjectRef: string;
22072
+ supabaseProjectName: string;
22073
+ supabaseProjectUrl: string;
22074
+ supabaseRegion: string;
22075
+ createdAt: any;
22076
+ updatedAt: any;
22077
+ };
21876
22078
  export type UpdateFragment = {
21877
22079
  __typename?: 'Update';
21878
22080
  id: string;