shipthis 0.1.31 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AppleBundleIdDetails-eoK5F8Qn.js → AppleBundleIdDetails-6H3cNWxw.js} +17 -19
- package/dist/Command-WPpmLPkL.js +29 -0
- package/dist/CommandGame-cxzWG4nT.js +7 -0
- package/dist/{Create-ISdroJ3G.js → Create-3Ob8sjik.js} +20 -20
- package/dist/GameStatus-BQEtVKvv.js +137 -0
- package/dist/{Import-CfThJF6k.js → Import-CFuPDI0K.js} +33 -35
- package/dist/{JobLogTail-BWzbQBZz.js → JobLogTail-0CBLoG8N.js} +53 -52
- package/dist/{JobProgress-DjIkuk5U.js → JobProgress-lKqVT88m.js} +35 -36
- package/dist/{JobStatusTable-CEqWU73q.js → JobStatusTable-C_ZsZJCm.js} +14 -13
- package/dist/{NextSteps-CK9zHOCt.js → NextSteps-DbJHmscQ.js} +1 -3
- package/dist/{ProgressSpinner-6pw1T8Iw.js → ProgressSpinner-DGcakQSK.js} +1 -1
- package/dist/{ProjectCredentialsTable-u9ruZ9mN.js → ProjectCredentialsTable-B5pHOnGu.js} +11 -10
- package/dist/{StatusTable-Dm5St4g-.js → StatusTable-DzRWcMr4.js} +7 -9
- package/dist/{Table-CvM6pccN.js → Table-FaNgpyeq.js} +15 -15
- package/dist/{UserCredentialsTable-Q7u9M-ap.js → UserCredentialsTable-3W3qesh7.js} +18 -19
- package/dist/{baseAppleCommand-zhkGlKq0.js → baseAppleCommand-BGV088--.js} +1 -1
- package/dist/{baseGameAndroidCommand-DJ-cMLa_.js → baseGameAndroidCommand-CsemgVjp.js} +23 -23
- package/dist/commands/apple/apiKey/create.js +35 -35
- package/dist/commands/apple/apiKey/export.js +26 -26
- package/dist/commands/apple/apiKey/import.js +27 -27
- package/dist/commands/apple/apiKey/status.js +31 -31
- package/dist/commands/apple/certificate/create.js +39 -39
- package/dist/commands/apple/certificate/export.js +26 -26
- package/dist/commands/apple/certificate/import.js +27 -27
- package/dist/commands/apple/certificate/status.js +31 -31
- package/dist/commands/apple/login.js +15 -16
- package/dist/commands/apple/status.js +27 -27
- package/dist/commands/dashboard.js +10 -11
- package/dist/commands/game/android/apiKey/connect.js +28 -28
- package/dist/commands/game/android/apiKey/create.js +28 -28
- package/dist/commands/game/android/apiKey/export.js +29 -29
- package/dist/commands/game/android/apiKey/import.js +31 -31
- package/dist/commands/game/android/apiKey/invite.js +14 -15
- package/dist/commands/game/android/apiKey/status.js +29 -29
- package/dist/commands/game/android/keyStore/create.js +24 -24
- package/dist/commands/game/android/keyStore/export.js +28 -28
- package/dist/commands/game/android/keyStore/import.js +35 -35
- package/dist/commands/game/android/keyStore/status.js +26 -26
- package/dist/commands/game/android/status.js +14 -58
- package/dist/commands/game/build/download.js +24 -24
- package/dist/commands/game/build/list.js +37 -37
- package/dist/commands/game/create.js +15 -16
- package/dist/commands/game/details.js +35 -36
- package/dist/commands/game/export.js +12 -13
- package/dist/commands/game/ios/app/addTester.js +24 -24
- package/dist/commands/game/ios/app/create.js +24 -24
- package/dist/commands/game/ios/app/status.js +29 -29
- package/dist/commands/game/ios/app/sync.js +31 -31
- package/dist/commands/game/ios/profile/create.js +30 -30
- package/dist/commands/game/ios/profile/export.js +28 -28
- package/dist/commands/game/ios/profile/import.js +32 -32
- package/dist/commands/game/ios/profile/status.js +36 -36
- package/dist/commands/game/ios/status.js +46 -58
- package/dist/commands/game/ios/wizard.js +31 -31
- package/dist/commands/game/job/list.js +34 -34
- package/dist/commands/game/job/status.js +31 -31
- package/dist/commands/game/list.js +37 -39
- package/dist/commands/game/ship.js +73 -71
- package/dist/commands/game/status.js +38 -85
- package/dist/commands/game/wizard.js +250 -239
- package/dist/commands/internal/fastlane.js +15 -18
- package/dist/commands/internal/readme.js +38 -37
- package/dist/commands/login.js +14 -15
- package/dist/commands/status.js +32 -30
- package/dist/{export-DZxo2_e_.js → export-CXsVPXA1.js} +5 -5
- package/dist/{git-DREGq-jc.js → git-BpsfNFZ_.js} +8 -8
- package/dist/{import-8pL1AF47.js → import-DGvG5REx.js} +14 -14
- package/dist/{index-w3lHxk5O.js → index-BhhiXbey.js} +240 -224
- package/dist/{index-BHh0BZvD.js → index-C03TV1_J.js} +37 -55
- package/dist/{index-CyvGh-kt.js → index-C66Dd8Xc.js} +77 -87
- package/dist/{index-DJ078v-U.js → index-CGBdOm1q.js} +43 -28
- package/dist/{index-DKQjnJrC.js → index-CS9Gwcb0.js} +41 -43
- package/dist/{index-C6aAyrXW.js → index-CtTI85m-.js} +6 -6
- package/dist/{upload-BTpxj3QP.js → upload-8y5MQEm9.js} +22 -22
- package/dist/{useAndroidServiceAccountTestResult-Dy3Ag7_r.js → useAndroidServiceAccountTestResult-DZk5SMxI.js} +11 -13
- package/dist/{useAppleApp-h1Ogi_qc.js → useAppleApp-DWYGURwU.js} +4 -4
- package/dist/{useAppleBundleId-B3TTNap0.js → useAppleBundleId-PsTJ2g1B.js} +6 -6
- package/dist/{useProjectCredentials-DpeXZcHP.js → useProjectCredentials-BEphqa18.js} +10 -12
- package/dist/{useWebSocket-gyuCsore.js → useWebSocket-5PYa2QER.js} +1 -1
- package/dist/utils/help.js +4 -4
- package/package.json +4 -3
- package/dist/Command-DFdHXDiU.js +0 -44
- package/dist/CommandGame-Dif-oSky.js +0 -9
- package/dist/{RunWithSpinner-BVXNWGD3.js → RunWithSpinner-gMVA07bZ.js} +2 -2
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import
|
|
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
|
|
5
|
+
import { v4 } from 'uuid';
|
|
5
6
|
import yazl from 'yazl';
|
|
6
|
-
import {
|
|
7
|
-
import { c as cacheKeys } from './useAndroidServiceAccountTestResult-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { g as getCWDGitInfo } from './git-DREGq-jc.js';
|
|
7
|
+
import { K as queryClient, v as DEFAULT_SHIPPED_FILES_GLOBS, w as DEFAULT_IGNORED_FILES_GLOBS, $ as getNewUploadTicket, a0 as startJobsFromUpload } from './index-BhhiXbey.js';
|
|
8
|
+
import { c as cacheKeys } from './useAndroidServiceAccountTestResult-DZk5SMxI.js';
|
|
9
|
+
import { f as getFileHash, h as getPlatformName } from './index-CGBdOm1q.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 '
|
|
17
|
+
import 'socket.io-client';
|
|
18
|
+
import { u as useJobWatching } from './JobLogTail-0CBLoG8N.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 '
|
|
23
|
-
import { P as ProgressSpinner } from './ProgressSpinner-6pw1T8Iw.js';
|
|
27
|
+
import { P as ProgressSpinner } from './ProgressSpinner-DGcakQSK.js';
|
|
24
28
|
import 'qrcode';
|
|
25
|
-
import '
|
|
26
|
-
import 'strip-ansi';
|
|
27
|
-
import 'socket.io-client';
|
|
28
|
-
import { u as useJobWatching } from './JobLogTail-BWzbQBZz.js';
|
|
29
|
+
import './index-C66Dd8Xc.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 =
|
|
36
|
-
const hasConfiguredAndroid =
|
|
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."
|
|
@@ -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-
|
|
69
|
-
"Content-
|
|
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
|
-
|
|
85
|
-
|
|
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...");
|
|
@@ -93,27 +94,25 @@ async function ship({ command, log = () => {
|
|
|
93
94
|
}
|
|
94
95
|
return jobs;
|
|
95
96
|
}
|
|
96
|
-
const useShip = () => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
};
|
|
97
|
+
const useShip = () => useMutation({
|
|
98
|
+
mutationFn: ship,
|
|
99
|
+
async onSuccess(data) {
|
|
100
|
+
queryClient.invalidateQueries({
|
|
101
|
+
queryKey: cacheKeys.jobs({ pageNumber: 0, projectId: data[0].project.id })
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
106
105
|
|
|
107
106
|
const JobProgress = (props) => {
|
|
108
107
|
const { progress } = useJobWatching({
|
|
109
|
-
projectId: props.job.project.id,
|
|
110
|
-
jobId: props.job.id,
|
|
111
108
|
isWatching: true,
|
|
109
|
+
jobId: props.job.id,
|
|
112
110
|
onComplete: props.onComplete,
|
|
113
|
-
onFailure: props.onFailure
|
|
111
|
+
onFailure: props.onFailure,
|
|
112
|
+
projectId: props.job.project.id
|
|
114
113
|
});
|
|
115
114
|
const label = `${getPlatformName(props.job.type)} build progress...`;
|
|
116
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ProgressSpinner, {
|
|
115
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ProgressSpinner, { label, progress, spinnerType: "dots" }) });
|
|
117
116
|
};
|
|
118
117
|
|
|
119
118
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
import '
|
|
4
|
+
import { DateTime } from 'luxon';
|
|
5
|
+
import { useState, useEffect } from 'react';
|
|
6
|
+
import { J as JobStatus } from './index-BhhiXbey.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 '
|
|
13
|
-
import { a as getJobSummary } from './index-
|
|
12
|
+
import { d as getStageColor, c as getJobStatusColor } from './index-CGBdOm1q.js';
|
|
13
|
+
import { a as getJobSummary } from './index-C66Dd8Xc.js';
|
|
14
14
|
import 'fast-glob';
|
|
15
15
|
import 'yazl';
|
|
16
16
|
import 'socket.io-client';
|
|
17
|
-
import { u as useJobWatching } from './JobLogTail-
|
|
17
|
+
import { u as useJobWatching } from './JobLogTail-0CBLoG8N.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 = ({
|
|
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 = ({
|
|
29
|
-
const { data: job,
|
|
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, {
|
|
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,7 +3,7 @@ import { ProgressBar } from '@inkjs/ui';
|
|
|
3
3
|
import { Box, Text } from 'ink';
|
|
4
4
|
import Spinner from 'ink-spinner';
|
|
5
5
|
|
|
6
|
-
const ProgressSpinner = ({
|
|
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
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: [
|
|
@@ -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-
|
|
13
|
+
import './index-BhhiXbey.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-
|
|
19
|
+
import { u as useProjectCredentials, g as getProjectCredentialSummary } from './useProjectCredentials-BEphqa18.js';
|
|
20
20
|
import 'fast-glob';
|
|
21
21
|
import 'yazl';
|
|
22
22
|
import 'socket.io-client';
|
|
23
|
-
import
|
|
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 {
|
|
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, {
|
|
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,
|
|
6
|
-
const StatusRow = ({ label, labelWidth, value, ...textProps }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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, {
|
|
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
|
-
|
|
7
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
Object.keys(row)
|
|
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,
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
Object.keys(row)
|
|
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,
|
|
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,
|
|
13
|
+
import { b as getShortDate, p as getAuthedHeaders, o as API_URL, I as castArrayObjectDates } from './index-BhhiXbey.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-
|
|
22
|
-
import { g as getShortUUID } from './index-
|
|
21
|
+
import { c as cacheKeys } from './useAndroidServiceAccountTestResult-DZk5SMxI.js';
|
|
22
|
+
import { g as getShortUUID } from './index-CGBdOm1q.js';
|
|
23
23
|
import 'socket.io-client';
|
|
24
|
-
import
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
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, {
|
|
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,28 +1,7 @@
|
|
|
1
|
-
import { c as BaseGameCommand,
|
|
2
|
-
import { b as generatePackageName, a as getInput } from './index-
|
|
1
|
+
import { c as BaseGameCommand, Q as getGoogleStatus, R as getGodotAndroidPackageName } from './index-BhhiXbey.js';
|
|
2
|
+
import { b as generatePackageName, a as getInput } from './index-CGBdOm1q.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 {
|
|
5
|
-
import {
|
|
6
|
-
import 'react';
|
|
7
|
-
import '../../../index-CyvGh-kt.js';
|
|
4
|
+
import { g as getUserCredentials } from '../../../index-CtTI85m-.js';
|
|
5
|
+
import { P as Platform, C as CredentialsType, A as ApiKey, U as UserRole, a as ApiKeyType } from '../../../index-BhhiXbey.js';
|
|
8
6
|
import 'ink-spinner';
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
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-
|
|
31
|
-
import '
|
|
32
|
-
import '
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { u as uploadUserCredentials } from '../../../upload-BTpxj3QP.js';
|
|
31
|
+
import { R as RunWithSpinner } from '../../../RunWithSpinner-gMVA07bZ.js';
|
|
32
|
+
import '../../../index-C66Dd8Xc.js';
|
|
33
|
+
import { C as Command } from '../../../Command-WPpmLPkL.js';
|
|
34
|
+
import { B as BaseAppleCommand } from '../../../baseAppleCommand-BGV088--.js';
|
|
35
|
+
import { u as uploadUserCredentials } from '../../../upload-8y5MQEm9.js';
|
|
36
36
|
import '@expo/apple-utils/build/index.js';
|
|
37
|
-
import 'ini';
|
|
38
37
|
import 'deepmerge';
|
|
39
|
-
import '
|
|
40
|
-
import '../../../
|
|
38
|
+
import 'ini';
|
|
39
|
+
import '../../../index-CGBdOm1q.js';
|
|
40
|
+
import '../../../useAndroidServiceAccountTestResult-DZk5SMxI.js';
|
|
41
41
|
|
|
42
42
|
class AppleApiKeyCreate extends BaseAppleCommand {
|
|
43
43
|
static args = {};
|
|
@@ -54,32 +54,32 @@ class AppleApiKeyCreate extends BaseAppleCommand {
|
|
|
54
54
|
const userAppleApiKeyCredentials = userCredentials.filter(
|
|
55
55
|
(cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.KEY
|
|
56
56
|
);
|
|
57
|
-
if (userAppleApiKeyCredentials.length
|
|
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
|
-
|
|
67
|
-
|
|
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
|
-
|
|
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
|
) })
|