shipthis 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/AppleBundleIdDetails-mPUG2R4N.js +76 -0
  2. package/dist/Command-B3AmRt2w.js +28 -0
  3. package/dist/CommandGame-BCMzP9pc.js +9 -0
  4. package/dist/Create-CsJxpzUs.js +59 -0
  5. package/dist/Import-v0M_ygyF.js +110 -0
  6. package/dist/JobProgress-9uvq8IBn.js +121 -0
  7. package/dist/JobStatusTable-Bf7J9WXe.js +191 -0
  8. package/dist/NextSteps-CK9zHOCt.js +18 -0
  9. package/dist/ProgressSpinner-6pw1T8Iw.js +16 -0
  10. package/dist/ProjectCredentialsTable-CTkP1mvy.js +37 -0
  11. package/dist/RunWithSpinner-BVXNWGD3.js +27 -0
  12. package/dist/StatusTable-Dm5St4g-.js +33 -0
  13. package/dist/Table-CvM6pccN.js +101 -0
  14. package/dist/Title-BCQtayg6.js +6 -0
  15. package/dist/UserCredentialsTable-DhtM_iTG.js +82 -0
  16. package/dist/baseAppleCommand-IGl6KTvv.js +10 -0
  17. package/dist/baseGameAndroidCommand-DFn4zMvq.js +43 -0
  18. package/dist/commands/apple/apiKey/create.js +103 -0
  19. package/dist/commands/apple/apiKey/export.js +81 -0
  20. package/dist/commands/apple/apiKey/import.js +85 -0
  21. package/dist/commands/apple/apiKey/status.js +122 -0
  22. package/dist/commands/apple/certificate/create.js +133 -0
  23. package/dist/commands/apple/certificate/export.js +81 -0
  24. package/dist/commands/apple/certificate/import.js +85 -0
  25. package/dist/commands/apple/certificate/status.js +130 -0
  26. package/dist/commands/apple/login.js +76 -0
  27. package/dist/commands/apple/status.js +79 -0
  28. package/dist/commands/dashboard.js +38 -0
  29. package/dist/commands/game/android/apiKey/connect.js +74 -0
  30. package/dist/commands/game/android/apiKey/create.js +74 -0
  31. package/dist/commands/game/android/apiKey/export.js +84 -0
  32. package/dist/commands/game/android/apiKey/import.js +93 -0
  33. package/dist/commands/game/android/apiKey/invite.js +81 -0
  34. package/dist/commands/game/android/apiKey/status.js +87 -0
  35. package/dist/commands/game/android/keyStore/create.js +69 -0
  36. package/dist/commands/game/android/keyStore/export.js +83 -0
  37. package/dist/commands/game/android/keyStore/import.js +112 -0
  38. package/dist/commands/game/android/keyStore/status.js +70 -0
  39. package/dist/commands/game/android/status.js +84 -0
  40. package/dist/commands/game/build/download.js +80 -0
  41. package/dist/commands/game/build/list.js +96 -0
  42. package/dist/commands/game/create.js +67 -0
  43. package/dist/commands/game/details.js +113 -0
  44. package/dist/commands/game/export.js +58 -0
  45. package/dist/commands/game/ios/app/addTester.js +124 -0
  46. package/dist/commands/game/ios/app/create.js +117 -0
  47. package/dist/commands/game/ios/app/status.js +66 -0
  48. package/dist/commands/game/ios/app/sync.js +95 -0
  49. package/dist/commands/game/ios/profile/create.js +129 -0
  50. package/dist/commands/game/ios/profile/export.js +83 -0
  51. package/dist/commands/game/ios/profile/import.js +92 -0
  52. package/dist/commands/game/ios/profile/status.js +139 -0
  53. package/dist/commands/game/ios/status.js +92 -0
  54. package/dist/commands/game/ios/wizard.js +153 -0
  55. package/dist/commands/game/job/list.js +95 -0
  56. package/dist/commands/game/job/status.js +91 -0
  57. package/dist/commands/game/list.js +83 -0
  58. package/dist/commands/game/ship.js +216 -0
  59. package/dist/commands/game/status.js +114 -0
  60. package/dist/commands/game/wizard.js +686 -0
  61. package/dist/commands/internal/fastlane.js +74 -0
  62. package/dist/commands/internal/readme.js +937 -0
  63. package/dist/commands/login.js +92 -0
  64. package/dist/commands/status.js +76 -0
  65. package/dist/export-CVs_xoDN.js +36 -0
  66. package/dist/git-DREGq-jc.js +32 -0
  67. package/dist/import-Ch5O7xfN.js +47 -0
  68. package/dist/index-BB00V5oF.js +136 -0
  69. package/dist/index-BD1WLuFJ.js +125 -0
  70. package/dist/index-CIa2EDQ6.js +24 -0
  71. package/dist/index-CboPN9aq.js +138 -0
  72. package/dist/index-DkNQs11R.js +711 -0
  73. package/dist/index-nnzhQ3nY.js +209 -0
  74. package/dist/index.d.ts +1 -0
  75. package/dist/index.js +1 -0
  76. package/dist/upload-CRE2nVdd.js +60 -0
  77. package/dist/useAndroidServiceAccountTestResult-DcYDam-p.js +52 -0
  78. package/dist/useAppleApp-B16WbUxJ.js +32 -0
  79. package/dist/useAppleBundleId-DobPATan.js +64 -0
  80. package/dist/useJobWatching--BvVn7xS.js +45 -0
  81. package/dist/useProjectCredentials-Btnr7WK3.js +54 -0
  82. package/dist/useWebSocket-ByuNoqRw.js +36 -0
  83. package/dist/utils/help.js +14 -0
  84. package/package.json +1 -1
@@ -0,0 +1,79 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { B as BaseAuthenticatedCommand } from '../../index-DkNQs11R.js';
3
+ import 'react';
4
+ import { render } from 'ink';
5
+ import '../../index-nnzhQ3nY.js';
6
+ import 'ink-spinner';
7
+ import 'axios';
8
+ import 'crypto-js';
9
+ import 'uuid';
10
+ import 'fs';
11
+ import 'luxon';
12
+ import '@inkjs/ui';
13
+ import '@tanstack/react-query';
14
+ import 'yazl';
15
+ import 'crypto';
16
+ import 'readline-sync';
17
+ import 'node:readline';
18
+ import 'node:path';
19
+ import 'node:url';
20
+ import 'isomorphic-git';
21
+ import '@oclif/core';
22
+ import 'fast-glob';
23
+ import 'socket.io-client';
24
+ import 'open';
25
+ import 'marked';
26
+ import 'marked-terminal';
27
+ import 'path';
28
+ import { N as NextSteps } from '../../NextSteps-CK9zHOCt.js';
29
+ import 'qrcode';
30
+ import { S as StatusTable } from '../../StatusTable-Dm5St4g-.js';
31
+ import 'string-length';
32
+ import 'strip-ansi';
33
+ import { C as Command } from '../../Command-B3AmRt2w.js';
34
+ import '@expo/apple-utils/build/index.js';
35
+ import 'ini';
36
+ import 'deepmerge';
37
+ import '../../index-BB00V5oF.js';
38
+ import '../../useAndroidServiceAccountTestResult-DcYDam-p.js';
39
+ import '../../Title-BCQtayg6.js';
40
+
41
+ class AppleStatus extends BaseAuthenticatedCommand {
42
+ static args = {};
43
+ static description = "Shows the status of the Apple authentication and integration.";
44
+ static examples = ["<%= config.bin %> <%= command.id %>"];
45
+ static flags = {};
46
+ async run() {
47
+ const checkAuth = async () => {
48
+ try {
49
+ const authState = await this.refreshAppleAuthState();
50
+ const { session: session2 } = authState;
51
+ return {
52
+ isAuthenticatedOnApple: true,
53
+ session: session2
54
+ };
55
+ } catch {
56
+ return {
57
+ isAuthenticatedOnApple: false,
58
+ session: null
59
+ };
60
+ }
61
+ };
62
+ const { isAuthenticatedOnApple, session } = await checkAuth();
63
+ const statuses = {
64
+ "Authenticated on Apple Developer Portal": isAuthenticatedOnApple,
65
+ "Apple Full Name": session?.user?.fullName || "Please authenticate",
66
+ "Apple Provider Name": session?.provider?.name || "Please authenticate"
67
+ };
68
+ let steps = [];
69
+ if (!isAuthenticatedOnApple) steps.push("$ shipthis apple login");
70
+ render(
71
+ /* @__PURE__ */ jsxs(Command, { command: this, children: [
72
+ /* @__PURE__ */ jsx(StatusTable, { marginBottom: 1, title: "Apple Status", statuses }),
73
+ /* @__PURE__ */ jsx(NextSteps, { steps })
74
+ ] })
75
+ );
76
+ }
77
+ }
78
+
79
+ export { AppleStatus as default };
@@ -0,0 +1,38 @@
1
+ import open from 'open';
2
+ import { B as BaseAuthenticatedCommand, Z as getSingleUseUrl } from '../index-DkNQs11R.js';
3
+ import 'path';
4
+ import 'fs';
5
+ import '@oclif/core';
6
+ import '@expo/apple-utils/build/index.js';
7
+ import 'axios';
8
+ import 'crypto-js';
9
+ import 'uuid';
10
+ import 'luxon';
11
+ import 'crypto';
12
+ import 'readline-sync';
13
+ import 'node:readline';
14
+ import 'node:path';
15
+ import 'node:url';
16
+ import 'isomorphic-git';
17
+ import 'ini';
18
+ import 'deepmerge';
19
+ import 'react';
20
+ import '@tanstack/react-query';
21
+ import 'fast-glob';
22
+ import 'yazl';
23
+ import 'socket.io-client';
24
+
25
+ class Dashboard extends BaseAuthenticatedCommand {
26
+ static args = {};
27
+ static description = "Opens the web-browser to your ShipThis dashboard";
28
+ static examples = ["<%= config.bin %> <%= command.id %>"];
29
+ static flags = {};
30
+ async run() {
31
+ const dashboardUrl = await getSingleUseUrl("/dashboard");
32
+ console.log(`Opening ${dashboardUrl}...`);
33
+ await open(dashboardUrl);
34
+ process.exit(0);
35
+ }
36
+ }
37
+
38
+ export { Dashboard as default };
@@ -0,0 +1,74 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { render } from 'ink';
3
+ import { Flags } from '@oclif/core';
4
+ import { T as getGoogleStatus, X as disconnectGoogle } from '../../../../index-DkNQs11R.js';
5
+ import 'react';
6
+ import '../../../../index-nnzhQ3nY.js';
7
+ import 'ink-spinner';
8
+ import '@inkjs/ui';
9
+ import 'axios';
10
+ import '@tanstack/react-query';
11
+ import 'fs';
12
+ import 'uuid';
13
+ import 'yazl';
14
+ import 'crypto';
15
+ import 'readline-sync';
16
+ import 'node:readline';
17
+ import 'node:path';
18
+ import 'node:url';
19
+ import 'luxon';
20
+ import 'isomorphic-git';
21
+ import 'fast-glob';
22
+ import 'socket.io-client';
23
+ import { C as ConnectGoogle } from '../../../../index-BD1WLuFJ.js';
24
+ import 'marked';
25
+ import 'marked-terminal';
26
+ import 'path';
27
+ import 'qrcode';
28
+ import 'string-length';
29
+ import 'strip-ansi';
30
+ import { C as CommandGame } from '../../../../CommandGame-BCMzP9pc.js';
31
+ import 'open';
32
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DFn4zMvq.js';
33
+ import '@expo/apple-utils/build/index.js';
34
+ import 'crypto-js';
35
+ import 'ini';
36
+ import 'deepmerge';
37
+ import '../../../../index-BB00V5oF.js';
38
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
39
+ import '../../../../useWebSocket-ByuNoqRw.js';
40
+ import '../../../../Command-B3AmRt2w.js';
41
+
42
+ class GameAndroidApiKeyConnect extends BaseGameAndroidCommand {
43
+ static args = {};
44
+ static description = "Connects ShipThis with Google for managing Service Account API Keys for an Android game";
45
+ static examples = [
46
+ "<%= config.bin %> <%= command.id %>",
47
+ "<%= config.bin %> <%= command.id %> --force",
48
+ "<%= config.bin %> <%= command.id %> --disconnect"
49
+ ];
50
+ static flags = {
51
+ ...BaseGameAndroidCommand.flags,
52
+ force: Flags.boolean({ char: "f" }),
53
+ disconnect: Flags.boolean({ char: "d" })
54
+ };
55
+ async run() {
56
+ const googleStatus = await getGoogleStatus();
57
+ if (this.flags.disconnect) {
58
+ if (!googleStatus.isAuthenticated && !this.flags.force) {
59
+ throw new Error("You are not authenticated with Google. Use --force to disconnect anyway.");
60
+ }
61
+ await disconnectGoogle();
62
+ this.log("Disconnected from Google.");
63
+ return;
64
+ }
65
+ if (googleStatus.isAuthenticated && !this.flags.force) {
66
+ throw new Error("You are already authenticated with Google. Use --force to re-authenticate.");
67
+ }
68
+ render(
69
+ /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(ConnectGoogle, { helpPage: !this.flags.force, onComplete: () => process.exit(0), onError: (e) => this.error(e) }) })
70
+ );
71
+ }
72
+ }
73
+
74
+ export { GameAndroidApiKeyConnect as default };
@@ -0,0 +1,74 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { render } from 'ink';
3
+ import { Flags } from '@oclif/core';
4
+ import 'react';
5
+ import '../../../../index-nnzhQ3nY.js';
6
+ import { P as Platform, C as CredentialsType } from '../../../../index-DkNQs11R.js';
7
+ import 'ink-spinner';
8
+ import 'axios';
9
+ import 'crypto-js';
10
+ import 'uuid';
11
+ import 'fs';
12
+ import 'luxon';
13
+ import { a as getProjectCredentials } from '../../../../index-CIa2EDQ6.js';
14
+ import '@inkjs/ui';
15
+ import '@tanstack/react-query';
16
+ import 'yazl';
17
+ import 'crypto';
18
+ import 'readline-sync';
19
+ import 'node:readline';
20
+ import 'node:path';
21
+ import 'node:url';
22
+ import 'isomorphic-git';
23
+ import 'fast-glob';
24
+ import 'socket.io-client';
25
+ import 'open';
26
+ import 'marked';
27
+ import 'marked-terminal';
28
+ import 'path';
29
+ import 'qrcode';
30
+ import 'string-length';
31
+ import 'strip-ansi';
32
+ import { C as CreateServiceAccountKey } from '../../../../index-CboPN9aq.js';
33
+ import { C as CommandGame } from '../../../../CommandGame-BCMzP9pc.js';
34
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DFn4zMvq.js';
35
+ import '../../../../index-BB00V5oF.js';
36
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
37
+ import '@expo/apple-utils/build/index.js';
38
+ import 'ini';
39
+ import 'deepmerge';
40
+ import '../../../../useWebSocket-ByuNoqRw.js';
41
+ import '../../../../useProjectCredentials-Btnr7WK3.js';
42
+ import '../../../../ProgressSpinner-6pw1T8Iw.js';
43
+ import '../../../../Command-B3AmRt2w.js';
44
+
45
+ class GameAndroidApiKeyCreate extends BaseGameAndroidCommand {
46
+ static args = {};
47
+ static description = "Creates a new Android Service Account API Key for a game";
48
+ static examples = [
49
+ "<%= config.bin %> <%= command.id %>",
50
+ "<%= config.bin %> <%= command.id %> --gameId 0c179fc4"
51
+ ];
52
+ static flags = {
53
+ ...BaseGameAndroidCommand.flags,
54
+ waitForAuth: Flags.boolean({ char: "w", description: "Wait for Google Authentication (10 mins)." }),
55
+ force: Flags.boolean({ char: "f" })
56
+ };
57
+ async run() {
58
+ const game = await this.getGame();
59
+ const { force, waitForAuth } = this.flags;
60
+ this.checkGoogleAuth(waitForAuth);
61
+ const projectCredentials = await getProjectCredentials(game.id);
62
+ const hasApiKey = projectCredentials.some(
63
+ (cred) => cred.platform == Platform.ANDROID && cred.isActive && cred.type == CredentialsType.KEY
64
+ );
65
+ if (hasApiKey && !force) {
66
+ this.error("An API Key is already set on this game. Use --force to overwrite it.");
67
+ }
68
+ render(
69
+ /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(CreateServiceAccountKey, { onComplete: () => process.exit(0), onError: (e) => this.error(e) }) })
70
+ );
71
+ }
72
+ }
73
+
74
+ export { GameAndroidApiKeyCreate as default };
@@ -0,0 +1,84 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { render } from 'ink';
4
+ import * as fs from 'fs';
5
+ import { P as Platform, C as CredentialsType } from '../../../../index-DkNQs11R.js';
6
+ import { a as getProjectCredentials } from '../../../../index-CIa2EDQ6.js';
7
+ import 'react';
8
+ import '../../../../index-nnzhQ3nY.js';
9
+ import 'ink-spinner';
10
+ import 'axios';
11
+ import 'crypto-js';
12
+ import 'uuid';
13
+ import 'luxon';
14
+ import '@inkjs/ui';
15
+ import '@tanstack/react-query';
16
+ import 'yazl';
17
+ import 'crypto';
18
+ import 'readline-sync';
19
+ import 'node:readline';
20
+ import 'node:path';
21
+ import 'node:url';
22
+ import 'isomorphic-git';
23
+ import 'fast-glob';
24
+ import 'socket.io-client';
25
+ import 'open';
26
+ import 'marked';
27
+ import 'marked-terminal';
28
+ import 'path';
29
+ import 'qrcode';
30
+ import { R as RunWithSpinner } from '../../../../RunWithSpinner-BVXNWGD3.js';
31
+ import 'string-length';
32
+ import 'strip-ansi';
33
+ import { C as Command } from '../../../../Command-B3AmRt2w.js';
34
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DFn4zMvq.js';
35
+ import { e as exportCredential } from '../../../../export-CVs_xoDN.js';
36
+ import '@expo/apple-utils/build/index.js';
37
+ import 'ini';
38
+ import 'deepmerge';
39
+ import '../../../../index-BB00V5oF.js';
40
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
41
+
42
+ class GameAndroidApiKeyExport extends BaseGameAndroidCommand {
43
+ static args = {
44
+ file: Args.string({ description: "Name of the ZIP file to create", required: true })
45
+ };
46
+ static description = "Saves the current Android Service Account API Key to a ZIP file";
47
+ static examples = ["<%= config.bin %> <%= command.id %> keyStore.zip"];
48
+ static flags = {
49
+ gameId: Flags.string({ char: "g", description: "The ID of the game" }),
50
+ force: Flags.boolean({ char: "f", description: "Overwrite the file if it already exists" })
51
+ };
52
+ async run() {
53
+ const { args, flags } = this;
54
+ const { file } = args;
55
+ const { force } = flags;
56
+ const game = await this.getGame();
57
+ const zipAlreadyExists = fs.existsSync(file);
58
+ if (zipAlreadyExists && !force) {
59
+ this.error(`The file ${file} already exists. Use --force to overwrite it.`);
60
+ }
61
+ const projectCredentials = await getProjectCredentials(game.id);
62
+ const projectAndroidApiKeyCreds = projectCredentials.filter(
63
+ (cred) => cred.platform == Platform.ANDROID && cred.type == CredentialsType.KEY && cred.isActive
64
+ );
65
+ if (projectAndroidApiKeyCreds.length === 0) {
66
+ this.error("No Android Service Account API Key found which can be exported.");
67
+ }
68
+ const [apiKey] = projectAndroidApiKeyCreds;
69
+ const handleComplete = async () => process.exit(0);
70
+ render(
71
+ /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
72
+ RunWithSpinner,
73
+ {
74
+ msgInProgress: `Exporting Android Service Account API Key to ${file}...`,
75
+ msgComplete: `Android Service Account API Key exported to ${file}`,
76
+ executeMethod: () => exportCredential({ zipPath: file, credentialId: apiKey.id, projectId: game.id }),
77
+ onComplete: handleComplete
78
+ }
79
+ ) })
80
+ );
81
+ }
82
+ }
83
+
84
+ export { GameAndroidApiKeyExport as default };
@@ -0,0 +1,93 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { render } from 'ink';
4
+ import * as fs from 'fs';
5
+ import { P as Platform, C as CredentialsType } from '../../../../index-DkNQs11R.js';
6
+ import { a as getProjectCredentials } from '../../../../index-CIa2EDQ6.js';
7
+ import 'react';
8
+ import '../../../../index-nnzhQ3nY.js';
9
+ import 'ink-spinner';
10
+ import 'axios';
11
+ import 'crypto-js';
12
+ import 'uuid';
13
+ import 'luxon';
14
+ import '@inkjs/ui';
15
+ import '@tanstack/react-query';
16
+ import 'yazl';
17
+ import 'crypto';
18
+ import 'readline-sync';
19
+ import 'node:readline';
20
+ import 'node:path';
21
+ import 'node:url';
22
+ import 'isomorphic-git';
23
+ import 'fast-glob';
24
+ import 'socket.io-client';
25
+ import 'open';
26
+ import 'marked';
27
+ import 'marked-terminal';
28
+ import 'path';
29
+ import 'qrcode';
30
+ import { R as RunWithSpinner } from '../../../../RunWithSpinner-BVXNWGD3.js';
31
+ import 'string-length';
32
+ import 'strip-ansi';
33
+ import { C as Command } from '../../../../Command-B3AmRt2w.js';
34
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DFn4zMvq.js';
35
+ import { i as importCredential } from '../../../../import-Ch5O7xfN.js';
36
+ import '@expo/apple-utils/build/index.js';
37
+ import 'ini';
38
+ import 'deepmerge';
39
+ import '../../../../index-BB00V5oF.js';
40
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
41
+
42
+ class GameAndroidApiKeyImport extends BaseGameAndroidCommand {
43
+ static args = {
44
+ file: Args.string({
45
+ description: "Name of the ZIP file to import (must be in the same format as the export)",
46
+ required: true
47
+ })
48
+ };
49
+ static description = "Imports an Android Service Account API Key to your ShipThis account for the specified game.";
50
+ static examples = ["<%= config.bin %> <%= command.id %>"];
51
+ static flags = {
52
+ gameId: Flags.string({ char: "g", description: "The ID of the game" }),
53
+ force: Flags.boolean({ char: "f" })
54
+ };
55
+ async run() {
56
+ const game = await this.getGame();
57
+ const { args, flags } = this;
58
+ const { file } = args;
59
+ const { force } = flags;
60
+ const zipFound = fs.existsSync(file);
61
+ if (!zipFound) {
62
+ this.error(`The file ${file} does not exist.`);
63
+ }
64
+ const projectCredentials = await getProjectCredentials(game.id);
65
+ const hasAndroidApiKey = projectCredentials.some(
66
+ (cred) => cred.platform == Platform.ANDROID && cred.isActive && cred.type == CredentialsType.KEY
67
+ );
68
+ if (hasAndroidApiKey && !force) {
69
+ this.error("An Android Service Account API Key is already set on this game. Use --force to overwrite it.");
70
+ }
71
+ const handleComplete = async () => {
72
+ await this.config.runCommand(`game:android:apiKey:status`, ["--gameId", game.id]);
73
+ };
74
+ render(
75
+ /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
76
+ RunWithSpinner,
77
+ {
78
+ msgInProgress: `Importing Android Service Account API Key from ${file}...`,
79
+ msgComplete: `Android Service Account API Key imported from ${file}`,
80
+ executeMethod: () => importCredential({
81
+ projectId: game.id,
82
+ zipPath: file,
83
+ type: CredentialsType.KEY,
84
+ platform: Platform.ANDROID
85
+ }),
86
+ onComplete: handleComplete
87
+ }
88
+ ) })
89
+ );
90
+ }
91
+ }
92
+
93
+ export { GameAndroidApiKeyImport as default };
@@ -0,0 +1,81 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { V as inviteServiceAccount } from '../../../../index-DkNQs11R.js';
3
+ import { f as fetchKeyTestResult, K as KeyTestStatus, a as KeyTestError, n as niceError } from '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
4
+ import { a as getInput } from '../../../../index-BB00V5oF.js';
5
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DFn4zMvq.js';
6
+ import 'path';
7
+ import 'fs';
8
+ import '@expo/apple-utils/build/index.js';
9
+ import 'axios';
10
+ import 'crypto-js';
11
+ import 'uuid';
12
+ import 'luxon';
13
+ import 'crypto';
14
+ import 'readline-sync';
15
+ import 'node:readline';
16
+ import 'node:path';
17
+ import 'node:url';
18
+ import 'isomorphic-git';
19
+ import 'ini';
20
+ import 'deepmerge';
21
+ import 'react';
22
+ import '@tanstack/react-query';
23
+ import 'fast-glob';
24
+ import 'yazl';
25
+ import 'socket.io-client';
26
+
27
+ class GameAndroidApiKeyInvite extends BaseGameAndroidCommand {
28
+ static args = {
29
+ accountId: Args.string({ description: "The Google Play Account ID", required: false })
30
+ };
31
+ static description = "Invites the Service Account to your Google Play Account.";
32
+ static examples = ["<%= config.bin %> <%= command.id %>"];
33
+ static flags = {
34
+ ...BaseGameAndroidCommand.flags,
35
+ prompt: Flags.boolean({ char: "p", description: "Prompt for the Google Play Account ID" }),
36
+ waitForGoogleApp: Flags.boolean({ char: "p", description: "Waits for the Google Play app to be created (10 mins)." }),
37
+ waitForAuth: Flags.boolean({ char: "w", description: "Wait for Google Authentication (10 mins)." })
38
+ };
39
+ async run() {
40
+ const game = await this.getGame();
41
+ const { prompt, waitForAuth, waitForGoogleApp } = this.flags;
42
+ this.checkGoogleAuth(waitForAuth);
43
+ const getAccountId = async () => {
44
+ if (!prompt) return this.args.accountId;
45
+ const entered = await getInput(`Please enter the Google Play Account ID: `);
46
+ return entered;
47
+ };
48
+ const waitForApp = async () => {
49
+ console.log("Waiting for Google Play app to be created...");
50
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
51
+ let testResult2 = await fetchKeyTestResult({ projectId: game.id });
52
+ while (testResult2.error === KeyTestError.APP_NOT_FOUND) {
53
+ process.stdout.write(".");
54
+ await sleep(1e3 * 30);
55
+ testResult2 = await fetchKeyTestResult({ projectId: game.id });
56
+ }
57
+ return testResult2;
58
+ };
59
+ const accountId = await getAccountId();
60
+ if (!accountId) {
61
+ this.error("You must provide a Google Play Account ID.", { exit: 1 });
62
+ }
63
+ let testResult = await fetchKeyTestResult({ projectId: game.id });
64
+ if (testResult.status === KeyTestStatus.SUCCESS) {
65
+ this.error("The Service Account API Key is working and does not need to be invited.", {
66
+ exit: 1
67
+ });
68
+ }
69
+ if (testResult.error === KeyTestError.APP_NOT_FOUND && waitForGoogleApp) {
70
+ this.log("Waiting for Google Play app to be created...");
71
+ testResult = await waitForApp();
72
+ }
73
+ if (testResult.error !== KeyTestError.NOT_INVITED) {
74
+ this.error(`${niceError(testResult.error)}`);
75
+ }
76
+ await inviteServiceAccount(game.id, accountId);
77
+ await this.config.runCommand(`game:android:apiKey:status`, ["--gameId", game.id]);
78
+ }
79
+ }
80
+
81
+ export { GameAndroidApiKeyInvite as default };
@@ -0,0 +1,87 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { render } from 'ink';
3
+ import { Flags } from '@oclif/core';
4
+ import 'react';
5
+ import '../../../../index-nnzhQ3nY.js';
6
+ import { P as Platform, C as CredentialsType } from '../../../../index-DkNQs11R.js';
7
+ import 'ink-spinner';
8
+ import 'axios';
9
+ import 'crypto-js';
10
+ import 'uuid';
11
+ import 'fs';
12
+ import 'luxon';
13
+ import '@inkjs/ui';
14
+ import '@tanstack/react-query';
15
+ import 'yazl';
16
+ import 'crypto';
17
+ import 'readline-sync';
18
+ import 'node:readline';
19
+ import 'node:path';
20
+ import 'node:url';
21
+ import 'isomorphic-git';
22
+ import { f as fetchKeyTestResult, n as niceError, K as KeyTestStatus } from '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
23
+ import 'fast-glob';
24
+ import 'socket.io-client';
25
+ import 'open';
26
+ import { T as Title } from '../../../../Title-BCQtayg6.js';
27
+ import 'marked';
28
+ import 'marked-terminal';
29
+ import 'path';
30
+ import 'qrcode';
31
+ import { T as Table } from '../../../../Table-CvM6pccN.js';
32
+ import 'string-length';
33
+ import 'strip-ansi';
34
+ import { C as Command } from '../../../../Command-B3AmRt2w.js';
35
+ import { P as ProjectCredentialsTable } from '../../../../ProjectCredentialsTable-CTkP1mvy.js';
36
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DFn4zMvq.js';
37
+ import '../../../../index-BB00V5oF.js';
38
+ import '@expo/apple-utils/build/index.js';
39
+ import 'ini';
40
+ import 'deepmerge';
41
+ import '../../../../useProjectCredentials-Btnr7WK3.js';
42
+
43
+ class GameAndroidApiKeyStatus extends BaseGameAndroidCommand {
44
+ static args = {};
45
+ static description = "Displays the status of the Android Service Account API Key for a specific game.";
46
+ static examples = [
47
+ "<%= config.bin %> <%= command.id %>",
48
+ "<%= config.bin %> <%= command.id %> --gameId 0c179fc4"
49
+ ];
50
+ static flags = {
51
+ gameId: Flags.string({ char: "g", description: "The ID of the game" })
52
+ };
53
+ async run() {
54
+ const game = await this.getGame();
55
+ const testResult = await fetchKeyTestResult({ projectId: game.id });
56
+ render(
57
+ /* @__PURE__ */ jsxs(Command, { command: this, children: [
58
+ /* @__PURE__ */ jsx(
59
+ ProjectCredentialsTable,
60
+ {
61
+ credentialTypeName: "Android Service Account API Key",
62
+ queryProps: {
63
+ projectId: game.id,
64
+ type: CredentialsType.KEY,
65
+ platform: Platform.ANDROID
66
+ }
67
+ }
68
+ ),
69
+ /* @__PURE__ */ jsx(Title, { children: "Android Service Account API Key Test Result" }),
70
+ /* @__PURE__ */ jsx(
71
+ Table,
72
+ {
73
+ data: [
74
+ {
75
+ "Key Works?": testResult.status == KeyTestStatus.SUCCESS,
76
+ ...testResult,
77
+ error: niceError(testResult.error)
78
+ }
79
+ ]
80
+ }
81
+ )
82
+ ] })
83
+ );
84
+ }
85
+ }
86
+
87
+ export { GameAndroidApiKeyStatus as default };
@@ -0,0 +1,69 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { render } from 'ink';
3
+ import { Flags } from '@oclif/core';
4
+ import 'react';
5
+ import '../../../../index-nnzhQ3nY.js';
6
+ import { P as Platform, C as CredentialsType } from '../../../../index-DkNQs11R.js';
7
+ import 'ink-spinner';
8
+ import 'axios';
9
+ import 'crypto-js';
10
+ import 'uuid';
11
+ import 'fs';
12
+ import 'luxon';
13
+ import { a as getProjectCredentials } from '../../../../index-CIa2EDQ6.js';
14
+ import '@inkjs/ui';
15
+ import { C as CreateKeystore } from '../../../../Create-CsJxpzUs.js';
16
+ import 'yazl';
17
+ import '@tanstack/react-query';
18
+ import 'crypto';
19
+ import 'readline-sync';
20
+ import 'node:readline';
21
+ import 'node:path';
22
+ import 'node:url';
23
+ import 'isomorphic-git';
24
+ import 'fast-glob';
25
+ import 'socket.io-client';
26
+ import 'open';
27
+ import 'marked';
28
+ import 'marked-terminal';
29
+ import 'path';
30
+ import 'qrcode';
31
+ import 'string-length';
32
+ import 'strip-ansi';
33
+ import { C as CommandGame } from '../../../../CommandGame-BCMzP9pc.js';
34
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DFn4zMvq.js';
35
+ import '../../../../index-BB00V5oF.js';
36
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
37
+ import '@expo/apple-utils/build/index.js';
38
+ import 'ini';
39
+ import 'deepmerge';
40
+ import '../../../../RunWithSpinner-BVXNWGD3.js';
41
+ import '../../../../Command-B3AmRt2w.js';
42
+
43
+ class GameAndroidKeyStoreCreate extends BaseGameAndroidCommand {
44
+ static args = {};
45
+ static description = "Creates a new Android Keystore for a game";
46
+ static examples = [
47
+ "<%= config.bin %> <%= command.id %>",
48
+ "<%= config.bin %> <%= command.id %> --gameId 0c179fc4"
49
+ ];
50
+ static flags = {
51
+ ...BaseGameAndroidCommand.flags,
52
+ force: Flags.boolean({ char: "f" })
53
+ };
54
+ async run() {
55
+ const game = await this.getGame();
56
+ const projectCredentials = await getProjectCredentials(game.id);
57
+ const hasKeystore = projectCredentials.some(
58
+ (cred) => cred.platform == Platform.ANDROID && cred.isActive && cred.type == CredentialsType.CERTIFICATE
59
+ );
60
+ if (hasKeystore && !this.flags.force) {
61
+ this.error("A Keystore is already set on this game. Use --force to overwrite it.");
62
+ }
63
+ render(
64
+ /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(CreateKeystore, { onComplete: () => process.exit(0), onError: (e) => this.error(e) }) })
65
+ );
66
+ }
67
+ }
68
+
69
+ export { GameAndroidKeyStoreCreate as default };