eas-cli 7.1.3 → 7.3.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 +60 -61
- package/build/build/local.js +1 -1
- package/build/commands/project/init.js +13 -1
- package/build/commands/update/index.d.ts +0 -1
- package/build/commands/update/index.js +9 -9
- package/build/commands/update/roll-back-to-embedded.js +6 -1
- package/build/credentials/android/actions/{AssignGoogleServiceAccountKey.d.ts → AssignGoogleServiceAccountKeyForFcmV1.d.ts} +1 -1
- package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForFcmV1.js +19 -0
- package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForSubmissions.d.ts +8 -0
- package/build/credentials/android/actions/{AssignGoogleServiceAccountKey.js → AssignGoogleServiceAccountKeyForSubmissions.js} +3 -3
- package/build/credentials/android/actions/CreateGoogleServiceAccountKey.js +1 -1
- package/build/credentials/android/actions/{SetUpGoogleServiceAccountKey.d.ts → SetUpGoogleServiceAccountKeyForFcmV1.d.ts} +1 -1
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.js +59 -0
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.d.ts +10 -0
- package/build/credentials/android/actions/{SetUpGoogleServiceAccountKey.js → SetUpGoogleServiceAccountKeyForSubmissions.js} +5 -5
- package/build/credentials/android/api/GraphqlClient.d.ts +2 -1
- package/build/credentials/android/api/GraphqlClient.js +5 -1
- package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.d.ts +1 -0
- package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.js +26 -0
- package/build/credentials/android/utils/googleServiceAccountKey.js +1 -1
- package/build/credentials/android/utils/printCredentials.js +24 -2
- package/build/credentials/manager/Actions.d.ts +22 -16
- package/build/credentials/manager/Actions.js +22 -16
- package/build/credentials/manager/AndroidActions.d.ts +3 -1
- package/build/credentials/manager/AndroidActions.js +46 -12
- package/build/credentials/manager/ManageAndroid.js +30 -12
- package/build/graphql/generated.d.ts +160 -0
- package/build/graphql/types/credentials/AndroidAppCredentials.js +4 -0
- package/build/project/customBuildConfig.js +1 -1
- package/build/project/publish.d.ts +7 -3
- package/build/project/publish.js +43 -24
- package/build/submit/android/ServiceAccountSource.js +2 -2
- package/build/utils/expoUpdatesCli.d.ts +1 -0
- package/build/utils/expoUpdatesCli.js +37 -0
- package/oclif.manifest.json +1 -7
- package/package.json +6 -6
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssignGoogleServiceAccountKeyForFcmV1 = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
6
|
+
class AssignGoogleServiceAccountKeyForFcmV1 {
|
|
7
|
+
constructor(app) {
|
|
8
|
+
this.app = app;
|
|
9
|
+
}
|
|
10
|
+
async runAsync(ctx, googleServiceAccountKey) {
|
|
11
|
+
const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(ctx.graphqlClient, this.app);
|
|
12
|
+
const updatedAppCredentials = await ctx.android.updateAndroidAppCredentialsAsync(ctx.graphqlClient, appCredentials, {
|
|
13
|
+
googleServiceAccountKeyForFcmV1Id: googleServiceAccountKey.id,
|
|
14
|
+
});
|
|
15
|
+
log_1.default.succeed(`Google Service Account Key assigned to ${this.app.androidApplicationIdentifier} for FCM V1`);
|
|
16
|
+
return updatedAppCredentials;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.AssignGoogleServiceAccountKeyForFcmV1 = AssignGoogleServiceAccountKeyForFcmV1;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommonAndroidAppCredentialsFragment, GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
|
|
2
|
+
import { CredentialsContext } from '../../context';
|
|
3
|
+
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
|
+
export declare class AssignGoogleServiceAccountKeyForSubmissions {
|
|
5
|
+
private app;
|
|
6
|
+
constructor(app: AppLookupParams);
|
|
7
|
+
runAsync(ctx: CredentialsContext, googleServiceAccountKey: GoogleServiceAccountKeyFragment): Promise<CommonAndroidAppCredentialsFragment>;
|
|
8
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AssignGoogleServiceAccountKeyForSubmissions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
6
|
-
class
|
|
6
|
+
class AssignGoogleServiceAccountKeyForSubmissions {
|
|
7
7
|
constructor(app) {
|
|
8
8
|
this.app = app;
|
|
9
9
|
}
|
|
@@ -16,4 +16,4 @@ class AssignGoogleServiceAccountKey {
|
|
|
16
16
|
return updatedAppCredentials;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
exports.
|
|
19
|
+
exports.AssignGoogleServiceAccountKeyForSubmissions = AssignGoogleServiceAccountKeyForSubmissions;
|
|
@@ -35,7 +35,7 @@ class CreateGoogleServiceAccountKey {
|
|
|
35
35
|
if (detectedPath) {
|
|
36
36
|
return detectedPath;
|
|
37
37
|
}
|
|
38
|
-
log_1.default.log(`${chalk_1.default.bold('A Google Service Account JSON key is required
|
|
38
|
+
log_1.default.log(`${chalk_1.default.bold('A Google Service Account JSON key is required for uploading your app to Google Play Store, and for sending Android Notifications via FCM V1.')}.\n` +
|
|
39
39
|
`If you're not sure what this is or how to create one, ${(0, log_1.learnMore)('https://expo.fyi/creating-google-service-account', { learnMoreMessage: 'learn more' })}`);
|
|
40
40
|
const { filePath } = await (0, prompts_1.promptAsync)({
|
|
41
41
|
name: 'filePath',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonAndroidAppCredentialsFragment } from '../../../graphql/generated';
|
|
2
2
|
import { CredentialsContext } from '../../context';
|
|
3
3
|
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class SetUpGoogleServiceAccountKeyForFcmV1 {
|
|
5
5
|
private app;
|
|
6
6
|
constructor(app: AppLookupParams);
|
|
7
7
|
runAsync(ctx: CredentialsContext): Promise<CommonAndroidAppCredentialsFragment>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetUpGoogleServiceAccountKeyForFcmV1 = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
|
+
const AssignGoogleServiceAccountKeyForFcmV1_1 = require("./AssignGoogleServiceAccountKeyForFcmV1");
|
|
7
|
+
const CreateGoogleServiceAccountKey_1 = require("./CreateGoogleServiceAccountKey");
|
|
8
|
+
const UseExistingGoogleServiceAccountKey_1 = require("./UseExistingGoogleServiceAccountKey");
|
|
9
|
+
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
10
|
+
const prompts_1 = require("../../../prompts");
|
|
11
|
+
const errors_1 = require("../../errors");
|
|
12
|
+
class SetUpGoogleServiceAccountKeyForFcmV1 {
|
|
13
|
+
constructor(app) {
|
|
14
|
+
this.app = app;
|
|
15
|
+
}
|
|
16
|
+
async runAsync(ctx) {
|
|
17
|
+
const isKeySetup = await this.isGoogleServiceAccountKeySetupAsync(ctx);
|
|
18
|
+
if (isKeySetup) {
|
|
19
|
+
log_1.default.succeed('Google Service Account Key for FCM V1 already set up.');
|
|
20
|
+
return (0, nullthrows_1.default)(await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app), 'androidAppCredentials cannot be null if google service account key is already set up');
|
|
21
|
+
}
|
|
22
|
+
if (ctx.nonInteractive) {
|
|
23
|
+
throw new errors_1.MissingCredentialsNonInteractiveError('Google Service Account Keys cannot be set up in --non-interactive mode.');
|
|
24
|
+
}
|
|
25
|
+
const keysForAccount = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(ctx.graphqlClient, this.app.account);
|
|
26
|
+
let googleServiceAccountKey = null;
|
|
27
|
+
if (keysForAccount.length === 0) {
|
|
28
|
+
googleServiceAccountKey = await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(this.app.account).runAsync(ctx);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
googleServiceAccountKey = await this.createOrUseExistingKeyAsync(ctx);
|
|
32
|
+
}
|
|
33
|
+
return await new AssignGoogleServiceAccountKeyForFcmV1_1.AssignGoogleServiceAccountKeyForFcmV1(this.app).runAsync(ctx, googleServiceAccountKey);
|
|
34
|
+
}
|
|
35
|
+
async isGoogleServiceAccountKeySetupAsync(ctx) {
|
|
36
|
+
const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
|
|
37
|
+
return !!(appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.googleServiceAccountKeyForFcmV1);
|
|
38
|
+
}
|
|
39
|
+
async createOrUseExistingKeyAsync(ctx) {
|
|
40
|
+
var _a;
|
|
41
|
+
const { action } = await (0, prompts_1.promptAsync)({
|
|
42
|
+
type: 'select',
|
|
43
|
+
name: 'action',
|
|
44
|
+
message: 'Select the Google Service Account Key to use for FCM V1:',
|
|
45
|
+
choices: [
|
|
46
|
+
{
|
|
47
|
+
title: '[Choose an existing key]',
|
|
48
|
+
value: 'CHOOSE_EXISTING',
|
|
49
|
+
},
|
|
50
|
+
{ title: '[Upload a new service account key]', value: 'GENERATE' },
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
if (action === 'GENERATE') {
|
|
54
|
+
return await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(this.app.account).runAsync(ctx);
|
|
55
|
+
}
|
|
56
|
+
return ((_a = (await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(this.app.account).runAsync(ctx))) !== null && _a !== void 0 ? _a : (await this.createOrUseExistingKeyAsync(ctx)));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.SetUpGoogleServiceAccountKeyForFcmV1 = SetUpGoogleServiceAccountKeyForFcmV1;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommonAndroidAppCredentialsFragment } from '../../../graphql/generated';
|
|
2
|
+
import { CredentialsContext } from '../../context';
|
|
3
|
+
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
|
+
export declare class SetUpGoogleServiceAccountKeyForSubmissions {
|
|
5
|
+
private app;
|
|
6
|
+
constructor(app: AppLookupParams);
|
|
7
|
+
runAsync(ctx: CredentialsContext): Promise<CommonAndroidAppCredentialsFragment>;
|
|
8
|
+
private isGoogleServiceAccountKeySetupAsync;
|
|
9
|
+
private createOrUseExistingKeyAsync;
|
|
10
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SetUpGoogleServiceAccountKeyForSubmissions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
|
-
const
|
|
6
|
+
const AssignGoogleServiceAccountKeyForSubmissions_1 = require("./AssignGoogleServiceAccountKeyForSubmissions");
|
|
7
7
|
const CreateGoogleServiceAccountKey_1 = require("./CreateGoogleServiceAccountKey");
|
|
8
8
|
const UseExistingGoogleServiceAccountKey_1 = require("./UseExistingGoogleServiceAccountKey");
|
|
9
9
|
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
10
10
|
const prompts_1 = require("../../../prompts");
|
|
11
11
|
const errors_1 = require("../../errors");
|
|
12
|
-
class
|
|
12
|
+
class SetUpGoogleServiceAccountKeyForSubmissions {
|
|
13
13
|
constructor(app) {
|
|
14
14
|
this.app = app;
|
|
15
15
|
}
|
|
@@ -30,7 +30,7 @@ class SetUpGoogleServiceAccountKey {
|
|
|
30
30
|
else {
|
|
31
31
|
googleServiceAccountKey = await this.createOrUseExistingKeyAsync(ctx);
|
|
32
32
|
}
|
|
33
|
-
return await new
|
|
33
|
+
return await new AssignGoogleServiceAccountKeyForSubmissions_1.AssignGoogleServiceAccountKeyForSubmissions(this.app).runAsync(ctx, googleServiceAccountKey);
|
|
34
34
|
}
|
|
35
35
|
async isGoogleServiceAccountKeySetupAsync(ctx) {
|
|
36
36
|
const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
|
|
@@ -56,4 +56,4 @@ class SetUpGoogleServiceAccountKey {
|
|
|
56
56
|
return ((_a = (await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(this.app.account).runAsync(ctx))) !== null && _a !== void 0 ? _a : (await this.createOrUseExistingKeyAsync(ctx)));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
exports.
|
|
59
|
+
exports.SetUpGoogleServiceAccountKeyForSubmissions = SetUpGoogleServiceAccountKeyForSubmissions;
|
|
@@ -11,9 +11,10 @@ export declare function getAndroidAppBuildCredentialsListAsync(graphqlClient: Ex
|
|
|
11
11
|
export declare function getLegacyAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment | null>;
|
|
12
12
|
export declare function getLegacyAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment | null>;
|
|
13
13
|
export declare function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment>;
|
|
14
|
-
export declare function updateAndroidAppCredentialsAsync(graphqlClient: ExpoGraphqlClient, appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }: {
|
|
14
|
+
export declare function updateAndroidAppCredentialsAsync(graphqlClient: ExpoGraphqlClient, appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, googleServiceAccountKeyForSubmissionsId, googleServiceAccountKeyForFcmV1Id, }: {
|
|
15
15
|
androidFcmId?: string;
|
|
16
16
|
googleServiceAccountKeyForSubmissionsId?: string;
|
|
17
|
+
googleServiceAccountKeyForFcmV1Id?: string;
|
|
17
18
|
}): Promise<CommonAndroidAppCredentialsFragment>;
|
|
18
19
|
export declare function updateAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, buildCredentials: AndroidAppBuildCredentialsFragment, { androidKeystoreId, }: {
|
|
19
20
|
androidKeystoreId: string;
|
|
@@ -50,7 +50,7 @@ async function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
exports.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync = createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync;
|
|
53
|
-
async function updateAndroidAppCredentialsAsync(graphqlClient, appCredentials, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }) {
|
|
53
|
+
async function updateAndroidAppCredentialsAsync(graphqlClient, appCredentials, { androidFcmId, googleServiceAccountKeyForSubmissionsId, googleServiceAccountKeyForFcmV1Id, }) {
|
|
54
54
|
let updatedAppCredentials = appCredentials;
|
|
55
55
|
if (androidFcmId) {
|
|
56
56
|
updatedAppCredentials = await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setFcmKeyAsync(graphqlClient, appCredentials.id, androidFcmId);
|
|
@@ -59,6 +59,10 @@ async function updateAndroidAppCredentialsAsync(graphqlClient, appCredentials, {
|
|
|
59
59
|
updatedAppCredentials =
|
|
60
60
|
await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setGoogleServiceAccountKeyForSubmissionsAsync(graphqlClient, appCredentials.id, googleServiceAccountKeyForSubmissionsId);
|
|
61
61
|
}
|
|
62
|
+
if (googleServiceAccountKeyForFcmV1Id) {
|
|
63
|
+
updatedAppCredentials =
|
|
64
|
+
await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setGoogleServiceAccountKeyForFcmV1Async(graphqlClient, appCredentials.id, googleServiceAccountKeyForFcmV1Id);
|
|
65
|
+
}
|
|
62
66
|
return updatedAppCredentials;
|
|
63
67
|
}
|
|
64
68
|
exports.updateAndroidAppCredentialsAsync = updateAndroidAppCredentialsAsync;
|
|
@@ -6,4 +6,5 @@ export declare const AndroidAppCredentialsMutation: {
|
|
|
6
6
|
}, appId: string, applicationIdentifier: string): Promise<CommonAndroidAppCredentialsFragment>;
|
|
7
7
|
setFcmKeyAsync(graphqlClient: ExpoGraphqlClient, androidAppCredentialsId: string, fcmId: string): Promise<CommonAndroidAppCredentialsFragment>;
|
|
8
8
|
setGoogleServiceAccountKeyForSubmissionsAsync(graphqlClient: ExpoGraphqlClient, androidAppCredentialsId: string, googleServiceAccountKeyId: string): Promise<CommonAndroidAppCredentialsFragment>;
|
|
9
|
+
setGoogleServiceAccountKeyForFcmV1Async(graphqlClient: ExpoGraphqlClient, androidAppCredentialsId: string, googleServiceAccountKeyId: string): Promise<CommonAndroidAppCredentialsFragment>;
|
|
9
10
|
};
|
|
@@ -83,4 +83,30 @@ exports.AndroidAppCredentialsMutation = {
|
|
|
83
83
|
(0, assert_1.default)(data.androidAppCredentials.setGoogleServiceAccountKeyForSubmissions, 'GraphQL: `setGoogleServiceAccountKeyForSubmissions` not defined in server response');
|
|
84
84
|
return data.androidAppCredentials.setGoogleServiceAccountKeyForSubmissions;
|
|
85
85
|
},
|
|
86
|
+
async setGoogleServiceAccountKeyForFcmV1Async(graphqlClient, androidAppCredentialsId, googleServiceAccountKeyId) {
|
|
87
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
88
|
+
.mutation((0, graphql_tag_1.default) `
|
|
89
|
+
mutation SetGoogleServiceAccountKeyForFcmV1Mutation(
|
|
90
|
+
$androidAppCredentialsId: ID!
|
|
91
|
+
$googleServiceAccountKeyId: ID!
|
|
92
|
+
) {
|
|
93
|
+
androidAppCredentials {
|
|
94
|
+
setGoogleServiceAccountKeyForFcmV1(
|
|
95
|
+
id: $androidAppCredentialsId
|
|
96
|
+
googleServiceAccountKeyId: $googleServiceAccountKeyId
|
|
97
|
+
) {
|
|
98
|
+
id
|
|
99
|
+
...CommonAndroidAppCredentialsFragment
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
${(0, graphql_1.print)(AndroidAppCredentials_1.CommonAndroidAppCredentialsFragmentNode)}
|
|
104
|
+
`, {
|
|
105
|
+
androidAppCredentialsId,
|
|
106
|
+
googleServiceAccountKeyId,
|
|
107
|
+
})
|
|
108
|
+
.toPromise());
|
|
109
|
+
(0, assert_1.default)(data.androidAppCredentials.setGoogleServiceAccountKeyForFcmV1, 'GraphQL: `setGoogleServiceAccountKeyForFcmV1` not defined in server response');
|
|
110
|
+
return data.androidAppCredentials.setGoogleServiceAccountKeyForFcmV1;
|
|
111
|
+
},
|
|
86
112
|
};
|
|
@@ -74,7 +74,7 @@ function formatGoogleServiceAccountKey({ projectIdentifier, privateKeyIdentifier
|
|
|
74
74
|
async function detectGoogleServiceAccountKeyPathAsync(projectDir) {
|
|
75
75
|
const foundFilePaths = await (0, fast_glob_1.default)('**/*.json', {
|
|
76
76
|
cwd: projectDir,
|
|
77
|
-
ignore: ['app.json', 'package*.json', 'tsconfig.json', 'node_modules'],
|
|
77
|
+
ignore: ['app.json', 'package*.json', 'tsconfig.json', 'node_modules', 'google-services.json'],
|
|
78
78
|
});
|
|
79
79
|
const googleServiceFiles = foundFilePaths
|
|
80
80
|
.map(file => path_1.default.join(projectDir, file))
|
|
@@ -22,7 +22,7 @@ function displayEmptyAndroidCredentials(appLookupParams) {
|
|
|
22
22
|
exports.displayEmptyAndroidCredentials = displayEmptyAndroidCredentials;
|
|
23
23
|
function displayAndroidFcmCredentials(appCredentials) {
|
|
24
24
|
const maybeFcm = appCredentials.androidFcm;
|
|
25
|
-
log_1.default.log((0, formatFields_1.default)([{ label: 'Push Notifications (FCM)', value: '' }], {
|
|
25
|
+
log_1.default.log((0, formatFields_1.default)([{ label: 'Push Notifications (FCM Legacy)', value: '' }], {
|
|
26
26
|
labelFormat: chalk_1.default.cyan.bold,
|
|
27
27
|
}));
|
|
28
28
|
if (!maybeFcm) {
|
|
@@ -49,7 +49,28 @@ function displayAndroidFcmCredentials(appCredentials) {
|
|
|
49
49
|
}
|
|
50
50
|
function displayGoogleServiceAccountKeyForSubmissions(appCredentials) {
|
|
51
51
|
const maybeGsaKey = appCredentials.googleServiceAccountKeyForSubmissions;
|
|
52
|
-
log_1.default.log((0, formatFields_1.default)([{ label: 'Google Service Account Key
|
|
52
|
+
log_1.default.log((0, formatFields_1.default)([{ label: 'Submissions: Google Service Account Key for Play Store Submissions', value: '' }], {
|
|
53
|
+
labelFormat: chalk_1.default.cyan.bold,
|
|
54
|
+
}));
|
|
55
|
+
if (!maybeGsaKey) {
|
|
56
|
+
log_1.default.log((0, formatFields_1.default)([{ label: '', value: 'None assigned yet' }]));
|
|
57
|
+
log_1.default.newLine();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const { projectIdentifier, privateKeyIdentifier, clientEmail, clientIdentifier, updatedAt } = maybeGsaKey;
|
|
61
|
+
const fields = [
|
|
62
|
+
{ label: 'Project ID', value: projectIdentifier },
|
|
63
|
+
{ label: 'Client Email', value: clientEmail },
|
|
64
|
+
{ label: 'Client ID', value: clientIdentifier },
|
|
65
|
+
{ label: 'Private Key ID', value: privateKeyIdentifier },
|
|
66
|
+
{ label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` },
|
|
67
|
+
];
|
|
68
|
+
log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
|
|
69
|
+
log_1.default.newLine();
|
|
70
|
+
}
|
|
71
|
+
function displayGoogleServiceAccountKeyForFcmV1(appCredentials) {
|
|
72
|
+
const maybeGsaKey = appCredentials.googleServiceAccountKeyForFcmV1;
|
|
73
|
+
log_1.default.log((0, formatFields_1.default)([{ label: 'Push Notifications (FCM V1): Google Service Account Key For FCM V1', value: '' }], {
|
|
53
74
|
labelFormat: chalk_1.default.cyan.bold,
|
|
54
75
|
}));
|
|
55
76
|
if (!maybeGsaKey) {
|
|
@@ -70,6 +91,7 @@ function displayGoogleServiceAccountKeyForSubmissions(appCredentials) {
|
|
|
70
91
|
}
|
|
71
92
|
function displayEASAndroidAppCredentials(appCredentials) {
|
|
72
93
|
displayAndroidFcmCredentials(appCredentials);
|
|
94
|
+
displayGoogleServiceAccountKeyForFcmV1(appCredentials);
|
|
73
95
|
displayGoogleServiceAccountKeyForSubmissions(appCredentials);
|
|
74
96
|
const sortedBuildCredentialsList = (0, BuildCredentialsUtils_1.sortBuildCredentials)(appCredentials.androidAppBuildCredentialsList);
|
|
75
97
|
for (const buildCredentials of sortedBuildCredentialsList) {
|
|
@@ -11,22 +11,28 @@ export declare enum Scope {
|
|
|
11
11
|
export declare enum AndroidActionType {
|
|
12
12
|
ManageBuildCredentials = 0,
|
|
13
13
|
ManageFcm = 1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
ManageGoogleServiceAccountKeyForSubmissions = 2,
|
|
15
|
+
ManageGoogleServiceAccount = 3,
|
|
16
|
+
ManageGoogleServiceAccountKeyForFcmV1 = 4,
|
|
17
|
+
ManageCredentialsJson = 5,
|
|
18
|
+
GoBackToCaller = 6,
|
|
19
|
+
GoBackToHighLevelActions = 7,
|
|
20
|
+
CreateKeystore = 8,
|
|
21
|
+
SetDefaultKeystore = 9,
|
|
22
|
+
DownloadKeystore = 10,
|
|
23
|
+
RemoveKeystore = 11,
|
|
24
|
+
CreateFcm = 12,
|
|
25
|
+
RemoveFcm = 13,
|
|
26
|
+
CreateGsaKey = 14,
|
|
27
|
+
UseExistingGsaKeyForSubmissions = 15,
|
|
28
|
+
RemoveGsaKey = 16,
|
|
29
|
+
SetUpGsaKeyForSubmissions = 17,
|
|
30
|
+
CreateGsaKeyForFcmV1 = 18,
|
|
31
|
+
UseExistingGsaKeyForFcmV1 = 19,
|
|
32
|
+
RemoveGsaKeyForFcmV1 = 20,
|
|
33
|
+
SetUpGsaKeyForFcmV1 = 21,
|
|
34
|
+
UpdateCredentialsJson = 22,
|
|
35
|
+
SetUpBuildCredentialsFromCredentialsJson = 23
|
|
30
36
|
}
|
|
31
37
|
export declare enum IosActionType {
|
|
32
38
|
ManageCredentialsJson = 0,
|
|
@@ -11,22 +11,28 @@ var AndroidActionType;
|
|
|
11
11
|
(function (AndroidActionType) {
|
|
12
12
|
AndroidActionType[AndroidActionType["ManageBuildCredentials"] = 0] = "ManageBuildCredentials";
|
|
13
13
|
AndroidActionType[AndroidActionType["ManageFcm"] = 1] = "ManageFcm";
|
|
14
|
-
AndroidActionType[AndroidActionType["
|
|
15
|
-
AndroidActionType[AndroidActionType["
|
|
16
|
-
AndroidActionType[AndroidActionType["
|
|
17
|
-
AndroidActionType[AndroidActionType["
|
|
18
|
-
AndroidActionType[AndroidActionType["
|
|
19
|
-
AndroidActionType[AndroidActionType["
|
|
20
|
-
AndroidActionType[AndroidActionType["
|
|
21
|
-
AndroidActionType[AndroidActionType["
|
|
22
|
-
AndroidActionType[AndroidActionType["
|
|
23
|
-
AndroidActionType[AndroidActionType["
|
|
24
|
-
AndroidActionType[AndroidActionType["
|
|
25
|
-
AndroidActionType[AndroidActionType["
|
|
26
|
-
AndroidActionType[AndroidActionType["
|
|
27
|
-
AndroidActionType[AndroidActionType["
|
|
28
|
-
AndroidActionType[AndroidActionType["
|
|
29
|
-
AndroidActionType[AndroidActionType["
|
|
14
|
+
AndroidActionType[AndroidActionType["ManageGoogleServiceAccountKeyForSubmissions"] = 2] = "ManageGoogleServiceAccountKeyForSubmissions";
|
|
15
|
+
AndroidActionType[AndroidActionType["ManageGoogleServiceAccount"] = 3] = "ManageGoogleServiceAccount";
|
|
16
|
+
AndroidActionType[AndroidActionType["ManageGoogleServiceAccountKeyForFcmV1"] = 4] = "ManageGoogleServiceAccountKeyForFcmV1";
|
|
17
|
+
AndroidActionType[AndroidActionType["ManageCredentialsJson"] = 5] = "ManageCredentialsJson";
|
|
18
|
+
AndroidActionType[AndroidActionType["GoBackToCaller"] = 6] = "GoBackToCaller";
|
|
19
|
+
AndroidActionType[AndroidActionType["GoBackToHighLevelActions"] = 7] = "GoBackToHighLevelActions";
|
|
20
|
+
AndroidActionType[AndroidActionType["CreateKeystore"] = 8] = "CreateKeystore";
|
|
21
|
+
AndroidActionType[AndroidActionType["SetDefaultKeystore"] = 9] = "SetDefaultKeystore";
|
|
22
|
+
AndroidActionType[AndroidActionType["DownloadKeystore"] = 10] = "DownloadKeystore";
|
|
23
|
+
AndroidActionType[AndroidActionType["RemoveKeystore"] = 11] = "RemoveKeystore";
|
|
24
|
+
AndroidActionType[AndroidActionType["CreateFcm"] = 12] = "CreateFcm";
|
|
25
|
+
AndroidActionType[AndroidActionType["RemoveFcm"] = 13] = "RemoveFcm";
|
|
26
|
+
AndroidActionType[AndroidActionType["CreateGsaKey"] = 14] = "CreateGsaKey";
|
|
27
|
+
AndroidActionType[AndroidActionType["UseExistingGsaKeyForSubmissions"] = 15] = "UseExistingGsaKeyForSubmissions";
|
|
28
|
+
AndroidActionType[AndroidActionType["RemoveGsaKey"] = 16] = "RemoveGsaKey";
|
|
29
|
+
AndroidActionType[AndroidActionType["SetUpGsaKeyForSubmissions"] = 17] = "SetUpGsaKeyForSubmissions";
|
|
30
|
+
AndroidActionType[AndroidActionType["CreateGsaKeyForFcmV1"] = 18] = "CreateGsaKeyForFcmV1";
|
|
31
|
+
AndroidActionType[AndroidActionType["UseExistingGsaKeyForFcmV1"] = 19] = "UseExistingGsaKeyForFcmV1";
|
|
32
|
+
AndroidActionType[AndroidActionType["RemoveGsaKeyForFcmV1"] = 20] = "RemoveGsaKeyForFcmV1";
|
|
33
|
+
AndroidActionType[AndroidActionType["SetUpGsaKeyForFcmV1"] = 21] = "SetUpGsaKeyForFcmV1";
|
|
34
|
+
AndroidActionType[AndroidActionType["UpdateCredentialsJson"] = 22] = "UpdateCredentialsJson";
|
|
35
|
+
AndroidActionType[AndroidActionType["SetUpBuildCredentialsFromCredentialsJson"] = 23] = "SetUpBuildCredentialsFromCredentialsJson";
|
|
30
36
|
})(AndroidActionType || (exports.AndroidActionType = AndroidActionType = {}));
|
|
31
37
|
var IosActionType;
|
|
32
38
|
(function (IosActionType) {
|
|
@@ -3,4 +3,6 @@ export declare const highLevelActions: ActionInfo[];
|
|
|
3
3
|
export declare const credentialsJsonActions: ActionInfo[];
|
|
4
4
|
export declare const buildCredentialsActions: ActionInfo[];
|
|
5
5
|
export declare const fcmActions: ActionInfo[];
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const gsaKeyActionsForFcmV1: ActionInfo[];
|
|
7
|
+
export declare const gsaKeyActionsForSubmissions: ActionInfo[];
|
|
8
|
+
export declare const gsaActions: ActionInfo[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.gsaActions = exports.gsaKeyActionsForSubmissions = exports.gsaKeyActionsForFcmV1 = exports.fcmActions = exports.buildCredentialsActions = exports.credentialsJsonActions = exports.highLevelActions = void 0;
|
|
4
4
|
const Actions_1 = require("./Actions");
|
|
5
5
|
exports.highLevelActions = [
|
|
6
6
|
{
|
|
@@ -9,13 +9,13 @@ exports.highLevelActions = [
|
|
|
9
9
|
scope: Actions_1.Scope.Manager,
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
value: Actions_1.AndroidActionType.
|
|
13
|
-
title: '
|
|
12
|
+
value: Actions_1.AndroidActionType.ManageGoogleServiceAccount,
|
|
13
|
+
title: 'Google Service Account',
|
|
14
14
|
scope: Actions_1.Scope.Manager,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
value: Actions_1.AndroidActionType.
|
|
18
|
-
title: '
|
|
17
|
+
value: Actions_1.AndroidActionType.ManageFcm,
|
|
18
|
+
title: 'Push Notifications (Legacy): Manage your FCM (Legacy) API Key',
|
|
19
19
|
scope: Actions_1.Scope.Manager,
|
|
20
20
|
},
|
|
21
21
|
{
|
|
@@ -90,20 +90,54 @@ exports.fcmActions = [
|
|
|
90
90
|
scope: Actions_1.Scope.Manager,
|
|
91
91
|
},
|
|
92
92
|
];
|
|
93
|
-
exports.
|
|
93
|
+
exports.gsaKeyActionsForFcmV1 = [
|
|
94
94
|
{
|
|
95
|
-
value: Actions_1.AndroidActionType.
|
|
96
|
-
title: 'Set up a Google Service Account Key',
|
|
95
|
+
value: Actions_1.AndroidActionType.SetUpGsaKeyForFcmV1,
|
|
96
|
+
title: 'Set up a Google Service Account Key for Push Notifications (FCM V1)',
|
|
97
97
|
scope: Actions_1.Scope.Project,
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
|
-
value: Actions_1.AndroidActionType.
|
|
101
|
-
title: '
|
|
100
|
+
value: Actions_1.AndroidActionType.UseExistingGsaKeyForFcmV1,
|
|
101
|
+
title: 'Select an existing Google Service Account Key for Push Notifications (FCM V1)',
|
|
102
|
+
scope: Actions_1.Scope.Project,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
value: Actions_1.AndroidActionType.GoBackToHighLevelActions,
|
|
106
|
+
title: 'Go back',
|
|
107
|
+
scope: Actions_1.Scope.Manager,
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
exports.gsaKeyActionsForSubmissions = [
|
|
111
|
+
{
|
|
112
|
+
value: Actions_1.AndroidActionType.SetUpGsaKeyForSubmissions,
|
|
113
|
+
title: 'Set up a Google Service Account Key for Play Store Submissions',
|
|
114
|
+
scope: Actions_1.Scope.Project,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
value: Actions_1.AndroidActionType.UseExistingGsaKeyForSubmissions,
|
|
118
|
+
title: 'Select an existing Google Service Account Key for Play Store Submissions',
|
|
102
119
|
scope: Actions_1.Scope.Project,
|
|
103
120
|
},
|
|
104
121
|
{
|
|
105
|
-
value: Actions_1.AndroidActionType.
|
|
106
|
-
title: '
|
|
122
|
+
value: Actions_1.AndroidActionType.GoBackToHighLevelActions,
|
|
123
|
+
title: 'Go back',
|
|
124
|
+
scope: Actions_1.Scope.Manager,
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
exports.gsaActions = [
|
|
128
|
+
{
|
|
129
|
+
value: Actions_1.AndroidActionType.ManageGoogleServiceAccountKeyForSubmissions,
|
|
130
|
+
title: 'Manage your Google Service Account Key for Play Store Submissions',
|
|
131
|
+
scope: Actions_1.Scope.Manager,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: Actions_1.AndroidActionType.ManageGoogleServiceAccountKeyForFcmV1,
|
|
135
|
+
title: 'Manage your Google Service Account Key for Push Notifications (FCM V1)',
|
|
136
|
+
scope: Actions_1.Scope.Manager,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
value: Actions_1.AndroidActionType.CreateGsaKey,
|
|
140
|
+
title: 'Upload a Google Service Account Key',
|
|
107
141
|
scope: Actions_1.Scope.Project,
|
|
108
142
|
},
|
|
109
143
|
{
|
|
@@ -15,7 +15,8 @@ const log_1 = tslib_1.__importStar(require("../../log"));
|
|
|
15
15
|
const gradle_1 = require("../../project/android/gradle");
|
|
16
16
|
const prompts_1 = require("../../prompts");
|
|
17
17
|
const AssignFcm_1 = require("../android/actions/AssignFcm");
|
|
18
|
-
const
|
|
18
|
+
const AssignGoogleServiceAccountKeyForFcmV1_1 = require("../android/actions/AssignGoogleServiceAccountKeyForFcmV1");
|
|
19
|
+
const AssignGoogleServiceAccountKeyForSubmissions_1 = require("../android/actions/AssignGoogleServiceAccountKeyForSubmissions");
|
|
19
20
|
const BuildCredentialsUtils_1 = require("../android/actions/BuildCredentialsUtils");
|
|
20
21
|
const CreateFcm_1 = require("../android/actions/CreateFcm");
|
|
21
22
|
const CreateGoogleServiceAccountKey_1 = require("../android/actions/CreateGoogleServiceAccountKey");
|
|
@@ -24,7 +25,8 @@ const RemoveFcm_1 = require("../android/actions/RemoveFcm");
|
|
|
24
25
|
const RemoveGoogleServiceAccountKey_1 = require("../android/actions/RemoveGoogleServiceAccountKey");
|
|
25
26
|
const RemoveKeystore_1 = require("../android/actions/RemoveKeystore");
|
|
26
27
|
const SetUpBuildCredentialsFromCredentialsJson_1 = require("../android/actions/SetUpBuildCredentialsFromCredentialsJson");
|
|
27
|
-
const
|
|
28
|
+
const SetUpGoogleServiceAccountKeyForFcmV1_1 = require("../android/actions/SetUpGoogleServiceAccountKeyForFcmV1");
|
|
29
|
+
const SetUpGoogleServiceAccountKeyForSubmissions_1 = require("../android/actions/SetUpGoogleServiceAccountKeyForSubmissions");
|
|
28
30
|
const UpdateCredentialsJson_1 = require("../android/actions/UpdateCredentialsJson");
|
|
29
31
|
const UseExistingGoogleServiceAccountKey_1 = require("../android/actions/UseExistingGoogleServiceAccountKey");
|
|
30
32
|
const printCredentials_1 = require("../android/utils/printCredentials");
|
|
@@ -101,8 +103,16 @@ class ManageAndroid {
|
|
|
101
103
|
currentActions = AndroidActions_1.fcmActions;
|
|
102
104
|
continue;
|
|
103
105
|
}
|
|
104
|
-
else if (chosenAction === Actions_1.AndroidActionType.
|
|
105
|
-
currentActions = AndroidActions_1.
|
|
106
|
+
else if (chosenAction === Actions_1.AndroidActionType.ManageGoogleServiceAccount) {
|
|
107
|
+
currentActions = AndroidActions_1.gsaActions;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
else if (chosenAction === Actions_1.AndroidActionType.ManageGoogleServiceAccountKeyForSubmissions) {
|
|
111
|
+
currentActions = AndroidActions_1.gsaKeyActionsForSubmissions;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
else if (chosenAction === Actions_1.AndroidActionType.ManageGoogleServiceAccountKeyForFcmV1) {
|
|
115
|
+
currentActions = AndroidActions_1.gsaKeyActionsForFcmV1;
|
|
106
116
|
continue;
|
|
107
117
|
}
|
|
108
118
|
else if (chosenAction === Actions_1.AndroidActionType.ManageCredentialsJson) {
|
|
@@ -165,22 +175,30 @@ class ManageAndroid {
|
|
|
165
175
|
else if (action === Actions_1.AndroidActionType.RemoveFcm) {
|
|
166
176
|
await new RemoveFcm_1.RemoveFcm(appLookupParams).runAsync(ctx);
|
|
167
177
|
}
|
|
168
|
-
else if (action === Actions_1.AndroidActionType.
|
|
169
|
-
|
|
170
|
-
await new AssignGoogleServiceAccountKey_1.AssignGoogleServiceAccountKey(appLookupParams).runAsync(ctx, gsaKey);
|
|
178
|
+
else if (action === Actions_1.AndroidActionType.SetUpGsaKeyForSubmissions) {
|
|
179
|
+
await new SetUpGoogleServiceAccountKeyForSubmissions_1.SetUpGoogleServiceAccountKeyForSubmissions(appLookupParams).runAsync(ctx);
|
|
171
180
|
}
|
|
172
|
-
else if (action === Actions_1.AndroidActionType.
|
|
181
|
+
else if (action === Actions_1.AndroidActionType.UseExistingGsaKeyForSubmissions) {
|
|
173
182
|
const gsaKey = await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
|
|
174
183
|
if (gsaKey) {
|
|
175
|
-
await new
|
|
184
|
+
await new AssignGoogleServiceAccountKeyForSubmissions_1.AssignGoogleServiceAccountKeyForSubmissions(appLookupParams).runAsync(ctx, gsaKey);
|
|
176
185
|
}
|
|
177
186
|
}
|
|
187
|
+
else if (action === Actions_1.AndroidActionType.SetUpGsaKeyForFcmV1) {
|
|
188
|
+
await new SetUpGoogleServiceAccountKeyForFcmV1_1.SetUpGoogleServiceAccountKeyForFcmV1(appLookupParams).runAsync(ctx);
|
|
189
|
+
}
|
|
190
|
+
else if (action === Actions_1.AndroidActionType.UseExistingGsaKeyForFcmV1) {
|
|
191
|
+
const gsaKey = await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
|
|
192
|
+
if (gsaKey) {
|
|
193
|
+
await new AssignGoogleServiceAccountKeyForFcmV1_1.AssignGoogleServiceAccountKeyForFcmV1(appLookupParams).runAsync(ctx, gsaKey);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else if (action === Actions_1.AndroidActionType.CreateGsaKey) {
|
|
197
|
+
await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
|
|
198
|
+
}
|
|
178
199
|
else if (action === Actions_1.AndroidActionType.RemoveGsaKey) {
|
|
179
200
|
await new RemoveGoogleServiceAccountKey_1.SelectAndRemoveGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
|
|
180
201
|
}
|
|
181
|
-
else if (action === Actions_1.AndroidActionType.SetUpGsaKey) {
|
|
182
|
-
await new SetUpGoogleServiceAccountKey_1.SetUpGoogleServiceAccountKey(appLookupParams).runAsync(ctx);
|
|
183
|
-
}
|
|
184
202
|
else if (action === Actions_1.AndroidActionType.UpdateCredentialsJson) {
|
|
185
203
|
const buildCredentials = await new SelectAndroidBuildCredentials_1.SelectExistingAndroidBuildCredentials(appLookupParams).runAsync(ctx);
|
|
186
204
|
if (buildCredentials) {
|