eas-cli 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1034
- package/build/branch/queries.d.ts +10 -2
- package/build/branch/queries.js +27 -24
- package/build/branch/utils.d.ts +4 -0
- package/build/branch/utils.js +15 -0
- package/build/build/android/build.js +3 -3
- package/build/build/android/graphql.js +2 -1
- package/build/build/android/prepareJob.js +4 -3
- package/build/build/android/syncProjectConfiguration.d.ts +2 -1
- package/build/build/android/syncProjectConfiguration.js +2 -2
- package/build/build/build.js +15 -4
- package/build/build/configure.js +2 -2
- package/build/build/createContext.d.ts +5 -1
- package/build/build/createContext.js +8 -14
- package/build/build/ios/build.js +2 -1
- package/build/build/ios/credentials.js +1 -1
- package/build/build/ios/graphql.js +2 -1
- package/build/build/ios/prepareJob.js +4 -3
- package/build/build/ios/syncProjectConfiguration.d.ts +2 -1
- package/build/build/ios/syncProjectConfiguration.js +2 -2
- package/build/build/local.js +1 -1
- package/build/build/metadata.js +1 -2
- package/build/build/queries.d.ts +9 -0
- package/build/build/queries.js +51 -0
- package/build/build/runBuildAndSubmit.d.ts +3 -1
- package/build/build/runBuildAndSubmit.js +15 -7
- package/build/build/utils/repository.js +5 -1
- package/build/channel/queries.d.ts +17 -0
- package/build/channel/queries.js +137 -0
- package/build/channel/utils.d.ts +22 -0
- package/build/channel/utils.js +87 -0
- package/build/commandUtils/EasCommand.d.ts +68 -7
- package/build/commandUtils/EasCommand.js +60 -79
- package/build/commandUtils/context/ActorContextField.d.ts +5 -0
- package/build/commandUtils/context/ActorContextField.js +11 -0
- package/build/commandUtils/context/ContextField.d.ts +6 -0
- package/build/commandUtils/context/ContextField.js +5 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +11 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +27 -0
- package/build/commandUtils/context/OptionalProjectConfigContextField.d.ts +13 -0
- package/build/commandUtils/context/OptionalProjectConfigContextField.js +37 -0
- package/build/commandUtils/context/ProjectConfigContextField.d.ts +13 -0
- package/build/commandUtils/context/ProjectConfigContextField.js +23 -0
- package/build/commandUtils/context/ProjectDirContextField.d.ts +4 -0
- package/build/commandUtils/context/ProjectDirContextField.js +11 -0
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.d.ts +21 -0
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.js +75 -0
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.d.ts +17 -0
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +102 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +24 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +108 -0
- package/build/commandUtils/flags.d.ts +10 -0
- package/build/commandUtils/flags.js +23 -0
- package/build/commandUtils/pagination.d.ts +7 -4
- package/build/commandUtils/pagination.js +11 -15
- package/build/commands/account/login.d.ts +0 -2
- package/build/commands/account/login.js +2 -7
- package/build/commands/account/logout.d.ts +0 -2
- package/build/commands/account/logout.js +0 -5
- package/build/commands/account/view.d.ts +0 -2
- package/build/commands/account/view.js +0 -5
- package/build/commands/analytics.d.ts +0 -1
- package/build/commands/analytics.js +0 -4
- package/build/commands/branch/create.d.ts +4 -0
- package/build/commands/branch/create.js +18 -18
- package/build/commands/branch/delete.d.ts +4 -0
- package/build/commands/branch/delete.js +29 -26
- package/build/commands/branch/list.d.ts +5 -2
- package/build/commands/branch/list.js +13 -8
- package/build/commands/branch/rename.d.ts +5 -1
- package/build/commands/branch/rename.js +15 -13
- package/build/commands/branch/view.d.ts +5 -2
- package/build/commands/branch/view.js +31 -13
- package/build/commands/build/cancel.d.ts +7 -0
- package/build/commands/build/cancel.js +50 -23
- package/build/commands/build/configure.d.ts +3 -0
- package/build/commands/build/configure.js +12 -7
- package/build/commands/build/index.d.ts +7 -2
- package/build/commands/build/index.js +77 -15
- package/build/commands/build/inspect.d.ts +5 -0
- package/build/commands/build/inspect.js +12 -3
- package/build/commands/build/list.d.ts +7 -2
- package/build/commands/build/list.js +36 -59
- package/build/commands/build/version/set.d.ts +5 -0
- package/build/commands/build/version/set.js +22 -14
- package/build/commands/build/version/sync.d.ts +5 -0
- package/build/commands/build/version/sync.js +22 -13
- package/build/commands/build/view.d.ts +3 -0
- package/build/commands/build/view.js +20 -14
- package/build/commands/channel/create.d.ts +4 -0
- package/build/commands/channel/create.js +32 -25
- package/build/commands/channel/delete.d.ts +3 -0
- package/build/commands/channel/delete.js +36 -59
- package/build/commands/channel/edit.d.ts +7 -7
- package/build/commands/channel/edit.js +39 -72
- package/build/commands/channel/list.d.ts +6 -0
- package/build/commands/channel/list.js +20 -76
- package/build/commands/channel/rollout.d.ts +5 -1
- package/build/commands/channel/rollout.js +34 -35
- package/build/commands/channel/view.d.ts +6 -33
- package/build/commands/channel/view.js +31 -132
- package/build/commands/config.d.ts +6 -2
- package/build/commands/config.js +22 -13
- package/build/commands/credentials.d.ts +4 -0
- package/build/commands/credentials.js +10 -1
- package/build/commands/device/create.d.ts +4 -0
- package/build/commands/device/create.js +15 -3
- package/build/commands/device/delete.d.ts +13 -8
- package/build/commands/device/delete.js +81 -129
- package/build/commands/device/list.d.ts +7 -0
- package/build/commands/device/list.js +42 -63
- package/build/commands/device/view.d.ts +3 -0
- package/build/commands/device/view.js +10 -5
- package/build/commands/diagnostics.d.ts +3 -1
- package/build/commands/diagnostics.js +10 -8
- package/build/commands/metadata/pull.d.ts +4 -0
- package/build/commands/metadata/pull.js +13 -8
- package/build/commands/metadata/push.d.ts +4 -0
- package/build/commands/metadata/push.js +13 -8
- package/build/commands/open.d.ts +8 -0
- package/build/commands/open.js +42 -0
- package/build/commands/project/info.d.ts +3 -0
- package/build/commands/project/info.js +9 -6
- package/build/commands/project/init.d.ts +12 -0
- package/build/commands/project/init.js +155 -8
- package/build/commands/secret/create.d.ts +6 -0
- package/build/commands/secret/create.js +87 -30
- package/build/commands/secret/delete.d.ts +4 -0
- package/build/commands/secret/delete.js +28 -19
- package/build/commands/secret/list.d.ts +3 -0
- package/build/commands/secret/list.js +19 -13
- package/build/commands/submit.d.ts +5 -0
- package/build/commands/submit.js +16 -7
- package/build/commands/update/configure.d.ts +3 -0
- package/build/commands/update/configure.js +24 -18
- package/build/commands/update/delete.d.ts +1 -0
- package/build/commands/update/delete.js +5 -8
- package/build/commands/update/index.d.ts +8 -12
- package/build/commands/update/index.js +90 -166
- package/build/commands/update/list.d.ts +8 -2
- package/build/commands/update/list.js +51 -81
- package/build/commands/update/view.d.ts +0 -4
- package/build/commands/update/view.js +14 -51
- package/build/commands/webhook/create.d.ts +4 -0
- package/build/commands/webhook/create.js +10 -5
- package/build/commands/webhook/delete.d.ts +6 -0
- package/build/commands/webhook/delete.js +26 -14
- package/build/commands/webhook/list.d.ts +3 -0
- package/build/commands/webhook/list.js +13 -9
- package/build/commands/webhook/update.d.ts +1 -0
- package/build/commands/webhook/update.js +3 -1
- package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -6
- package/build/credentials/android/actions/CreateFcm.d.ts +2 -3
- package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/actions/CreateKeystore.d.ts +2 -3
- package/build/credentials/android/actions/CreateKeystore.js +1 -2
- package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/api/GraphqlClient.d.ts +6 -7
- package/build/credentials/context.d.ts +8 -4
- package/build/credentials/context.js +8 -23
- package/build/credentials/ios/IosCredentialsProvider.js +11 -6
- package/build/credentials/ios/actions/AppleTeamFormatting.d.ts +2 -0
- package/build/credentials/ios/actions/AppleTeamFormatting.js +7 -0
- package/build/credentials/ios/actions/AppleTeamUtils.d.ts +1 -2
- package/build/credentials/ios/actions/AppleTeamUtils.js +1 -5
- package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +3 -4
- package/build/credentials/ios/actions/AscApiKeyUtils.js +2 -2
- package/build/credentials/ios/actions/AssignAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/AssignPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/BuildCredentialsUtils.d.ts +3 -3
- package/build/credentials/ios/actions/BuildCredentialsUtils.js +8 -12
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +4 -2
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +5 -2
- package/build/credentials/ios/actions/CreateAscApiKey.d.ts +2 -3
- package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +2 -2
- package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +4 -2
- package/build/credentials/ios/actions/CreateProvisioningProfile.js +3 -2
- package/build/credentials/ios/actions/CreatePushKey.d.ts +2 -3
- package/build/credentials/ios/actions/DeviceUtils.d.ts +0 -1
- package/build/credentials/ios/actions/DeviceUtils.js +3 -19
- package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +3 -4
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +2 -2
- package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -1
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +4 -2
- package/build/credentials/ios/actions/PushKeyUtils.d.ts +2 -3
- package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
- package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -3
- package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -4
- package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -3
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +9 -3
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +30 -18
- package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpBuildCredentials.js +1 -0
- package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +9 -3
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.js +6 -12
- package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +4 -2
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +8 -5
- package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +3 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +5 -5
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +1 -1
- package/build/credentials/ios/api/GraphqlClient.d.ts +9 -15
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +2 -3
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +3 -1
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +3 -3
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +20 -6
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +8 -7
- package/build/credentials/ios/api/graphql/types/AppLookupParams.d.ts +7 -0
- package/build/credentials/ios/api/graphql/types/AppLookupParams.js +2 -0
- package/build/credentials/ios/appstore/AppStoreApi.d.ts +7 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +8 -8
- package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -14
- package/build/credentials/ios/appstore/Credentials.types.js +0 -6
- package/build/credentials/ios/appstore/constants.d.ts +1 -0
- package/build/credentials/ios/appstore/constants.js +6 -0
- package/build/credentials/ios/appstore/distributionCertificate.js +1 -1
- package/build/credentials/ios/appstore/provisioningProfile.d.ts +5 -3
- package/build/credentials/ios/appstore/provisioningProfile.js +30 -7
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +3 -1
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +10 -10
- package/build/credentials/ios/types.d.ts +2 -3
- package/build/credentials/ios/utils/printCredentials.d.ts +1 -1
- package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +3 -2
- package/build/credentials/ios/validators/validateProvisioningProfile.js +6 -4
- package/build/credentials/manager/HelperActions.d.ts +4 -1
- package/build/credentials/manager/ManageAndroid.js +4 -14
- package/build/credentials/manager/ManageIos.js +20 -20
- package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +1 -1
- package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -3
- package/build/credentials/manager/SelectPlatform.d.ts +5 -1
- package/build/credentials/manager/SelectPlatform.js +5 -3
- package/build/devices/actions/create/action.d.ts +2 -3
- package/build/devices/actions/create/developerPortalMethod.js +2 -2
- package/build/devices/context.d.ts +3 -5
- package/build/devices/context.js +2 -11
- package/build/devices/manager.d.ts +4 -5
- package/build/devices/manager.js +9 -16
- package/build/devices/queries.d.ts +21 -0
- package/build/devices/queries.js +121 -0
- package/build/devices/utils/errors.d.ts +3 -0
- package/build/devices/utils/errors.js +9 -0
- package/build/devices/utils/formatDevice.d.ts +3 -3
- package/build/devices/utils/formatDevice.js +8 -3
- package/build/graphql/generated.d.ts +1141 -192
- package/build/graphql/generated.js +13 -2
- package/build/graphql/mutations/EnvironmentSecretMutation.d.ts +3 -1
- package/build/graphql/queries/AppQuery.d.ts +1 -0
- package/build/graphql/queries/AppQuery.js +19 -0
- package/build/graphql/queries/BranchQuery.d.ts +5 -6
- package/build/graphql/queries/BranchQuery.js +44 -3
- package/build/graphql/queries/BuildQuery.d.ts +2 -20
- package/build/graphql/queries/BuildQuery.js +2 -2
- package/build/graphql/queries/ChannelQuery.d.ts +5 -2
- package/build/graphql/queries/ChannelQuery.js +45 -19
- package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +5 -3
- package/build/graphql/queries/EnvironmentSecretsQuery.js +14 -28
- package/build/graphql/queries/UpdateQuery.d.ts +4 -6
- package/build/graphql/queries/UpdateQuery.js +59 -50
- package/build/graphql/queries/UserQuery.js +8 -1
- package/build/graphql/types/Account.d.ts +1 -0
- package/build/graphql/types/Account.js +17 -0
- package/build/graphql/types/App.js +7 -0
- package/build/graphql/types/EnvironmentSecret.d.ts +7 -0
- package/build/graphql/types/EnvironmentSecret.js +16 -1
- package/build/graphql/types/Update.d.ts +1 -0
- package/build/graphql/types/Update.js +30 -0
- package/build/graphql/types/UpdateBranch.js +4 -15
- package/build/metadata/context.d.ts +1 -1
- package/build/metadata/context.js +7 -9
- package/build/project/android/applicationId.d.ts +2 -1
- package/build/project/android/applicationId.js +7 -7
- package/build/project/android/versions.js +1 -1
- package/build/project/applicationIdentifier.d.ts +2 -1
- package/build/project/applicationIdentifier.js +2 -2
- package/build/project/expoConfig.d.ts +3 -3
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.d.ts +22 -0
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +93 -0
- package/build/project/ios/bundleIdentifier.d.ts +2 -1
- package/build/project/ios/bundleIdentifier.js +7 -7
- package/build/project/ios/scheme.d.ts +1 -1
- package/build/project/ios/target.d.ts +7 -0
- package/build/project/ios/target.js +26 -1
- package/build/project/projectUtils.d.ts +4 -31
- package/build/project/projectUtils.js +13 -123
- package/build/project/remoteVersionSource.d.ts +2 -2
- package/build/project/remoteVersionSource.js +8 -7
- package/build/project/workflow.js +3 -1
- package/build/submit/android/ServiceAccountSource.js +1 -2
- package/build/submit/context.d.ts +3 -1
- package/build/submit/context.js +12 -14
- package/build/submit/ios/CredentialsServiceSource.js +1 -2
- package/build/submit/utils/builds.js +3 -1
- package/build/update/android/UpdatesModule.d.ts +1 -1
- package/build/update/android/UpdatesModule.js +2 -3
- package/build/update/ios/UpdatesModule.d.ts +1 -1
- package/build/update/ios/UpdatesModule.js +2 -3
- package/build/update/queries.d.ts +16 -1
- package/build/update/queries.js +96 -30
- package/build/update/utils.d.ts +21 -8
- package/build/update/utils.js +75 -14
- package/build/user/actions.d.ts +2 -8
- package/build/user/actions.js +4 -63
- package/build/utils/profiles.d.ts +3 -3
- package/build/utils/profiles.js +6 -5
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/clients/git.js +5 -2
- package/build/vcs/clients/gitNoCommit.js +2 -1
- package/build/vcs/vcs.d.ts +1 -1
- package/build/webhooks/input.d.ts +2 -1
- package/build/webhooks/input.js +10 -1
- package/oclif.manifest.json +1 -1
- package/package.json +6 -5
- package/build/project/ensureProjectExists.d.ts +0 -21
- package/build/project/ensureProjectExists.js +0 -88
- package/build/user/Account.d.ts +0 -3
- package/build/user/Account.js +0 -7
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import {
|
|
2
|
+
import { ViewBranchQueryVariables } from '../../graphql/generated';
|
|
3
3
|
import { PublishPlatform } from '../../project/publish';
|
|
4
4
|
export declare const defaultPublishPlatforms: PublishPlatform[];
|
|
5
5
|
export declare type PublishPlatformFlag = PublishPlatform | 'all';
|
|
6
|
-
export declare function ensureBranchExistsAsync({ appId, name: branchName,
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
limit: number;
|
|
10
|
-
offset: number;
|
|
11
|
-
}): Promise<{
|
|
12
|
-
id: string;
|
|
13
|
-
updates: Exclude<Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'], null | undefined>['updates'];
|
|
6
|
+
export declare function ensureBranchExistsAsync({ appId, name: branchName, }: ViewBranchQueryVariables): Promise<{
|
|
7
|
+
branchId: string;
|
|
14
8
|
}>;
|
|
15
9
|
export default class UpdatePublish extends EasCommand {
|
|
16
10
|
static description: string;
|
|
17
11
|
static flags: {
|
|
12
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
14
|
branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
19
15
|
message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
20
16
|
republish: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -22,12 +18,12 @@ export default class UpdatePublish extends EasCommand {
|
|
|
22
18
|
'input-dir': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
23
19
|
'skip-bundler': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
20
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
25
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
26
21
|
auto: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
27
22
|
'private-key-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
28
|
-
|
|
23
|
+
};
|
|
24
|
+
static contextDefinition: {
|
|
25
|
+
getDynamicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicProjectConfigContextField;
|
|
29
26
|
};
|
|
30
27
|
runAsync(): Promise<void>;
|
|
31
28
|
}
|
|
32
|
-
export declare function getUpdatesToRepublishInteractiveAsync(projectId: string, branchName: string, platformFlag: string, pageSize: number, offset?: number, cumulativeUpdates?: Exclude<Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'], null | undefined>['updates']): Promise<Exclude<Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'], null | undefined>['updates']>;
|
|
33
29
|
export declare const truncatePublishUpdateMessage: (originalMessage: string) => string;
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.truncatePublishUpdateMessage = exports.
|
|
4
|
+
exports.truncatePublishUpdateMessage = exports.ensureBranchExistsAsync = exports.defaultPublishPlatforms = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
7
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
8
|
const core_1 = require("@oclif/core");
|
|
8
9
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
9
10
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
-
const dateformat_1 = tslib_1.__importDefault(require("dateformat"));
|
|
11
|
-
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
12
11
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
13
12
|
const api_1 = require("../../api");
|
|
14
13
|
const queries_1 = require("../../branch/queries");
|
|
14
|
+
const utils_1 = require("../../branch/utils");
|
|
15
15
|
const url_1 = require("../../build/utils/url");
|
|
16
16
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
17
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
18
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
17
19
|
const fetch_1 = tslib_1.__importDefault(require("../../fetch"));
|
|
18
|
-
const client_1 = require("../../graphql/client");
|
|
19
20
|
const generated_1 = require("../../graphql/generated");
|
|
20
21
|
const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
|
|
21
22
|
const BranchQuery_1 = require("../../graphql/queries/BranchQuery");
|
|
22
23
|
const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
|
|
23
24
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
24
25
|
const ora_1 = require("../../ora");
|
|
25
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
26
26
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
27
27
|
const publish_1 = require("../../project/publish");
|
|
28
28
|
const workflow_1 = require("../../project/workflow");
|
|
29
29
|
const prompts_1 = require("../../prompts");
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const queries_2 = require("../../update/queries");
|
|
31
|
+
const utils_2 = require("../../update/utils");
|
|
32
32
|
const code_signing_1 = require("../../utils/code-signing");
|
|
33
|
-
const uniqBy_1 = tslib_1.__importDefault(require("../../utils/expodash/uniqBy"));
|
|
34
33
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
35
34
|
const json_1 = require("../../utils/json");
|
|
36
35
|
const statuspageService_1 = require("../../utils/statuspageService");
|
|
@@ -38,27 +37,8 @@ const vcs_1 = require("../../vcs");
|
|
|
38
37
|
const create_1 = require("../branch/create");
|
|
39
38
|
const create_2 = require("../channel/create");
|
|
40
39
|
exports.defaultPublishPlatforms = ['android', 'ios'];
|
|
41
|
-
async function getUpdateGroupAsync({ group, }) {
|
|
42
|
-
const { updatesByGroup } = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
43
|
-
.query((0, graphql_tag_1.default) `
|
|
44
|
-
query getUpdateGroupAsync($group: ID!) {
|
|
45
|
-
updatesByGroup(group: $group) {
|
|
46
|
-
id
|
|
47
|
-
group
|
|
48
|
-
runtimeVersion
|
|
49
|
-
manifestFragment
|
|
50
|
-
platform
|
|
51
|
-
message
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`, {
|
|
55
|
-
group,
|
|
56
|
-
}, { additionalTypenames: ['Update'] })
|
|
57
|
-
.toPromise());
|
|
58
|
-
return updatesByGroup;
|
|
59
|
-
}
|
|
60
40
|
async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
|
|
61
|
-
var
|
|
41
|
+
var _b;
|
|
62
42
|
try {
|
|
63
43
|
await (0, create_2.createUpdateChannelOnAppAsync)({
|
|
64
44
|
appId,
|
|
@@ -68,47 +48,59 @@ async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
|
|
|
68
48
|
log_1.default.withTick(`Created a channel: ${chalk_1.default.bold(channelName)} pointed at branch: ${chalk_1.default.bold(channelName)}.`);
|
|
69
49
|
}
|
|
70
50
|
catch (e) {
|
|
71
|
-
const isIgnorableError = ((
|
|
51
|
+
const isIgnorableError = ((_b = e.graphQLErrors) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
|
72
52
|
e.graphQLErrors[0].extensions.errorCode === 'CHANNEL_ALREADY_EXISTS';
|
|
73
53
|
if (!isIgnorableError) {
|
|
74
54
|
throw e;
|
|
75
55
|
}
|
|
76
56
|
}
|
|
77
57
|
}
|
|
78
|
-
async function ensureBranchExistsAsync({ appId, name: branchName,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const updateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
|
|
86
|
-
if (updateBranch) {
|
|
87
|
-
const { id, updates } = updateBranch;
|
|
58
|
+
async function ensureBranchExistsAsync({ appId, name: branchName, }) {
|
|
59
|
+
try {
|
|
60
|
+
const updateBranch = await BranchQuery_1.BranchQuery.getBranchByNameAsync({
|
|
61
|
+
appId,
|
|
62
|
+
name: branchName,
|
|
63
|
+
});
|
|
64
|
+
const { id } = updateBranch;
|
|
88
65
|
await ensureChannelExistsAsync({ appId, branchId: id, channelName: branchName });
|
|
89
|
-
return { id
|
|
66
|
+
return { branchId: id };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error instanceof utils_1.BranchNotFoundError) {
|
|
70
|
+
const newUpdateBranch = await (0, create_1.createUpdateBranchOnAppAsync)({ appId, name: branchName });
|
|
71
|
+
log_1.default.withTick(`Created branch: ${chalk_1.default.bold(branchName)}`);
|
|
72
|
+
await ensureChannelExistsAsync({
|
|
73
|
+
appId,
|
|
74
|
+
branchId: newUpdateBranch.id,
|
|
75
|
+
channelName: branchName,
|
|
76
|
+
});
|
|
77
|
+
return { branchId: newUpdateBranch.id };
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
90
82
|
}
|
|
91
|
-
const newUpdateBranch = await (0, create_1.createUpdateBranchOnAppAsync)({ appId, name: branchName });
|
|
92
|
-
log_1.default.withTick(`Created branch: ${chalk_1.default.bold(branchName)}`);
|
|
93
|
-
await ensureChannelExistsAsync({ appId, branchId: newUpdateBranch.id, channelName: branchName });
|
|
94
|
-
return { id: newUpdateBranch.id, updates: [] };
|
|
95
83
|
}
|
|
96
84
|
exports.ensureBranchExistsAsync = ensureBranchExistsAsync;
|
|
97
85
|
class UpdatePublish extends EasCommand_1.default {
|
|
98
86
|
async runAsync() {
|
|
99
|
-
var
|
|
100
|
-
|
|
87
|
+
var _b, _c, _d;
|
|
88
|
+
const { flags } = await this.parse(UpdatePublish);
|
|
89
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
90
|
+
let { branch: branchName, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, platform, 'private-key-path': privateKeyPath, 'non-interactive': nonInteractive, json: jsonFlag, } = flags;
|
|
91
|
+
const { getDynamicProjectConfigAsync } = await this.getContextAsync(UpdatePublish, {
|
|
92
|
+
nonInteractive,
|
|
93
|
+
});
|
|
101
94
|
if (jsonFlag) {
|
|
102
95
|
(0, json_1.enableJsonOutput)();
|
|
103
96
|
}
|
|
104
97
|
const platformFlag = platform;
|
|
105
98
|
// If a group was specified, that means we are republishing it.
|
|
106
|
-
republish =
|
|
107
|
-
const projectDir = await (
|
|
108
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, {
|
|
99
|
+
republish = republish || !!group;
|
|
100
|
+
const { exp, projectId, projectDir } = await getDynamicProjectConfigAsync({
|
|
109
101
|
isPublicConfig: true,
|
|
110
102
|
});
|
|
111
|
-
const expPrivate =
|
|
103
|
+
const { exp: expPrivate } = await getDynamicProjectConfigAsync({
|
|
112
104
|
isPublicConfig: false,
|
|
113
105
|
});
|
|
114
106
|
await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)([generated_1.StatuspageServiceName.EasUpdate]);
|
|
@@ -132,45 +124,36 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
132
124
|
}
|
|
133
125
|
}
|
|
134
126
|
const runtimeVersions = await getRuntimeVersionObjectAsync(exp, platformFlag, projectDir);
|
|
135
|
-
|
|
136
|
-
await checkEASUpdateURLIsSetAsync(exp);
|
|
137
|
-
if (!branchName && autoFlag) {
|
|
138
|
-
branchName =
|
|
139
|
-
(await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
|
|
140
|
-
`branch-${Math.random().toString(36).substr(2, 4)}`;
|
|
141
|
-
}
|
|
127
|
+
await checkEASUpdateURLIsSetAsync(exp, projectId);
|
|
142
128
|
if (!branchName) {
|
|
143
|
-
if (
|
|
144
|
-
|
|
129
|
+
if (autoFlag) {
|
|
130
|
+
branchName = await (0, utils_1.getDefaultBranchNameAsync)();
|
|
145
131
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
throw new Error(validationMessage);
|
|
149
|
-
}
|
|
150
|
-
const branches = await BranchQuery_1.BranchQuery.listBranchesAsync({
|
|
151
|
-
appId: projectId,
|
|
152
|
-
limit: queries_1.BRANCHES_LIMIT,
|
|
153
|
-
offset: 0,
|
|
154
|
-
});
|
|
155
|
-
if (branches.length === 0) {
|
|
156
|
-
({ name: branchName } = await (0, prompts_1.promptAsync)({
|
|
157
|
-
type: 'text',
|
|
158
|
-
name: 'name',
|
|
159
|
-
message: 'No branches found. Provide a branch name:',
|
|
160
|
-
initial: (await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
|
|
161
|
-
`branch-${Math.random().toString(36).substr(2, 4)}`,
|
|
162
|
-
validate: value => (value ? true : validationMessage),
|
|
163
|
-
}));
|
|
132
|
+
else if (nonInteractive) {
|
|
133
|
+
throw new Error('Must supply --branch or use --auto when in non-interactive mode');
|
|
164
134
|
}
|
|
165
135
|
else {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
136
|
+
try {
|
|
137
|
+
const branch = await (0, queries_1.selectBranchOnAppAsync)({
|
|
138
|
+
projectId,
|
|
139
|
+
promptTitle: `Which branch would you like to ${republish ? 'republish' : 'publish'} on?`,
|
|
140
|
+
displayTextForListItem: updateBranch => `${updateBranch.name} ${chalk_1.default.grey(`- current update: ${(0, utils_2.formatUpdateMessage)(updateBranch.updates[0])}`)}`,
|
|
141
|
+
paginatedQueryOptions,
|
|
142
|
+
});
|
|
143
|
+
branchName = branch.name;
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
// unable to select a branch (network error or no branches for project)
|
|
147
|
+
({ name: branchName } = await (0, prompts_1.promptAsync)({
|
|
148
|
+
type: 'text',
|
|
149
|
+
name: 'name',
|
|
150
|
+
message: 'No branches found. Provide a branch name:',
|
|
151
|
+
initial: await (0, utils_1.getDefaultBranchNameAsync)(),
|
|
152
|
+
validate: value => (value ? true : 'Branch name may not be empty.'),
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
(0, assert_1.default)(branchName, 'Branch name must be specified.');
|
|
172
156
|
}
|
|
173
|
-
(0, assert_1.default)(branchName, 'Branch name must be specified.');
|
|
174
157
|
}
|
|
175
158
|
let unsortedUpdateInfoGroups = {};
|
|
176
159
|
let oldMessage, oldRuntimeVersion;
|
|
@@ -181,17 +164,18 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
181
164
|
// Instead we get the `updateInfoGroup` from the update we wish to republish.
|
|
182
165
|
let updatesToRepublish;
|
|
183
166
|
if (group) {
|
|
184
|
-
|
|
167
|
+
const updatesByGroup = await UpdateQuery_1.UpdateQuery.viewUpdateGroupAsync({ groupId: group });
|
|
168
|
+
updatesToRepublish = updatesByGroup;
|
|
185
169
|
}
|
|
186
170
|
else {
|
|
187
171
|
if (nonInteractive) {
|
|
188
172
|
throw new Error('Must supply --group when in non-interactive mode');
|
|
189
173
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
174
|
+
updatesToRepublish = await (0, queries_2.selectUpdateGroupOnBranchAsync)({
|
|
175
|
+
projectId,
|
|
176
|
+
branchName,
|
|
177
|
+
paginatedQueryOptions,
|
|
178
|
+
});
|
|
195
179
|
}
|
|
196
180
|
const updatesToRepublishFilteredByPlatform = updatesToRepublish.filter(
|
|
197
181
|
// Only republish to the specified platforms
|
|
@@ -219,7 +203,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
219
203
|
}
|
|
220
204
|
// These are the same for each member of an update group
|
|
221
205
|
group = updatesToRepublishFilteredByPlatform[0].group;
|
|
222
|
-
oldMessage = (
|
|
206
|
+
oldMessage = (_b = updatesToRepublishFilteredByPlatform[0].message) !== null && _b !== void 0 ? _b : '';
|
|
223
207
|
oldRuntimeVersion = updatesToRepublishFilteredByPlatform[0].runtimeVersion;
|
|
224
208
|
if (!message) {
|
|
225
209
|
if (nonInteractive) {
|
|
@@ -240,7 +224,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
240
224
|
}
|
|
241
225
|
else {
|
|
242
226
|
if (!message && autoFlag) {
|
|
243
|
-
message = (
|
|
227
|
+
message = (_c = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim();
|
|
244
228
|
}
|
|
245
229
|
if (!message) {
|
|
246
230
|
if (nonInteractive) {
|
|
@@ -254,7 +238,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
254
238
|
type: 'text',
|
|
255
239
|
name: 'publishMessage',
|
|
256
240
|
message: `Provide an update message.`,
|
|
257
|
-
initial: (
|
|
241
|
+
initial: (_d = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _d === void 0 ? void 0 : _d.trim(),
|
|
258
242
|
validate: (value) => (value ? true : validationMessage),
|
|
259
243
|
}));
|
|
260
244
|
}
|
|
@@ -297,11 +281,9 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
297
281
|
.filter(pair => pair[1] === runtime)
|
|
298
282
|
.map(pair => pair[0]);
|
|
299
283
|
}
|
|
300
|
-
const {
|
|
284
|
+
const { branchId } = await ensureBranchExistsAsync({
|
|
301
285
|
appId: projectId,
|
|
302
286
|
name: branchName,
|
|
303
|
-
limit: 0,
|
|
304
|
-
offset: 0,
|
|
305
287
|
});
|
|
306
288
|
// Sort the updates into different groups based on their platform specific runtime versions
|
|
307
289
|
const updateGroups = Object.entries(runtimeToPlatformMapping).map(([runtime, platforms]) => {
|
|
@@ -354,7 +336,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
354
336
|
publishSpinner.succeed('Published!');
|
|
355
337
|
}
|
|
356
338
|
catch (e) {
|
|
357
|
-
publishSpinner.fail('Failed to
|
|
339
|
+
publishSpinner.fail('Failed to publish updates');
|
|
358
340
|
throw e;
|
|
359
341
|
}
|
|
360
342
|
if (jsonFlag) {
|
|
@@ -376,7 +358,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
376
358
|
const newIosUpdate = newUpdatesForRuntimeVersion.find(update => update.platform === 'ios');
|
|
377
359
|
const updateGroupId = newUpdatesForRuntimeVersion[0].group;
|
|
378
360
|
const projectName = exp.slug;
|
|
379
|
-
const accountName = (
|
|
361
|
+
const accountName = (await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId)).name;
|
|
380
362
|
const updateGroupUrl = (0, url_1.getUpdateGroupUrl)(accountName, projectName, updateGroupId);
|
|
381
363
|
const updateGroupLink = (0, log_1.link)(updateGroupUrl, { dim: false });
|
|
382
364
|
log_1.default.log((0, formatFields_1.default)([
|
|
@@ -405,6 +387,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
405
387
|
}
|
|
406
388
|
}
|
|
407
389
|
exports.default = UpdatePublish;
|
|
390
|
+
_a = UpdatePublish;
|
|
408
391
|
UpdatePublish.description = 'publish an update group';
|
|
409
392
|
UpdatePublish.flags = {
|
|
410
393
|
branch: core_1.Flags.string({
|
|
@@ -438,10 +421,6 @@ UpdatePublish.flags = {
|
|
|
438
421
|
default: 'all',
|
|
439
422
|
required: false,
|
|
440
423
|
}),
|
|
441
|
-
json: core_1.Flags.boolean({
|
|
442
|
-
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
|
|
443
|
-
default: false,
|
|
444
|
-
}),
|
|
445
424
|
auto: core_1.Flags.boolean({
|
|
446
425
|
description: 'Use the current git branch and commit message for the EAS branch and update message',
|
|
447
426
|
default: false,
|
|
@@ -450,52 +429,16 @@ UpdatePublish.flags = {
|
|
|
450
429
|
description: `File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named "private-key.pem" in the certificate's directory.`,
|
|
451
430
|
required: false,
|
|
452
431
|
}),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
432
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
433
|
+
};
|
|
434
|
+
UpdatePublish.contextDefinition = {
|
|
435
|
+
..._a.ContextOptions.DynamicProjectConfig,
|
|
457
436
|
};
|
|
458
|
-
async function getUpdatesToRepublishInteractiveAsync(projectId, branchName, platformFlag, pageSize, offset = 0, cumulativeUpdates = []) {
|
|
459
|
-
const fetchMoreValue = '_fetchMore';
|
|
460
|
-
const { updates } = await ensureBranchExistsAsync({
|
|
461
|
-
appId: projectId,
|
|
462
|
-
name: branchName,
|
|
463
|
-
limit: pageSize + 1,
|
|
464
|
-
offset,
|
|
465
|
-
});
|
|
466
|
-
cumulativeUpdates = [
|
|
467
|
-
...cumulativeUpdates,
|
|
468
|
-
// drop that extra item used for pagination from our render logic
|
|
469
|
-
...updates.slice(0, updates.length - 1),
|
|
470
|
-
];
|
|
471
|
-
const cumulativeUpdatesForTargetPlatforms = platformFlag === 'all'
|
|
472
|
-
? cumulativeUpdates
|
|
473
|
-
: cumulativeUpdates.filter(update => {
|
|
474
|
-
// Only show groups that have updates on the specified platform(s).
|
|
475
|
-
return update.platform === platformFlag;
|
|
476
|
-
});
|
|
477
|
-
const updateGroups = (0, uniqBy_1.default)(cumulativeUpdatesForTargetPlatforms, u => u.group).map(update => ({
|
|
478
|
-
title: formatUpdateTitle(update),
|
|
479
|
-
value: update.group,
|
|
480
|
-
}));
|
|
481
|
-
if (updateGroups.length === 0) {
|
|
482
|
-
throw new Error(`There are no updates on branch "${branchName}" published for the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`);
|
|
483
|
-
}
|
|
484
|
-
if (updates.length > pageSize) {
|
|
485
|
-
updateGroups.push({ title: 'Next page...', value: fetchMoreValue });
|
|
486
|
-
}
|
|
487
|
-
const selectedUpdateGroup = await (0, prompts_1.selectAsync)('Which update would you like to republish?', updateGroups);
|
|
488
|
-
if (selectedUpdateGroup === fetchMoreValue) {
|
|
489
|
-
return await getUpdatesToRepublishInteractiveAsync(projectId, branchName, platformFlag, pageSize, offset + pageSize, cumulativeUpdates);
|
|
490
|
-
}
|
|
491
|
-
return cumulativeUpdates.filter(update => update.group === selectedUpdateGroup);
|
|
492
|
-
}
|
|
493
|
-
exports.getUpdatesToRepublishInteractiveAsync = getUpdatesToRepublishInteractiveAsync;
|
|
494
437
|
async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
|
|
495
|
-
var
|
|
438
|
+
var _b, _c;
|
|
496
439
|
const platforms = (platformFlag === 'all' ? ['android', 'ios'] : [platformFlag]);
|
|
497
440
|
for (const platform of platforms) {
|
|
498
|
-
const isPolicy = typeof ((
|
|
441
|
+
const isPolicy = typeof ((_c = (_b = exp[platform]) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== null && _c !== void 0 ? _c : exp.runtimeVersion) === 'object';
|
|
499
442
|
if (isPolicy) {
|
|
500
443
|
const isManaged = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform)) === eas_build_job_1.Workflow.MANAGED;
|
|
501
444
|
if (!isManaged) {
|
|
@@ -508,28 +451,9 @@ async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
|
|
|
508
451
|
(0, nullthrows_1.default)(config_plugins_1.Updates.getRuntimeVersion(exp, platform), `Unable to determine runtime version for ${platform}`),
|
|
509
452
|
]));
|
|
510
453
|
}
|
|
511
|
-
function
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
switch (actor === null || actor === void 0 ? void 0 : actor.__typename) {
|
|
515
|
-
case 'User': {
|
|
516
|
-
actorName = actor.username;
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
case 'Robot': {
|
|
520
|
-
const { firstName, id } = actor;
|
|
521
|
-
actorName = firstName !== null && firstName !== void 0 ? firstName : `robot: ${id.slice(0, 4)}...`;
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
default:
|
|
525
|
-
actorName = 'unknown';
|
|
526
|
-
}
|
|
527
|
-
return `[${(0, dateformat_1.default)(createdAt, 'mmm dd HH:MM')} by ${actorName}, runtimeVersion: ${runtimeVersion}] ${message}`;
|
|
528
|
-
}
|
|
529
|
-
async function checkEASUpdateURLIsSetAsync(exp) {
|
|
530
|
-
var _a;
|
|
531
|
-
const configuredURL = (_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url;
|
|
532
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
454
|
+
async function checkEASUpdateURLIsSetAsync(exp, projectId) {
|
|
455
|
+
var _b;
|
|
456
|
+
const configuredURL = (_b = exp.updates) === null || _b === void 0 ? void 0 : _b.url;
|
|
533
457
|
const expectedURL = (0, api_1.getEASUpdateURL)(projectId);
|
|
534
458
|
if (configuredURL !== expectedURL) {
|
|
535
459
|
throw new Error(`The update URL is incorrectly configured for EAS Update. Set updates.url to ${expectedURL} in your ${chalk_1.default.bold('app.json')}.`);
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
export default class
|
|
2
|
+
export default class UpdateList extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
limit: any;
|
|
8
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
5
9
|
branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
10
|
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
|
|
11
|
+
};
|
|
12
|
+
static contextDefinition: {
|
|
13
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
8
14
|
};
|
|
9
15
|
runAsync(): Promise<void>;
|
|
10
16
|
}
|
|
@@ -1,109 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
6
|
+
const queries_1 = require("../../branch/queries");
|
|
8
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
13
|
-
const prompts_1 = require("../../prompts");
|
|
14
|
-
const queries_1 = require("../../update/queries");
|
|
15
|
-
const utils_1 = require("../../update/utils");
|
|
8
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
9
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
10
|
+
const queries_2 = require("../../update/queries");
|
|
16
11
|
const json_1 = require("../../utils/json");
|
|
17
|
-
|
|
18
|
-
class BranchView extends EasCommand_1.default {
|
|
12
|
+
class UpdateList extends EasCommand_1.default {
|
|
19
13
|
async runAsync() {
|
|
20
|
-
|
|
21
|
-
const {
|
|
14
|
+
const { flags } = await this.parse(UpdateList);
|
|
15
|
+
const { branch: branchFlag, all, json: jsonFlag, 'non-interactive': nonInteractive } = flags;
|
|
16
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(UpdateList, {
|
|
17
|
+
nonInteractive,
|
|
18
|
+
});
|
|
19
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
22
20
|
if (jsonFlag) {
|
|
23
21
|
(0, json_1.enableJsonOutput)();
|
|
24
22
|
}
|
|
25
|
-
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
26
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
27
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
28
|
-
let updateGroupDescriptions;
|
|
29
23
|
if (all) {
|
|
30
|
-
|
|
31
|
-
appId: projectId,
|
|
32
|
-
limit: queries_1.UPDATES_LIMIT,
|
|
33
|
-
offset: 0,
|
|
34
|
-
});
|
|
35
|
-
updateGroupDescriptions = (0, utils_1.getUpdateGroupsWithPlatforms)(branchesAndUpdates.app.byId.updates.map(update => ({
|
|
36
|
-
...update,
|
|
37
|
-
branch: update.branch.name,
|
|
38
|
-
}))).sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
24
|
+
(0, queries_2.listAndRenderUpdateGroupsOnAppAsync)({ projectId, paginatedQueryOptions });
|
|
39
25
|
}
|
|
40
26
|
else {
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
if (branchFlag) {
|
|
28
|
+
(0, queries_2.listAndRenderUpdateGroupsOnBranchAsync)({
|
|
29
|
+
projectId,
|
|
30
|
+
branchName: branchFlag,
|
|
31
|
+
paginatedQueryOptions,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
43
35
|
const validationMessage = 'Branch name may not be empty.';
|
|
44
|
-
if (
|
|
36
|
+
if (nonInteractive) {
|
|
45
37
|
throw new Error(validationMessage);
|
|
46
38
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (!UpdateBranch) {
|
|
65
|
-
throw new Error(`Could not find branch "${branch}"`);
|
|
39
|
+
const selectedBranch = await (0, queries_1.selectBranchOnAppAsync)({
|
|
40
|
+
projectId,
|
|
41
|
+
promptTitle: 'Which branch would you like to view?',
|
|
42
|
+
displayTextForListItem: updateBranch => updateBranch.name,
|
|
43
|
+
paginatedQueryOptions:
|
|
44
|
+
// discard limit and offset because this query is not those flag's intended target
|
|
45
|
+
{
|
|
46
|
+
json: paginatedQueryOptions.json,
|
|
47
|
+
nonInteractive: paginatedQueryOptions.nonInteractive,
|
|
48
|
+
offset: 0,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
(0, queries_2.listAndRenderUpdateGroupsOnBranchAsync)({
|
|
52
|
+
projectId,
|
|
53
|
+
branchName: selectedBranch.name,
|
|
54
|
+
paginatedQueryOptions,
|
|
55
|
+
});
|
|
66
56
|
}
|
|
67
|
-
updateGroupDescriptions = (0, utils_1.getUpdateGroupsWithPlatforms)(UpdateBranch.updates.map(update => ({ ...update, branch }))).sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
68
|
-
}
|
|
69
|
-
if (jsonFlag) {
|
|
70
|
-
(0, json_1.printJsonOnlyOutput)(updateGroupDescriptions);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
logAsTable(updateGroupDescriptions);
|
|
74
57
|
}
|
|
75
58
|
}
|
|
76
59
|
}
|
|
77
|
-
exports.default =
|
|
78
|
-
|
|
79
|
-
|
|
60
|
+
exports.default = UpdateList;
|
|
61
|
+
_a = UpdateList;
|
|
62
|
+
UpdateList.description = 'view the recent updates';
|
|
63
|
+
UpdateList.flags = {
|
|
80
64
|
branch: core_1.Flags.string({
|
|
81
|
-
description: 'List
|
|
65
|
+
description: 'List updates only on this branch',
|
|
82
66
|
exclusive: ['all'],
|
|
83
67
|
}),
|
|
84
68
|
all: core_1.Flags.boolean({
|
|
85
|
-
description: 'List
|
|
69
|
+
description: 'List updates on all branches',
|
|
86
70
|
exclusive: ['branch'],
|
|
87
71
|
default: false,
|
|
88
72
|
}),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
73
|
+
...pagination_1.EasPaginatedQueryFlags,
|
|
74
|
+
limit: (0, pagination_1.getLimitFlagWithCustomValues)({ defaultTo: 25, limit: 50 }),
|
|
75
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
76
|
+
};
|
|
77
|
+
UpdateList.contextDefinition = {
|
|
78
|
+
..._a.ContextOptions.ProjectConfig,
|
|
93
79
|
};
|
|
94
|
-
function logAsTable(updateGroupDescriptions) {
|
|
95
|
-
const table = new cli_table3_1.default({
|
|
96
|
-
head: ['Branch', ...utils_1.UPDATE_COLUMNS],
|
|
97
|
-
wordWrap: true,
|
|
98
|
-
});
|
|
99
|
-
table.push(...updateGroupDescriptions.map(updateGroupDescription => [
|
|
100
|
-
updateGroupDescription.branch,
|
|
101
|
-
(0, utils_1.formatUpdate)(updateGroupDescription),
|
|
102
|
-
updateGroupDescription.runtimeVersion,
|
|
103
|
-
updateGroupDescription.group,
|
|
104
|
-
updateGroupDescription.platforms,
|
|
105
|
-
]));
|
|
106
|
-
log_1.default.addNewLineIfNone();
|
|
107
|
-
log_1.default.log(chalk_1.default.bold('Recently published update groups:'));
|
|
108
|
-
log_1.default.log(table.toString());
|
|
109
|
-
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import { UpdatesByGroupQuery } from '../../graphql/generated';
|
|
3
|
-
export declare function viewUpdateAsync({ groupId, }: {
|
|
4
|
-
groupId: string;
|
|
5
|
-
}): Promise<UpdatesByGroupQuery>;
|
|
6
2
|
export default class UpdateView extends EasCommand {
|
|
7
3
|
static description: string;
|
|
8
4
|
static args: {
|