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.
- package/README.md +25 -16
- package/docs/assets/ship-outputx0.8.gif +0 -0
- package/package.json +1 -1
- package/bin/readme.sh +0 -15
- package/dist/AppleBundleIdDetails-mPUG2R4N.js +0 -76
- package/dist/Command-B3AmRt2w.js +0 -28
- package/dist/CommandGame-BCMzP9pc.js +0 -9
- package/dist/Create-CsJxpzUs.js +0 -59
- package/dist/Import-v0M_ygyF.js +0 -110
- package/dist/JobProgress-9uvq8IBn.js +0 -121
- package/dist/JobStatusTable-Bf7J9WXe.js +0 -191
- package/dist/NextSteps-CK9zHOCt.js +0 -18
- package/dist/ProgressSpinner-6pw1T8Iw.js +0 -16
- package/dist/ProjectCredentialsTable-CTkP1mvy.js +0 -37
- package/dist/RunWithSpinner-BVXNWGD3.js +0 -27
- package/dist/StatusTable-Dm5St4g-.js +0 -33
- package/dist/Table-CvM6pccN.js +0 -101
- package/dist/Title-BCQtayg6.js +0 -6
- package/dist/UserCredentialsTable-DhtM_iTG.js +0 -82
- package/dist/baseAppleCommand-IGl6KTvv.js +0 -10
- package/dist/baseGameAndroidCommand-DFn4zMvq.js +0 -43
- package/dist/commands/apple/apiKey/create.js +0 -103
- package/dist/commands/apple/apiKey/export.js +0 -81
- package/dist/commands/apple/apiKey/import.js +0 -85
- package/dist/commands/apple/apiKey/status.js +0 -122
- package/dist/commands/apple/certificate/create.js +0 -133
- package/dist/commands/apple/certificate/export.js +0 -81
- package/dist/commands/apple/certificate/import.js +0 -85
- package/dist/commands/apple/certificate/status.js +0 -130
- package/dist/commands/apple/login.js +0 -76
- package/dist/commands/apple/status.js +0 -79
- package/dist/commands/dashboard.js +0 -38
- package/dist/commands/game/android/apiKey/connect.js +0 -74
- package/dist/commands/game/android/apiKey/create.js +0 -74
- package/dist/commands/game/android/apiKey/export.js +0 -84
- package/dist/commands/game/android/apiKey/import.js +0 -93
- package/dist/commands/game/android/apiKey/invite.js +0 -81
- package/dist/commands/game/android/apiKey/status.js +0 -87
- package/dist/commands/game/android/keyStore/create.js +0 -69
- package/dist/commands/game/android/keyStore/export.js +0 -83
- package/dist/commands/game/android/keyStore/import.js +0 -112
- package/dist/commands/game/android/keyStore/status.js +0 -70
- package/dist/commands/game/android/status.js +0 -84
- package/dist/commands/game/build/download.js +0 -80
- package/dist/commands/game/build/list.js +0 -94
- package/dist/commands/game/create.js +0 -67
- package/dist/commands/game/details.js +0 -113
- package/dist/commands/game/export.js +0 -58
- package/dist/commands/game/ios/app/addTester.js +0 -124
- package/dist/commands/game/ios/app/create.js +0 -117
- package/dist/commands/game/ios/app/status.js +0 -66
- package/dist/commands/game/ios/app/sync.js +0 -95
- package/dist/commands/game/ios/profile/create.js +0 -129
- package/dist/commands/game/ios/profile/export.js +0 -83
- package/dist/commands/game/ios/profile/import.js +0 -92
- package/dist/commands/game/ios/profile/status.js +0 -139
- package/dist/commands/game/ios/status.js +0 -92
- package/dist/commands/game/ios/wizard.js +0 -153
- package/dist/commands/game/job/list.js +0 -91
- package/dist/commands/game/job/status.js +0 -91
- package/dist/commands/game/list.js +0 -83
- package/dist/commands/game/ship.js +0 -216
- package/dist/commands/game/status.js +0 -114
- package/dist/commands/game/wizard.js +0 -686
- package/dist/commands/internal/fastlane.js +0 -74
- package/dist/commands/internal/readme.js +0 -937
- package/dist/commands/login.js +0 -92
- package/dist/commands/status.js +0 -76
- package/dist/export-CVs_xoDN.js +0 -36
- package/dist/git-DREGq-jc.js +0 -32
- package/dist/import-Ch5O7xfN.js +0 -47
- package/dist/index-BB00V5oF.js +0 -136
- package/dist/index-BD1WLuFJ.js +0 -125
- package/dist/index-CIa2EDQ6.js +0 -24
- package/dist/index-CboPN9aq.js +0 -138
- package/dist/index-DkNQs11R.js +0 -711
- package/dist/index-nnzhQ3nY.js +0 -209
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/upload-CRE2nVdd.js +0 -60
- package/dist/useAndroidServiceAccountTestResult-DcYDam-p.js +0 -52
- package/dist/useAppleApp-B16WbUxJ.js +0 -32
- package/dist/useAppleBundleId-DobPATan.js +0 -64
- package/dist/useJobWatching--BvVn7xS.js +0 -45
- package/dist/useProjectCredentials-Btnr7WK3.js +0 -54
- package/dist/useWebSocket-ByuNoqRw.js +0 -36
- package/dist/utils/help.js +0 -14
- package/npm-shrinkwrap.json +0 -14011
- package/oclif.manifest.json +0 -2286
package/dist/index-nnzhQ3nY.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Text, useInput, Box } from 'ink';
|
|
3
|
-
import React, { useState, useEffect, useContext, useRef } from 'react';
|
|
4
|
-
import Spinner from 'ink-spinner';
|
|
5
|
-
import open from 'open';
|
|
6
|
-
import { g as getShortUUID, f as getPlatformName, s as scriptDir } from './index-BB00V5oF.js';
|
|
7
|
-
import { c as cacheKeys, u as useAndroidServiceAccountTestResult, K as KeyTestStatus, a as KeyTestError } from './useAndroidServiceAccountTestResult-DcYDam-p.js';
|
|
8
|
-
import { p as getAuthedHeaders, q as API_URL, L as castArrayObjectDates, P as Platform, a6 as getShortDateTime, J as JobStatus, a7 as getShortTimeDelta, E as getJob, I as getProject, a3 as getShortAuthRequiredUrl, M as queryClient, W as WEB_URL } from './index-DkNQs11R.js';
|
|
9
|
-
import '@inkjs/ui';
|
|
10
|
-
import axios from 'axios';
|
|
11
|
-
import { useQuery } from '@tanstack/react-query';
|
|
12
|
-
import fs__default from 'fs';
|
|
13
|
-
import 'uuid';
|
|
14
|
-
import 'yazl';
|
|
15
|
-
import { setOptions, parse } from 'marked';
|
|
16
|
-
import TerminalRenderer from 'marked-terminal';
|
|
17
|
-
import path from 'path';
|
|
18
|
-
import 'qrcode';
|
|
19
|
-
import 'string-length';
|
|
20
|
-
import 'strip-ansi';
|
|
21
|
-
import 'luxon';
|
|
22
|
-
import 'fast-glob';
|
|
23
|
-
import 'socket.io-client';
|
|
24
|
-
|
|
25
|
-
async function queryBuilds({ projectId, ...pageAndSortParams }) {
|
|
26
|
-
try {
|
|
27
|
-
const headers = getAuthedHeaders();
|
|
28
|
-
const url = `${API_URL}/projects/${projectId}/builds`;
|
|
29
|
-
const response = await axios.get(url, { headers, params: pageAndSortParams });
|
|
30
|
-
return {
|
|
31
|
-
...response.data,
|
|
32
|
-
data: castArrayObjectDates(response.data.data)
|
|
33
|
-
};
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.warn("queryBuilds Error", error);
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function getBuildSummary(build) {
|
|
40
|
-
const buildType = build.buildType || (build.platform == Platform.IOS ? "IPA" : "AAB");
|
|
41
|
-
const filename = `game.${buildType.toLowerCase()}`;
|
|
42
|
-
return {
|
|
43
|
-
id: getShortUUID(build.id),
|
|
44
|
-
jobId: getShortUUID(build.jobId),
|
|
45
|
-
...getJobDetailsSummary(build.jobDetails),
|
|
46
|
-
type: `${getPlatformName(build.platform)} ${buildType}`,
|
|
47
|
-
createdAt: getShortDateTime(build.createdAt),
|
|
48
|
-
cmd: `shipthis game build download ${getShortUUID(build.id)} ${filename}`
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const useBuilds = (props) => {
|
|
52
|
-
const queryResult = useQuery({
|
|
53
|
-
queryKey: cacheKeys.builds(props),
|
|
54
|
-
queryFn: async () => queryBuilds(props)
|
|
55
|
-
});
|
|
56
|
-
return queryResult;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
function getJobDetailsSummary(jobDetails) {
|
|
60
|
-
const semanticVersion = jobDetails?.semanticVersion || "N/A";
|
|
61
|
-
const buildNumber = jobDetails?.buildNumber || "N/A";
|
|
62
|
-
const gitCommit = jobDetails?.gitCommitHash ? getShortUUID(jobDetails?.gitCommitHash) : "";
|
|
63
|
-
const gitBranch = jobDetails?.gitBranch || "";
|
|
64
|
-
return {
|
|
65
|
-
version: `${semanticVersion} (${buildNumber})`,
|
|
66
|
-
gitInfo: gitCommit ? `${gitCommit} (${gitBranch})` : ""
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function getJobSummary(job, timeNow) {
|
|
70
|
-
const inProgress = ![JobStatus.COMPLETED, JobStatus.FAILED].includes(job.status);
|
|
71
|
-
return {
|
|
72
|
-
id: getShortUUID(job.id),
|
|
73
|
-
...getJobDetailsSummary(job.details),
|
|
74
|
-
platform: getPlatformName(job.type),
|
|
75
|
-
status: job.status,
|
|
76
|
-
createdAt: getShortDateTime(job.createdAt),
|
|
77
|
-
runtime: getShortTimeDelta(job.createdAt, inProgress ? timeNow : job.updatedAt)
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
const useJob = (props) => {
|
|
81
|
-
return useQuery({
|
|
82
|
-
queryKey: cacheKeys.job(props),
|
|
83
|
-
queryFn: () => getJob(props.jobId, props.projectId)
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const CommandContext = React.createContext({
|
|
88
|
-
command: null,
|
|
89
|
-
setCommand: (command) => {
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
const CommandProvider = (props) => {
|
|
93
|
-
const [command, setCommand] = useState(props.command || null);
|
|
94
|
-
return /* @__PURE__ */ jsx(CommandContext.Provider, { value: { command, setCommand }, children: props.children });
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const GameContext = React.createContext({
|
|
98
|
-
gameId: null,
|
|
99
|
-
game: null,
|
|
100
|
-
setGameId: (gameId) => {
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
const GameProvider = ({ children }) => {
|
|
104
|
-
const [gameId, setGameId] = useState(null);
|
|
105
|
-
const [game, setGame] = useState(null);
|
|
106
|
-
const { command } = React.useContext(CommandContext);
|
|
107
|
-
const handleLoad = async () => {
|
|
108
|
-
if (command) {
|
|
109
|
-
const commandGameId = await command.getGameId();
|
|
110
|
-
if (commandGameId) setGameId(commandGameId);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const handleGameIdChange = async () => {
|
|
114
|
-
if (!gameId) {
|
|
115
|
-
setGame(null);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const game2 = await getProject(gameId);
|
|
119
|
-
setGame(game2);
|
|
120
|
-
};
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
handleGameIdChange();
|
|
123
|
-
}, [gameId]);
|
|
124
|
-
useEffect(() => {
|
|
125
|
-
handleLoad();
|
|
126
|
-
}, [command]);
|
|
127
|
-
return /* @__PURE__ */ jsx(GameContext.Provider, { value: { gameId, game, setGameId }, children });
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const cleanHyperlinks = (input) => {
|
|
131
|
-
return input.replace(/\x1b]8;;[^\x07]*\x07/g, "").replace(/\x1b]8;;\x07/g, "");
|
|
132
|
-
};
|
|
133
|
-
const getRenderedMarkdown = ({ filename, templateVars, ...options }) => {
|
|
134
|
-
setOptions({
|
|
135
|
-
renderer: new TerminalRenderer({
|
|
136
|
-
...options
|
|
137
|
-
})
|
|
138
|
-
});
|
|
139
|
-
const entrypointPath = fs__default.realpathSync(process.argv[1]);
|
|
140
|
-
const root = path.dirname(entrypointPath);
|
|
141
|
-
const mdPath = path.join(root, "..", "assets", "markdown", filename);
|
|
142
|
-
const mdTemplate = fs__default.readFileSync(mdPath, "utf8").trim();
|
|
143
|
-
const markdown = !templateVars ? mdTemplate : mdTemplate.replace(/\${(.*?)}/g, (_, key) => templateVars[key.trim()] || "");
|
|
144
|
-
const rendered = parse(markdown).trim();
|
|
145
|
-
const cleaned = cleanHyperlinks(rendered);
|
|
146
|
-
return cleaned;
|
|
147
|
-
};
|
|
148
|
-
const Markdown = ({ filename, templateVars, ...options }) => {
|
|
149
|
-
const [text, setText] = useState("");
|
|
150
|
-
useEffect(() => {
|
|
151
|
-
const cleaned = getRenderedMarkdown({ filename, templateVars, ...options });
|
|
152
|
-
setText(cleaned);
|
|
153
|
-
}, [filename, templateVars, options]);
|
|
154
|
-
return /* @__PURE__ */ jsx(Text, { children: text });
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
scriptDir(import.meta);
|
|
158
|
-
const getIsAppFound = (result) => {
|
|
159
|
-
const isFound = result?.status === KeyTestStatus.SUCCESS || result?.status === KeyTestStatus.ERROR && result?.error === KeyTestError.NOT_INVITED;
|
|
160
|
-
return isFound;
|
|
161
|
-
};
|
|
162
|
-
const CreateGooglePlayGame = (props) => {
|
|
163
|
-
const { gameId } = useContext(GameContext);
|
|
164
|
-
return /* @__PURE__ */ jsx(Fragment, { children: gameId && /* @__PURE__ */ jsx(Create, { gameId, ...props }) });
|
|
165
|
-
};
|
|
166
|
-
const Create = ({ onComplete, onError, gameId, ...boxProps }) => {
|
|
167
|
-
const { data: result, isFetching } = useAndroidServiceAccountTestResult({ projectId: gameId });
|
|
168
|
-
const { data: builds } = useBuilds({ projectId: gameId, pageNumber: 0 });
|
|
169
|
-
const previousIsFound = useRef(false);
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
const isFound = getIsAppFound(result);
|
|
172
|
-
if (previousIsFound.current === false && isFound) {
|
|
173
|
-
onComplete();
|
|
174
|
-
}
|
|
175
|
-
previousIsFound.current = isFound;
|
|
176
|
-
}, [result]);
|
|
177
|
-
useInput(async (input) => {
|
|
178
|
-
if (!gameId) return;
|
|
179
|
-
switch (input) {
|
|
180
|
-
case "r":
|
|
181
|
-
queryClient.invalidateQueries({
|
|
182
|
-
queryKey: cacheKeys.androidKeyTestResult({ projectId: gameId })
|
|
183
|
-
});
|
|
184
|
-
break;
|
|
185
|
-
case "d":
|
|
186
|
-
const dashUrl = await getShortAuthRequiredUrl(`/games/${getShortUUID(gameId)}/builds`);
|
|
187
|
-
await open(dashUrl);
|
|
188
|
-
}
|
|
189
|
-
if (input !== "r") return;
|
|
190
|
-
queryClient.invalidateQueries({
|
|
191
|
-
queryKey: cacheKeys.androidKeyTestResult({ projectId: gameId })
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
const initialBuild = builds?.data.find((build) => build.platform === Platform.ANDROID);
|
|
195
|
-
const downloadCmd = initialBuild ? `${getBuildSummary(initialBuild).cmd}` : "";
|
|
196
|
-
const templateVars = {
|
|
197
|
-
downloadCmd,
|
|
198
|
-
dashboardURL: new URL(`/games/${getShortUUID(gameId)}/builds`, WEB_URL).toString()
|
|
199
|
-
};
|
|
200
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, ...boxProps, children: [
|
|
201
|
-
/* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
|
|
202
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: isFetching ? "Checking..." : "ShipThis has not detected your game in Google Play. Press R to test again." }),
|
|
203
|
-
isFetching && /* @__PURE__ */ jsx(Spinner, { type: "dots" })
|
|
204
|
-
] }),
|
|
205
|
-
/* @__PURE__ */ jsx(Markdown, { filename: "create-google-play-game.md", templateVars })
|
|
206
|
-
] }) });
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export { CommandProvider as C, GameProvider as G, Markdown as M, getJobSummary as a, GameContext as b, useBuilds as c, getBuildSummary as d, CommandContext as e, CreateGooglePlayGame as f, getRenderedMarkdown as g, queryBuilds as q, useJob as u };
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { run } from '@oclif/core';
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { run } from '@oclif/core';
|
package/dist/upload-CRE2nVdd.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import { p as getAuthedHeaders, q as API_URL } from './index-DkNQs11R.js';
|
|
3
|
-
|
|
4
|
-
async function getNewUploadTicket(projectId = null) {
|
|
5
|
-
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/url` : `${API_URL}/credentials/url`;
|
|
6
|
-
const headers = getAuthedHeaders();
|
|
7
|
-
const { data: uploadInfo } = await axios({
|
|
8
|
-
method: "post",
|
|
9
|
-
url,
|
|
10
|
-
headers
|
|
11
|
-
});
|
|
12
|
-
return uploadInfo;
|
|
13
|
-
}
|
|
14
|
-
async function uploadUserCredentials({ contents, platform, type, serialNumber }) {
|
|
15
|
-
const uploadInfo = await getNewUploadTicket();
|
|
16
|
-
const jsonBuffer = Buffer.from(JSON.stringify(contents));
|
|
17
|
-
await axios.put(uploadInfo.url, jsonBuffer, {
|
|
18
|
-
headers: {
|
|
19
|
-
"Content-length": jsonBuffer.length,
|
|
20
|
-
"Content-Type": "application/json"
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const headers = getAuthedHeaders();
|
|
24
|
-
return await axios({
|
|
25
|
-
method: "post",
|
|
26
|
-
url: `${API_URL}/credentials`,
|
|
27
|
-
headers,
|
|
28
|
-
data: {
|
|
29
|
-
platform,
|
|
30
|
-
type,
|
|
31
|
-
uuid: uploadInfo.uuid,
|
|
32
|
-
serialNumber
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
async function uploadProjectCredentials(projectId, { contents, platform, type, serialNumber, identifier }) {
|
|
37
|
-
const uploadInfo = await getNewUploadTicket(projectId);
|
|
38
|
-
const jsonBuffer = Buffer.from(JSON.stringify(contents));
|
|
39
|
-
await axios.put(uploadInfo.url, jsonBuffer, {
|
|
40
|
-
headers: {
|
|
41
|
-
"Content-length": jsonBuffer.length,
|
|
42
|
-
"Content-Type": "application/json"
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const headers = getAuthedHeaders();
|
|
46
|
-
return await axios({
|
|
47
|
-
method: "post",
|
|
48
|
-
url: `${API_URL}/projects/${projectId}/credentials`,
|
|
49
|
-
headers,
|
|
50
|
-
data: {
|
|
51
|
-
platform,
|
|
52
|
-
type,
|
|
53
|
-
uuid: uploadInfo.uuid,
|
|
54
|
-
identifier,
|
|
55
|
-
serialNumber
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { uploadProjectCredentials as a, uploadUserCredentials as u };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { p as getAuthedHeaders, q as API_URL } from './index-DkNQs11R.js';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
import { useQuery } from '@tanstack/react-query';
|
|
4
|
-
|
|
5
|
-
const cacheKeys = {
|
|
6
|
-
androidKeyTestResult: (props) => ["androidKeyTestResult", ...Object.values(props)],
|
|
7
|
-
androidSetupStatus: (props) => ["androidSetupStatus", ...Object.values(props)],
|
|
8
|
-
builds: (props) => ["builds", ...Object.values(props)],
|
|
9
|
-
googleStatus: () => ["googleStatus"],
|
|
10
|
-
job: (props) => ["job", ...Object.values(props)],
|
|
11
|
-
jobLogs: (props) => ["jobLogs", ...Object.values(props)],
|
|
12
|
-
jobs: (props) => ["jobs", ...Object.values(props)],
|
|
13
|
-
projectCredentials: (props) => ["projectCredentials", ...Object.values(props)],
|
|
14
|
-
userCredentials: (props) => ["userCredentials", ...Object.values(props)]
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var KeyTestStatus = /* @__PURE__ */ ((KeyTestStatus2) => {
|
|
18
|
-
KeyTestStatus2["SUCCESS"] = "success";
|
|
19
|
-
KeyTestStatus2["ERROR"] = "error";
|
|
20
|
-
return KeyTestStatus2;
|
|
21
|
-
})(KeyTestStatus || {});
|
|
22
|
-
var KeyTestError = /* @__PURE__ */ ((KeyTestError2) => {
|
|
23
|
-
KeyTestError2["NO_SERVICE_ACCOUNT_KEY"] = "no_service_account_key";
|
|
24
|
-
KeyTestError2["NO_PACKAGE_NAME"] = "no_package_name";
|
|
25
|
-
KeyTestError2["APP_NOT_FOUND"] = "app_not_found";
|
|
26
|
-
KeyTestError2["NOT_INVITED"] = "not_invited";
|
|
27
|
-
return KeyTestError2;
|
|
28
|
-
})(KeyTestError || {});
|
|
29
|
-
const KeyTestErrorMessage = {
|
|
30
|
-
["no_service_account_key" /* NO_SERVICE_ACCOUNT_KEY */]: "Service Account API Key not found in your account",
|
|
31
|
-
["no_package_name" /* NO_PACKAGE_NAME */]: "Android Package Name has not been set",
|
|
32
|
-
["app_not_found" /* APP_NOT_FOUND */]: "Application not found in Google Play Console",
|
|
33
|
-
["not_invited" /* NOT_INVITED */]: "Service Account has not been invited to Google Play"
|
|
34
|
-
};
|
|
35
|
-
function niceError(keyError) {
|
|
36
|
-
return keyError ? KeyTestErrorMessage[keyError] : void 0;
|
|
37
|
-
}
|
|
38
|
-
const fetchKeyTestResult = async ({ projectId }, config) => {
|
|
39
|
-
if (!projectId) throw new Error("projectId is required");
|
|
40
|
-
const url = `${API_URL}/projects/${projectId}/credentials/android/key/test`;
|
|
41
|
-
const headers = getAuthedHeaders();
|
|
42
|
-
const { data } = await axios.post(url, {}, { headers, ...config });
|
|
43
|
-
return data;
|
|
44
|
-
};
|
|
45
|
-
const useAndroidServiceAccountTestResult = (props) => {
|
|
46
|
-
return useQuery({
|
|
47
|
-
queryKey: cacheKeys.androidKeyTestResult(props),
|
|
48
|
-
queryFn: () => fetchKeyTestResult(props)
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export { KeyTestStatus as K, KeyTestError as a, cacheKeys as c, fetchKeyTestResult as f, niceError as n, useAndroidServiceAccountTestResult as u };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
import { f as App } from './index-DkNQs11R.js';
|
|
3
|
-
|
|
4
|
-
const queryAppleApp = async ({ ctx, iosBundleId }) => {
|
|
5
|
-
if (!iosBundleId) {
|
|
6
|
-
return { app: null, summary: null };
|
|
7
|
-
}
|
|
8
|
-
const app = await App.findAsync(ctx, {
|
|
9
|
-
bundleId: iosBundleId
|
|
10
|
-
});
|
|
11
|
-
if (!app) {
|
|
12
|
-
return { app: null, summary: null };
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
app,
|
|
16
|
-
summary: {
|
|
17
|
-
id: app.id,
|
|
18
|
-
name: app.attributes.name,
|
|
19
|
-
bundleId: app.attributes.bundleId,
|
|
20
|
-
primaryLocale: app.attributes.primaryLocale
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
const useAppleApp = (props) => {
|
|
25
|
-
const queryResult = useQuery({
|
|
26
|
-
queryKey: ["appleApp", props.iosBundleId],
|
|
27
|
-
queryFn: () => queryAppleApp(props)
|
|
28
|
-
});
|
|
29
|
-
return queryResult;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { queryAppleApp as q, useAppleApp as u };
|
|
@@ -1,64 +0,0 @@
|
|
|
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-DkNQs11R.js';
|
|
3
|
-
|
|
4
|
-
async function getBundleIdCapabilities(bundleId) {
|
|
5
|
-
const current = await bundleId.getBundleIdCapabilitiesAsync();
|
|
6
|
-
let existing = [];
|
|
7
|
-
for (const capability of current) {
|
|
8
|
-
const capabilityType = Object.values(CapabilityType).find((c) => capability.isType(c));
|
|
9
|
-
if (capabilityType) {
|
|
10
|
-
existing.push(capabilityType);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return existing;
|
|
14
|
-
}
|
|
15
|
-
const fetchBundleId = async ({ ctx, iosBundleId }) => {
|
|
16
|
-
const empty = {
|
|
17
|
-
bundleId: null,
|
|
18
|
-
bundleIdSummary: null,
|
|
19
|
-
capabilities: null,
|
|
20
|
-
capabilitiesTable: null,
|
|
21
|
-
projectCapabilities: null,
|
|
22
|
-
shouldSyncCapabilities: null
|
|
23
|
-
};
|
|
24
|
-
if (!iosBundleId) return empty;
|
|
25
|
-
const bundleId = await BundleId.findAsync(ctx, {
|
|
26
|
-
identifier: iosBundleId
|
|
27
|
-
});
|
|
28
|
-
if (!bundleId) return empty;
|
|
29
|
-
const bundleIdCapabilities = await getBundleIdCapabilities(bundleId);
|
|
30
|
-
const projectCapabilities = getGodotProjectCapabilities(Platform.IOS);
|
|
31
|
-
const capabilitiesTable = GODOT_CAPABILITIES.map((gc) => {
|
|
32
|
-
const isEnabledInBundle = bundleIdCapabilities.includes(gc.type);
|
|
33
|
-
const isEnabledInProject = projectCapabilities.includes(gc.type);
|
|
34
|
-
const isCorrectlyConfigured = isEnabledInBundle === isEnabledInProject;
|
|
35
|
-
return {
|
|
36
|
-
name: gc.name,
|
|
37
|
-
isEnabledInBundle,
|
|
38
|
-
isEnabledInProject,
|
|
39
|
-
isCorrectlyConfigured
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
bundleId,
|
|
44
|
-
bundleIdSummary: {
|
|
45
|
-
id: bundleId.id,
|
|
46
|
-
identifier: bundleId.attributes.identifier,
|
|
47
|
-
name: bundleId.attributes.name,
|
|
48
|
-
platform: bundleId.attributes.platform
|
|
49
|
-
},
|
|
50
|
-
capabilities: bundleIdCapabilities,
|
|
51
|
-
capabilitiesTable,
|
|
52
|
-
projectCapabilities,
|
|
53
|
-
shouldSyncCapabilities: !capabilitiesTable.every((c) => c.isCorrectlyConfigured)
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
const useAppleBundleId = (props) => {
|
|
57
|
-
const queryResult = useQuery({
|
|
58
|
-
queryKey: ["appleBundleId", props.iosBundleId],
|
|
59
|
-
queryFn: () => fetchBundleId(props)
|
|
60
|
-
});
|
|
61
|
-
return queryResult;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export { fetchBundleId as f, useAppleBundleId as u };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { u as useJob } from './index-nnzhQ3nY.js';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { u as useWebSocket } from './useWebSocket-ByuNoqRw.js';
|
|
4
|
-
import { F as castJobDates, H as castObjectDates } from './index-DkNQs11R.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
|
-
const stage = mostRecentLog?.stage || null;
|
|
37
|
-
return {
|
|
38
|
-
isLoading,
|
|
39
|
-
data,
|
|
40
|
-
progress,
|
|
41
|
-
stage
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { useJobWatching as u };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import { useQuery } from '@tanstack/react-query';
|
|
3
|
-
import { c as cacheKeys } from './useAndroidServiceAccountTestResult-DcYDam-p.js';
|
|
4
|
-
import { b as getShortDate, p as getAuthedHeaders, q as API_URL, L as castArrayObjectDates } from './index-DkNQs11R.js';
|
|
5
|
-
import { g as getShortUUID } from './index-BB00V5oF.js';
|
|
6
|
-
|
|
7
|
-
async function queryProjectCredentials({
|
|
8
|
-
projectId,
|
|
9
|
-
...pageAndSortParams
|
|
10
|
-
}) {
|
|
11
|
-
try {
|
|
12
|
-
const headers = getAuthedHeaders();
|
|
13
|
-
const url = `${API_URL}/projects/${projectId}/credentials`;
|
|
14
|
-
const response = await axios.get(url, { headers, params: pageAndSortParams });
|
|
15
|
-
return {
|
|
16
|
-
...response.data,
|
|
17
|
-
data: castArrayObjectDates(response.data.data)
|
|
18
|
-
};
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.warn("queryProjectCredentials Error", error);
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function getProjectCredentialSummary(credential) {
|
|
25
|
-
return {
|
|
26
|
-
id: getShortUUID(credential.id),
|
|
27
|
-
type: credential.type,
|
|
28
|
-
serial: credential.serialNumber.substring(0, 30) + (credential.serialNumber.length > 30 ? "\u2026" : ""),
|
|
29
|
-
isActive: credential.isActive,
|
|
30
|
-
createdAt: getShortDate(credential.createdAt)
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const useProjectCredentials = ({
|
|
34
|
-
platform,
|
|
35
|
-
type,
|
|
36
|
-
...fetchProps
|
|
37
|
-
}) => {
|
|
38
|
-
const queryResult = useQuery({
|
|
39
|
-
queryKey: cacheKeys.projectCredentials(fetchProps),
|
|
40
|
-
queryFn: async () => queryProjectCredentials(fetchProps),
|
|
41
|
-
select: (data) => {
|
|
42
|
-
if (!(platform || type)) return data;
|
|
43
|
-
return {
|
|
44
|
-
...data,
|
|
45
|
-
data: data.data.filter((credential) => {
|
|
46
|
-
return (!platform || credential.platform === platform) && (!type || credential.type === type);
|
|
47
|
-
})
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return queryResult;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export { getProjectCredentialSummary as g, useProjectCredentials as u };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { io } from 'socket.io-client';
|
|
3
|
-
import { Q as getAuthToken, R as WS_URL } from './index-DkNQs11R.js';
|
|
4
|
-
|
|
5
|
-
function useWebSocket(listeners = []) {
|
|
6
|
-
const log = () => {
|
|
7
|
-
};
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (listeners.length === 0) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const token = getAuthToken();
|
|
13
|
-
const socket = io(WS_URL, {
|
|
14
|
-
auth: { token },
|
|
15
|
-
forceNew: true
|
|
16
|
-
});
|
|
17
|
-
socket.on("connect", () => log());
|
|
18
|
-
for (const listener of listeners) {
|
|
19
|
-
const pattern = listener.getPattern();
|
|
20
|
-
const bindSocket = (pattern2) => {
|
|
21
|
-
const boundListener = listener.eventHandler.bind(listener, pattern2);
|
|
22
|
-
socket.on(pattern2, boundListener);
|
|
23
|
-
};
|
|
24
|
-
if (Array.isArray(pattern)) {
|
|
25
|
-
pattern.forEach(bindSocket);
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
bindSocket(pattern);
|
|
29
|
-
}
|
|
30
|
-
return () => {
|
|
31
|
-
socket.disconnect();
|
|
32
|
-
};
|
|
33
|
-
}, []);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { useWebSocket as u };
|
package/dist/utils/help.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Help } from '@oclif/core';
|
|
2
|
-
|
|
3
|
-
class CustomHelp extends Help {
|
|
4
|
-
formatTopics(topics) {
|
|
5
|
-
const publicTopics = topics.filter((t) => t.name !== "internal");
|
|
6
|
-
return super.formatTopics(publicTopics);
|
|
7
|
-
}
|
|
8
|
-
// formatCommand is protected, so we need to override it to make it public
|
|
9
|
-
exposedFormatCommand(command) {
|
|
10
|
-
return super.formatCommand(command);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { CustomHelp as default };
|