From e0083ccf1eb1b94b4ec588650c9c80fcfcb1bfa3 Mon Sep 17 00:00:00 2001 From: Quinlan Jung Date: Sun, 5 Jan 2025 12:31:51 -0800 Subject: [PATCH] [eas-cli] upload local project fingerprint --- packages/eas-cli/graphql-codegen.yml | 2 +- packages/eas-cli/graphql.schema.json | 1070 ++++++++++++++--- .../src/commands/fingerprint/compare.ts | 16 + packages/eas-cli/src/graphql/generated.ts | 102 +- .../graphql/mutations/FingerprintMutation.ts | 39 + 5 files changed, 1029 insertions(+), 200 deletions(-) create mode 100644 packages/eas-cli/src/graphql/mutations/FingerprintMutation.ts diff --git a/packages/eas-cli/graphql-codegen.yml b/packages/eas-cli/graphql-codegen.yml index 69e7315c47..e26f1b6951 100644 --- a/packages/eas-cli/graphql-codegen.yml +++ b/packages/eas-cli/graphql-codegen.yml @@ -1,5 +1,5 @@ overwrite: true -schema: 'https://staging-api.expo.dev/graphql' +schema: 'http://localhost:3000/graphql' documents: - 'src/graphql/**/!(*.d).{ts,tsx}' - 'src/credentials/ios/api/graphql/**/!(*.d).{ts,tsx}' diff --git a/packages/eas-cli/graphql.schema.json b/packages/eas-cli/graphql.schema.json index e99613d5ff..f189ff3b40 100644 --- a/packages/eas-cli/graphql.schema.json +++ b/packages/eas-cli/graphql.schema.json @@ -1777,6 +1777,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "isFreeAppDevDomainTier", + "description": "Whether an Account plan falls into AppDevDomainName's free or paid tier", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "isSSOEnabled", "description": "Whether this account has SSO enabled. Can be queried by all members.", @@ -1865,6 +1881,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "profileImageUrl", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "pushSecurityEnabled", "description": null, @@ -10309,6 +10341,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "usageMetrics", + "description": "Project query object for querying EAS usage metrics", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AppUsageMetrics", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "username", "description": null, @@ -13404,6 +13452,321 @@ ], "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "AppUsageMetric", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metricType", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "UsageMetricType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "serviceMetric", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "EASServiceMetric", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timestamp", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AppUsageMetricTotal", + "description": null, + "fields": [ + { + "name": "billingPeriod", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BillingPeriod", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "planMetrics", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "EstimatedUsage", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCost", + "description": "Total cost of overages, in cents", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AppUsageMetrics", + "description": null, + "fields": [ + { + "name": "byBillingPeriod", + "description": null, + "args": [ + { + "name": "date", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "service", + "description": null, + "type": { + "kind": "ENUM", + "name": "EASService", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AppUsageMetricTotal", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metricsForServiceMetric", + "description": null, + "args": [ + { + "name": "filterParams", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSONObject", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "granularity", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "UsageMetricsGranularity", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "serviceMetric", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "EASServiceMetric", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timespan", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UsageMetricsTimespan", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AppUsageMetric", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "AppVersion", @@ -22289,6 +22652,26 @@ "description": null, "fields": null, "inputFields": [ + { + "name": "crashKind", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "WorkerDeploymentCrashKind", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "name", "description": null, @@ -22723,6 +23106,45 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "CreateFingerprintInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "hash", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "source", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "FingerprintSourceInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "CreateGitHubAppInstallationInput", @@ -28656,6 +29078,66 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "FingerprintMutation", + "description": null, + "fields": [ + { + "name": "createOrGetExistingFingerprint", + "description": "Create an fingeprint for an App", + "args": [ + { + "name": "appId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fingerprintData", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateFingerprintInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Fingerprint", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "FingerprintSource", @@ -38120,6 +38602,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "environment", + "description": null, + "type": { + "kind": "ENUM", + "name": "EnvironmentVariableEnvironment", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "excludedAssets", "description": null, @@ -38404,6 +38898,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "isLimitExceeded", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "isVerifiedBot", "description": null, @@ -38955,6 +39461,30 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "githubAppInstallations", + "description": "GitHub App Installations that manage this actor", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GitHubAppInstallation", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": null, @@ -38987,6 +39517,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "isManagedByGitHubApp", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "lastDeletionAttemptTime", "description": null, @@ -39761,6 +40307,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "fingerprint", + "description": "Mutations that modify App fingerprints", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "FingerprintMutation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "githubApp", "description": "Mutations that utilize services facilitated by the GitHub App", @@ -44251,7 +44813,7 @@ "inputFields": [ { "name": "bucketKey", - "description": "Required if the archive source type is GCS_BUILD_APPLICATION_ARCHIVE or GCS_SUBMIT_ARCHIVE", + "description": "Required if the archive source type is GCS_BUILD_APPLICATION_ARCHIVE, GCS_BUILD_APPLICATION_ARCHIVE_ORCHESTRATOR or GCS_SUBMIT_ARCHIVE", "type": { "kind": "SCALAR", "name": "String", @@ -44308,6 +44870,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "GCS_BUILD_APPLICATION_ARCHIVE_ORCHESTRATOR", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "GCS_SUBMIT_ARCHIVE", "description": null, @@ -45454,6 +46022,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "environment", + "description": null, + "args": [], + "type": { + "kind": "ENUM", + "name": "EnvironmentVariableEnvironment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "expoGoSDKVersion", "description": null, @@ -53034,120 +53614,15 @@ "deprecationReason": null }, { - "name": "crashes", - "description": null, - "args": [ - { - "name": "filters", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "CrashesFilters", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timespan", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "DatasetTimespan", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "WorkerDeploymentCrashes", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createdAt", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deploymentDomain", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deploymentIdentifier", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "WorkerDeploymentIdentifier", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "devDomainName", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DevDomainName", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", + "name": "app", "description": null, "args": [], "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "ID", + "kind": "OBJECT", + "name": "App", "ofType": null } }, @@ -53155,60 +53630,7 @@ "deprecationReason": null }, { - "name": "initiatingActor", - "description": null, - "args": [], - "type": { - "kind": "INTERFACE", - "name": "Actor", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "logs", - "description": null, - "args": [ - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": "500", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timespan", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "LogsTimespan", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "WorkerDeploymentLogs", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "requests", + "name": "crashes", "description": null, "args": [ { @@ -53216,7 +53638,7 @@ "description": null, "type": { "kind": "INPUT_OBJECT", - "name": "RequestsFilters", + "name": "CrashesFilters", "ofType": null }, "defaultValue": null, @@ -53242,14 +53664,30 @@ ], "type": { "kind": "OBJECT", - "name": "WorkerDeploymentRequests", + "name": "WorkerDeploymentCrashes", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "subdomain", + "name": "createdAt", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deploymentDomain", "description": null, "args": [], "type": { @@ -53265,17 +53703,163 @@ "deprecationReason": null }, { - "name": "tier", + "name": "deploymentIdentifier", "description": null, "args": [], "type": { - "kind": "ENUM", - "name": "WorkerDeploymentTier", + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "WorkerDeploymentIdentifier", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "devDomainName", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DevDomainName", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "initiatingActor", + "description": null, + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logs", + "description": null, + "args": [ + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "500", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timespan", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "LogsTimespan", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "WorkerDeploymentLogs", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, + { + "name": "requests", + "description": null, + "args": [ + { + "name": "filters", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "RequestsFilters", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timespan", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DatasetTimespan", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "WorkerDeploymentRequests", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subdomain", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "url", "description": null, @@ -53612,6 +54196,53 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "ENUM", + "name": "WorkerDeploymentCrashKind", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "EXCEEDED_CPU", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "EXCEEDED_MEMORY", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "EXCEEDED_SUBREQUESTS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "GENERIC", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERNAL", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RESPONSE_STREAM_DISCONNECTED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "OBJECT", "name": "WorkerDeploymentCrashNode", @@ -53633,6 +54264,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "crashKind", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "WorkerDeploymentCrashKind", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "crashTimestamp", "description": null, @@ -54700,6 +55347,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "isLimitExceeded", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "isRejected", "description": null, @@ -55838,6 +56501,34 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "limitExceededPerMs", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limitExceededSum", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "requestsPerMs", "description": null, @@ -56559,29 +57250,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "ENUM", - "name": "WorkerDeploymentTier", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "FREE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PAID", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, { "kind": "OBJECT", "name": "WorkerDeploymentsConnection", @@ -57380,6 +58048,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "DEPLOY", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "GET_BUILD", "description": null, @@ -57435,6 +58109,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "packageJsonBucketKey", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "projectArchiveBucketKey", "description": null, diff --git a/packages/eas-cli/src/commands/fingerprint/compare.ts b/packages/eas-cli/src/commands/fingerprint/compare.ts index aba5720e1c..d0ca2d398a 100644 --- a/packages/eas-cli/src/commands/fingerprint/compare.ts +++ b/packages/eas-cli/src/commands/fingerprint/compare.ts @@ -7,10 +7,12 @@ import { fetchBuildsAsync, formatBuild } from '../../commandUtils/builds'; import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient'; import { EasNonInteractiveAndJsonFlags } from '../../commandUtils/flags'; import { AppPlatform, BuildStatus } from '../../graphql/generated'; +import { FingerprintMutation } from '../../graphql/mutations/FingerprintMutation'; import { BuildQuery } from '../../graphql/queries/BuildQuery'; import Log from '../../log'; import { ora } from '../../ora'; import { RequestedPlatform } from '../../platform'; +import { maybeUploadFingerprintAsync } from '../../project/maybeUploadFingerprintAsync'; import { getDisplayNameForProjectIdAsync } from '../../project/projectUtils'; import { resolveWorkflowPerPlatformAsync } from '../../project/workflow'; import { selectAsync } from '../../prompts'; @@ -95,6 +97,20 @@ export default class FingerprintCompare extends EasCommand { Log.error('Project fingerprints can only be computed for projects with SDK 52 or higher'); return; } + + const uploadedFingerprint = await maybeUploadFingerprintAsync({ + hash: fingerprint.hash, + fingerprint: { + fingerprintSources: fingerprint.sources, + isDebugFingerprintSource: isDebug, + }, + graphqlClient, + }); + await FingerprintMutation.createFingerprintAsync(graphqlClient, projectId, { + hash: uploadedFingerprint.hash, + source: uploadedFingerprint.fingerprintSource, + }); + if (fingerprint.hash === projectFingerprint.hash) { Log.log(`✅ Project fingerprint matches build`); return; diff --git a/packages/eas-cli/src/graphql/generated.ts b/packages/eas-cli/src/graphql/generated.ts index f19fa907df..b940893ec9 100644 --- a/packages/eas-cli/src/graphql/generated.ts +++ b/packages/eas-cli/src/graphql/generated.ts @@ -133,6 +133,8 @@ export type Account = { id: Scalars['ID']['output']; isCurrent: Scalars['Boolean']['output']; isDisabled: Scalars['Boolean']['output']; + /** Whether an Account plan falls into AppDevDomainName's free or paid tier */ + isFreeAppDevDomainTier: Scalars['Boolean']['output']; /** Whether this account has SSO enabled. Can be queried by all members. */ isSSOEnabled: Scalars['Boolean']['output']; lastDeletionAttemptTime?: Maybe; @@ -143,6 +145,7 @@ export type Account = { owner?: Maybe; /** Owning UserActor of this account if personal account */ ownerUserActor?: Maybe; + profileImageUrl: Scalars['String']['output']; pushSecurityEnabled: Scalars['Boolean']['output']; /** @deprecated Legacy access tokens are deprecated */ requiresAccessTokenForPushSecurity: Scalars['Boolean']['output']; @@ -1366,6 +1369,8 @@ export type App = Project & { /** EAS updates owned by an app */ updates: Array; updatesPaginated: AppUpdatesConnection; + /** Project query object for querying EAS usage metrics */ + usageMetrics: AppUsageMetrics; /** @deprecated Use ownerAccount.name instead */ username: Scalars['String']['output']; /** @deprecated No longer supported */ @@ -2053,6 +2058,44 @@ export enum AppUploadSessionType { ProfileImageUpload = 'PROFILE_IMAGE_UPLOAD' } +export type AppUsageMetric = { + __typename?: 'AppUsageMetric'; + id: Scalars['ID']['output']; + metricType: UsageMetricType; + serviceMetric: EasServiceMetric; + timestamp: Scalars['DateTime']['output']; + value: Scalars['Float']['output']; +}; + +export type AppUsageMetricTotal = { + __typename?: 'AppUsageMetricTotal'; + billingPeriod: BillingPeriod; + id: Scalars['ID']['output']; + planMetrics: Array; + /** Total cost of overages, in cents */ + totalCost: Scalars['Float']['output']; +}; + +export type AppUsageMetrics = { + __typename?: 'AppUsageMetrics'; + byBillingPeriod: AppUsageMetricTotal; + metricsForServiceMetric: Array; +}; + + +export type AppUsageMetricsByBillingPeriodArgs = { + date: Scalars['DateTime']['input']; + service?: InputMaybe; +}; + + +export type AppUsageMetricsMetricsForServiceMetricArgs = { + filterParams?: InputMaybe; + granularity: UsageMetricsGranularity; + serviceMetric: EasServiceMetric; + timespan: UsageMetricsTimespan; +}; + /** Represents Play Store/App Store version of an application */ export type AppVersion = { __typename?: 'AppVersion'; @@ -3294,6 +3337,7 @@ export enum CrashSampleFor { } export type CrashesFilters = { + crashKind?: InputMaybe>; name?: InputMaybe>; }; @@ -3346,6 +3390,11 @@ export type CreateEnvironmentVariableInput = { visibility: EnvironmentVariableVisibility; }; +export type CreateFingerprintInput = { + hash: Scalars['String']['input']; + source?: InputMaybe; +}; + export type CreateGitHubAppInstallationInput = { accountId: Scalars['ID']['input']; installationIdentifier: Scalars['Int']['input']; @@ -4199,6 +4248,18 @@ export type FingerprintInfoGroup = { web?: InputMaybe; }; +export type FingerprintMutation = { + __typename?: 'FingerprintMutation'; + /** Create an fingeprint for an App */ + createOrGetExistingFingerprint: Fingerprint; +}; + + +export type FingerprintMutationCreateOrGetExistingFingerprintArgs = { + appId: Scalars['ID']['input']; + fingerprintData: CreateFingerprintInput; +}; + export type FingerprintSource = { __typename?: 'FingerprintSource'; bucketKey: Scalars['String']['output']; @@ -5512,6 +5573,7 @@ export type PublicArtifacts = { export type PublishUpdateGroupInput = { awaitingCodeSigningInfo?: InputMaybe; branchId: Scalars['String']['input']; + environment?: InputMaybe; excludedAssets?: InputMaybe>; fingerprintInfoGroup?: InputMaybe; gitCommitHash?: InputMaybe; @@ -5541,6 +5603,7 @@ export type RequestsFilters = { hasCustomDomainOrigin?: InputMaybe; isAsset?: InputMaybe; isCrash?: InputMaybe; + isLimitExceeded?: InputMaybe; isVerifiedBot?: InputMaybe; method?: InputMaybe>; os?: InputMaybe>; @@ -5617,8 +5680,11 @@ export type Robot = Actor & { */ featureGates: Scalars['JSONObject']['output']; firstName?: Maybe; + /** GitHub App Installations that manage this actor */ + githubAppInstallations: Array; id: Scalars['ID']['output']; isExpoAdmin: Scalars['Boolean']['output']; + isManagedByGitHubApp: Scalars['Boolean']['output']; lastDeletionAttemptTime?: Maybe; }; @@ -5731,6 +5797,8 @@ export type RootMutation = { environmentSecret: EnvironmentSecretMutation; /** Mutations that create and delete EnvironmentVariables */ environmentVariable: EnvironmentVariableMutation; + /** Mutations that modify App fingerprints */ + fingerprint: FingerprintMutation; /** Mutations that utilize services facilitated by the GitHub App */ githubApp: GitHubAppMutation; /** Mutations for GitHub App installations */ @@ -6383,7 +6451,7 @@ export enum SubmissionAndroidTrack { } export type SubmissionArchiveSourceInput = { - /** Required if the archive source type is GCS_BUILD_APPLICATION_ARCHIVE or GCS_SUBMIT_ARCHIVE */ + /** Required if the archive source type is GCS_BUILD_APPLICATION_ARCHIVE, GCS_BUILD_APPLICATION_ARCHIVE_ORCHESTRATOR or GCS_SUBMIT_ARCHIVE */ bucketKey?: InputMaybe; type: SubmissionArchiveSourceType; /** Required if the archive source type is URL */ @@ -6392,6 +6460,7 @@ export type SubmissionArchiveSourceInput = { export enum SubmissionArchiveSourceType { GcsBuildApplicationArchive = 'GCS_BUILD_APPLICATION_ARCHIVE', + GcsBuildApplicationArchiveOrchestrator = 'GCS_BUILD_APPLICATION_ARCHIVE_ORCHESTRATOR', GcsSubmitArchive = 'GCS_SUBMIT_ARCHIVE', Url = 'URL' } @@ -6549,6 +6618,7 @@ export type Update = ActivityTimelineProjectActivity & { codeSigningInfo?: Maybe; createdAt: Scalars['DateTime']['output']; deployments: DeploymentResult; + environment?: Maybe; expoGoSDKVersion?: Maybe; fingerprint?: Maybe; gitCommitHash?: Maybe; @@ -7641,6 +7711,7 @@ export type WorkerDeployment = ActivityTimelineProjectActivity & { activityTimestamp: Scalars['DateTime']['output']; actor?: Maybe; aliases?: Maybe>; + app: App; crashes?: Maybe; createdAt: Scalars['DateTime']['output']; deploymentDomain: Scalars['String']['output']; @@ -7651,7 +7722,6 @@ export type WorkerDeployment = ActivityTimelineProjectActivity & { logs?: Maybe; requests?: Maybe; subdomain: Scalars['String']['output']; - tier?: Maybe; url: Scalars['String']['output']; }; @@ -7705,9 +7775,19 @@ export type WorkerDeploymentCrashEdge = { request?: Maybe; }; +export enum WorkerDeploymentCrashKind { + ExceededCpu = 'EXCEEDED_CPU', + ExceededMemory = 'EXCEEDED_MEMORY', + ExceededSubrequests = 'EXCEEDED_SUBREQUESTS', + Generic = 'GENERIC', + Internal = 'INTERNAL', + ResponseStreamDisconnected = 'RESPONSE_STREAM_DISCONNECTED' +} + export type WorkerDeploymentCrashNode = { __typename?: 'WorkerDeploymentCrashNode'; crashHash: Scalars['ID']['output']; + crashKind: WorkerDeploymentCrashKind; crashTimestamp: Scalars['DateTime']['output']; deploymentIdentifier: Scalars['String']['output']; firstStackLine?: Maybe; @@ -7819,6 +7899,7 @@ export type WorkerDeploymentRequestNode = { hasCustomDomainOrigin: Scalars['Boolean']['output']; isAsset: Scalars['Boolean']['output']; isCrash: Scalars['Boolean']['output']; + isLimitExceeded: Scalars['Boolean']['output']; isRejected: Scalars['Boolean']['output']; isStaleIfError: Scalars['Boolean']['output']; isStaleWhileRevalidate: Scalars['Boolean']['output']; @@ -7929,6 +8010,8 @@ export type WorkerDeploymentRequestsAggregationNode = { durationP50: Scalars['Float']['output']; durationP90: Scalars['Float']['output']; durationP99: Scalars['Float']['output']; + limitExceededPerMs?: Maybe; + limitExceededSum: Scalars['Int']['output']; requestsPerMs?: Maybe; requestsSum: Scalars['Int']['output']; sampleRate?: Maybe; @@ -8004,11 +8087,6 @@ export type WorkerDeploymentRequestsTimeseriesEdge = { timestamp: Scalars['DateTime']['output']; }; -export enum WorkerDeploymentTier { - Free = 'FREE', - Paid = 'PAID' -} - export type WorkerDeploymentsConnection = { __typename?: 'WorkerDeploymentsConnection'; edges: Array; @@ -8112,6 +8190,7 @@ export enum WorkflowJobType { AppleDeviceRegistrationRequest = 'APPLE_DEVICE_REGISTRATION_REQUEST', Build = 'BUILD', Custom = 'CUSTOM', + Deploy = 'DEPLOY', GetBuild = 'GET_BUILD', MaestroTest = 'MAESTRO_TEST', RequireApproval = 'REQUIRE_APPROVAL', @@ -8121,6 +8200,7 @@ export enum WorkflowJobType { export type WorkflowProjectSourceInput = { easJsonBucketKey: Scalars['String']['input']; + packageJsonBucketKey?: InputMaybe; projectArchiveBucketKey: Scalars['String']['input']; type: WorkflowProjectSourceType; }; @@ -8926,6 +9006,14 @@ export type CreateBulkEnvironmentVariablesForAppMutationVariables = Exact<{ export type CreateBulkEnvironmentVariablesForAppMutation = { __typename?: 'RootMutation', environmentVariable: { __typename?: 'EnvironmentVariableMutation', createBulkEnvironmentVariablesForApp: Array<{ __typename?: 'EnvironmentVariable', id: string }> } }; +export type CreateFingeprintMutationVariables = Exact<{ + fingerprintData: CreateFingerprintInput; + appId: Scalars['ID']['input']; +}>; + + +export type CreateFingeprintMutation = { __typename?: 'RootMutation', fingerprint: { __typename?: 'FingerprintMutation', createOrGetExistingFingerprint: { __typename?: 'Fingerprint', id: string, hash: string, debugInfoUrl?: string | null } } }; + export type CreateKeystoreGenerationUrlMutationVariables = Exact<{ [key: string]: never; }>; diff --git a/packages/eas-cli/src/graphql/mutations/FingerprintMutation.ts b/packages/eas-cli/src/graphql/mutations/FingerprintMutation.ts new file mode 100644 index 0000000000..87c8023b27 --- /dev/null +++ b/packages/eas-cli/src/graphql/mutations/FingerprintMutation.ts @@ -0,0 +1,39 @@ +import { FingerprintSource } from '@expo/eas-build-job'; +import { print } from 'graphql'; +import gql from 'graphql-tag'; + +import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient'; +import { withErrorHandlingAsync } from '../client'; +import { CreateFingeprintMutation, FingerprintFragment } from '../generated'; +import { FingerprintFragmentNode } from '../types/Fingerprint'; + +export const FingerprintMutation = { + async createFingerprintAsync( + graphqlClient: ExpoGraphqlClient, + appId: string, + fingerprintData: { hash: string; source?: FingerprintSource } + ): Promise { + const data = await withErrorHandlingAsync( + graphqlClient + .mutation( + gql` + mutation CreateFingeprintMutation( + $fingerprintData: CreateFingerprintInput! + $appId: ID! + ) { + fingerprint { + createOrGetExistingFingerprint(fingerprintData: $fingerprintData, appId: $appId) { + id + ...FingerprintFragment + } + } + } + ${print(FingerprintFragmentNode)} + `, + { appId, fingerprintData } + ) + .toPromise() + ); + return data.fingerprint.createOrGetExistingFingerprint; + }, +};