UNPKG

shipthis

Version:

ShipThis manages building and uploading your Godot games to the App Store and Google Play.

59 lines (56 loc) 1.8 kB
import { jsx } from 'react/jsx-runtime'; import { useQueryClient } from '@tanstack/react-query'; import axios from 'axios'; import { Box } from 'ink'; import { useContext } from 'react'; import { p as getAuthedHeaders, o as API_URL } from './baseCommand-CTn3KGH3.js'; import 'ink-spinner'; import 'node:crypto'; import 'node:fs'; import 'node:path'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'luxon'; import 'isomorphic-git'; import '@oclif/core'; import { G as GameContext, k as cacheKeys } from './baseGameCommand-8VL7xe-O.js'; import 'fast-glob'; import 'uuid'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import 'string-length'; import 'strip-ansi'; import 'open'; import '@inkjs/ui'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import { R as RunWithSpinner } from './RunWithSpinner-DucRnFp6.js'; const CreateKeystore = ({ onComplete, onError, ...boxProps }) => { const { gameId } = useContext(GameContext); const queryClient = useQueryClient(); const handleCreate = async () => { try { if (!gameId) throw new Error("No game"); const headers = await getAuthedHeaders(); await axios.post(`${API_URL}/projects/${gameId}/credentials/android/certificate`, null, { headers }); queryClient.invalidateQueries({ queryKey: cacheKeys.projectCredentials({ pageNumber: 0, projectId: gameId }) }); } catch (error) { onError(error); } }; return /* @__PURE__ */ jsx(Box, { flexDirection: "column", gap: 1, ...boxProps, children: gameId && /* @__PURE__ */ jsx( RunWithSpinner, { executeMethod: handleCreate, msgComplete: "Keystore created", msgInProgress: "Creating Keystore...", onComplete } ) }); }; export { CreateKeystore as C };