shipthis 0.1.24 → 0.1.25

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 (89) hide show
  1. package/README.md +25 -16
  2. package/docs/assets/ship-outputx0.8.gif +0 -0
  3. package/package.json +1 -1
  4. package/bin/readme.sh +0 -15
  5. package/dist/AppleBundleIdDetails-mPUG2R4N.js +0 -76
  6. package/dist/Command-B3AmRt2w.js +0 -28
  7. package/dist/CommandGame-BCMzP9pc.js +0 -9
  8. package/dist/Create-CsJxpzUs.js +0 -59
  9. package/dist/Import-v0M_ygyF.js +0 -110
  10. package/dist/JobProgress-9uvq8IBn.js +0 -121
  11. package/dist/JobStatusTable-Bf7J9WXe.js +0 -191
  12. package/dist/NextSteps-CK9zHOCt.js +0 -18
  13. package/dist/ProgressSpinner-6pw1T8Iw.js +0 -16
  14. package/dist/ProjectCredentialsTable-CTkP1mvy.js +0 -37
  15. package/dist/RunWithSpinner-BVXNWGD3.js +0 -27
  16. package/dist/StatusTable-Dm5St4g-.js +0 -33
  17. package/dist/Table-CvM6pccN.js +0 -101
  18. package/dist/Title-BCQtayg6.js +0 -6
  19. package/dist/UserCredentialsTable-DhtM_iTG.js +0 -82
  20. package/dist/baseAppleCommand-IGl6KTvv.js +0 -10
  21. package/dist/baseGameAndroidCommand-DFn4zMvq.js +0 -43
  22. package/dist/commands/apple/apiKey/create.js +0 -103
  23. package/dist/commands/apple/apiKey/export.js +0 -81
  24. package/dist/commands/apple/apiKey/import.js +0 -85
  25. package/dist/commands/apple/apiKey/status.js +0 -122
  26. package/dist/commands/apple/certificate/create.js +0 -133
  27. package/dist/commands/apple/certificate/export.js +0 -81
  28. package/dist/commands/apple/certificate/import.js +0 -85
  29. package/dist/commands/apple/certificate/status.js +0 -130
  30. package/dist/commands/apple/login.js +0 -76
  31. package/dist/commands/apple/status.js +0 -79
  32. package/dist/commands/dashboard.js +0 -38
  33. package/dist/commands/game/android/apiKey/connect.js +0 -74
  34. package/dist/commands/game/android/apiKey/create.js +0 -74
  35. package/dist/commands/game/android/apiKey/export.js +0 -84
  36. package/dist/commands/game/android/apiKey/import.js +0 -93
  37. package/dist/commands/game/android/apiKey/invite.js +0 -81
  38. package/dist/commands/game/android/apiKey/status.js +0 -87
  39. package/dist/commands/game/android/keyStore/create.js +0 -69
  40. package/dist/commands/game/android/keyStore/export.js +0 -83
  41. package/dist/commands/game/android/keyStore/import.js +0 -112
  42. package/dist/commands/game/android/keyStore/status.js +0 -70
  43. package/dist/commands/game/android/status.js +0 -84
  44. package/dist/commands/game/build/download.js +0 -80
  45. package/dist/commands/game/build/list.js +0 -94
  46. package/dist/commands/game/create.js +0 -67
  47. package/dist/commands/game/details.js +0 -113
  48. package/dist/commands/game/export.js +0 -58
  49. package/dist/commands/game/ios/app/addTester.js +0 -124
  50. package/dist/commands/game/ios/app/create.js +0 -117
  51. package/dist/commands/game/ios/app/status.js +0 -66
  52. package/dist/commands/game/ios/app/sync.js +0 -95
  53. package/dist/commands/game/ios/profile/create.js +0 -129
  54. package/dist/commands/game/ios/profile/export.js +0 -83
  55. package/dist/commands/game/ios/profile/import.js +0 -92
  56. package/dist/commands/game/ios/profile/status.js +0 -139
  57. package/dist/commands/game/ios/status.js +0 -92
  58. package/dist/commands/game/ios/wizard.js +0 -153
  59. package/dist/commands/game/job/list.js +0 -91
  60. package/dist/commands/game/job/status.js +0 -91
  61. package/dist/commands/game/list.js +0 -83
  62. package/dist/commands/game/ship.js +0 -216
  63. package/dist/commands/game/status.js +0 -114
  64. package/dist/commands/game/wizard.js +0 -686
  65. package/dist/commands/internal/fastlane.js +0 -74
  66. package/dist/commands/internal/readme.js +0 -937
  67. package/dist/commands/login.js +0 -92
  68. package/dist/commands/status.js +0 -76
  69. package/dist/export-CVs_xoDN.js +0 -36
  70. package/dist/git-DREGq-jc.js +0 -32
  71. package/dist/import-Ch5O7xfN.js +0 -47
  72. package/dist/index-BB00V5oF.js +0 -136
  73. package/dist/index-BD1WLuFJ.js +0 -125
  74. package/dist/index-CIa2EDQ6.js +0 -24
  75. package/dist/index-CboPN9aq.js +0 -138
  76. package/dist/index-DkNQs11R.js +0 -711
  77. package/dist/index-nnzhQ3nY.js +0 -209
  78. package/dist/index.d.ts +0 -1
  79. package/dist/index.js +0 -1
  80. package/dist/upload-CRE2nVdd.js +0 -60
  81. package/dist/useAndroidServiceAccountTestResult-DcYDam-p.js +0 -52
  82. package/dist/useAppleApp-B16WbUxJ.js +0 -32
  83. package/dist/useAppleBundleId-DobPATan.js +0 -64
  84. package/dist/useJobWatching--BvVn7xS.js +0 -45
  85. package/dist/useProjectCredentials-Btnr7WK3.js +0 -54
  86. package/dist/useWebSocket-ByuNoqRw.js +0 -36
  87. package/dist/utils/help.js +0 -14
  88. package/npm-shrinkwrap.json +0 -14011
  89. package/oclif.manifest.json +0 -2286
@@ -1,138 +0,0 @@
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 { b as GameContext } from './index-nnzhQ3nY.js';
6
- import { p as getAuthedHeaders, q as API_URL, H as castObjectDates, P as Platform, C as CredentialsType, T as getGoogleStatus } from './index-DkNQs11R.js';
7
- import axios from 'axios';
8
- import 'crypto-js';
9
- import 'uuid';
10
- import 'fs';
11
- import 'luxon';
12
- import '@inkjs/ui';
13
- import { useQuery, useQueryClient } from '@tanstack/react-query';
14
- import 'yazl';
15
- import 'crypto';
16
- import 'readline-sync';
17
- import 'node:readline';
18
- import 'node:path';
19
- import 'node:url';
20
- import 'isomorphic-git';
21
- import '@oclif/core';
22
- import { c as cacheKeys } from './useAndroidServiceAccountTestResult-DcYDam-p.js';
23
- import 'fast-glob';
24
- import 'socket.io-client';
25
- import { u as useWebSocket } from './useWebSocket-ByuNoqRw.js';
26
- import { u as useProjectCredentials } from './useProjectCredentials-Btnr7WK3.js';
27
- import 'open';
28
- import 'marked';
29
- import 'marked-terminal';
30
- import 'path';
31
- import { P as ProgressSpinner } from './ProgressSpinner-6pw1T8Iw.js';
32
- import 'qrcode';
33
- import 'string-length';
34
- import 'strip-ansi';
35
-
36
- async function fetchStatus({ projectId }) {
37
- try {
38
- if (!projectId) throw new Error("projectId is required");
39
- const headers = getAuthedHeaders();
40
- const url = `${API_URL}/projects/${projectId}/credentials/android/key/status/`;
41
- const response = await axios.get(url, { headers });
42
- return castObjectDates(response.data);
43
- } catch (error) {
44
- console.warn("fetchStatus Error", error);
45
- throw error;
46
- }
47
- }
48
- const useAndroidServiceAccountSetupStatus = (props) => {
49
- return useQuery({
50
- queryKey: cacheKeys.androidSetupStatus(props),
51
- queryFn: () => fetchStatus(props),
52
- // Status changes frequently, so we want to keep it fresh
53
- refetchInterval: 1e3 * 5,
54
- staleTime: 1e3 * 5
55
- });
56
- };
57
-
58
- const ERR_NOT_AUTHENTICATED = "You must be connected to Google to create a Service Account Key";
59
- const useHasServiceAccountKey = (projectId) => {
60
- const { data, isSuccess } = useProjectCredentials({ projectId, platform: Platform.ANDROID });
61
- return isSuccess && data.data.some((cred) => cred.isActive && cred.platform === Platform.ANDROID && cred.type == CredentialsType.KEY);
62
- };
63
- const useAndroidServiceAccount = ({ projectId, onError, onComplete }) => {
64
- const queryClient = useQueryClient();
65
- const [isStarting, setIsStarting] = useState(false);
66
- const hasServiceAccountKey = useHasServiceAccountKey(projectId);
67
- const listener = {
68
- getPattern: () => `project.${projectId}:android-setup-status`,
69
- eventHandler: async (pattern, data) => {
70
- const key = cacheKeys.androidSetupStatus({ projectId });
71
- queryClient.setQueryData(key, () => data);
72
- }
73
- };
74
- useWebSocket([listener]);
75
- const { data: setupStatus } = useAndroidServiceAccountSetupStatus({ projectId });
76
- const prevSetupStatusRef = useRef("unknown");
77
- useEffect(() => {
78
- if (["running", "queued"].includes(prevSetupStatusRef.current)) {
79
- if (setupStatus?.status === "complete") onComplete();
80
- if (setupStatus?.status === "error") onError(new Error(setupStatus.errorMessage));
81
- }
82
- prevSetupStatusRef.current = setupStatus?.status || "unknown";
83
- }, [setupStatus]);
84
- const handleStart = async () => {
85
- try {
86
- setIsStarting(true);
87
- const currentStatus = await getGoogleStatus();
88
- if (!currentStatus.isAuthenticated) throw new Error(ERR_NOT_AUTHENTICATED);
89
- const headers = getAuthedHeaders();
90
- const androidKeyApiBase = `${API_URL}/projects/${projectId}/credentials/android/key`;
91
- const startUrl = `${androidKeyApiBase}/setup/`;
92
- const { data: updatedStatus } = await axios.post(startUrl, {}, { headers });
93
- queryClient.invalidateQueries({
94
- queryKey: cacheKeys.projectCredentials({ projectId, pageNumber: 0 })
95
- });
96
- await queryClient.setQueryData(cacheKeys.androidSetupStatus({ projectId }), (_) => updatedStatus);
97
- setIsStarting(false);
98
- return true;
99
- } catch (error) {
100
- setIsStarting(false);
101
- console.warn("useAndroidServiceAccount.handleStart Error", error);
102
- onError(error);
103
- return false;
104
- }
105
- };
106
- const isCreating = isStarting || setupStatus?.status === "queued" || setupStatus?.status === "running";
107
- return {
108
- handleStart,
109
- setupStatus,
110
- isCreating,
111
- hasServiceAccountKey
112
- };
113
- };
114
-
115
- const CreateServiceAccountKey = (props) => {
116
- const { gameId } = useContext(GameContext);
117
- return /* @__PURE__ */ jsx(Fragment, { children: gameId && /* @__PURE__ */ jsx(CreateForGame, { gameId, ...props }) });
118
- };
119
- const CreateForGame = ({ onComplete, onError, gameId, ...boxProps }) => {
120
- const [didStart, setDidStart] = useState(false);
121
- const { handleStart, setupStatus, isCreating } = useAndroidServiceAccount({
122
- projectId: gameId,
123
- onError,
124
- onComplete
125
- });
126
- useEffect(() => {
127
- handleStart().then(() => setDidStart(true));
128
- }, [gameId]);
129
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, ...boxProps, children: [
130
- /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
131
- /* @__PURE__ */ jsx(Text, { children: "Creating a Service Account and API Key..." }),
132
- isCreating && /* @__PURE__ */ jsx(Spinner, { type: "dots" })
133
- ] }),
134
- didStart && /* @__PURE__ */ jsx(ProgressSpinner, { progress: (setupStatus?.progress || 0) * 100, spinnerType: "dots" })
135
- ] }) });
136
- };
137
-
138
- export { CreateServiceAccountKey as C };