shipthis 0.1.31 → 0.1.33

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-eoK5F8Qn.js → AppleBundleIdDetails-BhHPCvRm.js} +17 -19
  2. package/dist/Command-BDIkuv2g.js +29 -0
  3. package/dist/CommandGame-CvBIjPZp.js +7 -0
  4. package/dist/{Create-ISdroJ3G.js → Create-Lpe0B8nT.js} +20 -20
  5. package/dist/GameStatus-5XpufIY_.js +137 -0
  6. package/dist/{Import-CfThJF6k.js → Import-DFzrAG04.js} +34 -36
  7. package/dist/{JobLogTail-BWzbQBZz.js → JobLogTail-BYcJgPcL.js} +53 -52
  8. package/dist/{JobProgress-DjIkuk5U.js → JobProgress-BcrE7CUK.js} +40 -38
  9. package/dist/{JobStatusTable-CEqWU73q.js → JobStatusTable-Bi-y8ZZT.js} +14 -13
  10. package/dist/{NextSteps-CK9zHOCt.js → NextSteps-DbJHmscQ.js} +1 -3
  11. package/dist/{ProgressSpinner-6pw1T8Iw.js → ProgressSpinner-Um6ARKlk.js} +2 -2
  12. package/dist/{ProjectCredentialsTable-u9ruZ9mN.js → ProjectCredentialsTable-B4vDJl4l.js} +11 -10
  13. package/dist/{StatusTable-Dm5St4g-.js → StatusTable-DzRWcMr4.js} +7 -9
  14. package/dist/{Table-CvM6pccN.js → Table-FaNgpyeq.js} +15 -15
  15. package/dist/{UserCredentialsTable-Q7u9M-ap.js → UserCredentialsTable-CwkZTFBD.js} +18 -19
  16. package/dist/{baseAppleCommand-zhkGlKq0.js → baseAppleCommand-BKXweb-U.js} +1 -1
  17. package/dist/{baseGameAndroidCommand-DJ-cMLa_.js → baseGameAndroidCommand-CAi-BSsH.js} +23 -23
  18. package/dist/commands/apple/apiKey/create.js +36 -36
  19. package/dist/commands/apple/apiKey/export.js +27 -27
  20. package/dist/commands/apple/apiKey/import.js +28 -28
  21. package/dist/commands/apple/apiKey/status.js +32 -32
  22. package/dist/commands/apple/certificate/create.js +40 -40
  23. package/dist/commands/apple/certificate/export.js +27 -27
  24. package/dist/commands/apple/certificate/import.js +28 -28
  25. package/dist/commands/apple/certificate/status.js +33 -33
  26. package/dist/commands/apple/login.js +15 -15
  27. package/dist/commands/apple/status.js +27 -27
  28. package/dist/commands/dashboard.js +10 -10
  29. package/dist/commands/game/android/apiKey/connect.js +28 -28
  30. package/dist/commands/game/android/apiKey/create.js +29 -29
  31. package/dist/commands/game/android/apiKey/export.js +30 -30
  32. package/dist/commands/game/android/apiKey/import.js +32 -32
  33. package/dist/commands/game/android/apiKey/invite.js +14 -14
  34. package/dist/commands/game/android/apiKey/status.js +30 -30
  35. package/dist/commands/game/android/keyStore/create.js +25 -25
  36. package/dist/commands/game/android/keyStore/export.js +29 -29
  37. package/dist/commands/game/android/keyStore/import.js +36 -36
  38. package/dist/commands/game/android/keyStore/status.js +26 -26
  39. package/dist/commands/game/android/status.js +15 -58
  40. package/dist/commands/game/build/download.js +24 -24
  41. package/dist/commands/game/build/list.js +37 -37
  42. package/dist/commands/game/create.js +15 -15
  43. package/dist/commands/game/details.js +35 -36
  44. package/dist/commands/game/export.js +12 -12
  45. package/dist/commands/game/ios/app/addTester.js +37 -32
  46. package/dist/commands/game/ios/app/create.js +24 -24
  47. package/dist/commands/game/ios/app/status.js +29 -29
  48. package/dist/commands/game/ios/app/sync.js +31 -31
  49. package/dist/commands/game/ios/profile/create.js +32 -32
  50. package/dist/commands/game/ios/profile/export.js +29 -29
  51. package/dist/commands/game/ios/profile/import.js +33 -33
  52. package/dist/commands/game/ios/profile/status.js +36 -36
  53. package/dist/commands/game/ios/status.js +46 -58
  54. package/dist/commands/game/ios/wizard.js +39 -34
  55. package/dist/commands/game/job/list.js +34 -34
  56. package/dist/commands/game/job/status.js +32 -32
  57. package/dist/commands/game/list.js +38 -40
  58. package/dist/commands/game/ship.js +81 -77
  59. package/dist/commands/game/status.js +38 -85
  60. package/dist/commands/game/wizard.js +253 -242
  61. package/dist/commands/internal/fastlane.js +15 -17
  62. package/dist/commands/internal/readme.js +38 -36
  63. package/dist/commands/login.js +14 -14
  64. package/dist/commands/status.js +32 -30
  65. package/dist/{export-DZxo2_e_.js → export-DLQrUEBK.js} +5 -5
  66. package/dist/{git-DREGq-jc.js → git-BpsfNFZ_.js} +8 -8
  67. package/dist/{import-8pL1AF47.js → import-BoY5e0uJ.js} +14 -14
  68. package/dist/{index-DJ078v-U.js → index-B27WJDxn.js} +43 -27
  69. package/dist/{index-DKQjnJrC.js → index-CisLwc7e.js} +42 -44
  70. package/dist/{index-C6aAyrXW.js → index-Crv7S0bl.js} +6 -6
  71. package/dist/{index-BHh0BZvD.js → index-DC0GJtAy.js} +50 -60
  72. package/dist/{index-CyvGh-kt.js → index-DfUg5j06.js} +93 -92
  73. package/dist/{index-w3lHxk5O.js → index-pj8JVg5X.js} +242 -225
  74. package/dist/{upload-BTpxj3QP.js → upload-C8S17EU_.js} +22 -22
  75. package/dist/{useAndroidServiceAccountTestResult-Dy3Ag7_r.js → useAndroidServiceAccountTestResult-D4e5AKAZ.js} +11 -13
  76. package/dist/{useAppleApp-h1Ogi_qc.js → useAppleApp-Dr6URQvC.js} +4 -4
  77. package/dist/{useAppleBundleId-B3TTNap0.js → useAppleBundleId-DELAwSQp.js} +6 -6
  78. package/dist/{useProjectCredentials-DpeXZcHP.js → useProjectCredentials-BjvdJdQg.js} +10 -12
  79. package/dist/{useWebSocket-gyuCsore.js → useWebSocket-CRV7V69Q.js} +1 -1
  80. package/dist/utils/help.js +4 -4
  81. package/package.json +5 -4
  82. package/dist/Command-DFdHXDiU.js +0 -44
  83. package/dist/CommandGame-Dif-oSky.js +0 -9
  84. package/dist/{RunWithSpinner-BVXNWGD3.js → RunWithSpinner-gMVA07bZ.js} +2 -2
@@ -1,39 +1,40 @@
1
- import { v4 } from 'uuid';
1
+ import fs__default from 'node:fs';
2
+ import { useMutation } from '@tanstack/react-query';
2
3
  import axios from 'axios';
3
4
  import fg from 'fast-glob';
4
- import fs__default from 'fs';
5
- import yazl from 'yazl';
6
- import { useMutation } from '@tanstack/react-query';
7
- import { c as cacheKeys } from './useAndroidServiceAccountTestResult-Dy3Ag7_r.js';
8
- import { _ as queryClient, x as DEFAULT_SHIPPED_FILES_GLOBS, w as DEFAULT_IGNORED_FILES_GLOBS, $ as getNewUploadTicket, a0 as startJobsFromUpload } from './index-w3lHxk5O.js';
9
- import { f as getFileHash, h as getPlatformName } from './index-DJ078v-U.js';
10
- import { g as getCWDGitInfo } from './git-DREGq-jc.js';
5
+ import { v4 } from 'uuid';
6
+ import { ZipFile } from 'yazl';
7
+ import { K as queryClient, v as DEFAULT_SHIPPED_FILES_GLOBS, w as DEFAULT_IGNORED_FILES_GLOBS, $ as getNewUploadTicket, a0 as startJobsFromUpload } from './index-pj8JVg5X.js';
8
+ import { c as cacheKeys } from './useAndroidServiceAccountTestResult-D4e5AKAZ.js';
9
+ import { f as getFileHash, h as getPlatformName } from './index-B27WJDxn.js';
10
+ import { g as getCWDGitInfo } from './git-BpsfNFZ_.js';
11
11
  import { jsx, Fragment } from 'react/jsx-runtime';
12
- import 'react';
13
12
  import 'ink';
14
- import './index-CyvGh-kt.js';
15
13
  import 'ink-spinner';
14
+ import 'react';
16
15
  import 'crypto-js';
17
16
  import 'luxon';
18
- import '@inkjs/ui';
17
+ import 'socket.io-client';
18
+ import { u as useJobWatching } from './JobLogTail-BYcJgPcL.js';
19
+ import 'fullscreen-ink';
20
+ import 'string-length';
21
+ import 'strip-ansi';
19
22
  import 'open';
23
+ import '@inkjs/ui';
24
+ import 'node:path';
20
25
  import 'marked';
21
26
  import 'marked-terminal';
22
- import 'path';
23
- import { P as ProgressSpinner } from './ProgressSpinner-6pw1T8Iw.js';
27
+ import { P as ProgressSpinner } from './ProgressSpinner-Um6ARKlk.js';
24
28
  import 'qrcode';
25
- import 'string-length';
26
- import 'strip-ansi';
27
- import 'socket.io-client';
28
- import { u as useJobWatching } from './JobLogTail-BWzbQBZz.js';
29
+ import './index-DfUg5j06.js';
29
30
 
30
31
  async function ship({ command, log = () => {
31
32
  }, shipFlags }) {
32
33
  log("Fetching game config...");
33
34
  const projectConfig = await command.getProjectConfig();
34
35
  if (!projectConfig.project) throw new Error("No project found in project config");
35
- const hasConfiguredIos = !!projectConfig.project.details?.iosBundleId;
36
- const hasConfiguredAndroid = !!projectConfig.project.details?.androidPackageName;
36
+ const hasConfiguredIos = Boolean(projectConfig.project.details?.iosBundleId);
37
+ const hasConfiguredAndroid = Boolean(projectConfig.project.details?.androidPackageName);
37
38
  if (!hasConfiguredAndroid && !hasConfiguredIos) {
38
39
  throw new Error(
39
40
  "No Android or iOS configuration found. Please run `shipthis game wizard android` or `shipthis game wizard ios` to configure your game."
@@ -45,7 +46,7 @@ async function ship({ command, log = () => {
45
46
  log("Finding files to include in zip...");
46
47
  const files = await fg(shippedFilesGlobs, { dot: true, ignore: ignoredFilesGlobs });
47
48
  log(`Found ${files.length} files, adding to zip...`);
48
- const zipFile = new yazl.ZipFile();
49
+ const zipFile = new ZipFile();
49
50
  for (const file of files) {
50
51
  zipFile.addFile(file, file);
51
52
  }
@@ -65,8 +66,8 @@ async function ship({ command, log = () => {
65
66
  log("Uploading zip file...");
66
67
  await axios.put(uploadTicket.url, zipBuffer, {
67
68
  headers: {
68
- "Content-length": size,
69
- "Content-Type": "application/zip"
69
+ "Content-Type": "application/zip",
70
+ "Content-length": size
70
71
  }
71
72
  });
72
73
  log("Fetching Git info...");
@@ -81,8 +82,8 @@ async function ship({ command, log = () => {
81
82
  const finalFlags = shipFlags || command.getFlags();
82
83
  const startJobsOptions = {
83
84
  ...uploadDetails,
84
- skipPublish: finalFlags.skipPublish,
85
- platform: finalFlags.platform?.toUpperCase()
85
+ platform: finalFlags.platform?.toUpperCase(),
86
+ skipPublish: finalFlags.skipPublish
86
87
  };
87
88
  const jobs = await startJobsFromUpload(uploadTicket.id, startJobsOptions);
88
89
  log("Cleaning up temporary zip file...");
@@ -91,29 +92,30 @@ async function ship({ command, log = () => {
91
92
  if (jobs.length === 0) {
92
93
  throw new Error("No jobs were created. Please check your game configuration and try again.");
93
94
  }
95
+ if (finalFlags?.follow) {
96
+ log("Waiting for job to start...");
97
+ }
94
98
  return jobs;
95
99
  }
96
- const useShip = () => {
97
- return useMutation({
98
- mutationFn: ship,
99
- onSuccess: async (data) => {
100
- queryClient.invalidateQueries({
101
- queryKey: cacheKeys.jobs({ projectId: data[0].project.id, pageNumber: 0 })
102
- });
103
- }
104
- });
105
- };
100
+ const useShip = () => useMutation({
101
+ mutationFn: ship,
102
+ async onSuccess(data) {
103
+ queryClient.invalidateQueries({
104
+ queryKey: cacheKeys.jobs({ pageNumber: 0, projectId: data[0].project.id })
105
+ });
106
+ }
107
+ });
106
108
 
107
109
  const JobProgress = (props) => {
108
110
  const { progress } = useJobWatching({
109
- projectId: props.job.project.id,
110
- jobId: props.job.id,
111
111
  isWatching: true,
112
+ jobId: props.job.id,
112
113
  onComplete: props.onComplete,
113
- onFailure: props.onFailure
114
+ onFailure: props.onFailure,
115
+ projectId: props.job.project.id
114
116
  });
115
117
  const label = `${getPlatformName(props.job.type)} build progress...`;
116
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ProgressSpinner, { progress, label, spinnerType: "dots" }) });
118
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ProgressSpinner, { label, progress, spinnerType: "dots" }) });
117
119
  };
118
120
 
119
121
  export { JobProgress as J, useShip as u };
@@ -1,32 +1,33 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { useState, useEffect } from 'react';
3
2
  import { Box, Text } from 'ink';
4
- import { DateTime } from 'luxon';
5
3
  import Spinner from 'ink-spinner';
6
- import { d as getStageColor, c as getJobStatusColor } from './index-DJ078v-U.js';
7
- import { J as JobStatus } from './index-w3lHxk5O.js';
8
- import 'axios';
4
+ import { DateTime } from 'luxon';
5
+ import { useState, useEffect } from 'react';
6
+ import { J as JobStatus } from './index-pj8JVg5X.js';
9
7
  import '@tanstack/react-query';
8
+ import 'axios';
9
+ import 'node:fs';
10
10
  import 'crypto-js';
11
11
  import 'uuid';
12
- import 'fs';
13
- import { a as getJobSummary } from './index-CyvGh-kt.js';
12
+ import { d as getStageColor, c as getJobStatusColor } from './index-B27WJDxn.js';
13
+ import { a as getJobSummary } from './index-DfUg5j06.js';
14
14
  import 'fast-glob';
15
15
  import 'yazl';
16
16
  import 'socket.io-client';
17
- import { u as useJobWatching } from './JobLogTail-BWzbQBZz.js';
17
+ import { u as useJobWatching } from './JobLogTail-BYcJgPcL.js';
18
+ import 'fullscreen-ink';
19
+ import { a as StatusRow, b as StatusRowLabel } from './StatusTable-DzRWcMr4.js';
18
20
  import { T as Title } from './Title-BCQtayg6.js';
19
- import { a as StatusRow, b as StatusRowLabel } from './StatusTable-Dm5St4g-.js';
20
21
 
21
- const JobStatusSpinner = ({ status, showSpinner }) => /* @__PURE__ */ jsxs(Fragment, { children: [
22
+ const JobStatusSpinner = ({ showSpinner, status }) => /* @__PURE__ */ jsxs(Fragment, { children: [
22
23
  /* @__PURE__ */ jsx(Box, { width: JobStatus.PROCESSING.length, children: /* @__PURE__ */ jsx(Text, { color: getJobStatusColor(status), children: `${status}` }) }),
23
24
  showSpinner && /* @__PURE__ */ jsxs(Fragment, { children: [
24
25
  /* @__PURE__ */ jsx(Text, { children: " " }),
25
26
  /* @__PURE__ */ jsx(Spinner, { type: "dots" })
26
27
  ] })
27
28
  ] });
28
- const JobStatusTable = ({ jobId, projectId, isWatching, onJobUpdate }) => {
29
- const { data: job, stage, isLoading } = useJobWatching({ projectId, jobId, isWatching, onJobUpdate });
29
+ const JobStatusTable = ({ isWatching, jobId, onJobUpdate, projectId }) => {
30
+ const { data: job, isLoading, stage } = useJobWatching({ isWatching, jobId, onJobUpdate, projectId });
30
31
  const [time, setTime] = useState(DateTime.now());
31
32
  useEffect(() => {
32
33
  if (!isWatching) return;
@@ -46,7 +47,7 @@ const JobStatusTable = ({ jobId, projectId, isWatching, onJobUpdate }) => {
46
47
  /* @__PURE__ */ jsx(StatusRow, { label: "Platform", value: summary.platform }),
47
48
  /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
48
49
  /* @__PURE__ */ jsx(StatusRowLabel, { label: "Status" }),
49
- /* @__PURE__ */ jsx(JobStatusSpinner, { status: job.status, showSpinner: isWatching && !!isJobInProgress })
50
+ /* @__PURE__ */ jsx(JobStatusSpinner, { showSpinner: isWatching && Boolean(isJobInProgress), status: job.status })
50
51
  ] }),
51
52
  /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
52
53
  /* @__PURE__ */ jsx(StatusRowLabel, { label: "Stage" }),
@@ -11,8 +11,6 @@ const ListWithTitle = ({ listItems, title }) => {
11
11
  ] });
12
12
  };
13
13
 
14
- const NextSteps = ({ steps }) => {
15
- return /* @__PURE__ */ jsx(ListWithTitle, { listItems: steps, title: "Next Steps" });
16
- };
14
+ const NextSteps = ({ steps }) => /* @__PURE__ */ jsx(ListWithTitle, { listItems: steps, title: "Next Steps" });
17
15
 
18
16
  export { NextSteps as N };
@@ -3,8 +3,8 @@ import { ProgressBar } from '@inkjs/ui';
3
3
  import { Box, Text } from 'ink';
4
4
  import Spinner from 'ink-spinner';
5
5
 
6
- const ProgressSpinner = ({ progress, label, spinnerType, labelProps, boxProps }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Box, { flexDirection: "column", gap: 1, ...boxProps, children: /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
7
- label && label != "" && /* @__PURE__ */ jsx(Text, { ...labelProps, children: label }),
6
+ const ProgressSpinner = ({ boxProps, label, labelProps, progress, spinnerType }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Box, { flexDirection: "column", gap: 1, ...boxProps, children: /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
7
+ label && label !== "" && /* @__PURE__ */ jsx(Text, { ...labelProps, children: label }),
8
8
  /* @__PURE__ */ jsx(ProgressBar, { value: progress || 0 }),
9
9
  /* @__PURE__ */ jsx(Box, { width: 4, children: /* @__PURE__ */ jsxs(Text, { children: [
10
10
  Math.floor(progress || 0),
@@ -1,34 +1,35 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Box, Text } from 'ink';
3
3
  import Spinner from 'ink-spinner';
4
- import 'crypto';
5
- import 'fs';
6
- import 'readline-sync';
7
- import 'node:readline';
4
+ import 'node:crypto';
5
+ import 'node:fs';
8
6
  import 'node:path';
7
+ import 'node:readline';
9
8
  import 'node:url';
9
+ import 'readline-sync';
10
10
  import 'luxon';
11
11
  import 'axios';
12
12
  import 'isomorphic-git';
13
- import './index-w3lHxk5O.js';
13
+ import './index-pj8JVg5X.js';
14
14
  import '@oclif/core';
15
- import 'react';
16
15
  import '@tanstack/react-query';
16
+ import 'react';
17
17
  import 'crypto-js';
18
18
  import 'uuid';
19
- import { u as useProjectCredentials, g as getProjectCredentialSummary } from './useProjectCredentials-DpeXZcHP.js';
19
+ import { u as useProjectCredentials, g as getProjectCredentialSummary } from './useProjectCredentials-BjvdJdQg.js';
20
20
  import 'fast-glob';
21
21
  import 'yazl';
22
22
  import 'socket.io-client';
23
- import { T as Table } from './Table-CvM6pccN.js';
23
+ import 'fullscreen-ink';
24
+ import { T as Table } from './Table-FaNgpyeq.js';
24
25
  import { T as Title } from './Title-BCQtayg6.js';
25
26
 
26
27
  const ProjectCredentialsTable = ({ credentialTypeName, queryProps, ...boxProps }) => {
27
- const { isLoading, data } = useProjectCredentials(queryProps);
28
+ const { data, isLoading } = useProjectCredentials(queryProps);
28
29
  const hasActive = data?.data.some((credential) => credential.isActive);
29
30
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, ...boxProps, children: [
30
31
  /* @__PURE__ */ jsx(Title, { children: `${credentialTypeName}s in your ShipThis account` }),
31
- /* @__PURE__ */ jsx(Box, { marginLeft: 2, marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsx(Text, { children: hasActive ? `You have an active ${credentialTypeName} in your ShipThis account.` : `You DO NOT have an active ${credentialTypeName} which ShipThis can use.` }) }),
32
+ /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 1, marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { children: hasActive ? `You have an active ${credentialTypeName} in your ShipThis account.` : `You DO NOT have an active ${credentialTypeName} which ShipThis can use.` }) }),
32
33
  isLoading && /* @__PURE__ */ jsx(Spinner, { type: "dots" }),
33
34
  data && data.data.length > 0 && /* @__PURE__ */ jsx(Table, { data: data.data.map(getProjectCredentialSummary) })
34
35
  ] });
@@ -2,14 +2,12 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Box, Text } from 'ink';
3
3
  import { T as Title } from './Title-BCQtayg6.js';
4
4
 
5
- const StatusRowLabel = ({ label, width }) => /* @__PURE__ */ jsx(Box, { width: width || 10, marginRight: 2, children: /* @__PURE__ */ jsx(Text, { children: `${label}` }) });
6
- const StatusRow = ({ label, labelWidth, value, ...textProps }) => {
7
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", alignItems: "flex-end", children: [
8
- /* @__PURE__ */ jsx(StatusRowLabel, { width: labelWidth, label }),
9
- /* @__PURE__ */ jsx(Text, { bold: true, ...textProps, children: value })
10
- ] });
11
- };
12
- const StatusTable = ({ title, statuses, colors, ...rest }) => {
5
+ const StatusRowLabel = ({ label, width }) => /* @__PURE__ */ jsx(Box, { marginRight: 2, width: width || 10, children: /* @__PURE__ */ jsx(Text, { children: `${label}` }) });
6
+ const StatusRow = ({ label, labelWidth, value, ...textProps }) => /* @__PURE__ */ jsxs(Box, { alignItems: "flex-end", flexDirection: "row", children: [
7
+ /* @__PURE__ */ jsx(StatusRowLabel, { label, width: labelWidth }),
8
+ /* @__PURE__ */ jsx(Text, { bold: true, ...textProps, children: value })
9
+ ] });
10
+ const StatusTable = ({ colors, statuses, title, ...rest }) => {
13
11
  const getColor = (key) => {
14
12
  const value = statuses[key];
15
13
  if (typeof value === "boolean") return value ? "green" : "red";
@@ -26,7 +24,7 @@ const StatusTable = ({ title, statuses, colors, ...rest }) => {
26
24
  const labelWidth = Math.max(maxLabelLength, 10);
27
25
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", ...rest, children: [
28
26
  /* @__PURE__ */ jsx(Title, { children: title }),
29
- /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginLeft: 2, children: Object.entries(statuses).map(([key, value]) => /* @__PURE__ */ jsx(StatusRow, { labelWidth, label: key, value: getText(key), color: getColor(key) }, key)) })
27
+ /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginLeft: 2, children: Object.entries(statuses).map(([key, value]) => /* @__PURE__ */ jsx(StatusRow, { color: getColor(key), label: key, labelWidth, value: getText(key) }, key)) })
30
28
  ] });
31
29
  };
32
30
 
@@ -1,24 +1,24 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import React from 'react';
3
2
  import { Box, Text } from 'ink';
3
+ import React from 'react';
4
4
 
5
5
  const BASE_HEADER_PROPS = {
6
- color: "blue",
7
- bold: true
6
+ bold: true,
7
+ color: "blue"
8
8
  };
9
9
  const BASE_TEXT_PROPS = {
10
10
  color: "white"
11
11
  };
12
12
  function generateHeaders(data) {
13
- let headers = {};
14
- data.forEach((row) => {
15
- Object.keys(row).forEach((key) => {
13
+ const headers = {};
14
+ for (const row of data) {
15
+ for (const key of Object.keys(row)) {
16
16
  headers[key] = key;
17
- });
18
- });
17
+ }
18
+ }
19
19
  return headers;
20
20
  }
21
- const Table = ({ data, showHeaders = true, headerTextProps, columnTextProps, getTextProps }) => {
21
+ const Table = ({ columnTextProps, data, getTextProps, headerTextProps, showHeaders = true }) => {
22
22
  const columns = getColumns(data);
23
23
  const fullHeaderTextProps = {
24
24
  ...BASE_HEADER_PROPS,
@@ -38,13 +38,13 @@ const Table = ({ data, showHeaders = true, headerTextProps, columnTextProps, get
38
38
  ] });
39
39
  };
40
40
  function getColumns(data) {
41
- let columnWidths = {};
42
- data.forEach((row) => {
43
- Object.keys(row).forEach((key) => {
41
+ const columnWidths = {};
42
+ for (const row of data) {
43
+ for (const key of Object.keys(row)) {
44
44
  const valueLength = row[key]?.toString().length || 0;
45
45
  columnWidths[key] = Math.max(columnWidths[key] || key.length, valueLength);
46
- });
47
- });
46
+ }
47
+ }
48
48
  return Object.keys(columnWidths).map((key) => ({
49
49
  key,
50
50
  width: (columnWidths[key] ?? 0) + 2
@@ -76,7 +76,7 @@ function renderRow(row, columns, baseCellTextProps, columnTextProps, getTextProp
76
76
  const cellTextProps = getTextPropsForCell(row, column);
77
77
  return /* @__PURE__ */ jsxs(React.Fragment, { children: [
78
78
  index !== 0 && /* @__PURE__ */ jsx(Text, { children: "\u2502" }),
79
- /* @__PURE__ */ jsx(Box, { width: column.width, justifyContent: "center", children: /* @__PURE__ */ jsx(Text, { ...cellTextProps, children: getDisplayValue(row, column) }) })
79
+ /* @__PURE__ */ jsx(Box, { justifyContent: "center", width: column.width, children: /* @__PURE__ */ jsx(Text, { ...cellTextProps, children: getDisplayValue(row, column) }) })
80
80
  ] }, column.key);
81
81
  }),
82
82
  /* @__PURE__ */ jsx(Text, { children: "\u2502" })
@@ -1,27 +1,28 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Box, Text } from 'ink';
3
3
  import Spinner from 'ink-spinner';
4
- import 'crypto';
5
- import 'fs';
6
- import 'readline-sync';
7
- import 'node:readline';
4
+ import 'node:crypto';
5
+ import 'node:fs';
8
6
  import 'node:path';
7
+ import 'node:readline';
9
8
  import 'node:url';
9
+ import 'readline-sync';
10
10
  import 'luxon';
11
11
  import axios from 'axios';
12
12
  import 'isomorphic-git';
13
- import { b as getShortDate, p as getAuthedHeaders, q as API_URL, I as castArrayObjectDates } from './index-w3lHxk5O.js';
13
+ import { b as getShortDate, p as getAuthedHeaders, o as API_URL, I as castArrayObjectDates } from './index-pj8JVg5X.js';
14
14
  import '@oclif/core';
15
- import 'react';
16
15
  import { useQuery } from '@tanstack/react-query';
16
+ import 'react';
17
17
  import 'crypto-js';
18
18
  import 'uuid';
19
19
  import 'fast-glob';
20
20
  import 'yazl';
21
- import { c as cacheKeys } from './useAndroidServiceAccountTestResult-Dy3Ag7_r.js';
22
- import { g as getShortUUID } from './index-DJ078v-U.js';
21
+ import { c as cacheKeys } from './useAndroidServiceAccountTestResult-D4e5AKAZ.js';
22
+ import { g as getShortUUID } from './index-B27WJDxn.js';
23
23
  import 'socket.io-client';
24
- import { T as Table } from './Table-CvM6pccN.js';
24
+ import 'fullscreen-ink';
25
+ import { T as Table } from './Table-FaNgpyeq.js';
25
26
  import { T as Title } from './Title-BCQtayg6.js';
26
27
 
27
28
  async function queryUserCredentials(params) {
@@ -40,11 +41,11 @@ async function queryUserCredentials(params) {
40
41
  }
41
42
  function getUserCredentialSummary(credential) {
42
43
  return {
44
+ createdAt: getShortDate(credential.createdAt),
43
45
  id: getShortUUID(credential.id),
44
- type: credential.type,
45
- serial: credential.serialNumber,
46
46
  isActive: credential.isActive,
47
- createdAt: getShortDate(credential.createdAt)
47
+ serial: credential.serialNumber,
48
+ type: credential.type
48
49
  };
49
50
  }
50
51
  const useUserCredentials = ({
@@ -53,15 +54,13 @@ const useUserCredentials = ({
53
54
  ...pageAndSortParams
54
55
  }) => {
55
56
  const queryResult = useQuery({
56
- queryKey: cacheKeys.userCredentials(pageAndSortParams),
57
57
  queryFn: async () => queryUserCredentials(pageAndSortParams),
58
- select: (data) => {
58
+ queryKey: cacheKeys.userCredentials(pageAndSortParams),
59
+ select(data) {
59
60
  if (!(platform || type)) return data;
60
61
  return {
61
62
  ...data,
62
- data: data.data.filter((credential) => {
63
- return (!platform || credential.platform === platform) && (!type || credential.type === type);
64
- })
63
+ data: data.data.filter((credential) => (!platform || credential.platform === platform) && (!type || credential.type === type))
65
64
  };
66
65
  }
67
66
  });
@@ -69,11 +68,11 @@ const useUserCredentials = ({
69
68
  };
70
69
 
71
70
  const UserCredentialsTable = ({ credentialTypeName, queryProps, ...boxProps }) => {
72
- const { isLoading, data } = useUserCredentials(queryProps);
71
+ const { data, isLoading } = useUserCredentials(queryProps);
73
72
  const hasActive = data?.data.some((credential) => credential.isActive);
74
73
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, ...boxProps, children: [
75
74
  /* @__PURE__ */ jsx(Title, { children: `${credentialTypeName}s in your ShipThis account` }),
76
- /* @__PURE__ */ jsx(Box, { marginLeft: 2, marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsx(Text, { children: hasActive ? `You have an active ${credentialTypeName} in your ShipThis account.` : `You DO NOT have an active ${credentialTypeName} which ShipThis can use.` }) }),
75
+ /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 1, marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { children: hasActive ? `You have an active ${credentialTypeName} in your ShipThis account.` : `You DO NOT have an active ${credentialTypeName} which ShipThis can use.` }) }),
77
76
  isLoading && /* @__PURE__ */ jsx(Spinner, { type: "dots" }),
78
77
  data && data.data.length > 0 && /* @__PURE__ */ jsx(Table, { data: data.data.map(getUserCredentialSummary) })
79
78
  ] });
@@ -1,4 +1,4 @@
1
- import { B as BaseAuthenticatedCommand } from './index-w3lHxk5O.js';
1
+ import { B as BaseAuthenticatedCommand } from './index-pj8JVg5X.js';
2
2
 
3
3
  class BaseAppleCommand extends BaseAuthenticatedCommand {
4
4
  async init() {
@@ -1,28 +1,7 @@
1
- import { c as BaseGameCommand, O as getGodotAndroidPackageName, Q as getGoogleStatus } from './index-w3lHxk5O.js';
2
- import { b as generatePackageName, a as getInput } from './index-DJ078v-U.js';
1
+ import { c as BaseGameCommand, Q as getGoogleStatus, R as getGodotAndroidPackageName } from './index-pj8JVg5X.js';
2
+ import { b as generatePackageName, a as getInput } from './index-B27WJDxn.js';
3
3
 
4
4
  class BaseGameAndroidCommand extends BaseGameCommand {
5
- async init() {
6
- await super.init();
7
- await this.ensureWeHaveAndroidPackageName();
8
- }
9
- // Prompts the user for the Android package name
10
- async getAndroidPackageName(gameId) {
11
- const game = await this.getGame();
12
- const generated = generatePackageName(game.name);
13
- const suggested = game.details?.iosBundleId || getGodotAndroidPackageName() || generated || "com.example.game";
14
- const question = `Please enter the Android Package Name, or press enter to use ${suggested}: `;
15
- const entered = await getInput(question);
16
- return entered || suggested;
17
- }
18
- // Forces us to have the androidPackageName in the game details
19
- async ensureWeHaveAndroidPackageName() {
20
- const game = await this.getGame();
21
- if (!game.details?.androidPackageName) {
22
- const androidPackageName = await this.getAndroidPackageName(game.id);
23
- await this.updateGame({ details: { ...game.details, androidPackageName } });
24
- }
25
- }
26
5
  async checkGoogleAuth(waitForAuth = false) {
27
6
  let status = await getGoogleStatus();
28
7
  if (status.isAuthenticated) return;
@@ -38,6 +17,27 @@ class BaseGameAndroidCommand extends BaseGameCommand {
38
17
  }
39
18
  this.error("Google authentication failed. Please try again.", { exit: 1 });
40
19
  }
20
+ // Forces us to have the androidPackageName in the game details
21
+ async ensureWeHaveAndroidPackageName() {
22
+ const game = await this.getGame();
23
+ if (!game.details?.androidPackageName) {
24
+ const androidPackageName = await this.getAndroidPackageName(game.id);
25
+ await this.updateGame({ details: { ...game.details, androidPackageName } });
26
+ }
27
+ }
28
+ // Prompts the user for the Android package name
29
+ async getAndroidPackageName(gameId) {
30
+ const game = await this.getGame();
31
+ const generated = generatePackageName(game.name);
32
+ const suggested = game.details?.iosBundleId || getGodotAndroidPackageName() || generated || "com.example.game";
33
+ const question = `Please enter the Android Package Name, or press enter to use ${suggested}: `;
34
+ const entered = await getInput(question);
35
+ return entered || suggested;
36
+ }
37
+ async init() {
38
+ await super.init();
39
+ await this.ensureWeHaveAndroidPackageName();
40
+ }
41
41
  }
42
42
 
43
43
  export { BaseGameAndroidCommand as B };
@@ -1,43 +1,43 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Flags } from '@oclif/core';
3
3
  import { render } from 'ink';
4
- import { P as Platform, C as CredentialsType, A as ApiKey, a as ApiKeyType, U as UserRole } from '../../../index-w3lHxk5O.js';
5
- import { g as getUserCredentials } from '../../../index-C6aAyrXW.js';
6
- import 'react';
7
- import '../../../index-CyvGh-kt.js';
4
+ import { g as getUserCredentials } from '../../../index-Crv7S0bl.js';
5
+ import { P as Platform, C as CredentialsType, A as ApiKey, U as UserRole, a as ApiKeyType } from '../../../index-pj8JVg5X.js';
8
6
  import 'ink-spinner';
9
- import 'axios';
10
- import 'crypto-js';
11
- import 'uuid';
12
- import 'fs';
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';
7
+ import 'node:crypto';
8
+ import 'node:fs';
20
9
  import 'node:path';
10
+ import 'node:readline';
21
11
  import 'node:url';
12
+ import 'readline-sync';
13
+ import 'luxon';
14
+ import 'axios';
22
15
  import 'isomorphic-git';
16
+ import '@tanstack/react-query';
17
+ import 'react';
18
+ import 'crypto-js';
19
+ import 'uuid';
23
20
  import 'fast-glob';
21
+ import 'yazl';
24
22
  import 'socket.io-client';
23
+ import 'fullscreen-ink';
24
+ import 'string-length';
25
+ import 'strip-ansi';
25
26
  import 'open';
27
+ import '@inkjs/ui';
26
28
  import 'marked';
27
29
  import 'marked-terminal';
28
- import 'path';
29
30
  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-DFdHXDiU.js';
34
- import { B as BaseAppleCommand } from '../../../baseAppleCommand-zhkGlKq0.js';
35
- import { u as uploadUserCredentials } from '../../../upload-BTpxj3QP.js';
31
+ import { R as RunWithSpinner } from '../../../RunWithSpinner-gMVA07bZ.js';
32
+ import '../../../index-DfUg5j06.js';
33
+ import { C as Command } from '../../../Command-BDIkuv2g.js';
34
+ import { B as BaseAppleCommand } from '../../../baseAppleCommand-BKXweb-U.js';
35
+ import { u as uploadUserCredentials } from '../../../upload-C8S17EU_.js';
36
36
  import '@expo/apple-utils/build/index.js';
37
- import 'ini';
38
37
  import 'deepmerge';
39
- import '../../../index-DJ078v-U.js';
40
- import '../../../useAndroidServiceAccountTestResult-Dy3Ag7_r.js';
38
+ import 'ini';
39
+ import '../../../index-B27WJDxn.js';
40
+ import '../../../useAndroidServiceAccountTestResult-D4e5AKAZ.js';
41
41
 
42
42
  class AppleApiKeyCreate extends BaseAppleCommand {
43
43
  static args = {};
@@ -52,34 +52,34 @@ class AppleApiKeyCreate extends BaseAppleCommand {
52
52
  const { force } = flags;
53
53
  const userCredentials = await getUserCredentials();
54
54
  const userAppleApiKeyCredentials = userCredentials.filter(
55
- (cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.KEY
55
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.KEY
56
56
  );
57
- if (userAppleApiKeyCredentials.length !== 0 && !force) {
57
+ if (userAppleApiKeyCredentials.length > 0 && !force) {
58
58
  this.error("An App Store Connect API already exists. Use --force to overwrite it.");
59
59
  }
60
60
  const authState = await this.refreshAppleAuthState();
61
61
  const ctx = authState.context;
62
62
  const createApiKey = async () => {
63
63
  const userKey = await ApiKey.createAsync(ctx, {
64
- nickname: `ShipThis ${Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3)}`,
65
64
  allAppsVisible: true,
66
- roles: [UserRole.ADMIN],
67
- keyType: ApiKeyType.PUBLIC_API
65
+ keyType: ApiKeyType.PUBLIC_API,
66
+ nickname: `ShipThis ${Math.floor(Date.now() / 1e3)}`,
67
+ roles: [UserRole.ADMIN]
68
68
  });
69
69
  const keyContent = await userKey.downloadAsync();
70
70
  if (!keyContent) throw new Error("Failed to download key content");
71
71
  const reloadedKey = await ApiKey.infoAsync(ctx, { id: userKey.id });
72
72
  const key = {
73
- keyId: userKey.id,
74
73
  issuer: `${reloadedKey.attributes.provider?.id}`,
74
+ keyId: userKey.id,
75
75
  p8Content: keyContent,
76
76
  serialNumber: userKey.id
77
77
  };
78
78
  await uploadUserCredentials({
79
- platform: Platform.IOS,
80
- type: CredentialsType.KEY,
81
79
  contents: key,
82
- serialNumber: key.serialNumber
80
+ platform: Platform.IOS,
81
+ serialNumber: key.serialNumber,
82
+ type: CredentialsType.KEY
83
83
  });
84
84
  };
85
85
  const handleComplete = async () => {
@@ -90,9 +90,9 @@ class AppleApiKeyCreate extends BaseAppleCommand {
90
90
  /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
91
91
  RunWithSpinner,
92
92
  {
93
- msgInProgress: `Creating App Store Connect API in the Apple Developer Portal...`,
94
- msgComplete: `App Store Connect API created and saved to ShipThis`,
95
93
  executeMethod: createApiKey,
94
+ msgComplete: `App Store Connect API created and saved to ShipThis`,
95
+ msgInProgress: `Creating App Store Connect API in the Apple Developer Portal...`,
96
96
  onComplete: handleComplete
97
97
  }
98
98
  ) })