eas-cli 2.3.0 → 2.4.1
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 +47 -47
- package/build/ApiV2Error.d.ts +15 -0
- package/build/ApiV2Error.js +14 -0
- package/build/api.d.ts +10 -16
- package/build/api.js +52 -59
- package/build/branch/queries.d.ts +3 -2
- package/build/branch/queries.js +7 -7
- package/build/build/android/build.js +3 -3
- package/build/build/android/syncProjectConfiguration.d.ts +2 -1
- package/build/build/android/syncProjectConfiguration.js +2 -2
- package/build/build/android/version.d.ts +2 -1
- package/build/build/android/version.js +4 -4
- package/build/build/build.d.ts +2 -1
- package/build/build/build.js +5 -5
- package/build/build/context.d.ts +2 -0
- package/build/build/createContext.d.ts +3 -1
- package/build/build/createContext.js +4 -2
- package/build/build/ios/build.js +3 -3
- package/build/build/ios/syncProjectConfiguration.d.ts +2 -1
- package/build/build/ios/syncProjectConfiguration.js +2 -2
- package/build/build/ios/version.d.ts +2 -1
- package/build/build/ios/version.js +4 -4
- package/build/build/local.js +1 -1
- package/build/build/queries.d.ts +2 -1
- package/build/build/queries.js +3 -3
- package/build/build/runBuildAndSubmit.d.ts +2 -1
- package/build/build/runBuildAndSubmit.js +9 -6
- package/build/channel/queries.d.ts +4 -3
- package/build/channel/queries.js +13 -13
- package/build/commandUtils/EasCommand.d.ts +24 -3
- package/build/commandUtils/EasCommand.js +36 -6
- package/build/commandUtils/context/ContextField.d.ts +2 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +2 -2
- package/build/commandUtils/context/LoggedInContextField.d.ts +12 -0
- package/build/commandUtils/context/LoggedInContextField.js +15 -0
- package/build/commandUtils/context/MaybeLoggedInContextField.d.ts +12 -0
- package/build/commandUtils/context/MaybeLoggedInContextField.js +17 -0
- package/build/commandUtils/context/OptionalProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/OptionalProjectConfigContextField.js +2 -2
- package/build/commandUtils/context/ProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/ProjectConfigContextField.js +2 -2
- package/build/commandUtils/context/SessionManagementContextField.d.ts +5 -0
- package/build/commandUtils/context/SessionManagementContextField.js +10 -0
- package/build/commandUtils/context/contextUtils/createGraphqlClient.d.ts +11 -0
- package/build/commandUtils/context/contextUtils/createGraphqlClient.js +43 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +2 -1
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +11 -7
- package/build/commands/account/login.d.ts +3 -0
- package/build/commands/account/login.js +7 -2
- package/build/commands/account/logout.d.ts +3 -0
- package/build/commands/account/logout.js +7 -2
- package/build/commands/account/view.d.ts +3 -0
- package/build/commands/account/view.js +8 -3
- package/build/commands/branch/create.d.ts +3 -1
- package/build/commands/branch/create.js +6 -5
- package/build/commands/branch/delete.d.ts +1 -0
- package/build/commands/branch/delete.js +10 -9
- package/build/commands/branch/list.d.ts +1 -0
- package/build/commands/branch/list.js +3 -2
- package/build/commands/branch/rename.d.ts +1 -0
- package/build/commands/branch/rename.js +6 -5
- package/build/commands/branch/view.d.ts +1 -0
- package/build/commands/branch/view.js +4 -3
- package/build/commands/build/cancel.d.ts +3 -1
- package/build/commands/build/cancel.js +14 -13
- package/build/commands/build/configure.d.ts +1 -0
- package/build/commands/build/configure.js +4 -3
- package/build/commands/build/index.d.ts +1 -1
- package/build/commands/build/index.js +3 -3
- package/build/commands/build/inspect.d.ts +1 -1
- package/build/commands/build/inspect.js +2 -2
- package/build/commands/build/list.d.ts +1 -0
- package/build/commands/build/list.js +4 -3
- package/build/commands/build/version/set.d.ts +1 -1
- package/build/commands/build/version/set.js +4 -4
- package/build/commands/build/version/sync.d.ts +1 -1
- package/build/commands/build/version/sync.js +2 -2
- package/build/commands/build/view.d.ts +1 -0
- package/build/commands/build/view.js +5 -4
- package/build/commands/channel/create.d.ts +3 -1
- package/build/commands/channel/create.js +8 -7
- package/build/commands/channel/delete.d.ts +1 -0
- package/build/commands/channel/delete.js +7 -6
- package/build/commands/channel/edit.d.ts +3 -1
- package/build/commands/channel/edit.js +12 -8
- package/build/commands/channel/list.d.ts +1 -0
- package/build/commands/channel/list.js +3 -2
- package/build/commands/channel/rollout.d.ts +1 -0
- package/build/commands/channel/rollout.js +15 -14
- package/build/commands/channel/view.d.ts +1 -0
- package/build/commands/channel/view.js +4 -3
- package/build/commands/credentials.d.ts +1 -1
- package/build/commands/credentials.js +2 -2
- package/build/commands/device/create.d.ts +1 -1
- package/build/commands/device/create.js +2 -1
- package/build/commands/device/delete.d.ts +3 -1
- package/build/commands/device/delete.js +9 -8
- package/build/commands/device/list.d.ts +1 -0
- package/build/commands/device/list.js +5 -4
- package/build/commands/device/view.d.ts +1 -0
- package/build/commands/device/view.js +4 -3
- package/build/commands/metadata/pull.d.ts +1 -1
- package/build/commands/metadata/pull.js +2 -1
- package/build/commands/metadata/push.d.ts +1 -1
- package/build/commands/metadata/push.js +2 -1
- package/build/commands/open.d.ts +1 -0
- package/build/commands/open.js +3 -2
- package/build/commands/project/info.d.ts +1 -0
- package/build/commands/project/info.js +5 -4
- package/build/commands/project/init.d.ts +1 -1
- package/build/commands/project/init.js +5 -5
- package/build/commands/secret/create.d.ts +1 -0
- package/build/commands/secret/create.js +10 -9
- package/build/commands/secret/delete.d.ts +1 -0
- package/build/commands/secret/delete.js +4 -3
- package/build/commands/secret/list.d.ts +1 -0
- package/build/commands/secret/list.js +3 -2
- package/build/commands/submit.d.ts +1 -1
- package/build/commands/submit.js +4 -3
- package/build/commands/update/configure.d.ts +1 -0
- package/build/commands/update/configure.js +4 -3
- package/build/commands/update/delete.d.ts +3 -0
- package/build/commands/update/delete.js +9 -3
- package/build/commands/update/index.d.ts +3 -1
- package/build/commands/update/index.js +23 -17
- package/build/commands/update/list.d.ts +1 -0
- package/build/commands/update/list.js +6 -5
- package/build/commands/update/view.d.ts +3 -0
- package/build/commands/update/view.js +7 -1
- package/build/commands/webhook/create.d.ts +1 -0
- package/build/commands/webhook/create.js +3 -2
- package/build/commands/webhook/delete.d.ts +1 -0
- package/build/commands/webhook/delete.js +7 -6
- package/build/commands/webhook/list.d.ts +1 -0
- package/build/commands/webhook/list.js +4 -3
- package/build/commands/webhook/update.d.ts +3 -0
- package/build/commands/webhook/update.js +8 -2
- package/build/commands/webhook/view.d.ts +3 -0
- package/build/commands/webhook/view.js +7 -1
- package/build/credentials/android/actions/AssignFcm.js +2 -2
- package/build/credentials/android/actions/AssignGoogleServiceAccountKey.js +2 -2
- package/build/credentials/android/actions/BuildCredentialsUtils.js +12 -12
- package/build/credentials/android/actions/CreateFcm.js +1 -1
- package/build/credentials/android/actions/CreateGoogleServiceAccountKey.js +1 -1
- package/build/credentials/android/actions/CreateKeystore.js +4 -4
- package/build/credentials/android/actions/RemoveFcm.js +2 -2
- package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.js +2 -2
- package/build/credentials/android/actions/RemoveKeystore.js +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentials.js +3 -3
- package/build/credentials/android/actions/SetUpBuildCredentialsFromCredentialsJson.js +3 -3
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKey.js +3 -3
- package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.js +1 -1
- package/build/credentials/android/api/GraphqlClient.d.ts +19 -18
- package/build/credentials/android/api/GraphqlClient.js +45 -45
- package/build/credentials/android/api/graphql/mutations/AndroidAppBuildCredentialsMutation.d.ts +3 -2
- package/build/credentials/android/api/graphql/mutations/AndroidAppBuildCredentialsMutation.js +4 -4
- package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.d.ts +4 -3
- package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.js +6 -6
- package/build/credentials/android/api/graphql/mutations/AndroidFcmMutation.d.ts +3 -2
- package/build/credentials/android/api/graphql/mutations/AndroidFcmMutation.js +4 -4
- package/build/credentials/android/api/graphql/mutations/AndroidKeystoreMutation.d.ts +3 -2
- package/build/credentials/android/api/graphql/mutations/AndroidKeystoreMutation.js +4 -4
- package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.d.ts +3 -2
- package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.js +4 -4
- package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.d.ts +2 -1
- package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.js +2 -2
- package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +2 -1
- package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -2
- package/build/credentials/android/utils/keystore.d.ts +2 -1
- package/build/credentials/android/utils/keystore.js +6 -6
- package/build/credentials/context.d.ts +3 -0
- package/build/credentials/context.js +1 -0
- package/build/credentials/credentialsJson/update.js +1 -1
- package/build/credentials/ios/actions/AppleTeamUtils.js +1 -1
- package/build/credentials/ios/actions/AscApiKeyUtils.js +1 -1
- package/build/credentials/ios/actions/AssignAscApiKey.js +2 -2
- package/build/credentials/ios/actions/AssignPushKey.js +2 -2
- package/build/credentials/ios/actions/BuildCredentialsUtils.js +5 -5
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/CreateAscApiKey.js +1 -1
- package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
- package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -2
- package/build/credentials/ios/actions/CreatePushKey.js +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +2 -2
- package/build/credentials/ios/actions/PushKeyUtils.js +1 -1
- package/build/credentials/ios/actions/RemoveAscApiKey.js +1 -1
- package/build/credentials/ios/actions/RemoveDistributionCertificate.js +1 -1
- package/build/credentials/ios/actions/RemoveProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/RemovePushKey.js +1 -1
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +8 -8
- package/build/credentials/ios/actions/SetUpAscApiKey.js +2 -2
- package/build/credentials/ios/actions/SetUpDistributionCertificate.js +2 -2
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/SetUpPushKey.js +4 -4
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +5 -5
- package/build/credentials/ios/api/GraphqlClient.d.ts +25 -24
- package/build/credentials/ios/api/GraphqlClient.js +73 -73
- package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.d.ts +3 -2
- package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.js +4 -4
- package/build/credentials/ios/api/graphql/mutations/AppleAppIdentifierMutation.d.ts +2 -1
- package/build/credentials/ios/api/graphql/mutations/AppleAppIdentifierMutation.js +2 -2
- package/build/credentials/ios/api/graphql/mutations/AppleDeviceMutation.d.ts +3 -2
- package/build/credentials/ios/api/graphql/mutations/AppleDeviceMutation.js +4 -4
- package/build/credentials/ios/api/graphql/mutations/AppleDeviceRegistrationRequestMutation.d.ts +2 -1
- package/build/credentials/ios/api/graphql/mutations/AppleDeviceRegistrationRequestMutation.js +2 -2
- package/build/credentials/ios/api/graphql/mutations/AppleDistributionCertificateMutation.d.ts +3 -2
- package/build/credentials/ios/api/graphql/mutations/AppleDistributionCertificateMutation.js +4 -4
- package/build/credentials/ios/api/graphql/mutations/AppleProvisioningProfileMutation.d.ts +4 -3
- package/build/credentials/ios/api/graphql/mutations/AppleProvisioningProfileMutation.js +6 -6
- package/build/credentials/ios/api/graphql/mutations/ApplePushKeyMutation.d.ts +3 -2
- package/build/credentials/ios/api/graphql/mutations/ApplePushKeyMutation.js +4 -4
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +2 -1
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +2 -2
- package/build/credentials/ios/api/graphql/mutations/IosAppBuildCredentialsMutation.d.ts +4 -3
- package/build/credentials/ios/api/graphql/mutations/IosAppBuildCredentialsMutation.js +6 -6
- package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.d.ts +4 -3
- package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.js +6 -6
- package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +2 -1
- package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleAppIdentifierQuery.d.ts +2 -1
- package/build/credentials/ios/api/graphql/queries/AppleAppIdentifierQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +4 -3
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -6
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.d.ts +3 -2
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +4 -4
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.d.ts +2 -1
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.d.ts +2 -1
- package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +3 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +4 -4
- package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.d.ts +2 -1
- package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.d.ts +3 -2
- package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.js +4 -4
- package/build/credentials/manager/HelperActions.d.ts +2 -0
- package/build/credentials/manager/ManageAndroid.js +4 -3
- package/build/credentials/manager/ManageIos.js +4 -3
- package/build/credentials/manager/SelectAndroidBuildCredentials.js +2 -2
- package/build/credentials/manager/SelectPlatform.d.ts +3 -1
- package/build/credentials/manager/SelectPlatform.js +2 -1
- package/build/devices/actions/create/action.d.ts +3 -1
- package/build/devices/actions/create/action.js +5 -4
- package/build/devices/actions/create/developerPortalMethod.d.ts +2 -1
- package/build/devices/actions/create/developerPortalMethod.js +9 -9
- package/build/devices/actions/create/inputMethod.d.ts +2 -1
- package/build/devices/actions/create/inputMethod.js +4 -4
- package/build/devices/actions/create/registrationUrlMethod.d.ts +2 -1
- package/build/devices/actions/create/registrationUrlMethod.js +4 -4
- package/build/devices/context.d.ts +4 -1
- package/build/devices/context.js +2 -1
- package/build/devices/manager.d.ts +3 -1
- package/build/devices/manager.js +9 -8
- package/build/devices/queries.d.ts +4 -3
- package/build/devices/queries.js +7 -7
- package/build/graphql/client.d.ts +1 -8
- package/build/graphql/client.js +1 -39
- package/build/graphql/mutations/AppMutation.d.ts +2 -1
- package/build/graphql/mutations/AppMutation.js +2 -2
- package/build/graphql/mutations/AppVersionMutation.d.ts +2 -1
- package/build/graphql/mutations/AppVersionMutation.js +2 -2
- package/build/graphql/mutations/BuildMutation.d.ts +3 -2
- package/build/graphql/mutations/BuildMutation.js +4 -4
- package/build/graphql/mutations/EnvironmentSecretMutation.d.ts +4 -3
- package/build/graphql/mutations/EnvironmentSecretMutation.js +6 -6
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +2 -1
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +2 -2
- package/build/graphql/mutations/PublishMutation.d.ts +4 -3
- package/build/graphql/mutations/PublishMutation.js +6 -6
- package/build/graphql/mutations/SubmissionMutation.d.ts +3 -2
- package/build/graphql/mutations/SubmissionMutation.js +4 -4
- package/build/graphql/mutations/UploadSessionMutation.d.ts +2 -1
- package/build/graphql/mutations/UploadSessionMutation.js +2 -2
- package/build/graphql/mutations/WebhookMutation.d.ts +4 -3
- package/build/graphql/mutations/WebhookMutation.js +6 -6
- package/build/graphql/queries/AppQuery.d.ts +3 -2
- package/build/graphql/queries/AppQuery.js +4 -4
- package/build/graphql/queries/AppVersionQuery.d.ts +2 -1
- package/build/graphql/queries/AppVersionQuery.js +2 -2
- package/build/graphql/queries/BranchQuery.d.ts +4 -3
- package/build/graphql/queries/BranchQuery.js +6 -6
- package/build/graphql/queries/BuildQuery.d.ts +4 -3
- package/build/graphql/queries/BuildQuery.js +6 -6
- package/build/graphql/queries/ChannelQuery.d.ts +3 -2
- package/build/graphql/queries/ChannelQuery.js +4 -4
- package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +3 -2
- package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -4
- package/build/graphql/queries/PublishQuery.d.ts +3 -2
- package/build/graphql/queries/PublishQuery.js +4 -4
- package/build/graphql/queries/StatuspageServiceQuery.d.ts +2 -1
- package/build/graphql/queries/StatuspageServiceQuery.js +2 -2
- package/build/graphql/queries/SubmissionQuery.d.ts +3 -2
- package/build/graphql/queries/SubmissionQuery.js +4 -4
- package/build/graphql/queries/UpdateQuery.d.ts +4 -3
- package/build/graphql/queries/UpdateQuery.js +6 -6
- package/build/graphql/queries/UserQuery.d.ts +2 -1
- package/build/graphql/queries/UserQuery.js +2 -2
- package/build/graphql/queries/WebhookQuery.d.ts +3 -2
- package/build/graphql/queries/WebhookQuery.js +4 -4
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.d.ts +3 -2
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +5 -5
- package/build/project/projectUtils.d.ts +3 -2
- package/build/project/projectUtils.js +4 -4
- package/build/project/publish.d.ts +3 -2
- package/build/project/publish.js +7 -7
- package/build/submit/ArchiveSource.d.ts +2 -1
- package/build/submit/ArchiveSource.js +30 -30
- package/build/submit/android/AndroidSubmitter.js +2 -2
- package/build/submit/context.d.ts +3 -0
- package/build/submit/context.js +3 -2
- package/build/submit/ios/IosSubmitter.js +2 -2
- package/build/submit/submit.d.ts +2 -1
- package/build/submit/submit.js +2 -2
- package/build/submit/utils/builds.d.ts +2 -1
- package/build/submit/utils/builds.js +2 -2
- package/build/submit/utils/errors.d.ts +3 -0
- package/build/submit/utils/errors.js +15 -67
- package/build/submit/utils/files.d.ts +2 -1
- package/build/submit/utils/files.js +2 -2
- package/build/submit/utils/wait.d.ts +2 -1
- package/build/submit/utils/wait.js +2 -2
- package/build/update/android/UpdatesModule.d.ts +2 -1
- package/build/update/android/UpdatesModule.js +2 -2
- package/build/update/ios/UpdatesModule.d.ts +2 -1
- package/build/update/ios/UpdatesModule.js +2 -2
- package/build/update/queries.d.ts +4 -3
- package/build/update/queries.js +22 -12
- package/build/uploads.d.ts +2 -1
- package/build/uploads.js +2 -2
- package/build/user/SessionManager.d.ts +70 -0
- package/build/user/SessionManager.js +258 -0
- package/build/user/User.d.ts +0 -9
- package/build/user/User.js +1 -60
- package/build/user/fetchSessionSecretAndUser.d.ts +9 -0
- package/build/user/fetchSessionSecretAndUser.js +43 -0
- package/build/utils/statuspageService.d.ts +2 -1
- package/build/utils/statuspageService.js +4 -4
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
- package/build/commandUtils/context/ActorContextField.d.ts +0 -5
- package/build/commandUtils/context/ActorContextField.js +0 -11
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.d.ts +0 -21
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.js +0 -75
- package/build/user/otp.d.ts +0 -29
- package/build/user/otp.js +0 -119
- package/build/user/sessionStorage.d.ts +0 -11
- package/build/user/sessionStorage.js +0 -36
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
import ActorContextField from './context/ActorContextField';
|
|
3
2
|
import ContextField from './context/ContextField';
|
|
4
3
|
import { DynamicProjectConfigContextField } from './context/DynamicProjectConfigContextField';
|
|
4
|
+
import LoggedInContextField from './context/LoggedInContextField';
|
|
5
|
+
import MaybeLoggedInContextField from './context/MaybeLoggedInContextField';
|
|
5
6
|
import { OptionalProjectConfigContextField } from './context/OptionalProjectConfigContextField';
|
|
6
7
|
import ProjectConfigContextField from './context/ProjectConfigContextField';
|
|
7
8
|
import ProjectDirContextField from './context/ProjectDirContextField';
|
|
9
|
+
import SessionManagementContextField from './context/SessionManagementContextField';
|
|
8
10
|
declare type ContextInput<T extends {
|
|
9
11
|
[name: string]: any;
|
|
10
12
|
} = object> = {
|
|
@@ -18,10 +20,24 @@ declare type ContextOutput<T extends {
|
|
|
18
20
|
export default abstract class EasCommand extends Command {
|
|
19
21
|
protected static readonly ContextOptions: {
|
|
20
22
|
/**
|
|
21
|
-
* Require this command to be run when logged-in. Returns the logged-in actor
|
|
23
|
+
* Require this command to be run when logged-in. Returns the logged-in actor and a logged-in
|
|
24
|
+
* graphql client in the context.
|
|
22
25
|
*/
|
|
23
26
|
LoggedIn: {
|
|
24
|
-
|
|
27
|
+
loggedIn: LoggedInContextField;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Do not require this command to be run when logged-in, but if it is get the logged-in actor and a
|
|
31
|
+
* maybe-logged-in graphql client.
|
|
32
|
+
*/
|
|
33
|
+
MaybeLoggedIn: {
|
|
34
|
+
maybeLoggedIn: MaybeLoggedInContextField;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Specify this context requirement if the command needs to mutate the user session.
|
|
38
|
+
*/
|
|
39
|
+
SessionManagment: {
|
|
40
|
+
sessionManager: SessionManagementContextField;
|
|
25
41
|
};
|
|
26
42
|
/**
|
|
27
43
|
* Require the project to be identified and registered on server if this command is being
|
|
@@ -69,6 +85,11 @@ export default abstract class EasCommand extends Command {
|
|
|
69
85
|
}, { nonInteractive }: {
|
|
70
86
|
nonInteractive: boolean;
|
|
71
87
|
}): Promise<ContextOutput<C>>;
|
|
88
|
+
/**
|
|
89
|
+
* The user session manager. Responsible for coordinating all user session related state.
|
|
90
|
+
* If needed in a subclass, SessionManager ContextOption.
|
|
91
|
+
*/
|
|
92
|
+
private readonly sessionManager;
|
|
72
93
|
protected abstract runAsync(): Promise<any>;
|
|
73
94
|
run(): Promise<any>;
|
|
74
95
|
finally(err: Error): Promise<any>;
|
|
@@ -3,20 +3,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const rudderstackClient_1 = require("../analytics/rudderstackClient");
|
|
6
|
-
const
|
|
7
|
-
const ActorContextField_1 = tslib_1.__importDefault(require("./context/ActorContextField"));
|
|
6
|
+
const SessionManager_1 = tslib_1.__importDefault(require("../user/SessionManager"));
|
|
8
7
|
const DynamicProjectConfigContextField_1 = require("./context/DynamicProjectConfigContextField");
|
|
8
|
+
const LoggedInContextField_1 = tslib_1.__importDefault(require("./context/LoggedInContextField"));
|
|
9
|
+
const MaybeLoggedInContextField_1 = tslib_1.__importDefault(require("./context/MaybeLoggedInContextField"));
|
|
9
10
|
const OptionalProjectConfigContextField_1 = require("./context/OptionalProjectConfigContextField");
|
|
10
11
|
const ProjectConfigContextField_1 = tslib_1.__importDefault(require("./context/ProjectConfigContextField"));
|
|
11
12
|
const ProjectDirContextField_1 = tslib_1.__importDefault(require("./context/ProjectDirContextField"));
|
|
13
|
+
const SessionManagementContextField_1 = tslib_1.__importDefault(require("./context/SessionManagementContextField"));
|
|
12
14
|
class EasCommand extends core_1.Command {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
/**
|
|
18
|
+
* The user session manager. Responsible for coordinating all user session related state.
|
|
19
|
+
* If needed in a subclass, SessionManager ContextOption.
|
|
20
|
+
*/
|
|
21
|
+
this.sessionManager = new SessionManager_1.default();
|
|
22
|
+
}
|
|
13
23
|
/**
|
|
14
24
|
* Execute the context in the contextDefinition to satisfy command prerequisites.
|
|
15
25
|
*/
|
|
16
26
|
async getContextAsync(commandClass, { nonInteractive }) {
|
|
17
27
|
const contextDefinition = commandClass.contextDefinition;
|
|
18
28
|
const contextValuePairs = await Promise.all(Object.keys(contextDefinition).map(async (contextKey) => {
|
|
19
|
-
return [
|
|
29
|
+
return [
|
|
30
|
+
contextKey,
|
|
31
|
+
await contextDefinition[contextKey].getValueAsync({
|
|
32
|
+
nonInteractive,
|
|
33
|
+
sessionManager: this.sessionManager,
|
|
34
|
+
}),
|
|
35
|
+
];
|
|
20
36
|
}));
|
|
21
37
|
return Object.fromEntries(contextValuePairs);
|
|
22
38
|
}
|
|
@@ -24,7 +40,7 @@ class EasCommand extends core_1.Command {
|
|
|
24
40
|
async run() {
|
|
25
41
|
await (0, rudderstackClient_1.initAsync)();
|
|
26
42
|
// this is needed for logEvent call below as it identifies the user in the analytics system
|
|
27
|
-
await
|
|
43
|
+
await this.sessionManager.getUserAsync();
|
|
28
44
|
(0, rudderstackClient_1.logEvent)(rudderstackClient_1.AnalyticsEvent.ACTION, {
|
|
29
45
|
// id is assigned by oclif in constructor based on the filepath:
|
|
30
46
|
// commands/submit === submit, commands/build/list === build:list
|
|
@@ -41,10 +57,24 @@ class EasCommand extends core_1.Command {
|
|
|
41
57
|
exports.default = EasCommand;
|
|
42
58
|
EasCommand.ContextOptions = {
|
|
43
59
|
/**
|
|
44
|
-
* Require this command to be run when logged-in. Returns the logged-in actor
|
|
60
|
+
* Require this command to be run when logged-in. Returns the logged-in actor and a logged-in
|
|
61
|
+
* graphql client in the context.
|
|
45
62
|
*/
|
|
46
63
|
LoggedIn: {
|
|
47
|
-
|
|
64
|
+
loggedIn: new LoggedInContextField_1.default(),
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Do not require this command to be run when logged-in, but if it is get the logged-in actor and a
|
|
68
|
+
* maybe-logged-in graphql client.
|
|
69
|
+
*/
|
|
70
|
+
MaybeLoggedIn: {
|
|
71
|
+
maybeLoggedIn: new MaybeLoggedInContextField_1.default(),
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Specify this context requirement if the command needs to mutate the user session.
|
|
75
|
+
*/
|
|
76
|
+
SessionManagment: {
|
|
77
|
+
sessionManager: new SessionManagementContextField_1.default(),
|
|
48
78
|
},
|
|
49
79
|
/**
|
|
50
80
|
* Require the project to be identified and registered on server if this command is being
|
|
@@ -7,5 +7,5 @@ export declare type DynamicConfigContextFn = (options?: ExpoConfigOptions) => Pr
|
|
|
7
7
|
projectDir: string;
|
|
8
8
|
}>;
|
|
9
9
|
export declare class DynamicProjectConfigContextField extends ContextField<DynamicConfigContextFn> {
|
|
10
|
-
getValueAsync({ nonInteractive }: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
10
|
+
getValueAsync({ nonInteractive, sessionManager, }: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
11
11
|
}
|
|
@@ -7,11 +7,11 @@ const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
|
7
7
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
8
8
|
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
9
9
|
class DynamicProjectConfigContextField extends ContextField_1.default {
|
|
10
|
-
async getValueAsync({ nonInteractive }) {
|
|
10
|
+
async getValueAsync({ nonInteractive, sessionManager, }) {
|
|
11
11
|
return async (options) => {
|
|
12
12
|
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
13
13
|
const expBefore = (0, expoConfig_1.getExpoConfig)(projectDir, options);
|
|
14
|
-
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(expBefore, {
|
|
14
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
15
15
|
nonInteractive,
|
|
16
16
|
env: options === null || options === void 0 ? void 0 : options.env,
|
|
17
17
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Actor } from '../../user/User';
|
|
2
|
+
import ContextField, { ContextOptions } from './ContextField';
|
|
3
|
+
import { ExpoGraphqlClient } from './contextUtils/createGraphqlClient';
|
|
4
|
+
export default class LoggedInContextField extends ContextField<{
|
|
5
|
+
actor: Actor;
|
|
6
|
+
graphqlClient: ExpoGraphqlClient;
|
|
7
|
+
}> {
|
|
8
|
+
getValueAsync({ nonInteractive, sessionManager }: ContextOptions): Promise<{
|
|
9
|
+
actor: Actor;
|
|
10
|
+
graphqlClient: ExpoGraphqlClient;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
5
|
+
const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
6
|
+
class LoggedInContextField extends ContextField_1.default {
|
|
7
|
+
async getValueAsync({ nonInteractive, sessionManager }) {
|
|
8
|
+
const { actor, authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
9
|
+
nonInteractive,
|
|
10
|
+
});
|
|
11
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
12
|
+
return { actor, graphqlClient };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = LoggedInContextField;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Actor } from '../../user/User';
|
|
2
|
+
import ContextField, { ContextOptions } from './ContextField';
|
|
3
|
+
import { ExpoGraphqlClient } from './contextUtils/createGraphqlClient';
|
|
4
|
+
export default class MaybeLoggedInContextField extends ContextField<{
|
|
5
|
+
actor: Actor | null;
|
|
6
|
+
graphqlClient: ExpoGraphqlClient;
|
|
7
|
+
}> {
|
|
8
|
+
getValueAsync({ sessionManager }: ContextOptions): Promise<{
|
|
9
|
+
actor: Actor | null;
|
|
10
|
+
graphqlClient: ExpoGraphqlClient;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
5
|
+
const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
6
|
+
class MaybeLoggedInContextField extends ContextField_1.default {
|
|
7
|
+
async getValueAsync({ sessionManager }) {
|
|
8
|
+
const authenticationInfo = {
|
|
9
|
+
accessToken: sessionManager.getAccessToken(),
|
|
10
|
+
sessionSecret: sessionManager.getSessionSecret(),
|
|
11
|
+
};
|
|
12
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
13
|
+
const actor = await sessionManager.getUserAsync();
|
|
14
|
+
return { actor: actor !== null && actor !== void 0 ? actor : null, graphqlClient };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = MaybeLoggedInContextField;
|
|
@@ -5,7 +5,7 @@ export declare class OptionalProjectConfigContextField extends ContextField<{
|
|
|
5
5
|
exp: ExpoConfig;
|
|
6
6
|
projectDir: string;
|
|
7
7
|
} | undefined> {
|
|
8
|
-
getValueAsync({ nonInteractive }: ContextOptions): Promise<{
|
|
8
|
+
getValueAsync({ nonInteractive, sessionManager }: ContextOptions): Promise<{
|
|
9
9
|
projectId: string;
|
|
10
10
|
exp: ExpoConfig;
|
|
11
11
|
projectDir: string;
|
|
@@ -8,7 +8,7 @@ const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
|
8
8
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
9
9
|
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
10
10
|
class OptionalProjectConfigContextField extends ContextField_1.default {
|
|
11
|
-
async getValueAsync({ nonInteractive }) {
|
|
11
|
+
async getValueAsync({ nonInteractive, sessionManager }) {
|
|
12
12
|
let projectDir;
|
|
13
13
|
try {
|
|
14
14
|
projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
@@ -23,7 +23,7 @@ class OptionalProjectConfigContextField extends ContextField_1.default {
|
|
|
23
23
|
return undefined;
|
|
24
24
|
}
|
|
25
25
|
const expBefore = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
26
|
-
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(expBefore, {
|
|
26
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
27
27
|
nonInteractive,
|
|
28
28
|
});
|
|
29
29
|
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
@@ -5,7 +5,7 @@ export default class ProjectConfigContextField extends ContextField<{
|
|
|
5
5
|
exp: ExpoConfig;
|
|
6
6
|
projectDir: string;
|
|
7
7
|
}> {
|
|
8
|
-
getValueAsync({ nonInteractive }: ContextOptions): Promise<{
|
|
8
|
+
getValueAsync({ nonInteractive, sessionManager }: ContextOptions): Promise<{
|
|
9
9
|
projectId: string;
|
|
10
10
|
exp: ExpoConfig;
|
|
11
11
|
projectDir: string;
|
|
@@ -6,10 +6,10 @@ const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
|
6
6
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
7
7
|
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
8
8
|
class ProjectConfigContextField extends ContextField_1.default {
|
|
9
|
-
async getValueAsync({ nonInteractive }) {
|
|
9
|
+
async getValueAsync({ nonInteractive, sessionManager }) {
|
|
10
10
|
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
11
11
|
const expBefore = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
12
|
-
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(expBefore, {
|
|
12
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
13
13
|
nonInteractive,
|
|
14
14
|
});
|
|
15
15
|
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import SessionManager from '../../user/SessionManager';
|
|
2
|
+
import ContextField, { ContextOptions } from './ContextField';
|
|
3
|
+
export default class SessionManagementContextField extends ContextField<SessionManager> {
|
|
4
|
+
getValueAsync({ sessionManager }: ContextOptions): Promise<SessionManager>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
5
|
+
class SessionManagementContextField extends ContextField_1.default {
|
|
6
|
+
async getValueAsync({ sessionManager }) {
|
|
7
|
+
return sessionManager;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.default = SessionManagementContextField;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Client, OperationContext, OperationResult, PromisifiedSource, TypedDocumentNode } from '@urql/core';
|
|
2
|
+
import { DocumentNode } from 'graphql';
|
|
3
|
+
export interface ExpoGraphqlClient extends Client {
|
|
4
|
+
query<Data = any, Variables extends object = object>(query: DocumentNode | TypedDocumentNode<Data, Variables> | string, variables: Variables | undefined, context: Partial<OperationContext> & {
|
|
5
|
+
additionalTypenames: string[];
|
|
6
|
+
}): PromisifiedSource<OperationResult<Data, Variables>>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createGraphqlClient(authInfo: {
|
|
9
|
+
accessToken: string | null;
|
|
10
|
+
sessionSecret: string | null;
|
|
11
|
+
}): ExpoGraphqlClient;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createGraphqlClient = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@urql/core");
|
|
6
|
+
const exchange_retry_1 = require("@urql/exchange-retry");
|
|
7
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
8
|
+
const api_1 = require("../../../api");
|
|
9
|
+
const fetch_1 = require("../../../fetch");
|
|
10
|
+
function createGraphqlClient(authInfo) {
|
|
11
|
+
return (0, core_1.createClient)({
|
|
12
|
+
url: (0, api_1.getExpoApiBaseUrl)() + '/graphql',
|
|
13
|
+
exchanges: [
|
|
14
|
+
core_1.dedupExchange,
|
|
15
|
+
core_1.cacheExchange,
|
|
16
|
+
(0, exchange_retry_1.retryExchange)({
|
|
17
|
+
maxDelayMs: 4000,
|
|
18
|
+
retryIf: (err, operation) => {
|
|
19
|
+
return !!(err &&
|
|
20
|
+
!operation.context.noRetry &&
|
|
21
|
+
(err.networkError || err.graphQLErrors.some(e => { var _a; return (_a = e === null || e === void 0 ? void 0 : e.extensions) === null || _a === void 0 ? void 0 : _a.isTransient; })));
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
core_1.fetchExchange,
|
|
25
|
+
],
|
|
26
|
+
// @ts-expect-error Type 'typeof fetch' is not assignable to type '(input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>'.
|
|
27
|
+
fetch: node_fetch_1.default,
|
|
28
|
+
fetchOptions: () => {
|
|
29
|
+
const headers = {};
|
|
30
|
+
if (authInfo.accessToken) {
|
|
31
|
+
headers.authorization = `Bearer ${authInfo.accessToken}`;
|
|
32
|
+
}
|
|
33
|
+
else if (authInfo.sessionSecret) {
|
|
34
|
+
headers['expo-session'] = authInfo.sessionSecret;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
...(fetch_1.httpsProxyAgent ? { agent: fetch_1.httpsProxyAgent } : {}),
|
|
38
|
+
headers,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.createGraphqlClient = createGraphqlClient;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config-types';
|
|
2
2
|
import { Env } from '@expo/eas-build-job';
|
|
3
|
+
import SessionManager from '../../../user/SessionManager';
|
|
3
4
|
/**
|
|
4
5
|
* Save an EAS project ID to the appropriate field in the app config.
|
|
5
6
|
*
|
|
@@ -18,7 +19,7 @@ export declare function saveProjectIdToAppConfigAsync(projectDir: string, projec
|
|
|
18
19
|
*
|
|
19
20
|
* @deprecated Should not be used outside of context functions.
|
|
20
21
|
*/
|
|
21
|
-
export declare function getProjectIdAsync(exp: ExpoConfig, options: {
|
|
22
|
+
export declare function getProjectIdAsync(sessionManager: SessionManager, exp: ExpoConfig, options: {
|
|
22
23
|
env?: Env;
|
|
23
24
|
nonInteractive: boolean;
|
|
24
25
|
}): Promise<string>;
|
|
@@ -10,7 +10,7 @@ const ora_1 = require("../../../ora");
|
|
|
10
10
|
const expoConfig_1 = require("../../../project/expoConfig");
|
|
11
11
|
const fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1 = require("../../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync");
|
|
12
12
|
const projectUtils_1 = require("../../../project/projectUtils");
|
|
13
|
-
const
|
|
13
|
+
const createGraphqlClient_1 = require("./createGraphqlClient");
|
|
14
14
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./findProjectDirAndVerifyProjectSetupAsync");
|
|
15
15
|
/**
|
|
16
16
|
* Save an EAS project ID to the appropriate field in the app config.
|
|
@@ -54,12 +54,19 @@ exports.saveProjectIdToAppConfigAsync = saveProjectIdToAppConfigAsync;
|
|
|
54
54
|
*
|
|
55
55
|
* @deprecated Should not be used outside of context functions.
|
|
56
56
|
*/
|
|
57
|
-
async function getProjectIdAsync(exp, options) {
|
|
57
|
+
async function getProjectIdAsync(sessionManager, exp, options) {
|
|
58
58
|
var _a, _b;
|
|
59
|
+
// all codepaths in this function require a logged-in user with access to the owning account
|
|
60
|
+
// since they either query the app via graphql or create it, which includes getting info about
|
|
61
|
+
// the owner
|
|
62
|
+
const { actor, authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
63
|
+
nonInteractive: options.nonInteractive,
|
|
64
|
+
});
|
|
65
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
59
66
|
const localProjectId = (_b = (_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas) === null || _b === void 0 ? void 0 : _b.projectId;
|
|
60
67
|
if (localProjectId) {
|
|
61
68
|
// check that the local project ID matches account and slug
|
|
62
|
-
const appForProjectId = await AppQuery_1.AppQuery.byIdAsync(localProjectId);
|
|
69
|
+
const appForProjectId = await AppQuery_1.AppQuery.byIdAsync(graphqlClient, localProjectId);
|
|
63
70
|
if (exp.owner && exp.owner !== appForProjectId.ownerAccount.name) {
|
|
64
71
|
throw new Error(`Project config: Project identified by "extra.eas.projectId" (${appForProjectId.ownerAccount.name}) is not owned by owner specified in the "owner" field (${exp.owner}). ${(0, log_1.learnMore)('https://expo.fyi/eas-project-id')}`);
|
|
65
72
|
}
|
|
@@ -84,10 +91,7 @@ async function getProjectIdAsync(exp, options) {
|
|
|
84
91
|
throw new Error('The "owner" manifest property is required when using robot users. See: https://docs.expo.dev/versions/latest/config/app/#owner');
|
|
85
92
|
}
|
|
86
93
|
};
|
|
87
|
-
const
|
|
88
|
-
nonInteractive: options.nonInteractive,
|
|
89
|
-
});
|
|
90
|
-
const projectId = await (0, fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync)({
|
|
94
|
+
const projectId = await (0, fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync)(graphqlClient, {
|
|
91
95
|
accountName: getAccountNameForEASProjectSync(exp, actor),
|
|
92
96
|
projectName: exp.slug,
|
|
93
97
|
privacy: (0, projectUtils_1.toAppPrivacy)(exp.privacy),
|
|
@@ -2,5 +2,8 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountLogin extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
+
static contextDefinition: {
|
|
6
|
+
sessionManager: import("../../commandUtils/context/SessionManagementContextField").default;
|
|
7
|
+
};
|
|
5
8
|
runAsync(): Promise<void>;
|
|
6
9
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
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 EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
5
|
-
const ensureLoggedInAsync_1 = require("../../commandUtils/context/contextUtils/ensureLoggedInAsync");
|
|
6
6
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
7
7
|
class AccountLogin extends EasCommand_1.default {
|
|
8
8
|
async runAsync() {
|
|
9
|
-
await (
|
|
9
|
+
const { sessionManager } = await this.getContextAsync(AccountLogin, { nonInteractive: false });
|
|
10
|
+
await sessionManager.showLoginPromptAsync();
|
|
10
11
|
log_1.default.log('Logged in');
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
exports.default = AccountLogin;
|
|
15
|
+
_a = AccountLogin;
|
|
14
16
|
AccountLogin.description = 'log in with your Expo account';
|
|
15
17
|
AccountLogin.aliases = ['login'];
|
|
18
|
+
AccountLogin.contextDefinition = {
|
|
19
|
+
..._a.ContextOptions.SessionManagment,
|
|
20
|
+
};
|
|
@@ -2,5 +2,8 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountLogout extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
+
static contextDefinition: {
|
|
6
|
+
sessionManager: import("../../commandUtils/context/SessionManagementContextField").default;
|
|
7
|
+
};
|
|
5
8
|
runAsync(): Promise<void>;
|
|
6
9
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
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 EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
5
6
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
6
|
-
const User_1 = require("../../user/User");
|
|
7
7
|
class AccountLogout extends EasCommand_1.default {
|
|
8
8
|
async runAsync() {
|
|
9
|
-
await (
|
|
9
|
+
const { sessionManager } = await this.getContextAsync(AccountLogout, { nonInteractive: false });
|
|
10
|
+
await sessionManager.logoutAsync();
|
|
10
11
|
log_1.default.log('Logged out');
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
exports.default = AccountLogout;
|
|
15
|
+
_a = AccountLogout;
|
|
14
16
|
AccountLogout.description = 'log out';
|
|
15
17
|
AccountLogout.aliases = ['logout'];
|
|
18
|
+
AccountLogout.contextDefinition = {
|
|
19
|
+
..._a.ContextOptions.SessionManagment,
|
|
20
|
+
};
|
|
@@ -2,5 +2,8 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountView extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
+
static contextDefinition: {
|
|
6
|
+
maybeLoggedIn: import("../../commandUtils/context/MaybeLoggedInContextField").default;
|
|
7
|
+
};
|
|
5
8
|
runAsync(): Promise<void>;
|
|
6
9
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
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 chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
@@ -7,9 +8,9 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
7
8
|
const User_1 = require("../../user/User");
|
|
8
9
|
class AccountView extends EasCommand_1.default {
|
|
9
10
|
async runAsync() {
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
log_1.default.log(chalk_1.default.green((0, User_1.getActorDisplayName)(
|
|
11
|
+
const { maybeLoggedIn: { actor }, } = await this.getContextAsync(AccountView, { nonInteractive: true });
|
|
12
|
+
if (actor) {
|
|
13
|
+
log_1.default.log(chalk_1.default.green((0, User_1.getActorDisplayName)(actor)));
|
|
13
14
|
}
|
|
14
15
|
else {
|
|
15
16
|
log_1.default.warn('Not logged in');
|
|
@@ -18,5 +19,9 @@ class AccountView extends EasCommand_1.default {
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
exports.default = AccountView;
|
|
22
|
+
_a = AccountView;
|
|
21
23
|
AccountView.description = 'show the username you are logged in as';
|
|
22
24
|
AccountView.aliases = ['whoami'];
|
|
25
|
+
AccountView.contextDefinition = {
|
|
26
|
+
..._a.ContextOptions.MaybeLoggedIn,
|
|
27
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
3
|
import { CreateUpdateBranchForAppMutationVariables, UpdateBranch } from '../../graphql/generated';
|
|
3
|
-
export declare function createUpdateBranchOnAppAsync({ appId, name
|
|
4
|
+
export declare function createUpdateBranchOnAppAsync(graphqlClient: ExpoGraphqlClient, { appId, name }: CreateUpdateBranchForAppMutationVariables): Promise<Pick<UpdateBranch, 'id' | 'name'>>;
|
|
4
5
|
export default class BranchCreate extends EasCommand {
|
|
5
6
|
static description: string;
|
|
6
7
|
static args: {
|
|
@@ -13,6 +14,7 @@ export default class BranchCreate extends EasCommand {
|
|
|
13
14
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
};
|
|
15
16
|
static contextDefinition: {
|
|
17
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
16
18
|
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
17
19
|
};
|
|
18
20
|
runAsync(): Promise<void>;
|
|
@@ -13,8 +13,8 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
13
13
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
14
14
|
const prompts_1 = require("../../prompts");
|
|
15
15
|
const json_1 = require("../../utils/json");
|
|
16
|
-
async function createUpdateBranchOnAppAsync({ appId, name
|
|
17
|
-
const result = await (0, client_1.withErrorHandlingAsync)(
|
|
16
|
+
async function createUpdateBranchOnAppAsync(graphqlClient, { appId, name }) {
|
|
17
|
+
const result = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
18
18
|
.mutation((0, graphql_tag_1.default) `
|
|
19
19
|
mutation createUpdateBranchForApp($appId: ID!, $name: String!) {
|
|
20
20
|
updateBranch {
|
|
@@ -39,13 +39,13 @@ exports.createUpdateBranchOnAppAsync = createUpdateBranchOnAppAsync;
|
|
|
39
39
|
class BranchCreate extends EasCommand_1.default {
|
|
40
40
|
async runAsync() {
|
|
41
41
|
let { args: { name }, flags: { json: jsonFlag, 'non-interactive': nonInteractive }, } = await this.parse(BranchCreate);
|
|
42
|
-
const { projectConfig: { projectId }, } = await this.getContextAsync(BranchCreate, {
|
|
42
|
+
const { projectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(BranchCreate, {
|
|
43
43
|
nonInteractive,
|
|
44
44
|
});
|
|
45
45
|
if (jsonFlag) {
|
|
46
46
|
(0, json_1.enableJsonOutput)();
|
|
47
47
|
}
|
|
48
|
-
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
|
|
48
|
+
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
|
|
49
49
|
if (!name) {
|
|
50
50
|
const validationMessage = 'Branch name may not be empty.';
|
|
51
51
|
if (nonInteractive) {
|
|
@@ -59,7 +59,7 @@ class BranchCreate extends EasCommand_1.default {
|
|
|
59
59
|
validate: value => (value ? true : validationMessage),
|
|
60
60
|
}));
|
|
61
61
|
}
|
|
62
|
-
const newBranch = await createUpdateBranchOnAppAsync({ appId: projectId, name });
|
|
62
|
+
const newBranch = await createUpdateBranchOnAppAsync(graphqlClient, { appId: projectId, name });
|
|
63
63
|
if (jsonFlag) {
|
|
64
64
|
(0, json_1.printJsonOnlyOutput)(newBranch);
|
|
65
65
|
}
|
|
@@ -83,4 +83,5 @@ BranchCreate.flags = {
|
|
|
83
83
|
};
|
|
84
84
|
BranchCreate.contextDefinition = {
|
|
85
85
|
..._a.ContextOptions.ProjectConfig,
|
|
86
|
+
..._a.ContextOptions.LoggedIn,
|
|
86
87
|
};
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class BranchDelete extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static contextDefinition: {
|
|
5
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
5
6
|
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
6
7
|
};
|
|
7
8
|
static args: {
|