shipthis 0.1.4 → 0.1.6

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 (132) hide show
  1. package/dist/AppleBundleIdDetails-Df30MPFC.js +73 -0
  2. package/dist/Command-DxmQn3XT.js +204 -0
  3. package/dist/CommandGame-DspVLTPZ.js +8 -0
  4. package/dist/CreateKeystore-D8uTRamD.js +56 -0
  5. package/dist/JobProgress-Dk0UoNah.js +108 -0
  6. package/dist/JobStatusTable-q4atKzhu.js +75 -0
  7. package/dist/ProgressSpinner-6pw1T8Iw.js +16 -0
  8. package/dist/ProjectCredentialsTable-BIWBAXCh.js +37 -0
  9. package/dist/UserCredentialsTable-CeJS3_hd.js +82 -0
  10. package/dist/baseAppleCommand-D-G4h8zQ.js +10 -0
  11. package/dist/baseGameAndroidCommand-DD0H8iy-.js +43 -0
  12. package/dist/commands/apple/apiKey/create.js +7 -7
  13. package/dist/commands/apple/apiKey/export.js +6 -6
  14. package/dist/commands/apple/apiKey/import.js +6 -6
  15. package/dist/commands/apple/apiKey/status.js +6 -6
  16. package/dist/commands/apple/certificate/create.js +7 -7
  17. package/dist/commands/apple/certificate/export.js +6 -6
  18. package/dist/commands/apple/certificate/import.js +6 -6
  19. package/dist/commands/apple/certificate/status.js +6 -6
  20. package/dist/commands/apple/login.js +2 -2
  21. package/dist/commands/apple/status.js +4 -4
  22. package/dist/commands/dashboard.js +1 -1
  23. package/dist/commands/game/android/apiKey/connect.js +8 -8
  24. package/dist/commands/game/android/apiKey/create.js +11 -10
  25. package/dist/commands/game/android/apiKey/export.js +7 -7
  26. package/dist/commands/game/android/apiKey/import.js +7 -7
  27. package/dist/commands/game/android/apiKey/invite.js +4 -4
  28. package/dist/commands/game/android/apiKey/status.js +7 -7
  29. package/dist/commands/game/android/keyStore/create.js +8 -8
  30. package/dist/commands/game/android/keyStore/export.js +6 -6
  31. package/dist/commands/game/android/keyStore/import.js +6 -6
  32. package/dist/commands/game/android/keyStore/status.js +6 -6
  33. package/dist/commands/game/android/status.js +4 -4
  34. package/dist/commands/game/android/wizard.js +18 -81
  35. package/dist/commands/game/build/download.js +4 -4
  36. package/dist/commands/game/build/list.js +5 -5
  37. package/dist/commands/game/create.js +2 -2
  38. package/dist/commands/game/details.js +4 -4
  39. package/dist/commands/game/export.js +1 -1
  40. package/dist/commands/game/ios/app/addTester.js +5 -5
  41. package/dist/commands/game/ios/app/create.js +4 -4
  42. package/dist/commands/game/ios/app/status.js +7 -7
  43. package/dist/commands/game/ios/app/sync.js +5 -5
  44. package/dist/commands/game/ios/profile/create.js +7 -7
  45. package/dist/commands/game/ios/profile/export.js +6 -6
  46. package/dist/commands/game/ios/profile/import.js +6 -6
  47. package/dist/commands/game/ios/profile/status.js +7 -7
  48. package/dist/commands/game/ios/status.js +7 -7
  49. package/dist/commands/game/ios/wizard.js +2 -2
  50. package/dist/commands/game/job/list.js +4 -4
  51. package/dist/commands/game/job/status.js +10 -59
  52. package/dist/commands/game/list.js +4 -4
  53. package/dist/commands/game/ship.js +73 -50
  54. package/dist/commands/game/status.js +4 -4
  55. package/dist/commands/game/wizard.js +1 -1
  56. package/dist/commands/internal/fastlane.js +1 -1
  57. package/dist/commands/internal/readme.js +3 -3
  58. package/dist/commands/login.js +2 -2
  59. package/dist/commands/status.js +4 -4
  60. package/dist/export-BDxGDZdh.js +36 -0
  61. package/dist/import-BrlJuE2Z.js +38 -0
  62. package/dist/index-BDFKyTPb.js +24 -0
  63. package/dist/index-BL-1G60K.js +135 -0
  64. package/dist/index-DBrQda8r.js +122 -0
  65. package/dist/index-DdABTtYO.js +693 -0
  66. package/dist/index-wyPoxiTc.js +136 -0
  67. package/dist/upload-LXRr4pMa.js +60 -0
  68. package/dist/useAndroidServiceAccountTestResult-InDf5WSl.js +52 -0
  69. package/dist/useAppleApp-DgE0wEaq.js +32 -0
  70. package/dist/useAppleBundleId-DtLODy3p.js +64 -0
  71. package/dist/useJobWatching-P5oC7mNB.js +45 -0
  72. package/dist/useProjectCredentials-BRffcsO3.js +54 -0
  73. package/dist/useWebSocket-D8PojLtx.js +36 -0
  74. package/docs/apple/apiKey/create.md +1 -1
  75. package/docs/apple/apiKey/export.md +1 -1
  76. package/docs/apple/apiKey/import.md +1 -1
  77. package/docs/apple/apiKey/status.md +1 -1
  78. package/docs/apple/apiKey.md +4 -4
  79. package/docs/apple/certificate/create.md +1 -1
  80. package/docs/apple/certificate/export.md +1 -1
  81. package/docs/apple/certificate/import.md +1 -1
  82. package/docs/apple/certificate/status.md +1 -1
  83. package/docs/apple/certificate.md +4 -4
  84. package/docs/apple/login.md +1 -1
  85. package/docs/apple/status.md +2 -1
  86. package/docs/dashboard.md +1 -1
  87. package/docs/game/android/apiKey/connect.md +1 -1
  88. package/docs/game/android/apiKey/create.md +1 -1
  89. package/docs/game/android/apiKey/export.md +1 -1
  90. package/docs/game/android/apiKey/import.md +1 -1
  91. package/docs/game/android/apiKey/invite.md +1 -1
  92. package/docs/game/android/apiKey/status.md +1 -1
  93. package/docs/game/android/apiKey.md +6 -6
  94. package/docs/game/android/keyStore/create.md +1 -1
  95. package/docs/game/android/keyStore/export.md +1 -1
  96. package/docs/game/android/keyStore/import.md +1 -1
  97. package/docs/game/android/keyStore/status.md +1 -1
  98. package/docs/game/android/keyStore.md +4 -4
  99. package/docs/game/android/status.md +1 -1
  100. package/docs/game/android/wizard.md +1 -1
  101. package/docs/game/android.md +12 -12
  102. package/docs/game/build/download.md +1 -1
  103. package/docs/game/build/list.md +1 -1
  104. package/docs/game/build.md +2 -2
  105. package/docs/game/create.md +1 -1
  106. package/docs/game/details.md +1 -1
  107. package/docs/game/export.md +1 -1
  108. package/docs/game/ios/app/addTester.md +1 -1
  109. package/docs/game/ios/app/create.md +1 -1
  110. package/docs/game/ios/app/status.md +1 -1
  111. package/docs/game/ios/app/sync.md +1 -1
  112. package/docs/game/ios/app.md +3 -3
  113. package/docs/game/ios/profile/create.md +1 -1
  114. package/docs/game/ios/profile/export.md +1 -1
  115. package/docs/game/ios/profile/import.md +1 -1
  116. package/docs/game/ios/profile/status.md +1 -1
  117. package/docs/game/ios/profile.md +4 -4
  118. package/docs/game/ios/status.md +1 -1
  119. package/docs/game/ios/wizard.md +1 -1
  120. package/docs/game/job/list.md +1 -1
  121. package/docs/game/job/status.md +1 -1
  122. package/docs/game/job.md +2 -2
  123. package/docs/game/list.md +1 -1
  124. package/docs/game/ship.md +1 -1
  125. package/docs/game/status.md +1 -1
  126. package/docs/game/wizard.md +1 -1
  127. package/docs/help.md +1 -1
  128. package/docs/login.md +1 -1
  129. package/docs/status.md +1 -1
  130. package/npm-shrinkwrap.json +2 -2
  131. package/oclif.manifest.json +122 -122
  132. package/package.json +1 -1
@@ -2,27 +2,27 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render } from 'ink';
3
3
  import { Flags } from '@oclif/core';
4
4
  import 'react';
5
- import { C as Command } from '../../../Command-1YAl_0zS.js';
6
- import { c as BaseGameCommand, k as getProjectPlatformProgress, P as Platform, b as getShortDate } from '../../../index-BQRxiyqn.js';
5
+ import { C as Command } from '../../../Command-DxmQn3XT.js';
6
+ import { c as BaseGameCommand, k as getProjectPlatformProgress, P as Platform, b as getShortDate } from '../../../index-DdABTtYO.js';
7
7
  import 'ink-spinner';
8
8
  import '@inkjs/ui';
9
9
  import 'axios';
10
10
  import '@tanstack/react-query';
11
11
  import 'open';
12
- import { g as getShortUUID, m as makeHumanReadable } from '../../../index-B6V7vGOj.js';
12
+ import { g as getShortUUID, m as makeHumanReadable } from '../../../index-wyPoxiTc.js';
13
13
  import { N as NextSteps } from '../../../NextSteps-CK9zHOCt.js';
14
14
  import 'qrcode';
15
15
  import { S as StatusTable } from '../../../StatusTable-Dm5St4g-.js';
16
16
  import 'string-length';
17
17
  import 'strip-ansi';
18
- import { A as AppleAppDetails, a as AppleBundleIdDetails } from '../../../AppleBundleIdDetails-Dxo99Sgu.js';
18
+ import { A as AppleAppDetails, a as AppleBundleIdDetails } from '../../../AppleBundleIdDetails-Df30MPFC.js';
19
19
  import 'luxon';
20
20
  import 'uuid';
21
21
  import 'fast-glob';
22
22
  import 'fs';
23
23
  import 'yazl';
24
24
  import 'socket.io-client';
25
- import '../../../useAndroidServiceAccountTestResult-D_30xIJA.js';
25
+ import '../../../useAndroidServiceAccountTestResult-InDf5WSl.js';
26
26
  import 'marked';
27
27
  import 'marked-terminal';
28
28
  import 'path';
@@ -37,9 +37,9 @@ import '@expo/apple-utils/build/index.js';
37
37
  import 'ini';
38
38
  import 'deepmerge';
39
39
  import '../../../Title-BCQtayg6.js';
40
- import '../../../useAppleApp-DnSjUfSs.js';
40
+ import '../../../useAppleApp-DgE0wEaq.js';
41
41
  import '../../../Table-CvM6pccN.js';
42
- import '../../../useAppleBundleId-BNI8swhC.js';
42
+ import '../../../useAppleBundleId-DtLODy3p.js';
43
43
 
44
44
  class GameIosStatus extends BaseGameCommand {
45
45
  static args = {};
@@ -1,10 +1,10 @@
1
1
  import { Flags } from '@oclif/core';
2
- import { B as BaseAuthenticatedCommand, j as isCWDGodotGame, P as Platform, C as CredentialsType } from '../../../index-BQRxiyqn.js';
2
+ import { B as BaseAuthenticatedCommand, j as isCWDGodotGame, P as Platform, C as CredentialsType } from '../../../index-DdABTtYO.js';
3
3
  import 'axios';
4
4
  import 'crypto-js';
5
5
  import 'uuid';
6
6
  import 'luxon';
7
- import { g as getUserCredentials, a as getProjectCredentials } from '../../../index-BuZmCvZh.js';
7
+ import { g as getUserCredentials, a as getProjectCredentials } from '../../../index-BDFKyTPb.js';
8
8
  import 'path';
9
9
  import 'fs';
10
10
  import '@expo/apple-utils/build/index.js';
@@ -1,15 +1,15 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render, Box, Text } from 'ink';
3
3
  import { Flags } from '@oclif/core';
4
- import { c as BaseGameCommand, F as getProjectJobs } from '../../../index-BQRxiyqn.js';
4
+ import { c as BaseGameCommand, z as getProjectJobs } from '../../../index-DdABTtYO.js';
5
5
  import 'react';
6
- import { g as getJobSummary, C as Command } from '../../../Command-1YAl_0zS.js';
6
+ import { g as getJobSummary, C as Command } from '../../../Command-DxmQn3XT.js';
7
7
  import 'ink-spinner';
8
8
  import '@inkjs/ui';
9
9
  import 'axios';
10
10
  import '@tanstack/react-query';
11
11
  import 'open';
12
- import { d as getJobStatusColor } from '../../../index-B6V7vGOj.js';
12
+ import { c as getJobStatusColor } from '../../../index-wyPoxiTc.js';
13
13
  import 'qrcode';
14
14
  import { T as Table } from '../../../Table-CvM6pccN.js';
15
15
  import 'string-length';
@@ -31,7 +31,7 @@ import 'node:url';
31
31
  import 'ini';
32
32
  import 'deepmerge';
33
33
  import 'isomorphic-git';
34
- import '../../../useAndroidServiceAccountTestResult-D_30xIJA.js';
34
+ import '../../../useAndroidServiceAccountTestResult-InDf5WSl.js';
35
35
  import 'marked';
36
36
  import 'marked-terminal';
37
37
 
@@ -1,9 +1,9 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Args, Flags } from '@oclif/core';
3
3
  import { measureElement, Box, Text, render } from 'ink';
4
- import { p as getAuthedHeaders, q as API_URL, J as castArrayObjectDates, O as castObjectDates, a3 as getShortTime, K as JobStatus, c as BaseGameCommand, a4 as getJob } from '../../../index-BQRxiyqn.js';
4
+ import { p as getAuthedHeaders, q as API_URL, H as castArrayObjectDates, M as castObjectDates, a4 as getShortTime, c as BaseGameCommand, a5 as getJob, J as JobStatus } from '../../../index-DdABTtYO.js';
5
5
  import { useState, useEffect, useRef } from 'react';
6
- import { g as getJobSummary, c as getBuildSummary, C as Command } from '../../../Command-1YAl_0zS.js';
6
+ import { C as Command } from '../../../Command-DxmQn3XT.js';
7
7
  import Spinner from 'ink-spinner';
8
8
  import '@inkjs/ui';
9
9
  import axios from 'axios';
@@ -15,7 +15,7 @@ import 'readline-sync';
15
15
  import 'node:readline';
16
16
  import 'node:path';
17
17
  import 'node:url';
18
- import { DateTime } from 'luxon';
18
+ import 'luxon';
19
19
  import 'uuid';
20
20
  import 'fast-glob';
21
21
  import 'yazl';
@@ -25,19 +25,20 @@ import { N as NextSteps } from '../../../NextSteps-CK9zHOCt.js';
25
25
  import 'qrcode';
26
26
  import stringLength from 'string-length';
27
27
  import stripAnsi from 'strip-ansi';
28
- import { f as getStageColor, h as getMessageColor, d as getJobStatusColor } from '../../../index-B6V7vGOj.js';
28
+ import { d as getStageColor, j as getMessageColor } from '../../../index-wyPoxiTc.js';
29
29
  import 'crypto-js';
30
- import { c as cacheKeys } from '../../../useAndroidServiceAccountTestResult-D_30xIJA.js';
31
- import { u as useWebSocket } from '../../../useWebSocket-DoImIdTy.js';
30
+ import { c as cacheKeys } from '../../../useAndroidServiceAccountTestResult-InDf5WSl.js';
31
+ import { u as useWebSocket } from '../../../useWebSocket-D8PojLtx.js';
32
32
  import { T as Title } from '../../../Title-BCQtayg6.js';
33
- import { u as useJobWatching } from '../../../useJobWatching-BcBJ5dy1.js';
34
- import { a as StatusRow, b as StatusRowLabel } from '../../../StatusTable-Dm5St4g-.js';
33
+ import { J as JobStatusTable } from '../../../JobStatusTable-q4atKzhu.js';
35
34
  import 'path';
36
35
  import '@expo/apple-utils/build/index.js';
37
36
  import 'ini';
38
37
  import 'deepmerge';
39
38
  import 'marked';
40
39
  import 'marked-terminal';
40
+ import '../../../useJobWatching-P5oC7mNB.js';
41
+ import '../../../StatusTable-Dm5St4g-.js';
41
42
 
42
43
  async function queryJobLogs({
43
44
  projectId,
@@ -153,56 +154,6 @@ const JobLogTail = (props) => {
153
154
  ] });
154
155
  };
155
156
 
156
- const JobStatusSpinner = ({ status, showSpinner }) => /* @__PURE__ */ jsxs(Fragment, { children: [
157
- /* @__PURE__ */ jsx(Text, { color: getJobStatusColor(status), children: `${status}` }),
158
- showSpinner && /* @__PURE__ */ jsxs(Fragment, { children: [
159
- /* @__PURE__ */ jsx(Text, { children: " " }),
160
- /* @__PURE__ */ jsx(Spinner, { type: "dots" })
161
- ] })
162
- ] });
163
- const JobStatusTable = ({ jobId, projectId, isWatching, onJobUpdate }) => {
164
- const { data: job, isLoading } = useJobWatching({ projectId, jobId, isWatching, onJobUpdate });
165
- const [time, setTime] = useState(DateTime.now());
166
- useEffect(() => {
167
- if (!isWatching) return;
168
- const interval = setInterval(() => setTime(DateTime.now()), 1e3);
169
- return () => {
170
- clearInterval(interval);
171
- };
172
- }, []);
173
- const isJobInProgress = job && ![JobStatus.COMPLETED, JobStatus.FAILED].includes(job.status);
174
- const summary = job ? getJobSummary(job, time) : null;
175
- const buildSummary = job && job.build ? getBuildSummary(job.build) : null;
176
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
177
- /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
178
- /* @__PURE__ */ jsx(Title, { children: "Job Details" }),
179
- isLoading && /* @__PURE__ */ jsx(Spinner, { type: "dots" }),
180
- summary && job && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [
181
- /* @__PURE__ */ jsx(StatusRow, { label: "ID", value: summary.id }),
182
- /* @__PURE__ */ jsx(StatusRow, { label: "Name", value: job.project.name }),
183
- /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
184
- /* @__PURE__ */ jsx(StatusRowLabel, { label: "Status" }),
185
- /* @__PURE__ */ jsx(JobStatusSpinner, { status: job.status, showSpinner: isWatching && !!isJobInProgress })
186
- ] }),
187
- /* @__PURE__ */ jsx(StatusRow, { label: "Version", value: summary.version }),
188
- /* @__PURE__ */ jsx(StatusRow, { label: "Git Info", value: summary.gitInfo }),
189
- /* @__PURE__ */ jsx(StatusRow, { label: "Platform", value: summary.platform }),
190
- /* @__PURE__ */ jsx(StatusRow, { label: "Started At", value: summary.createdAt }),
191
- /* @__PURE__ */ jsx(StatusRow, { label: "Runtime", value: summary.runtime })
192
- ] })
193
- ] }),
194
- buildSummary && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, marginLeft: 3, borderStyle: "single", padding: 1, children: [
195
- /* @__PURE__ */ jsx(Title, { children: "Build Details" }),
196
- /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [
197
- /* @__PURE__ */ jsx(StatusRow, { label: "ID", value: buildSummary.id }),
198
- /* @__PURE__ */ jsx(StatusRow, { label: "Platform", value: buildSummary.platform }),
199
- /* @__PURE__ */ jsx(StatusRow, { label: "Type", value: buildSummary.type }),
200
- /* @__PURE__ */ jsx(StatusRow, { label: "CMD", value: buildSummary.cmd })
201
- ] })
202
- ] })
203
- ] });
204
- };
205
-
206
157
  class GameJobStatus extends BaseGameCommand {
207
158
  static args = {
208
159
  job_id: Args.string({ description: "The id of the job to get the status of", required: true })
@@ -1,15 +1,15 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render, Text, Box } from 'ink';
3
3
  import { Flags } from '@oclif/core';
4
- import { B as BaseAuthenticatedCommand, g as getProjects, b as getShortDate } from '../../index-BQRxiyqn.js';
4
+ import { B as BaseAuthenticatedCommand, g as getProjects, b as getShortDate } from '../../index-DdABTtYO.js';
5
5
  import 'react';
6
- import { C as Command } from '../../Command-1YAl_0zS.js';
6
+ import { C as Command } from '../../Command-DxmQn3XT.js';
7
7
  import 'ink-spinner';
8
8
  import '@inkjs/ui';
9
9
  import 'axios';
10
10
  import '@tanstack/react-query';
11
11
  import 'open';
12
- import { g as getShortUUID } from '../../index-B6V7vGOj.js';
12
+ import { g as getShortUUID } from '../../index-wyPoxiTc.js';
13
13
  import 'qrcode';
14
14
  import { T as Table } from '../../Table-CvM6pccN.js';
15
15
  import 'string-length';
@@ -31,7 +31,7 @@ import 'node:url';
31
31
  import 'ini';
32
32
  import 'deepmerge';
33
33
  import 'isomorphic-git';
34
- import '../../useAndroidServiceAccountTestResult-D_30xIJA.js';
34
+ import '../../useAndroidServiceAccountTestResult-InDf5WSl.js';
35
35
  import 'marked';
36
36
  import 'marked-terminal';
37
37
 
@@ -1,27 +1,80 @@
1
- import { v4 } from 'uuid';
2
- import axios from 'axios';
3
- import fg from 'fast-glob';
4
- import fs__default from 'fs';
5
- import yazl from 'yazl';
6
- import { c as BaseGameCommand, x as DEFAULT_SHIPPED_FILES_GLOBS, w as DEFAULT_IGNORED_FILES_GLOBS, z as getNewUploadTicket, E as startJobsFromUpload } from '../../index-BQRxiyqn.js';
7
- import { c as getFileHash } from '../../index-B6V7vGOj.js';
8
- import { g as getCWDGitInfo } from '../../git-DREGq-jc.js';
9
- import 'path';
10
- import '@oclif/core';
11
- import '@expo/apple-utils/build/index.js';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { c as BaseGameCommand } from '../../index-DdABTtYO.js';
3
+ import { useContext, useState, useEffect } from 'react';
4
+ import { Box, Text, render } from 'ink';
5
+ import { c as CommandContext } from '../../Command-DxmQn3XT.js';
6
+ import 'ink-spinner';
7
+ import 'axios';
12
8
  import 'crypto-js';
9
+ import 'uuid';
13
10
  import 'luxon';
11
+ import 'fs';
12
+ import '@inkjs/ui';
13
+ import '@tanstack/react-query';
14
+ import 'open';
14
15
  import 'crypto';
15
16
  import 'readline-sync';
16
17
  import 'node:readline';
17
18
  import 'node:path';
18
19
  import 'node:url';
19
- import 'react';
20
- import '@tanstack/react-query';
21
- import 'ini';
22
- import 'deepmerge';
20
+ import 'fast-glob';
21
+ import 'yazl';
23
22
  import 'socket.io-client';
24
23
  import 'isomorphic-git';
24
+ import '@oclif/core';
25
+ import 'qrcode';
26
+ import 'string-length';
27
+ import 'strip-ansi';
28
+ import { C as CommandGame } from '../../CommandGame-DspVLTPZ.js';
29
+ import { u as useShip, J as JobProgress } from '../../JobProgress-Dk0UoNah.js';
30
+ import { J as JobStatusTable } from '../../JobStatusTable-q4atKzhu.js';
31
+ import 'path';
32
+ import '@expo/apple-utils/build/index.js';
33
+ import 'ini';
34
+ import 'deepmerge';
35
+ import '../../index-wyPoxiTc.js';
36
+ import '../../useAndroidServiceAccountTestResult-InDf5WSl.js';
37
+ import 'marked';
38
+ import 'marked-terminal';
39
+ import '../../git-DREGq-jc.js';
40
+ import '../../ProgressSpinner-6pw1T8Iw.js';
41
+ import '../../useJobWatching-P5oC7mNB.js';
42
+ import '../../useWebSocket-D8PojLtx.js';
43
+ import '../../Title-BCQtayg6.js';
44
+ import '../../StatusTable-Dm5St4g-.js';
45
+
46
+ const Ship = ({ onComplete, onError }) => {
47
+ const { command } = useContext(CommandContext);
48
+ const shipMutation = useShip();
49
+ const [jobs, setJobs] = useState(null);
50
+ const [shipLog, setShipLog] = useState("");
51
+ const [showSuccess, setShowSuccess] = useState(false);
52
+ const handleStartOnMount = async () => {
53
+ if (!command) throw new Error("No command in context");
54
+ const startedJobs = await shipMutation.mutateAsync({ command, log: setShipLog });
55
+ setJobs(startedJobs);
56
+ };
57
+ useEffect(() => {
58
+ handleStartOnMount().catch(onError);
59
+ }, []);
60
+ const handleJobComplete = (job) => {
61
+ const newJobs = (jobs || []).filter((prevJob) => prevJob.id !== job.id);
62
+ setJobs(newJobs);
63
+ if (newJobs.length === 0) {
64
+ setShowSuccess(true);
65
+ setTimeout(onComplete, 500);
66
+ }
67
+ };
68
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
69
+ jobs == null && /* @__PURE__ */ jsx(Text, { children: shipLog }),
70
+ jobs && jobs.map((job) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
71
+ /* @__PURE__ */ jsx(JobStatusTable, { jobId: job.id, projectId: job.project.id, isWatching: true }),
72
+ /* @__PURE__ */ jsx(Box, { width: 100, flexDirection: "column", children: /* @__PURE__ */ jsx(JobProgress, { job, onComplete: () => handleJobComplete(job) }) })
73
+ ] }, job.id)),
74
+ jobs && !showSuccess && /* @__PURE__ */ jsx(Text, { bold: true, children: "Please wait while ShipThis builds your game..." }),
75
+ showSuccess && /* @__PURE__ */ jsx(Text, { color: "green", children: "\u{1F680} Shipped" })
76
+ ] });
77
+ };
25
78
 
26
79
  class GameShip extends BaseGameCommand {
27
80
  static args = {};
@@ -29,41 +82,11 @@ class GameShip extends BaseGameCommand {
29
82
  static examples = ["<%= config.bin %> <%= command.id %>"];
30
83
  async run() {
31
84
  await this.ensureWeAreInAProjectDir();
32
- const projectConfig = await this.getProjectConfig();
33
- if (!projectConfig) throw new Error("No project config found");
34
- if (!projectConfig.project) throw new Error("No project found in project config");
35
- const shippedFilesGlobs = projectConfig.shippedFilesGlobs || DEFAULT_SHIPPED_FILES_GLOBS;
36
- const ignoredFilesGlobs = projectConfig.ignoredFilesGlobs || DEFAULT_IGNORED_FILES_GLOBS;
37
- const files = await fg(shippedFilesGlobs, { dot: true, ignore: ignoredFilesGlobs });
38
- const zipFile = new yazl.ZipFile();
39
- for (const file of files) {
40
- zipFile.addFile(file, file);
41
- }
42
- const outputZipToFile = (zip, fileName) => new Promise((resolve) => {
43
- const outputStream = fs__default.createWriteStream(fileName);
44
- zip.outputStream.pipe(outputStream).on("close", () => resolve());
45
- zip.end();
46
- });
47
- const tmpZipFile = `${process.cwd()}/shipthis-${v4()}.zip`;
48
- await outputZipToFile(zipFile, tmpZipFile);
49
- const zipBuffer = fs__default.readFileSync(tmpZipFile);
50
- const { size } = fs__default.statSync(tmpZipFile);
51
- const uploadTicket = await getNewUploadTicket(projectConfig.project.id);
52
- await axios.put(uploadTicket.url, zipBuffer, {
53
- headers: {
54
- "Content-length": size,
55
- "Content-Type": "application/zip"
56
- }
57
- });
58
- const gitInfo = await getCWDGitInfo();
59
- const zipFileMd5 = await getFileHash(tmpZipFile);
60
- const uploadDetails = {
61
- ...gitInfo,
62
- zipFileMd5
63
- };
64
- const [firstJob] = await startJobsFromUpload(uploadTicket.id, uploadDetails);
65
- fs__default.unlinkSync(tmpZipFile);
66
- await this.config.runCommand(`game:job:status`, [firstJob.id, "--follow"]);
85
+ const handleComplete = () => process.exit(0);
86
+ const handleError = (e) => this.error(e);
87
+ render(
88
+ /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(Ship, { onComplete: handleComplete, onError: handleError }) })
89
+ );
67
90
  }
68
91
  }
69
92
 
@@ -2,14 +2,14 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render } from 'ink';
3
3
  import { Flags } from '@oclif/core';
4
4
  import 'react';
5
- import { C as Command } from '../../Command-1YAl_0zS.js';
6
- import { B as BaseAuthenticatedCommand, H as getProject, P as Platform, k as getProjectPlatformProgress, b as getShortDate } from '../../index-BQRxiyqn.js';
5
+ import { C as Command } from '../../Command-DxmQn3XT.js';
6
+ import { B as BaseAuthenticatedCommand, E as getProject, P as Platform, k as getProjectPlatformProgress, b as getShortDate } from '../../index-DdABTtYO.js';
7
7
  import 'ink-spinner';
8
8
  import '@inkjs/ui';
9
9
  import 'axios';
10
10
  import '@tanstack/react-query';
11
11
  import 'open';
12
- import { g as getShortUUID, m as makeHumanReadable } from '../../index-B6V7vGOj.js';
12
+ import { g as getShortUUID, m as makeHumanReadable } from '../../index-wyPoxiTc.js';
13
13
  import { N as NextSteps } from '../../NextSteps-CK9zHOCt.js';
14
14
  import 'qrcode';
15
15
  import { S as StatusTable } from '../../StatusTable-Dm5St4g-.js';
@@ -21,7 +21,7 @@ import 'fast-glob';
21
21
  import 'fs';
22
22
  import 'yazl';
23
23
  import 'socket.io-client';
24
- import '../../useAndroidServiceAccountTestResult-D_30xIJA.js';
24
+ import '../../useAndroidServiceAccountTestResult-InDf5WSl.js';
25
25
  import 'marked';
26
26
  import 'marked-terminal';
27
27
  import 'path';
@@ -1,6 +1,6 @@
1
1
  import { Args } from '@oclif/core';
2
2
  import prompts from 'prompts';
3
- import { B as BaseAuthenticatedCommand, j as isCWDGodotGame, P as Platform } from '../../index-BQRxiyqn.js';
3
+ import { B as BaseAuthenticatedCommand, j as isCWDGodotGame, P as Platform } from '../../index-DdABTtYO.js';
4
4
  import 'path';
5
5
  import 'fs';
6
6
  import '@expo/apple-utils/build/index.js';
@@ -1,7 +1,7 @@
1
1
  import fs__default, { promises } from 'fs';
2
2
  import path from 'path';
3
3
  import { Args, Flags } from '@oclif/core';
4
- import { X as BaseCommand } from '../../index-BQRxiyqn.js';
4
+ import { T as BaseCommand } from '../../index-DdABTtYO.js';
5
5
  import '@expo/apple-utils/build/index.js';
6
6
  import 'axios';
7
7
  import 'crypto-js';
@@ -1,7 +1,7 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import fs__default from 'fs';
3
3
  import path from 'path';
4
- import { X as BaseCommand } from '../../index-BQRxiyqn.js';
4
+ import { T as BaseCommand } from '../../index-DdABTtYO.js';
5
5
  import CustomHelp from '../../utils/help.js';
6
6
  import '@expo/apple-utils/build/index.js';
7
7
  import 'axios';
@@ -1303,7 +1303,7 @@ const COMMAND_TEMPLATE = `
1303
1303
 
1304
1304
  ## Help Output
1305
1305
 
1306
- \`\`\`
1306
+ \`\`\`help
1307
1307
  <%- helpOutput %>
1308
1308
  \`\`\`
1309
1309
  `.trim();
@@ -1316,7 +1316,7 @@ const COMMAND_TEMPLATE_INCLUDE = `
1316
1316
 
1317
1317
  #### Help Output
1318
1318
 
1319
- \`\`\`
1319
+ \`\`\`help
1320
1320
  <%- helpOutput %>
1321
1321
  \`\`\`
1322
1322
  `.trim();
@@ -1,7 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import { Flags } from '@oclif/core';
3
- import { Z as WEB_URL, X as BaseCommand, q as API_URL, _ as setAuthToken, $ as acceptTerms } from '../index-BQRxiyqn.js';
4
- import { a as getInput } from '../index-B6V7vGOj.js';
3
+ import { X as WEB_URL, T as BaseCommand, q as API_URL, Y as setAuthToken, Z as acceptTerms } from '../index-DdABTtYO.js';
4
+ import { a as getInput } from '../index-wyPoxiTc.js';
5
5
  import 'path';
6
6
  import 'fs';
7
7
  import '@expo/apple-utils/build/index.js';
@@ -1,8 +1,8 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render } from 'ink';
3
- import { X as BaseCommand, j as isCWDGodotGame } from '../index-BQRxiyqn.js';
3
+ import { T as BaseCommand, j as isCWDGodotGame } from '../index-DdABTtYO.js';
4
4
  import 'react';
5
- import { C as Command } from '../Command-1YAl_0zS.js';
5
+ import { C as Command } from '../Command-DxmQn3XT.js';
6
6
  import 'ink-spinner';
7
7
  import 'axios';
8
8
  import 'crypto-js';
@@ -32,8 +32,8 @@ import '@expo/apple-utils/build/index.js';
32
32
  import 'ini';
33
33
  import 'deepmerge';
34
34
  import 'isomorphic-git';
35
- import '../index-B6V7vGOj.js';
36
- import '../useAndroidServiceAccountTestResult-D_30xIJA.js';
35
+ import '../index-wyPoxiTc.js';
36
+ import '../useAndroidServiceAccountTestResult-InDf5WSl.js';
37
37
  import 'marked';
38
38
  import 'marked-terminal';
39
39
  import '../Title-BCQtayg6.js';
@@ -0,0 +1,36 @@
1
+ import axios from 'axios';
2
+ import * as fs from 'fs';
3
+ import { p as getAuthedHeaders, q as API_URL } from './index-DdABTtYO.js';
4
+
5
+ async function exportCredential({ zipPath, credentialId, projectId }) {
6
+ const headers = getAuthedHeaders();
7
+ const url = projectId ? `${API_URL}/projects/${projectId}/credentials/${credentialId}/export` : `${API_URL}/credentials/${credentialId}/export`;
8
+ const { data } = await axios.post(
9
+ url,
10
+ {},
11
+ // no-body
12
+ { headers }
13
+ );
14
+ const downloadUrl = data.url;
15
+ return await downloadFile(downloadUrl, zipPath);
16
+ }
17
+ async function downloadFile(url, destination) {
18
+ const response = await axios({
19
+ url,
20
+ method: "GET",
21
+ responseType: "stream"
22
+ });
23
+ return new Promise((resolve, reject) => {
24
+ const file = fs.createWriteStream(destination);
25
+ response.data.pipe(file);
26
+ file.on("finish", () => {
27
+ file.close();
28
+ resolve();
29
+ });
30
+ file.on("error", (err) => {
31
+ fs.unlink(destination, () => reject(err));
32
+ });
33
+ });
34
+ }
35
+
36
+ export { exportCredential as e };
@@ -0,0 +1,38 @@
1
+ import axios from 'axios';
2
+ import { promises } from 'fs';
3
+ import { p as getAuthedHeaders, q as API_URL } from './index-DdABTtYO.js';
4
+
5
+ async function getNewImportTicket(projectId) {
6
+ const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import/url` : `${API_URL}/credentials/import/url`;
7
+ const headers = getAuthedHeaders();
8
+ const { data: importInfo } = await axios({
9
+ method: "post",
10
+ url,
11
+ headers
12
+ });
13
+ return importInfo;
14
+ }
15
+ async function importCredential({ projectId, zipPath, type, platform }) {
16
+ const importTicket = await getNewImportTicket(projectId);
17
+ const zipBuffer = await promises.readFile(zipPath);
18
+ await axios.put(importTicket.url, zipBuffer, {
19
+ headers: {
20
+ "Content-length": zipBuffer.length,
21
+ "Content-Type": "application/zip"
22
+ }
23
+ });
24
+ const headers = getAuthedHeaders();
25
+ const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import` : `${API_URL}/credentials/import`;
26
+ return await axios({
27
+ method: "post",
28
+ url,
29
+ headers,
30
+ data: {
31
+ uuid: importTicket.uuid,
32
+ type,
33
+ platform
34
+ }
35
+ });
36
+ }
37
+
38
+ export { importCredential as i };
@@ -0,0 +1,24 @@
1
+ import axios from 'axios';
2
+ import { p as getAuthedHeaders, q as API_URL, H as castArrayObjectDates } from './index-DdABTtYO.js';
3
+ import 'fs';
4
+
5
+ async function getUserCredentials(pageSize = 100) {
6
+ const headers = getAuthedHeaders();
7
+ const { data } = await axios({
8
+ method: "get",
9
+ url: `${API_URL}/credentials?pageSize=${pageSize}`,
10
+ headers
11
+ });
12
+ return castArrayObjectDates(data.data);
13
+ }
14
+ async function getProjectCredentials(projectId, pageSize = 100) {
15
+ const headers = getAuthedHeaders();
16
+ const { data } = await axios({
17
+ method: "get",
18
+ url: `${API_URL}/projects/${projectId}/credentials?pageSize=${pageSize}`,
19
+ headers
20
+ });
21
+ return castArrayObjectDates(data.data);
22
+ }
23
+
24
+ export { getProjectCredentials as a, getUserCredentials as g };