UNPKG

shipthis

Version:

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

86 lines (83 loc) 2.58 kB
import { Flags } from '@oclif/core'; import { O as enforcePolicy, Q as revokePolicy, M as getGoogleStatus } from '../../../../baseCommand-CTn3KGH3.js'; import 'node:fs'; import 'node:path'; import 'chalk'; import 'node:crypto'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'luxon'; import 'axios'; import 'isomorphic-git'; import '@tanstack/react-query'; import 'react'; import 'fast-glob'; import 'uuid'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import 'ink'; import 'react/jsx-runtime'; import 'ink-spinner'; import 'string-length'; import 'strip-ansi'; import 'open'; import '@inkjs/ui'; import { a as getRenderedMarkdown } from '../../../../baseGameCommand-8VL7xe-O.js'; import 'qrcode'; import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DRzVMKuG.js'; import 'crypto-js'; import '@expo/apple-utils/build/index.js'; import 'deepmerge'; import 'ini'; import 'fs'; import 'path'; import 'marked'; import 'marked-terminal'; class GameAndroidApiKeyPolicy extends BaseGameAndroidCommand { static args = {}; static description = "Gets and sets the iam.disableServiceAccountKeyCreation policy for your Google Organization"; static examples = [ "<%= config.bin %> <%= command.id %>", "<%= config.bin %> <%= command.id %> --enforce", "<%= config.bin %> <%= command.id %> --revoke" ]; static flags = { ...BaseGameAndroidCommand.flags, enforce: Flags.boolean({ char: "e", description: "Enforces the policy", exclusive: ["revoke"] }), revoke: Flags.boolean({ char: "r", description: "Revokes the policy", exclusive: ["enforce"] }), waitForAuth: Flags.boolean({ char: "w", description: "Wait for Google Authentication (10 mins)." }) }; async run() { const { enforce, revoke, waitForAuth } = this.flags; await this.checkGoogleAuth(waitForAuth); if (enforce) { console.log("Enforcing policy..."); await enforcePolicy(); } else if (revoke) { console.log("Revoking policy..."); await revokePolicy(); } const googleStatus = await getGoogleStatus(); const msg = getRenderedMarkdown({ filename: "service-account-policy.md.ejs", templateVars: { needsPolicyChange: Boolean(googleStatus.needsPolicyChange), orgCreatedAt: `${googleStatus.orgCreatedAt}`, orgName: `${googleStatus.orgName}`, orgResourceName: `${googleStatus.orgResourceName}` } }); console.log(msg); } } export { GameAndroidApiKeyPolicy as default };