UNPKG

shipthis

Version:

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

93 lines (90 loc) 3.34 kB
import { jsxs, jsx } from 'react/jsx-runtime'; import { Flags } from '@oclif/core'; import { render, Box, Text } from 'ink'; import { B as BaseAuthenticatedCommand, g as getProjects, b as getShortDate } from '../../index-BwnzoldS.js'; import 'ink-spinner'; import { g as getShortUUID } from '../../index-CJWMt1s-.js'; import { T as Table } from '../../Table-FaNgpyeq.js'; import 'react'; import '@tanstack/react-query'; import 'axios'; import 'luxon'; import 'node:fs'; 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 'node:path'; import '../../ejs-DirFZbza.js'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import '../../index-hoHfGrjg.js'; import { C as Command } from '../../Command-DN1j3tjt.js'; import 'crypto-js'; import '@expo/apple-utils/build/index.js'; import 'node:crypto'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'isomorphic-git'; import 'deepmerge'; import 'ini'; import 'fs'; import 'path'; import '../../useAndroidServiceAccountTestResult-CwKeW0ED.js'; class GameList extends BaseAuthenticatedCommand { static args = {}; static description = "Shows a list of all your games."; static examples = ["<%= config.bin %> <%= command.id %>"]; static flags = { order: Flags.string({ char: "r", default: "desc", description: "The order to sort by", options: ["asc", "desc"] }), orderBy: Flags.string({ char: "o", default: "createdAt", description: "The field to order by", options: ["createdAt", "updatedAt", "name"] }), pageNumber: Flags.integer({ char: "p", default: 0, description: "The page number to show (starts at 0)" }), pageSize: Flags.integer({ char: "s", default: 10, description: "The number of items to show per page" }) }; async run() { const { flags } = this; const params = flags; const gameListResponse = await getProjects(params); const data = gameListResponse.data.map((game) => { const item = {}; item.id = getShortUUID(game.id); item.name = game.name; item.createdAt = getShortDate(game.createdAt); return item; }); render( /* @__PURE__ */ jsxs(Command, { command: this, children: [ data.length === 0 && params.pageNumber === 0 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [ /* @__PURE__ */ jsx(Text, { children: "No games found. Create one now with:" }), /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: [ /* @__PURE__ */ jsx(Text, { children: "shipthis game wizard android" }), /* @__PURE__ */ jsx(Text, { children: "shipthis game wizard ios" }) ] }) ] }), data.length > 0 && /* @__PURE__ */ jsx(Table, { data }), gameListResponse.pageCount > 1 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [ /* @__PURE__ */ jsx(Text, { children: `Showing page ${flags.pageNumber + 1} of ${gameListResponse.pageCount}.` }), /* @__PURE__ */ jsx(Text, { children: "Use the --pageNumber parameter to see other pages." }) ] }) ] }) ); } } export { GameList as default };