shipthis
Version:
ShipThis manages building and uploading your Godot games to the App Store and Google Play.
79 lines (76 loc) • 2.82 kB
JavaScript
import { jsx } from 'react/jsx-runtime';
import { Flags } from '@oclif/core';
import { render } from 'ink';
import 'node:fs';
import 'axios';
import 'crypto-js';
import 'uuid';
import { P as Platform, C as CredentialsType } from '../../../../index-BwnzoldS.js';
import 'luxon';
import { a as getProjectCredentials } from '../../../../index-izrACZbC.js';
import 'ink-spinner';
import 'node:crypto';
import 'node:path';
import 'node:readline';
import 'node:url';
import 'readline-sync';
import 'isomorphic-git';
import '@tanstack/react-query';
import 'react';
import 'fast-glob';
import 'yazl';
import 'socket.io-client';
import 'fullscreen-ink';
import 'string-length';
import 'strip-ansi';
import 'open';
import '@inkjs/ui';
import '../../../../ejs-DirFZbza.js';
import 'marked';
import 'marked-terminal';
import 'qrcode';
import '../../../../index-hoHfGrjg.js';
import { C as CreateServiceAccountKey } from '../../../../index-BTXEUd8W.js';
import { C as CommandGame } from '../../../../CommandGame-D2NqytWc.js';
import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-BCB1SMCf.js';
import '@expo/apple-utils/build/index.js';
import 'deepmerge';
import 'ini';
import 'fs';
import 'path';
import '../../../../index-CJWMt1s-.js';
import '../../../../useAndroidServiceAccountTestResult-CwKeW0ED.js';
import '../../../../useWebSocket-cM5yOcDv.js';
import '../../../../useProjectCredentials-DxdwJCfU.js';
import '../../../../useGoogleStatus-Cx_QIsXa.js';
import '../../../../ProgressSpinner-Um6ARKlk.js';
import '../../../../Command-DN1j3tjt.js';
class GameAndroidApiKeyCreate extends BaseGameAndroidCommand {
static args = {};
static description = "Creates a new Android Service Account API Key for a game";
static examples = [
"<%= config.bin %> <%= command.id %>",
"<%= config.bin %> <%= command.id %> --gameId 0c179fc4"
];
static flags = {
...BaseGameAndroidCommand.flags,
force: Flags.boolean({ char: "f" }),
waitForAuth: Flags.boolean({ char: "w", description: "Wait for Google Authentication (10 mins)." })
};
async run() {
const game = await this.getGame();
const { force, waitForAuth } = this.flags;
this.checkGoogleAuth(waitForAuth);
const projectCredentials = await getProjectCredentials(game.id);
const hasApiKey = projectCredentials.some(
(cred) => cred.platform === Platform.ANDROID && cred.isActive && cred.type === CredentialsType.KEY
);
if (hasApiKey && !force) {
this.error("An API Key is already set on this game. Use --force to overwrite it.");
}
render(
/* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(CreateServiceAccountKey, { onComplete: () => process.exit(0), onError: (e) => this.error(e) }) })
);
}
}
export { GameAndroidApiKeyCreate as default };