shipthis 0.1.2 → 0.1.3

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 (83) hide show
  1. package/assets/markdown/android-success.md +17 -0
  2. package/assets/markdown/create-google-play-game.md +20 -0
  3. package/assets/markdown/invite-service-account.md +11 -0
  4. package/assets/markdown/privacy-notification.md +10 -0
  5. package/bin/alias-built.sh +10 -0
  6. package/dist/{AppleBundleIdDetails-BF-Pm1Ia.js → AppleBundleIdDetails-C0XqjxKJ.js} +5 -6
  7. package/dist/Command-Cl-JfhTy.js +203 -0
  8. package/dist/{CommandGame-D9wl8hfX.js → CommandGame--SAa3wEL.js} +1 -1
  9. package/dist/CreateKeystore-Dm0KVh85.js +56 -0
  10. package/dist/{NextSteps-DKcjSHZ3.js → NextSteps-CK9zHOCt.js} +1 -1
  11. package/dist/{ProjectCredentialsTable-BVvkIPjN.js → ProjectCredentialsTable-Ch8022rs.js} +3 -2
  12. package/dist/RunWithSpinner-BVXNWGD3.js +27 -0
  13. package/dist/{StatusTable-BzsNF75L.js → StatusTable-Dm5St4g-.js} +1 -1
  14. package/dist/Title-BCQtayg6.js +6 -0
  15. package/dist/{UserCredentialsTable-DUFQqHVt.js → UserCredentialsTable-ysmM5dlV.js} +4 -4
  16. package/dist/{baseAppleCommand-BSJhK8GA.js → baseAppleCommand-B3WQtlx-.js} +1 -1
  17. package/dist/{baseGameAndroidCommand-CPAtReqy.js → baseGameAndroidCommand-B-CFhPnE.js} +2 -2
  18. package/dist/commands/apple/apiKey/create.js +12 -12
  19. package/dist/commands/apple/apiKey/export.js +11 -11
  20. package/dist/commands/apple/apiKey/import.js +11 -11
  21. package/dist/commands/apple/apiKey/status.js +12 -13
  22. package/dist/commands/apple/certificate/create.js +12 -12
  23. package/dist/commands/apple/certificate/export.js +11 -11
  24. package/dist/commands/apple/certificate/import.js +11 -11
  25. package/dist/commands/apple/certificate/status.js +11 -12
  26. package/dist/commands/apple/login.js +2 -2
  27. package/dist/commands/apple/status.js +12 -13
  28. package/dist/commands/dashboard.js +1 -1
  29. package/dist/commands/game/android/apiKey/connect.js +12 -12
  30. package/dist/commands/game/android/apiKey/create.js +14 -12
  31. package/dist/commands/game/android/apiKey/export.js +12 -12
  32. package/dist/commands/game/android/apiKey/import.js +12 -12
  33. package/dist/commands/game/android/apiKey/invite.js +4 -4
  34. package/dist/commands/game/android/apiKey/status.js +12 -12
  35. package/dist/commands/game/android/keyStore/create.js +12 -11
  36. package/dist/commands/game/android/keyStore/export.js +11 -11
  37. package/dist/commands/game/android/keyStore/import.js +11 -11
  38. package/dist/commands/game/android/keyStore/status.js +11 -11
  39. package/dist/commands/game/android/status.js +13 -14
  40. package/dist/commands/game/android/wizard.js +533 -20
  41. package/dist/commands/game/build/download.js +10 -11
  42. package/dist/commands/game/build/list.js +10 -11
  43. package/dist/commands/game/create.js +2 -2
  44. package/dist/commands/game/details.js +10 -11
  45. package/dist/commands/game/export.js +1 -1
  46. package/dist/commands/game/ios/app/addTester.js +10 -11
  47. package/dist/commands/game/ios/app/create.js +9 -10
  48. package/dist/commands/game/ios/app/status.js +13 -14
  49. package/dist/commands/game/ios/app/sync.js +10 -11
  50. package/dist/commands/game/ios/profile/create.js +12 -12
  51. package/dist/commands/game/ios/profile/export.js +11 -11
  52. package/dist/commands/game/ios/profile/import.js +11 -11
  53. package/dist/commands/game/ios/profile/status.js +12 -12
  54. package/dist/commands/game/ios/status.js +16 -17
  55. package/dist/commands/game/ios/wizard.js +2 -2
  56. package/dist/commands/game/job/list.js +8 -10
  57. package/dist/commands/game/job/status.js +14 -13
  58. package/dist/commands/game/list.js +8 -10
  59. package/dist/commands/game/ship.js +2 -2
  60. package/dist/commands/game/status.js +13 -14
  61. package/dist/commands/game/wizard.js +1 -1
  62. package/dist/commands/internal/fastlane.js +1 -1
  63. package/dist/commands/internal/readme.js +1 -1
  64. package/dist/commands/login.js +2 -2
  65. package/dist/commands/status.js +11 -11
  66. package/dist/{export-B0FJT0EU.js → export-BiLHgSJ9.js} +1 -1
  67. package/dist/{import-CLDJ2iPu.js → import-CxNikF1c.js} +1 -1
  68. package/dist/index-B5XHQfs2.js +122 -0
  69. package/dist/{index-Df8uXQ4s.js → index-B6V7vGOj.js} +1 -1
  70. package/dist/{index-CF0fIsx2.js → index-BQRxiyqn.js} +1 -1
  71. package/dist/{index-CFHmtzfq.js → index-BuZmCvZh.js} +1 -1
  72. package/dist/index-CgBgZUkL.js +144 -0
  73. package/dist/{upload-C5L82Yq0.js → upload-CMo3hUhl.js} +1 -1
  74. package/dist/{useAndroidServiceAccountTestResult-BnxNuoG3.js → useAndroidServiceAccountTestResult-D_30xIJA.js} +1 -1
  75. package/dist/{useAppleApp-IXRdsK5w.js → useAppleApp-DnSjUfSs.js} +1 -1
  76. package/dist/{useAppleBundleId-DYC5ISKT.js → useAppleBundleId-BNI8swhC.js} +1 -1
  77. package/dist/useJobWatching-Bz1e6xOv.js +43 -0
  78. package/dist/useProjectCredentials-B5ZmpIxL.js +54 -0
  79. package/dist/useWebSocket-DoImIdTy.js +36 -0
  80. package/npm-shrinkwrap.json +2 -2
  81. package/oclif.manifest.json +115 -115
  82. package/package.json +3 -2
  83. package/dist/Command-BrfJSeOC.js +0 -1077
@@ -1,42 +1,43 @@
1
1
  import { jsx, jsxs, Fragment } 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, Z as castObjectDates, _ as getShortTime, K as JobStatus, c as BaseGameCommand, $ as getJob } from '../../../index-CF0fIsx2.js';
5
- import { h as useWebSocket, T as Title, i as useJobWatching, g as getJobSummary, f as getBuildSummary, C as Command } from '../../../Command-BrfJSeOC.js';
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';
6
5
  import { useState, useEffect, useRef } from 'react';
6
+ import { g as getJobSummary, c as getBuildSummary, C as Command } from '../../../Command-Cl-JfhTy.js';
7
7
  import Spinner from 'ink-spinner';
8
8
  import '@inkjs/ui';
9
+ import axios from 'axios';
10
+ import { useInfiniteQuery } from '@tanstack/react-query';
11
+ import 'open';
9
12
  import 'crypto';
10
13
  import 'fs';
11
14
  import 'readline-sync';
12
15
  import 'node:readline';
13
16
  import 'node:path';
14
17
  import 'node:url';
15
- import axios from 'axios';
16
- import { useInfiniteQuery } from '@tanstack/react-query';
17
18
  import { DateTime } from 'luxon';
18
19
  import 'uuid';
19
20
  import 'fast-glob';
20
21
  import 'yazl';
21
22
  import 'socket.io-client';
22
23
  import 'isomorphic-git';
23
- import 'marked';
24
- import 'marked-terminal';
25
- import { N as NextSteps } from '../../../NextSteps-DKcjSHZ3.js';
24
+ import { N as NextSteps } from '../../../NextSteps-CK9zHOCt.js';
26
25
  import 'qrcode';
27
26
  import stringLength from 'string-length';
28
27
  import stripAnsi from 'strip-ansi';
29
- import { f as getStageColor, h as getMessageColor, d as getJobStatusColor } from '../../../index-Df8uXQ4s.js';
28
+ import { f as getStageColor, h as getMessageColor, d as getJobStatusColor } from '../../../index-B6V7vGOj.js';
30
29
  import 'crypto-js';
31
- import { c as cacheKeys } from '../../../useAndroidServiceAccountTestResult-BnxNuoG3.js';
32
- import { a as StatusRow, b as StatusRowLabel } from '../../../StatusTable-BzsNF75L.js';
30
+ import { c as cacheKeys } from '../../../useAndroidServiceAccountTestResult-D_30xIJA.js';
31
+ import { u as useWebSocket } from '../../../useWebSocket-DoImIdTy.js';
32
+ import { T as Title } from '../../../Title-BCQtayg6.js';
33
+ import { u as useJobWatching } from '../../../useJobWatching-Bz1e6xOv.js';
34
+ import { a as StatusRow, b as StatusRowLabel } from '../../../StatusTable-Dm5St4g-.js';
33
35
  import 'path';
34
36
  import '@expo/apple-utils/build/index.js';
35
37
  import 'ini';
36
38
  import 'deepmerge';
37
- import 'open';
38
- import '../../../git-DREGq-jc.js';
39
- import '../../../index-CFHmtzfq.js';
39
+ import 'marked';
40
+ import 'marked-terminal';
40
41
 
41
42
  async function queryJobLogs({
42
43
  projectId,
@@ -1,17 +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-CF0fIsx2.js';
5
- import { C as Command } from '../../Command-BrfJSeOC.js';
4
+ import { B as BaseAuthenticatedCommand, g as getProjects, b as getShortDate } from '../../index-BQRxiyqn.js';
6
5
  import 'react';
6
+ import { C as Command } from '../../Command-Cl-JfhTy.js';
7
7
  import 'ink-spinner';
8
8
  import '@inkjs/ui';
9
- import { g as getShortUUID } from '../../index-Df8uXQ4s.js';
10
9
  import 'axios';
11
10
  import '@tanstack/react-query';
12
- import 'marked';
13
- import 'fs';
14
- import 'marked-terminal';
11
+ import 'open';
12
+ import { g as getShortUUID } from '../../index-B6V7vGOj.js';
15
13
  import 'qrcode';
16
14
  import { T as Table } from '../../Table-CvM6pccN.js';
17
15
  import 'string-length';
@@ -19,6 +17,7 @@ import 'strip-ansi';
19
17
  import 'luxon';
20
18
  import 'uuid';
21
19
  import 'fast-glob';
20
+ import 'fs';
22
21
  import 'yazl';
23
22
  import 'socket.io-client';
24
23
  import 'path';
@@ -32,10 +31,9 @@ import 'node:url';
32
31
  import 'ini';
33
32
  import 'deepmerge';
34
33
  import 'isomorphic-git';
35
- import 'open';
36
- import '../../useAndroidServiceAccountTestResult-BnxNuoG3.js';
37
- import '../../git-DREGq-jc.js';
38
- import '../../index-CFHmtzfq.js';
34
+ import '../../useAndroidServiceAccountTestResult-D_30xIJA.js';
35
+ import 'marked';
36
+ import 'marked-terminal';
39
37
 
40
38
  class GameList extends BaseAuthenticatedCommand {
41
39
  static args = {};
@@ -3,8 +3,8 @@ import axios from 'axios';
3
3
  import fg from 'fast-glob';
4
4
  import fs__default from 'fs';
5
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-CF0fIsx2.js';
7
- import { c as getFileHash } from '../../index-Df8uXQ4s.js';
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
8
  import { g as getCWDGitInfo } from '../../git-DREGq-jc.js';
9
9
  import 'path';
10
10
  import '@oclif/core';
@@ -1,42 +1,41 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render } from 'ink';
3
3
  import { Flags } from '@oclif/core';
4
- import { C as Command } from '../../Command-BrfJSeOC.js';
5
4
  import 'react';
5
+ import { C as Command } from '../../Command-Cl-JfhTy.js';
6
+ import { B as BaseAuthenticatedCommand, H as getProject, P as Platform, k as getProjectPlatformProgress, b as getShortDate } from '../../index-BQRxiyqn.js';
6
7
  import 'ink-spinner';
7
- import { B as BaseAuthenticatedCommand, H as getProject, P as Platform, k as getProjectPlatformProgress, b as getShortDate } from '../../index-CF0fIsx2.js';
8
8
  import '@inkjs/ui';
9
- import { g as getShortUUID, m as makeHumanReadable } from '../../index-Df8uXQ4s.js';
10
9
  import 'axios';
11
10
  import '@tanstack/react-query';
12
- import 'marked';
13
- import 'fs';
14
- import 'marked-terminal';
15
- import { N as NextSteps } from '../../NextSteps-DKcjSHZ3.js';
11
+ import 'open';
12
+ import { g as getShortUUID, m as makeHumanReadable } from '../../index-B6V7vGOj.js';
13
+ import { N as NextSteps } from '../../NextSteps-CK9zHOCt.js';
16
14
  import 'qrcode';
17
- import { S as StatusTable } from '../../StatusTable-BzsNF75L.js';
15
+ import { S as StatusTable } from '../../StatusTable-Dm5St4g-.js';
18
16
  import 'string-length';
19
17
  import 'strip-ansi';
20
18
  import 'luxon';
21
19
  import 'uuid';
22
20
  import 'fast-glob';
21
+ import 'fs';
23
22
  import 'yazl';
24
23
  import 'socket.io-client';
25
- import 'open';
26
- import 'crypto-js';
27
- import '../../useAndroidServiceAccountTestResult-BnxNuoG3.js';
24
+ import '../../useAndroidServiceAccountTestResult-D_30xIJA.js';
25
+ import 'marked';
26
+ import 'marked-terminal';
27
+ import 'path';
28
28
  import 'crypto';
29
29
  import 'readline-sync';
30
30
  import 'node:readline';
31
31
  import 'node:path';
32
32
  import 'node:url';
33
+ import 'crypto-js';
33
34
  import 'isomorphic-git';
34
- import '../../git-DREGq-jc.js';
35
- import '../../index-CFHmtzfq.js';
36
- import 'path';
37
35
  import '@expo/apple-utils/build/index.js';
38
36
  import 'ini';
39
37
  import 'deepmerge';
38
+ import '../../Title-BCQtayg6.js';
40
39
 
41
40
  function getSteps(platform, progress) {
42
41
  if (!progress) return [];
@@ -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-CF0fIsx2.js';
3
+ import { B as BaseAuthenticatedCommand, j as isCWDGodotGame, P as Platform } from '../../index-BQRxiyqn.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 { S as BaseCommand } from '../../index-CF0fIsx2.js';
4
+ import { X as BaseCommand } from '../../index-BQRxiyqn.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 { S as BaseCommand } from '../../index-CF0fIsx2.js';
4
+ import { X as BaseCommand } from '../../index-BQRxiyqn.js';
5
5
  import CustomHelp from '../../utils/help.js';
6
6
  import '@expo/apple-utils/build/index.js';
7
7
  import 'axios';
@@ -1,7 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import { Flags } from '@oclif/core';
3
- import { W as WEB_URL, S as BaseCommand, q as API_URL, V as setAuthToken, X as acceptTerms } from '../index-CF0fIsx2.js';
4
- import { a as getInput } from '../index-Df8uXQ4s.js';
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';
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 { S as BaseCommand, j as isCWDGodotGame } from '../index-CF0fIsx2.js';
4
- import { C as Command } from '../Command-BrfJSeOC.js';
3
+ import { X as BaseCommand, j as isCWDGodotGame } from '../index-BQRxiyqn.js';
5
4
  import 'react';
5
+ import { C as Command } from '../Command-Cl-JfhTy.js';
6
6
  import 'ink-spinner';
7
7
  import 'axios';
8
8
  import 'crypto-js';
@@ -10,22 +10,21 @@ import 'uuid';
10
10
  import 'luxon';
11
11
  import 'fs';
12
12
  import '@inkjs/ui';
13
+ import '@tanstack/react-query';
14
+ import 'open';
13
15
  import 'crypto';
14
16
  import 'readline-sync';
15
17
  import 'node:readline';
16
18
  import 'node:path';
17
19
  import 'node:url';
18
- import '@tanstack/react-query';
19
20
  import 'fast-glob';
20
21
  import 'yazl';
21
22
  import 'socket.io-client';
22
23
  import { i as isCWDGitRepo } from '../git-DREGq-jc.js';
23
24
  import '@oclif/core';
24
- import 'marked';
25
- import 'marked-terminal';
26
- import { N as NextSteps } from '../NextSteps-DKcjSHZ3.js';
25
+ import { N as NextSteps } from '../NextSteps-CK9zHOCt.js';
27
26
  import 'qrcode';
28
- import { S as StatusTable } from '../StatusTable-BzsNF75L.js';
27
+ import { S as StatusTable } from '../StatusTable-Dm5St4g-.js';
29
28
  import 'string-length';
30
29
  import 'strip-ansi';
31
30
  import 'path';
@@ -33,10 +32,11 @@ import '@expo/apple-utils/build/index.js';
33
32
  import 'ini';
34
33
  import 'deepmerge';
35
34
  import 'isomorphic-git';
36
- import 'open';
37
- import '../index-Df8uXQ4s.js';
38
- import '../useAndroidServiceAccountTestResult-BnxNuoG3.js';
39
- import '../index-CFHmtzfq.js';
35
+ import '../index-B6V7vGOj.js';
36
+ import '../useAndroidServiceAccountTestResult-D_30xIJA.js';
37
+ import 'marked';
38
+ import 'marked-terminal';
39
+ import '../Title-BCQtayg6.js';
40
40
 
41
41
  class Status extends BaseCommand {
42
42
  static args = {};
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import * as fs from 'fs';
3
- import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.js';
3
+ import { p as getAuthedHeaders, q as API_URL } from './index-BQRxiyqn.js';
4
4
 
5
5
  async function exportCredential({ zipPath, credentialId, projectId }) {
6
6
  const headers = getAuthedHeaders();
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import { promises } from 'fs';
3
- import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.js';
3
+ import { p as getAuthedHeaders, q as API_URL } from './index-BQRxiyqn.js';
4
4
 
5
5
  async function getNewImportTicket(projectId) {
6
6
  const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import/url` : `${API_URL}/credentials/import/url`;
@@ -0,0 +1,122 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { Text, useInput, Box } from 'ink';
3
+ import open from 'open';
4
+ import { useState, useEffect, useContext } from 'react';
5
+ import { S as getGoogleStatus, a1 as getShortAuthRequiredUrl, a2 as getGoogleAuthUrl, Z as WEB_URL } from './index-BQRxiyqn.js';
6
+ import 'crypto';
7
+ import 'fs';
8
+ import 'readline-sync';
9
+ import 'node:readline';
10
+ import 'node:path';
11
+ import 'node:url';
12
+ import 'axios';
13
+ import { useQuery } from '@tanstack/react-query';
14
+ import 'crypto-js';
15
+ import 'uuid';
16
+ import 'luxon';
17
+ import 'fast-glob';
18
+ import 'yazl';
19
+ import 'socket.io-client';
20
+ import { u as useWebSocket } from './useWebSocket-DoImIdTy.js';
21
+ import { c as cacheKeys } from './useAndroidServiceAccountTestResult-D_30xIJA.js';
22
+ import 'isomorphic-git';
23
+ import '@oclif/core';
24
+ import { a as GameContext, M as Markdown } from './Command-Cl-JfhTy.js';
25
+ import 'ink-spinner';
26
+ import '@inkjs/ui';
27
+ import qrcode from 'qrcode';
28
+ import 'string-length';
29
+ import 'strip-ansi';
30
+
31
+ const useGoogleStatus = () => {
32
+ return useQuery({
33
+ queryKey: cacheKeys.googleStatus(),
34
+ queryFn: getGoogleStatus
35
+ });
36
+ };
37
+
38
+ function useGoogleStatusWatching({
39
+ projectId,
40
+ isWatching,
41
+ onGoogleStatusUpdate
42
+ }) {
43
+ const [wsGoogleStatus, setWsGoogleStatus] = useState(null);
44
+ const listener = {
45
+ getPattern: () => `project.${projectId}:google-status`,
46
+ eventHandler: async (pattern, data2) => {
47
+ setWsGoogleStatus(data2);
48
+ if (onGoogleStatusUpdate) onGoogleStatusUpdate(data2);
49
+ }
50
+ };
51
+ useWebSocket([listener] );
52
+ const { isLoading, data: googleStatus } = useGoogleStatus();
53
+ useEffect(() => {
54
+ setWsGoogleStatus(null);
55
+ }, [projectId, isWatching, googleStatus]);
56
+ const fetchedGoogleStatus = googleStatus ? googleStatus : null;
57
+ const data = wsGoogleStatus ? wsGoogleStatus : fetchedGoogleStatus;
58
+ return {
59
+ isLoading,
60
+ data
61
+ };
62
+ }
63
+
64
+ const QRCodeTerminal = ({ url }) => {
65
+ const [code, setCode] = useState(null);
66
+ const handleLoad = async () => {
67
+ const codeString = await qrcode.toString(url, { type: "terminal", errorCorrectionLevel: "L", small: true });
68
+ setCode(codeString);
69
+ };
70
+ useEffect(() => {
71
+ handleLoad();
72
+ }, []);
73
+ return /* @__PURE__ */ jsx(Fragment, { children: code && /* @__PURE__ */ jsx(Text, { children: code }) });
74
+ };
75
+
76
+ async function getConnectUrl(gameId, helpPage) {
77
+ const helpPagePath = `/docs/android?gameId=${gameId}#2-connect-shipthis-with-google`;
78
+ const url = helpPage ? await getShortAuthRequiredUrl(helpPagePath) : await getGoogleAuthUrl(gameId);
79
+ return url;
80
+ }
81
+ const GoogleAuthQRCode = ({ gameId, helpPage }) => {
82
+ const [url, setUrl] = useState(null);
83
+ const handleLoad = async () => {
84
+ const url2 = await getConnectUrl(gameId, helpPage);
85
+ setUrl(url2);
86
+ };
87
+ useEffect(() => {
88
+ handleLoad();
89
+ }, []);
90
+ return /* @__PURE__ */ jsx(Fragment, { children: url && /* @__PURE__ */ jsx(QRCodeTerminal, { url }) });
91
+ };
92
+
93
+ const ConnectGoogle = (props) => {
94
+ const { gameId } = useContext(GameContext);
95
+ return /* @__PURE__ */ jsx(Fragment, { children: gameId && /* @__PURE__ */ jsx(ConnectForGame, { gameId, ...props }) });
96
+ };
97
+ const ConnectForGame = ({ onComplete, onError, helpPage, gameId, ...boxProps }) => {
98
+ useGoogleStatusWatching({
99
+ projectId: gameId,
100
+ isWatching: true,
101
+ onGoogleStatusUpdate: (status) => {
102
+ if (status.isAuthenticated) return onComplete();
103
+ }
104
+ });
105
+ useInput(async (input) => {
106
+ if (!gameId) return;
107
+ if (input !== "d") return;
108
+ const url = await getConnectUrl(gameId, true);
109
+ await open(url);
110
+ });
111
+ const templateVars = {
112
+ privacyURL: new URL("/privacy", WEB_URL).toString()
113
+ };
114
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, ...boxProps, children: [
115
+ /* @__PURE__ */ jsx(Markdown, { filename: "privacy-notification.md", templateVars }),
116
+ /* @__PURE__ */ jsx(Text, { children: "Scan the QR code below to connect your Google account to ShipThis:" }),
117
+ gameId && /* @__PURE__ */ jsx(GoogleAuthQRCode, { gameId, helpPage: !!helpPage }),
118
+ /* @__PURE__ */ jsx(Text, { children: "Or press D to sign-in using your browser" })
119
+ ] });
120
+ };
121
+
122
+ export { ConnectGoogle as C };
@@ -4,7 +4,7 @@ import readlineSync from 'readline-sync';
4
4
  import { promises } from 'node:readline';
5
5
  import path from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
- import { K as JobStatus, P as Platform, L as JobStage, M as LogLevel } from './index-CF0fIsx2.js';
7
+ import { K as JobStatus, P as Platform, L as JobStage, M as LogLevel } from './index-BQRxiyqn.js';
8
8
  import 'react';
9
9
  import 'axios';
10
10
  import '@tanstack/react-query';
@@ -690,4 +690,4 @@ const DetailsFlags = {
690
690
  androidPackageName: Flags.string({ char: "a", description: "Set the Android package name" })
691
691
  };
692
692
 
693
- export { getJob as $, ApiKey as A, BaseAuthenticatedCommand as B, CredentialsType as C, DetailsFlags as D, startJobsFromUpload as E, getProjectJobs as F, GODOT_CAPABILITIES as G, getProject as H, getBuild as I, castArrayObjectDates as J, JobStatus as K, JobStage as L, LogLevel as M, getGodotAndroidPackageName as N, getGoogleStatus as O, Platform as P, inviteServiceAccount as Q, disconnectGoogle as R, BaseCommand as S, getSingleUseUrl as T, UserRole as U, setAuthToken as V, WEB_URL as W, acceptTerms as X, Auth as Y, castObjectDates as Z, getShortTime as _, ApiKeyType as a, getShortDateTime as a0, getShortTimeDelta as a1, queryClient as a2, getAuthToken as a3, WS_URL as a4, castJobDates as a5, getShortAuthRequiredUrl as a6, getGoogleAuthUrl as a7, getShortDate as b, BaseGameCommand as c, getGodotAppleBundleIdentifier as d, BundleId as e, App as f, getProjects as g, CapabilityTypeOption as h, BetaGroup as i, isCWDGodotGame as j, getProjectPlatformProgress as k, Certificate as l, CertificateType as m, Profile as n, ProfileType as o, getAuthedHeaders as p, API_URL as q, getGodotProjectCapabilities as r, CapabilityType as s, GameEngine as t, getGodotVersion as u, createProject as v, DEFAULT_IGNORED_FILES_GLOBS as w, DEFAULT_SHIPPED_FILES_GLOBS as x, getGodotProjectName as y, getNewUploadTicket as z };
693
+ export { acceptTerms as $, ApiKey as A, BaseAuthenticatedCommand as B, CredentialsType as C, DetailsFlags as D, startJobsFromUpload as E, getProjectJobs as F, GODOT_CAPABILITIES as G, getProject as H, getBuild as I, castArrayObjectDates as J, JobStatus as K, JobStage as L, LogLevel as M, castJobDates as N, castObjectDates as O, Platform as P, getAuthToken as Q, getGodotAndroidPackageName as R, getGoogleStatus as S, inviteServiceAccount as T, UserRole as U, disconnectGoogle as V, WS_URL as W, BaseCommand as X, getSingleUseUrl as Y, WEB_URL as Z, setAuthToken as _, ApiKeyType as a, Auth as a0, getShortAuthRequiredUrl as a1, getGoogleAuthUrl as a2, getShortTime as a3, getJob as a4, getShortDateTime as a5, getShortTimeDelta as a6, queryClient as a7, getShortDate as b, BaseGameCommand as c, getGodotAppleBundleIdentifier as d, BundleId as e, App as f, getProjects as g, CapabilityTypeOption as h, BetaGroup as i, isCWDGodotGame as j, getProjectPlatformProgress as k, Certificate as l, CertificateType as m, Profile as n, ProfileType as o, getAuthedHeaders as p, API_URL as q, getGodotProjectCapabilities as r, CapabilityType as s, GameEngine as t, getGodotVersion as u, createProject as v, DEFAULT_IGNORED_FILES_GLOBS as w, DEFAULT_SHIPPED_FILES_GLOBS as x, getGodotProjectName as y, getNewUploadTicket as z };
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { p as getAuthedHeaders, q as API_URL, J as castArrayObjectDates } from './index-CF0fIsx2.js';
2
+ import { p as getAuthedHeaders, q as API_URL, J as castArrayObjectDates } from './index-BQRxiyqn.js';
3
3
  import 'fs';
4
4
 
5
5
  async function getUserCredentials(pageSize = 100) {
@@ -0,0 +1,144 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { Box, Text } from 'ink';
3
+ import { useState, useRef, useEffect, useContext } from 'react';
4
+ import Spinner from 'ink-spinner';
5
+ import { a as GameContext } from './Command-Cl-JfhTy.js';
6
+ import { p as getAuthedHeaders, q as API_URL, O as castObjectDates, P as Platform, C as CredentialsType, S as getGoogleStatus } from './index-BQRxiyqn.js';
7
+ import axios from 'axios';
8
+ import 'crypto-js';
9
+ import 'uuid';
10
+ import 'luxon';
11
+ import 'fs';
12
+ import { ProgressBar } from '@inkjs/ui';
13
+ import { useQuery, useQueryClient } from '@tanstack/react-query';
14
+ import 'open';
15
+ import 'crypto';
16
+ import 'readline-sync';
17
+ import 'node:readline';
18
+ import 'node:path';
19
+ import 'node:url';
20
+ import { c as cacheKeys } from './useAndroidServiceAccountTestResult-D_30xIJA.js';
21
+ import 'fast-glob';
22
+ import 'yazl';
23
+ import 'socket.io-client';
24
+ import 'isomorphic-git';
25
+ import '@oclif/core';
26
+ import { u as useWebSocket } from './useWebSocket-DoImIdTy.js';
27
+ import { u as useProjectCredentials } from './useProjectCredentials-B5ZmpIxL.js';
28
+ import 'qrcode';
29
+ import 'string-length';
30
+ import 'strip-ansi';
31
+
32
+ async function fetchStatus({ projectId }) {
33
+ try {
34
+ if (!projectId) throw new Error("projectId is required");
35
+ const headers = getAuthedHeaders();
36
+ const url = `${API_URL}/projects/${projectId}/credentials/android/key/status/`;
37
+ const response = await axios.get(url, { headers });
38
+ return castObjectDates(response.data);
39
+ } catch (error) {
40
+ console.warn("fetchStatus Error", error);
41
+ throw error;
42
+ }
43
+ }
44
+ const useAndroidServiceAccountSetupStatus = (props) => {
45
+ return useQuery({
46
+ queryKey: cacheKeys.androidSetupStatus(props),
47
+ queryFn: () => fetchStatus(props),
48
+ // Status changes frequently, so we want to keep it fresh
49
+ refetchInterval: 1e3 * 5,
50
+ staleTime: 1e3 * 5
51
+ });
52
+ };
53
+
54
+ const ERR_NOT_AUTHENTICATED = "You must be connected to Google to create a Service Account Key";
55
+ const useHasServiceAccountKey = (projectId) => {
56
+ const { data, isSuccess } = useProjectCredentials({ projectId, platform: Platform.ANDROID });
57
+ return isSuccess && data.data.some((cred) => cred.isActive && cred.platform === Platform.ANDROID && cred.type == CredentialsType.KEY);
58
+ };
59
+ const useAndroidServiceAccount = ({ projectId, onError, onComplete }) => {
60
+ const queryClient = useQueryClient();
61
+ const [isStarting, setIsStarting] = useState(false);
62
+ const hasServiceAccountKey = useHasServiceAccountKey(projectId);
63
+ const listener = {
64
+ getPattern: () => `project.${projectId}:android-setup-status`,
65
+ eventHandler: async (pattern, data) => {
66
+ const key = cacheKeys.androidSetupStatus({ projectId });
67
+ queryClient.setQueryData(key, () => data);
68
+ }
69
+ };
70
+ useWebSocket([listener]);
71
+ const { data: setupStatus } = useAndroidServiceAccountSetupStatus({ projectId });
72
+ const prevSetupStatusRef = useRef("unknown");
73
+ useEffect(() => {
74
+ if (["running", "queued"].includes(prevSetupStatusRef.current)) {
75
+ if (setupStatus?.status === "complete") onComplete();
76
+ if (setupStatus?.status === "error") onError(new Error(setupStatus.errorMessage));
77
+ }
78
+ prevSetupStatusRef.current = setupStatus?.status || "unknown";
79
+ }, [setupStatus]);
80
+ const handleStart = async () => {
81
+ try {
82
+ setIsStarting(true);
83
+ const currentStatus = await getGoogleStatus();
84
+ if (!currentStatus.isAuthenticated) throw new Error(ERR_NOT_AUTHENTICATED);
85
+ const headers = getAuthedHeaders();
86
+ const androidKeyApiBase = `${API_URL}/projects/${projectId}/credentials/android/key`;
87
+ const startUrl = `${androidKeyApiBase}/setup/`;
88
+ const { data: updatedStatus } = await axios.post(startUrl, {}, { headers });
89
+ queryClient.invalidateQueries({
90
+ queryKey: cacheKeys.projectCredentials({ projectId, pageNumber: 0 })
91
+ });
92
+ await queryClient.setQueryData(cacheKeys.androidSetupStatus({ projectId }), (_) => updatedStatus);
93
+ setIsStarting(false);
94
+ return true;
95
+ } catch (error) {
96
+ setIsStarting(false);
97
+ console.warn("useAndroidServiceAccount.handleStart Error", error);
98
+ onError(error);
99
+ return false;
100
+ }
101
+ };
102
+ const isCreating = isStarting || setupStatus?.status === "queued" || setupStatus?.status === "running";
103
+ return {
104
+ handleStart,
105
+ setupStatus,
106
+ isCreating,
107
+ hasServiceAccountKey
108
+ };
109
+ };
110
+
111
+ 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: [
112
+ label && label != "" && /* @__PURE__ */ jsx(Text, { ...labelProps, children: label }),
113
+ /* @__PURE__ */ jsx(ProgressBar, { value: progress || 0 }),
114
+ /* @__PURE__ */ jsxs(Text, { children: [
115
+ Math.floor(progress || 0),
116
+ "%"
117
+ ] }),
118
+ /* @__PURE__ */ jsx(Spinner, { type: spinnerType })
119
+ ] }) }) });
120
+
121
+ const CreateServiceAccountKey = (props) => {
122
+ const { gameId } = useContext(GameContext);
123
+ return /* @__PURE__ */ jsx(Fragment, { children: gameId && /* @__PURE__ */ jsx(CreateForGame, { gameId, ...props }) });
124
+ };
125
+ const CreateForGame = ({ onComplete, onError, gameId, ...boxProps }) => {
126
+ const [didStart, setDidStart] = useState(false);
127
+ const { handleStart, setupStatus, isCreating } = useAndroidServiceAccount({
128
+ projectId: gameId,
129
+ onError,
130
+ onComplete
131
+ });
132
+ useEffect(() => {
133
+ handleStart().then(() => setDidStart(true));
134
+ }, [gameId]);
135
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, ...boxProps, children: [
136
+ /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
137
+ /* @__PURE__ */ jsx(Text, { children: "Creating a Service Account and API Key..." }),
138
+ isCreating && /* @__PURE__ */ jsx(Spinner, { type: "dots" })
139
+ ] }),
140
+ didStart && /* @__PURE__ */ jsx(ProgressSpinner, { progress: (setupStatus?.progress || 0) * 100, spinnerType: "dots" })
141
+ ] }) });
142
+ };
143
+
144
+ export { CreateServiceAccountKey as C, ProgressSpinner as P };
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.js';
2
+ import { p as getAuthedHeaders, q as API_URL } from './index-BQRxiyqn.js';
3
3
 
4
4
  async function getNewUploadTicket(projectId = null) {
5
5
  const url = projectId ? `${API_URL}/projects/${projectId}/credentials/url` : `${API_URL}/credentials/url`;
@@ -1,4 +1,4 @@
1
- import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.js';
1
+ import { p as getAuthedHeaders, q as API_URL } from './index-BQRxiyqn.js';
2
2
  import axios from 'axios';
3
3
  import { useQuery } from '@tanstack/react-query';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
- import { f as App } from './index-CF0fIsx2.js';
2
+ import { f as App } from './index-BQRxiyqn.js';
3
3
 
4
4
  const queryAppleApp = async ({ ctx, iosBundleId }) => {
5
5
  if (!iosBundleId) {
@@ -1,5 +1,5 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
- import { e as BundleId, r as getGodotProjectCapabilities, P as Platform, G as GODOT_CAPABILITIES, s as CapabilityType } from './index-CF0fIsx2.js';
2
+ import { e as BundleId, r as getGodotProjectCapabilities, P as Platform, G as GODOT_CAPABILITIES, s as CapabilityType } from './index-BQRxiyqn.js';
3
3
 
4
4
  async function getBundleIdCapabilities(bundleId) {
5
5
  const current = await bundleId.getBundleIdCapabilitiesAsync();
@@ -0,0 +1,43 @@
1
+ import { u as useJob } from './Command-Cl-JfhTy.js';
2
+ import { useState, useEffect } from 'react';
3
+ import { u as useWebSocket } from './useWebSocket-DoImIdTy.js';
4
+ import { N as castJobDates, O as castObjectDates } from './index-BQRxiyqn.js';
5
+
6
+ function useJobWatching({ projectId, jobId, isWatching, onJobUpdate }) {
7
+ const [websocketJob, setWebsocketJob] = useState(null);
8
+ const [mostRecentLog, setMostRecentLog] = useState(null);
9
+ const jobStatusListener = {
10
+ getPattern: () => [`project.${projectId}:job:created`, `project.${projectId}:job:updated`],
11
+ eventHandler: async (pattern, rawJob) => {
12
+ if (rawJob.id !== jobId) return;
13
+ const job2 = castJobDates(rawJob);
14
+ setWebsocketJob(job2);
15
+ if (onJobUpdate) onJobUpdate(job2);
16
+ }
17
+ };
18
+ const jobProgressListener = {
19
+ getPattern: () => `project.${projectId}:job.${jobId}:log`,
20
+ eventHandler: async (pattern, rawLogEntry) => {
21
+ const logEntry = castObjectDates(rawLogEntry, ["sentAt", "createdAt"]);
22
+ setMostRecentLog(logEntry);
23
+ }
24
+ };
25
+ useWebSocket(isWatching ? [jobStatusListener, jobProgressListener] : []);
26
+ const { isLoading, data: job } = useJob({
27
+ projectId,
28
+ jobId
29
+ });
30
+ useEffect(() => {
31
+ setWebsocketJob(null);
32
+ }, [jobId, projectId, isWatching, job]);
33
+ const fetchedJob = job ? job : null;
34
+ const data = websocketJob ? websocketJob : fetchedJob;
35
+ const progress = mostRecentLog?.progress || null;
36
+ return {
37
+ isLoading,
38
+ data,
39
+ progress
40
+ };
41
+ }
42
+
43
+ export { useJobWatching as u };