shipthis 0.1.25 → 0.1.26

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 +94 -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 +91 -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,113 @@
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 { c as BaseGameCommand, D as DetailsFlags, t as GameEngine } 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 { i as isValidSemVer } from '../../index-BB00V5oF.js';
17
+ import 'open';
18
+ import 'marked';
19
+ import 'marked-terminal';
20
+ import 'path';
21
+ import 'qrcode';
22
+ import { S as StatusTable } from '../../StatusTable-Dm5St4g-.js';
23
+ import 'string-length';
24
+ import 'strip-ansi';
25
+ import 'fast-glob';
26
+ import { C as Command } from '../../Command-B3AmRt2w.js';
27
+ import 'socket.io-client';
28
+ import '../../useAndroidServiceAccountTestResult-DcYDam-p.js';
29
+ import '@expo/apple-utils/build/index.js';
30
+ import 'crypto';
31
+ import 'readline-sync';
32
+ import 'node:readline';
33
+ import 'node:path';
34
+ import 'node:url';
35
+ import 'isomorphic-git';
36
+ import 'ini';
37
+ import 'deepmerge';
38
+ import '../../Title-BCQtayg6.js';
39
+
40
+ class GameDetails extends BaseGameCommand {
41
+ static args = {};
42
+ static description = "Shows and sets the details of a game.";
43
+ static examples = [
44
+ "<%= config.bin %> <%= command.id %>",
45
+ "<%= config.bin %> <%= command.id %> --gameId 0c179fc4",
46
+ "<%= config.bin %> <%= command.id %> --buildNumber 5 --semanticVersion 1.2.3",
47
+ "<%= config.bin %> <%= command.id %> --gameEngine godot --gameEngineVersion 4.2 --force"
48
+ ];
49
+ static flags = {
50
+ ...BaseGameCommand.flags,
51
+ force: Flags.boolean({ char: "f", description: "Force the command to run" }),
52
+ ...DetailsFlags
53
+ };
54
+ async run() {
55
+ const { gameId, force, ...valueFlags } = this.flags;
56
+ const {
57
+ name,
58
+ semanticVersion,
59
+ buildNumber,
60
+ gameEngine,
61
+ gameEngineVersion,
62
+ iosBundleId,
63
+ androidPackageName,
64
+ gcpProjectId,
65
+ gcpServiceAccountId
66
+ } = valueFlags;
67
+ if (semanticVersion && !isValidSemVer(semanticVersion))
68
+ throw new Error(`Invalid semantic version: ${semanticVersion}`);
69
+ if ((gameEngine || gameEngineVersion || iosBundleId || androidPackageName) && !force)
70
+ throw new Error("Use --force to set the restricted fields");
71
+ if (gameEngine && gameEngine !== GameEngine.GODOT) throw new Error(`Game engine ${gameEngine} not supported`);
72
+ let game = await this.getGame();
73
+ const update = {
74
+ name: name || game.name,
75
+ details: {
76
+ ...game.details,
77
+ ...semanticVersion && { semanticVersion },
78
+ ...buildNumber && { buildNumber },
79
+ ...gameEngine && { gameEngine },
80
+ ...gameEngineVersion && { gameEngineVersion },
81
+ ...iosBundleId && { iosBundleId },
82
+ ...androidPackageName && { androidPackageName },
83
+ ...gcpProjectId && { gcpProjectId },
84
+ ...gcpServiceAccountId && { gcpServiceAccountId }
85
+ }
86
+ };
87
+ if (Object.keys(valueFlags).length > 0) {
88
+ game = await this.updateGame(update);
89
+ }
90
+ render(
91
+ /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
92
+ StatusTable,
93
+ {
94
+ title: "Game Details",
95
+ statuses: {
96
+ "Game Name": game.name,
97
+ "Game Engine": game.details?.gameEngine || "Please set!",
98
+ "Game Engine Version": game.details?.gameEngineVersion || "Please set!",
99
+ "iOS Bundle ID": game.details?.iosBundleId || "N/A",
100
+ "Android Package Name": game.details?.androidPackageName || "N/A",
101
+ "Semantic Version": game.details?.semanticVersion || "0.0.1",
102
+ "Build Number": game.details?.buildNumber || 1,
103
+ "GCP Project ID": game.details?.gcpProjectId || "N/A",
104
+ "GCP Service Account ID": game.details?.gcpServiceAccountId || "N/A"
105
+ }
106
+ }
107
+ ) })
108
+ );
109
+ return;
110
+ }
111
+ }
112
+
113
+ export { GameDetails as default };
@@ -0,0 +1,58 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { B as BaseAuthenticatedCommand, j as isCWDGodotGame, I as getProject, w as DEFAULT_IGNORED_FILES_GLOBS, x as DEFAULT_SHIPPED_FILES_GLOBS } from '../../index-DkNQs11R.js';
3
+ import 'crypto';
4
+ import 'fs';
5
+ import 'readline-sync';
6
+ import 'node:readline';
7
+ import 'node:path';
8
+ import 'node:url';
9
+ import 'luxon';
10
+ import 'axios';
11
+ import 'isomorphic-git';
12
+ import 'react';
13
+ import '@tanstack/react-query';
14
+ import 'uuid';
15
+ import 'fast-glob';
16
+ import 'yazl';
17
+ import 'socket.io-client';
18
+ import 'path';
19
+ import '@expo/apple-utils/build/index.js';
20
+ import 'crypto-js';
21
+ import 'ini';
22
+ import 'deepmerge';
23
+
24
+ class GameExport extends BaseAuthenticatedCommand {
25
+ static args = {
26
+ game_id: Args.string({ description: 'The ID of the game to export (use "list" to get the ID)', required: true })
27
+ };
28
+ static description = "Downloads the shipthis.json file for a given game into the current directory.";
29
+ static examples = [
30
+ "<%= config.bin %> <%= command.id %> abcd1234",
31
+ "<%= config.bin %> <%= command.id %> abcd1234 --force"
32
+ ];
33
+ static flags = {
34
+ force: Flags.boolean({ char: "f" })
35
+ };
36
+ async run() {
37
+ const { args } = this;
38
+ if (!isCWDGodotGame()) {
39
+ return this.error("No Godot project detected. Please run this from a godot project directory.", { exit: 1 });
40
+ }
41
+ if (this.hasProjectConfig() && !this.flags.force) {
42
+ return this.error(
43
+ "This project has already been initialized. Use --force to overwrite the existing configuration.",
44
+ { exit: 1 }
45
+ );
46
+ }
47
+ const project = await getProject(args.game_id);
48
+ await this.setProjectConfig({
49
+ project,
50
+ shippedFilesGlobs: DEFAULT_SHIPPED_FILES_GLOBS,
51
+ ignoredFilesGlobs: DEFAULT_IGNORED_FILES_GLOBS
52
+ });
53
+ await this.config.runCommand("game:status");
54
+ this.exit(0);
55
+ }
56
+ }
57
+
58
+ export { GameExport as default };
@@ -0,0 +1,124 @@
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 { c as BaseGameCommand, i as BetaGroup } 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 { a as getInput } from '../../../../index-BB00V5oF.js';
17
+ import 'open';
18
+ import 'marked';
19
+ import 'marked-terminal';
20
+ import 'path';
21
+ import 'qrcode';
22
+ import { R as RunWithSpinner } from '../../../../RunWithSpinner-BVXNWGD3.js';
23
+ import 'string-length';
24
+ import 'strip-ansi';
25
+ import { q as queryAppleApp } from '../../../../useAppleApp-B16WbUxJ.js';
26
+ import 'fast-glob';
27
+ import { C as Command } from '../../../../Command-B3AmRt2w.js';
28
+ import 'socket.io-client';
29
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
30
+ import '@expo/apple-utils/build/index.js';
31
+ import 'crypto';
32
+ import 'readline-sync';
33
+ import 'node:readline';
34
+ import 'node:path';
35
+ import 'node:url';
36
+ import 'isomorphic-git';
37
+ import 'ini';
38
+ import 'deepmerge';
39
+
40
+ const TEST_GROUP_NAME = "ShipThis Test Group";
41
+ class GameIosAppAddTester extends BaseGameCommand {
42
+ static args = {};
43
+ static description = "Adds a test user to the game in App Store Connect.";
44
+ static examples = ["<%= config.bin %> <%= command.id %>"];
45
+ static flags = {
46
+ gameId: Flags.string({ char: "g", description: "The ID of the game" }),
47
+ email: Flags.string({ char: "e", description: "The email address of the tester" }),
48
+ firstName: Flags.string({ char: "f", description: "The first name of the tester" }),
49
+ lastName: Flags.string({ char: "l", description: "The last name of the tester" })
50
+ };
51
+ async run() {
52
+ const game = await this.getGame();
53
+ const authState = await this.refreshAppleAuthState();
54
+ const ctx = authState.context;
55
+ const { flags } = this;
56
+ const getEmail = async () => {
57
+ if (flags.email) return flags.email;
58
+ const question = `Please enter the email address of the tester: `;
59
+ const enteredEmail = await getInput(question);
60
+ if (!enteredEmail) {
61
+ this.error("No email address provided");
62
+ }
63
+ return enteredEmail;
64
+ };
65
+ const getFirstName = async () => {
66
+ if (flags.firstName) return flags.firstName;
67
+ const suggestedName = "John";
68
+ const question = `Please enter the first name of the tester, or press enter to use ${suggestedName}: `;
69
+ const enteredName = await getInput(question);
70
+ return enteredName || suggestedName;
71
+ };
72
+ const getLastName = async () => {
73
+ if (flags.lastName) return flags.lastName;
74
+ const suggestedName = "Doe";
75
+ const question = `Please enter the last name of the tester, or press enter to use ${suggestedName}: `;
76
+ const enteredName = await getInput(question);
77
+ return enteredName || suggestedName;
78
+ };
79
+ const email = await getEmail();
80
+ const firstName = await getFirstName();
81
+ const lastName = await getLastName();
82
+ console.warn("This command does not yet work. It fails with an assertion error.");
83
+ const addTestUser = async () => {
84
+ const { app } = await queryAppleApp({ ctx, iosBundleId: game.details?.iosBundleId });
85
+ if (!app) return this.error("No app found");
86
+ const groups = await BetaGroup.getAsync(ctx, {});
87
+ let shipThisGroup = groups.find(
88
+ (group) => group.attributes.name === TEST_GROUP_NAME && group.attributes.isInternalGroup
89
+ );
90
+ if (!shipThisGroup) {
91
+ shipThisGroup = await BetaGroup.createAsync(ctx, {
92
+ id: app.id,
93
+ name: TEST_GROUP_NAME,
94
+ isInternalGroup: true,
95
+ publicLinkEnabled: false,
96
+ publicLinkLimit: 1,
97
+ publicLinkLimitEnabled: false
98
+ });
99
+ }
100
+ await shipThisGroup.createBulkBetaTesterAssignmentsAsync([
101
+ {
102
+ email,
103
+ firstName,
104
+ lastName
105
+ }
106
+ ]);
107
+ };
108
+ const handleComplete = async () => {
109
+ };
110
+ render(
111
+ /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
112
+ RunWithSpinner,
113
+ {
114
+ msgInProgress: "Adding test user...",
115
+ msgComplete: "Added test user",
116
+ executeMethod: addTestUser,
117
+ onComplete: handleComplete
118
+ }
119
+ ) })
120
+ );
121
+ }
122
+ }
123
+
124
+ export { GameIosAppAddTester as default };
@@ -0,0 +1,117 @@
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 { c as BaseGameCommand, d as getGodotAppleBundleIdentifier, e as BundleId, f as App } 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 { a as getInput, b as generatePackageName } from '../../../../index-BB00V5oF.js';
17
+ import 'open';
18
+ import 'marked';
19
+ import 'marked-terminal';
20
+ import 'path';
21
+ import 'qrcode';
22
+ import { R as RunWithSpinner } from '../../../../RunWithSpinner-BVXNWGD3.js';
23
+ import 'string-length';
24
+ import 'strip-ansi';
25
+ import 'fast-glob';
26
+ import { C as Command } from '../../../../Command-B3AmRt2w.js';
27
+ import 'socket.io-client';
28
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
29
+ import '@expo/apple-utils/build/index.js';
30
+ import 'crypto';
31
+ import 'readline-sync';
32
+ import 'node:readline';
33
+ import 'node:path';
34
+ import 'node:url';
35
+ import 'isomorphic-git';
36
+ import 'ini';
37
+ import 'deepmerge';
38
+
39
+ class GameIosAppCreate extends BaseGameCommand {
40
+ static args = {};
41
+ static description = "Creates an App and BundleId in the Apple Developer Portal.";
42
+ static examples = ["<%= config.bin %> <%= command.id %>"];
43
+ static flags = {
44
+ quiet: Flags.boolean({ char: "q", description: "Avoid output except for interactions and errors" }),
45
+ gameId: Flags.string({ char: "g", description: "The ID of the game" }),
46
+ appName: Flags.string({ char: "n", description: "The name of the App in the Apple Developer Portal" }),
47
+ bundleId: Flags.string({ char: "b", description: "The BundleId in the Apple Developer Portal" }),
48
+ force: Flags.boolean({ char: "f" })
49
+ // not used but don't remove or the wizard breaks
50
+ };
51
+ async run() {
52
+ const game = await this.getGame();
53
+ const authState = await this.refreshAppleAuthState();
54
+ const ctx = authState.context;
55
+ const { flags } = this;
56
+ const { appName, bundleId } = flags;
57
+ const getAppName = async () => {
58
+ if (appName) return appName;
59
+ const suggestedName = game.name;
60
+ const question = `Please enter the name of the App in the Apple Developer Portal, or press enter to use ${suggestedName}: `;
61
+ const enteredName = await getInput(question);
62
+ return enteredName || suggestedName;
63
+ };
64
+ const getBundleIdentifier = async () => {
65
+ if (bundleId) return bundleId;
66
+ const generatedBundleId = generatePackageName(game.name);
67
+ const suggestedBundleId = game.details?.iosBundleId || getGodotAppleBundleIdentifier() || generatedBundleId || "com.example.game";
68
+ const question = `Please enter the BundleId in the Apple Developer Portal, or press enter to use ${suggestedBundleId}: `;
69
+ const enteredBundleId = await getInput(question);
70
+ return enteredBundleId || suggestedBundleId;
71
+ };
72
+ const name = await getAppName();
73
+ const iosBundleId = await getBundleIdentifier();
74
+ const createApp = async () => {
75
+ this.log(`Checking for ${iosBundleId} in apple portal...`);
76
+ let bundleId2 = await BundleId.findAsync(ctx, { identifier: iosBundleId });
77
+ if (!bundleId2) {
78
+ this.log(`Creating BundleId ${iosBundleId} in apple portal...`);
79
+ bundleId2 = await BundleId.createAsync(ctx, {
80
+ identifier: iosBundleId,
81
+ name
82
+ });
83
+ }
84
+ let app = await App.findAsync(ctx, {
85
+ bundleId: iosBundleId
86
+ });
87
+ if (!app) {
88
+ this.log(`Creating App ${iosBundleId} in apple portal...`);
89
+ app = await App.createAsync(ctx, {
90
+ bundleId: iosBundleId,
91
+ name,
92
+ primaryLocale: "en-US"
93
+ // TODO
94
+ });
95
+ }
96
+ await this.updateGame({ details: { ...game.details, iosBundleId } });
97
+ };
98
+ const handleComplete = async () => {
99
+ await this.config.runCommand("game:ios:app:sync", ["--gameId", game.id]);
100
+ process.exit(0);
101
+ };
102
+ if (this.flags.quiet) return await createApp();
103
+ render(
104
+ /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
105
+ RunWithSpinner,
106
+ {
107
+ msgInProgress: "Creating App and BundleId in the Apple Developer Portal",
108
+ msgComplete: "App and BundleId created",
109
+ executeMethod: createApp,
110
+ onComplete: handleComplete
111
+ }
112
+ ) })
113
+ );
114
+ }
115
+ }
116
+
117
+ export { GameIosAppCreate as default };
@@ -0,0 +1,66 @@
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 { c as BaseGameCommand } 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 '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 'string-length';
31
+ import 'strip-ansi';
32
+ import { A as AppleAppDetails, a as AppleBundleIdDetails } from '../../../../AppleBundleIdDetails-mPUG2R4N.js';
33
+ import { C as Command } from '../../../../Command-B3AmRt2w.js';
34
+ import '../../../../index-BB00V5oF.js';
35
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
36
+ import '@expo/apple-utils/build/index.js';
37
+ import 'ini';
38
+ import 'deepmerge';
39
+ import '../../../../Title-BCQtayg6.js';
40
+ import '../../../../useAppleApp-B16WbUxJ.js';
41
+ import '../../../../Table-CvM6pccN.js';
42
+ import '../../../../useAppleBundleId-DobPATan.js';
43
+
44
+ class GameIosAppStatus extends BaseGameCommand {
45
+ static args = {};
46
+ static description = "Shows the Game iOS App status. ";
47
+ static examples = ["<%= config.bin %> <%= command.id %>"];
48
+ static flags = {
49
+ gameId: Flags.string({ char: "g", description: "The ID of the game" })
50
+ };
51
+ async run() {
52
+ const game = await this.getGame();
53
+ const authState = await this.refreshAppleAuthState();
54
+ const ctx = authState.context;
55
+ const steps = [];
56
+ render(
57
+ /* @__PURE__ */ jsxs(Command, { command: this, children: [
58
+ /* @__PURE__ */ jsx(AppleAppDetails, { iosBundleId: game.details?.iosBundleId, ctx }),
59
+ /* @__PURE__ */ jsx(AppleBundleIdDetails, { iosBundleId: game.details?.iosBundleId, ctx }),
60
+ /* @__PURE__ */ jsx(NextSteps, { steps })
61
+ ] })
62
+ );
63
+ }
64
+ }
65
+
66
+ export { GameIosAppStatus as default };
@@ -0,0 +1,95 @@
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 { c as BaseGameCommand, h as CapabilityTypeOption } 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 fetchBundleId } from '../../../../useAppleBundleId-DobPATan.js';
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 '../../../../index-BB00V5oF.js';
35
+ import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
36
+ import '@expo/apple-utils/build/index.js';
37
+ import 'ini';
38
+ import 'deepmerge';
39
+
40
+ class GameIosAppSync extends BaseGameCommand {
41
+ static args = {};
42
+ static description = 'Synchronies the Apple App "BundleId" with the capabilities from the local project.';
43
+ static examples = ["<%= config.bin %> <%= command.id %>"];
44
+ static flags = {
45
+ quiet: Flags.boolean({ char: "q", description: "Avoid output except for interactions and errors" }),
46
+ gameId: Flags.string({ char: "g", description: "The ID of the game" }),
47
+ force: Flags.boolean({ char: "f" })
48
+ // not used but don't remove or the wizard breaks
49
+ };
50
+ async run() {
51
+ const game = await this.getGame();
52
+ const authState = await this.refreshAppleAuthState();
53
+ const ctx = authState.context;
54
+ if (!game.details?.iosBundleId) return this.error("Please run `shipthis game ios app create` first");
55
+ const { iosBundleId } = game.details;
56
+ const syncCapabilities = async () => {
57
+ const bundleQueryResponse = await fetchBundleId({ ctx, iosBundleId });
58
+ const { bundleId, capabilities: existing, projectCapabilities } = bundleQueryResponse;
59
+ if (!bundleId) return this.error("BundleId not found");
60
+ if (!projectCapabilities) return this.error("Project capabilities not loaded");
61
+ const unRemovable = ["IN_APP_PURCHASE"];
62
+ const toRemove = existing.filter((c) => !projectCapabilities.includes(c) && !unRemovable.includes(c));
63
+ const toAdd = projectCapabilities.filter((c) => !existing.includes(c));
64
+ for (const capability of toRemove) {
65
+ await bundleId.updateBundleIdCapabilityAsync({
66
+ capabilityType: capability,
67
+ option: CapabilityTypeOption.OFF
68
+ });
69
+ }
70
+ for (const capability of toAdd) {
71
+ await bundleId.updateBundleIdCapabilityAsync({
72
+ capabilityType: capability,
73
+ option: CapabilityTypeOption.ON
74
+ });
75
+ }
76
+ };
77
+ const handleComplete = async () => {
78
+ await this.config.runCommand("game:ios:app:status", ["--gameId", game.id]);
79
+ };
80
+ if (this.flags.quiet) return await syncCapabilities();
81
+ render(
82
+ /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
83
+ RunWithSpinner,
84
+ {
85
+ msgInProgress: "Syncing App Store BundleId capabilities",
86
+ msgComplete: "App Store BundleId capabilities synced",
87
+ executeMethod: syncCapabilities,
88
+ onComplete: handleComplete
89
+ }
90
+ ) })
91
+ );
92
+ }
93
+ }
94
+
95
+ export { GameIosAppSync as default };