shipthis 0.0.40 → 0.1.0

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.
Files changed (93) hide show
  1. package/README.md +17 -17
  2. package/dist/{AppleBundleIdDetails-n1_U8IqK.js → AppleBundleIdDetails-BF-Pm1Ia.js} +19 -7
  3. package/dist/Command-BrfJSeOC.js +1077 -0
  4. package/dist/CommandGame-D9wl8hfX.js +8 -0
  5. package/dist/{NextSteps-CK9zHOCt.js → NextSteps-DKcjSHZ3.js} +1 -1
  6. package/dist/ProjectCredentialsTable-BVvkIPjN.js +36 -0
  7. package/dist/{StatusTable-CxuX_R1D.js → StatusTable-BzsNF75L.js} +2 -7
  8. package/dist/{UserCredentialsTable-A_YlFeJX.js → UserCredentialsTable-DUFQqHVt.js} +11 -5
  9. package/dist/{baseAppleCommand-DK5-Cvg4.js → baseAppleCommand-BSJhK8GA.js} +1 -1
  10. package/dist/baseGameAndroidCommand-CPAtReqy.js +43 -0
  11. package/dist/commands/apple/apiKey/create.js +24 -10
  12. package/dist/commands/apple/apiKey/export.js +23 -9
  13. package/dist/commands/apple/apiKey/import.js +23 -9
  14. package/dist/commands/apple/apiKey/status.js +25 -13
  15. package/dist/commands/apple/certificate/create.js +25 -11
  16. package/dist/commands/apple/certificate/export.js +23 -9
  17. package/dist/commands/apple/certificate/import.js +23 -9
  18. package/dist/commands/apple/certificate/status.js +26 -14
  19. package/dist/commands/apple/login.js +9 -3
  20. package/dist/commands/apple/status.js +27 -13
  21. package/dist/commands/dashboard.js +11 -5
  22. package/dist/commands/game/android/apiKey/connect.js +73 -0
  23. package/dist/commands/game/android/apiKey/create.js +70 -0
  24. package/dist/commands/game/android/apiKey/export.js +83 -0
  25. package/dist/commands/game/android/apiKey/import.js +92 -0
  26. package/dist/commands/game/android/apiKey/invite.js +81 -0
  27. package/dist/commands/game/android/apiKey/status.js +86 -0
  28. package/dist/commands/game/android/keyStore/create.js +67 -0
  29. package/dist/commands/game/android/keyStore/export.js +82 -0
  30. package/dist/commands/game/android/keyStore/import.js +91 -0
  31. package/dist/commands/game/android/keyStore/status.js +69 -0
  32. package/dist/commands/game/android/status.js +84 -0
  33. package/dist/commands/game/android/wizard.js +53 -0
  34. package/dist/commands/game/build/download.js +23 -9
  35. package/dist/commands/game/build/list.js +25 -14
  36. package/dist/commands/game/create.js +18 -10
  37. package/dist/commands/game/details.js +28 -19
  38. package/dist/commands/game/export.js +11 -5
  39. package/dist/commands/game/ios/app/addTester.js +25 -12
  40. package/dist/commands/game/ios/app/create.js +26 -13
  41. package/dist/commands/game/ios/app/status.js +27 -13
  42. package/dist/commands/game/ios/app/sync.js +23 -9
  43. package/dist/commands/game/ios/profile/create.js +22 -8
  44. package/dist/commands/game/ios/profile/export.js +23 -9
  45. package/dist/commands/game/ios/profile/import.js +23 -9
  46. package/dist/commands/game/ios/profile/status.js +26 -71
  47. package/dist/commands/game/ios/status.js +28 -15
  48. package/dist/commands/game/ios/wizard.js +125 -0
  49. package/dist/commands/game/job/list.js +26 -14
  50. package/dist/commands/game/job/status.js +26 -71
  51. package/dist/commands/game/list.js +26 -12
  52. package/dist/commands/game/ship.js +7 -4
  53. package/dist/commands/game/status.js +63 -25
  54. package/dist/commands/game/wizard.js +41 -99
  55. package/dist/commands/internal/fastlane.js +74 -0
  56. package/dist/commands/internal/readme.js +1452 -0
  57. package/dist/commands/login.js +11 -4
  58. package/dist/commands/status.js +23 -10
  59. package/dist/{export-C16psune.js → export-B0FJT0EU.js} +1 -1
  60. package/dist/{import-hte2Jy0K.js → import-CLDJ2iPu.js} +1 -1
  61. package/dist/{baseGameCommand-B3NbuvDu.js → index-CF0fIsx2.js} +112 -37
  62. package/dist/index-CFHmtzfq.js +24 -0
  63. package/dist/{index-ZHJdUrwJ.js → index-Df8uXQ4s.js} +14 -3
  64. package/dist/{upload-DADrkIUB.js → upload-C5L82Yq0.js} +1 -1
  65. package/dist/useAndroidServiceAccountTestResult-BnxNuoG3.js +52 -0
  66. package/dist/{useAppleApp-Cr3VcGVs.js → useAppleApp-IXRdsK5w.js} +1 -1
  67. package/dist/{useAppleBundleId-BxtyGpHy.js → useAppleBundleId-DYC5ISKT.js} +1 -1
  68. package/docs/game/android/apiKey/connect.md +27 -0
  69. package/docs/game/android/apiKey/create.md +25 -0
  70. package/docs/game/android/apiKey/export.md +25 -0
  71. package/docs/game/android/apiKey/import.md +25 -0
  72. package/docs/game/android/apiKey/invite.md +27 -0
  73. package/docs/game/android/apiKey/status.md +23 -0
  74. package/docs/game/android/apiKey.md +165 -0
  75. package/docs/game/android/keyStore/create.md +24 -0
  76. package/docs/game/android/keyStore/export.md +25 -0
  77. package/docs/game/android/keyStore/import.md +25 -0
  78. package/docs/game/android/keyStore/status.md +23 -0
  79. package/docs/game/android/keyStore.md +108 -0
  80. package/docs/game/android/status.md +23 -0
  81. package/docs/game/android/wizard.md +28 -0
  82. package/docs/game/android.md +339 -0
  83. package/docs/game/create.md +12 -7
  84. package/docs/game/ios/wizard.md +21 -0
  85. package/docs/game/wizard.md +12 -18
  86. package/oclif.manifest.json +821 -68
  87. package/package.json +53 -18
  88. package/dist/App-BfoOFeZ-.js +0 -21
  89. package/dist/RunWithSpinner-BVXNWGD3.js +0 -27
  90. package/dist/Title-BCQtayg6.js +0 -6
  91. package/dist/cacheKeys-CShA-ZjE.js +0 -9
  92. package/dist/useBuilds-JHqMwpWS.js +0 -41
  93. package/dist/useJob-Bc9fdiyP.js +0 -34
@@ -1,19 +1,25 @@
1
1
  import axios from 'axios';
2
2
  import { Flags } from '@oclif/core';
3
- import { W as WEB_URL, T as BaseCommand, p as API_URL, X as setAuthToken, Y as acceptTerms } from '../baseGameCommand-B3NbuvDu.js';
4
- import { a as getInput } from '../index-ZHJdUrwJ.js';
3
+ import { W as WEB_URL, S as BaseCommand, q as API_URL, V as setAuthToken, X as acceptTerms } from '../index-CF0fIsx2.js';
4
+ import { a as getInput } from '../index-Df8uXQ4s.js';
5
5
  import 'path';
6
6
  import 'fs';
7
7
  import '@expo/apple-utils/build/index.js';
8
+ import 'crypto-js';
9
+ import 'uuid';
8
10
  import 'luxon';
9
11
  import 'crypto';
10
12
  import 'readline-sync';
11
13
  import 'node:readline';
14
+ import 'node:path';
15
+ import 'node:url';
12
16
  import 'react';
13
17
  import '@tanstack/react-query';
14
- import 'socket.io-client';
15
18
  import 'ini';
16
19
  import 'deepmerge';
20
+ import 'fast-glob';
21
+ import 'yazl';
22
+ import 'socket.io-client';
17
23
  import 'isomorphic-git';
18
24
 
19
25
  const TERMS_URL = new URL("/terms", WEB_URL).href;
@@ -55,7 +61,8 @@ class Login extends BaseCommand {
55
61
  return otp2;
56
62
  };
57
63
  const otp = await getOTP();
58
- const { data: shipThisUser } = await axios.post(`${API_URL}/auth/email/verify`, { email, otp });
64
+ const source = `shipthis-cli-${this.config.version}`;
65
+ const { data: shipThisUser } = await axios.post(`${API_URL}/auth/email/verify`, { email, otp, source });
59
66
  const getAcceptedTermsResponse = async () => {
60
67
  console.log(
61
68
  `Please review the following documents:
@@ -1,29 +1,42 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render } from 'ink';
3
- import { T as BaseCommand, i as isCWDGodotGame } from '../baseGameCommand-B3NbuvDu.js';
3
+ import { S as BaseCommand, j as isCWDGodotGame } from '../index-CF0fIsx2.js';
4
+ import { C as Command } from '../Command-BrfJSeOC.js';
5
+ import 'react';
6
+ import 'ink-spinner';
4
7
  import 'axios';
8
+ import 'crypto-js';
9
+ import 'uuid';
5
10
  import 'luxon';
6
11
  import 'fs';
7
- import { A as App } from '../App-BfoOFeZ-.js';
8
- import 'ink-spinner';
12
+ import '@inkjs/ui';
9
13
  import 'crypto';
10
14
  import 'readline-sync';
11
15
  import 'node:readline';
12
- import 'react';
16
+ import 'node:path';
17
+ import 'node:url';
13
18
  import '@tanstack/react-query';
19
+ import 'fast-glob';
20
+ import 'yazl';
14
21
  import 'socket.io-client';
15
- import '@expo/apple-utils/build/index.js';
16
22
  import { i as isCWDGitRepo } from '../git-DREGq-jc.js';
17
- import { N as NextSteps } from '../NextSteps-CK9zHOCt.js';
18
- import { S as StatusTable } from '../StatusTable-CxuX_R1D.js';
23
+ import '@oclif/core';
24
+ import 'marked';
25
+ import 'marked-terminal';
26
+ import { N as NextSteps } from '../NextSteps-DKcjSHZ3.js';
27
+ import 'qrcode';
28
+ import { S as StatusTable } from '../StatusTable-BzsNF75L.js';
19
29
  import 'string-length';
20
30
  import 'strip-ansi';
21
- import '@oclif/core';
22
31
  import 'path';
32
+ import '@expo/apple-utils/build/index.js';
23
33
  import 'ini';
24
34
  import 'deepmerge';
25
35
  import 'isomorphic-git';
26
- import '../Title-BCQtayg6.js';
36
+ import 'open';
37
+ import '../index-Df8uXQ4s.js';
38
+ import '../useAndroidServiceAccountTestResult-BnxNuoG3.js';
39
+ import '../index-CFHmtzfq.js';
27
40
 
28
41
  class Status extends BaseCommand {
29
42
  static args = {};
@@ -51,7 +64,7 @@ class Status extends BaseCommand {
51
64
  }
52
65
  };
53
66
  render(
54
- /* @__PURE__ */ jsxs(App, { children: [
67
+ /* @__PURE__ */ jsxs(Command, { command: this, children: [
55
68
  /* @__PURE__ */ jsx(StatusTable, { ...statusProps }),
56
69
  /* @__PURE__ */ jsx(NextSteps, { steps })
57
70
  ] })
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import * as fs from 'fs';
3
- import { o as getAuthedHeaders, p as API_URL } from './baseGameCommand-B3NbuvDu.js';
3
+ import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.js';
4
4
 
5
5
  async function exportCredential({ zipPath, credentialId, projectId }) {
6
6
  const headers = getAuthedHeaders();
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import { promises } from 'fs';
3
- import { o as getAuthedHeaders, p as API_URL } from './baseGameCommand-B3NbuvDu.js';
3
+ import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.js';
4
4
 
5
5
  async function getNewImportTicket(projectId) {
6
6
  const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import/url` : `${API_URL}/credentials/import/url`;
@@ -1,17 +1,23 @@
1
- import { Command, Flags } from '@oclif/core';
2
1
  import path from 'path';
3
2
  import fs__default from 'fs';
3
+ import { Command, Flags } from '@oclif/core';
4
4
  import * as expo from '@expo/apple-utils/build/index.js';
5
5
  import axios from 'axios';
6
+ import CryptoJS from 'crypto-js';
7
+ import { v4 } from 'uuid';
6
8
  import { DateTime } from 'luxon';
7
9
  import 'crypto';
8
10
  import 'readline-sync';
9
11
  import 'node:readline';
12
+ import 'node:path';
13
+ import 'node:url';
10
14
  import 'react';
11
15
  import { QueryClient } from '@tanstack/react-query';
12
- import 'socket.io-client';
13
16
  import { parse } from 'ini';
14
17
  import merge from 'deepmerge';
18
+ import 'fast-glob';
19
+ import 'yazl';
20
+ import 'socket.io-client';
15
21
  import 'isomorphic-git';
16
22
 
17
23
  const defaultExport = expo.default;
@@ -105,25 +111,6 @@ function getShortTimeDelta(start, end) {
105
111
  });
106
112
  }
107
113
 
108
- async function getUserCredentials(pageSize = 100) {
109
- const headers = getAuthedHeaders();
110
- const { data } = await axios({
111
- method: "get",
112
- url: `${API_URL}/credentials?pageSize=${pageSize}`,
113
- headers
114
- });
115
- return castArrayObjectDates(data.data);
116
- }
117
- async function getProjectCredentials(projectId, pageSize = 100) {
118
- const headers = getAuthedHeaders();
119
- const { data } = await axios({
120
- method: "get",
121
- url: `${API_URL}/projects/${projectId}/credentials?pageSize=${pageSize}`,
122
- headers
123
- });
124
- return castArrayObjectDates(data.data);
125
- }
126
-
127
114
  const AUTH_ENV_VAR_NAME = "SHIPTHIS_TOKEN";
128
115
  function setAuthToken(token) {
129
116
  process.env[AUTH_ENV_VAR_NAME] = token;
@@ -201,10 +188,33 @@ async function getJob(jobId, projectId) {
201
188
  async function getSingleUseUrl(destination) {
202
189
  const headers = await getAuthedHeaders();
203
190
  const { data } = await axios.post(`${API_URL}/me/otp`, {}, { headers });
204
- const queryString = Object.entries({ ...data, destination }).map(([key, value]) => `${key}=${value}`).join("&");
191
+ const queryString = Object.entries({ ...data, destination }).map(([key, value]) => `${key}=${encodeURIComponent(`${value}`)}`).join("&");
205
192
  const url = `${WEB_URL}exchange/?${queryString}`;
206
193
  return url;
207
194
  }
195
+ async function getShortAuthRequiredUrl(destination) {
196
+ const { email } = await getSelf();
197
+ const key = v4();
198
+ const salt = "Na (s) + 1/2 Cl\u2082 (g) \u2192 NaCl (s)";
199
+ const fullKey = `${key}${salt}`;
200
+ const token = CryptoJS.AES.encrypt(email, fullKey).toString();
201
+ const params = {
202
+ key,
203
+ token,
204
+ destination
205
+ };
206
+ const queryString = Object.entries(params).map(([key2, value]) => `${key2}=${encodeURIComponent(`${value}`)}`).join("&");
207
+ const url = `${WEB_URL}login/?${queryString}`;
208
+ const headers = await getAuthedHeaders();
209
+ const { data } = await axios.post(
210
+ `${API_URL}/me/shorten`,
211
+ {
212
+ url
213
+ },
214
+ { headers }
215
+ );
216
+ return data.url;
217
+ }
208
218
  async function getBuild(projectId, buildId) {
209
219
  const headers = getAuthedHeaders();
210
220
  const opt = { headers };
@@ -223,6 +233,42 @@ async function acceptTerms() {
223
233
  const { data } = await axios.post(`${API_URL}/me/acceptTerms`, {}, opt);
224
234
  return castObjectDates(data);
225
235
  }
236
+ async function getGoogleAuthUrl(projectId) {
237
+ const headers = getAuthedHeaders();
238
+ const opt = { headers };
239
+ const web = encodeURIComponent(new URL("/google/redirect/", WEB_URL).href);
240
+ const url = `${API_URL}/projects/${projectId}/credentials/android/key/connect`;
241
+ const { data } = await axios.get(`${url}?redirectUri=${web}`, opt);
242
+ const response = data;
243
+ return await getShortAuthRequiredUrl(response.url);
244
+ }
245
+ async function disconnectGoogle() {
246
+ const headers = getAuthedHeaders();
247
+ const opt = { headers };
248
+ await axios.delete(`${API_URL}/me/google/connect`, opt);
249
+ }
250
+ async function getGoogleStatus() {
251
+ const headers = getAuthedHeaders();
252
+ const opt = { headers };
253
+ const { data } = await axios.get(`${API_URL}/me/google/status`, opt);
254
+ return data;
255
+ }
256
+ async function inviteServiceAccount(projectId, developerId) {
257
+ try {
258
+ const headers = getAuthedHeaders();
259
+ const { data } = await axios.post(
260
+ `${API_URL}/projects/${projectId}/credentials/android/key/invite/`,
261
+ { developerId },
262
+ {
263
+ headers
264
+ }
265
+ );
266
+ return data;
267
+ } catch (error) {
268
+ console.error("inviteServiceAccount Error", error);
269
+ throw error;
270
+ }
271
+ }
226
272
 
227
273
  var Platform = /* @__PURE__ */ ((Platform2) => {
228
274
  Platform2["IOS"] = "IOS";
@@ -311,6 +357,15 @@ function getGodotAppleBundleIdentifier() {
311
357
  return null;
312
358
  }
313
359
  }
360
+ function getGodotAndroidPackageName() {
361
+ try {
362
+ const preset = getGodotExportPresets(Platform.ANDROID);
363
+ return preset.options["package/unique_name"];
364
+ } catch (e) {
365
+ console.log(e);
366
+ return null;
367
+ }
368
+ }
314
369
  function getGodotVersion() {
315
370
  const projectGodotConfig = getGodotProjectConfig();
316
371
  if ("config/features" in projectGodotConfig["application"]) {
@@ -452,6 +507,10 @@ class BaseCommand extends Command {
452
507
  async finally(_) {
453
508
  return super.finally(_);
454
509
  }
510
+ // Exposing it to the react components using the CommandContext
511
+ getFlags() {
512
+ return this.flags;
513
+ }
455
514
  getAuthConfigPath() {
456
515
  return path.join(this.config.home, ".shipthis.auth.json");
457
516
  }
@@ -557,6 +616,23 @@ class BaseCommand extends Command {
557
616
  });
558
617
  }
559
618
  }
619
+ // Returns the values of the flags in DetailsFlags
620
+ // This is used to expose the flags to the Android Wizard
621
+ getDetailsFlagsValues() {
622
+ const keys = Object.keys(DetailsFlags);
623
+ const values = {};
624
+ for (const key of keys) {
625
+ if (this.flags[key]) values[key] = this.flags[key];
626
+ }
627
+ return values;
628
+ }
629
+ async getGameId() {
630
+ const { flags } = this;
631
+ if (flags.gameId) return flags.gameId;
632
+ const { project } = await this.getProjectConfigSafe();
633
+ if (!project) return null;
634
+ return project.id;
635
+ }
560
636
  }
561
637
 
562
638
  class BaseAuthenticatedCommand extends BaseCommand {
@@ -583,26 +659,15 @@ class BaseGameCommand extends BaseAuthenticatedCommand {
583
659
  };
584
660
  async getGame() {
585
661
  try {
586
- const { flags } = this;
587
- if (flags.gameId) {
588
- return await getProject(flags.gameId);
589
- }
590
- this.ensureWeAreInAProjectDir();
591
- const { project } = await this.getProjectConfig();
592
- if (!project) throw new Error("No project");
593
- return await getProject(project.id);
662
+ const gameId = await this.getGameId();
663
+ if (!gameId) this.error("No game ID found.");
664
+ return await getProject(gameId);
594
665
  } catch (e) {
595
666
  if (e?.response?.status === 404) {
596
667
  this.error("Game not found - please check you have access");
597
668
  } else throw e;
598
669
  }
599
670
  }
600
- async getGameCredentials() {
601
- const { project } = await this.getProjectConfig();
602
- if (!project) throw new Error("No project");
603
- const projectCredentials = await getProjectCredentials(project.id);
604
- return projectCredentials;
605
- }
606
671
  async updateGame(update) {
607
672
  const project = await this.getGame();
608
673
  const projectUpdate = {
@@ -615,4 +680,14 @@ class BaseGameCommand extends BaseAuthenticatedCommand {
615
680
  }
616
681
  }
617
682
 
618
- export { WS_URL as $, ApiKey as A, BaseAuthenticatedCommand as B, CredentialsType as C, DEFAULT_SHIPPED_FILES_GLOBS as D, getGodotProjectName as E, getBuild as F, GODOT_CAPABILITIES as G, getShortDateTime as H, castArrayObjectDates as I, getProjectJobs as J, JobStatus as K, getShortTimeDelta as L, getJob as M, getNewUploadTicket as N, startJobsFromUpload as O, Platform as P, queryClient as Q, JobStage as R, LogLevel as S, BaseCommand as T, UserRole as U, getSingleUseUrl as V, WEB_URL as W, setAuthToken as X, acceptTerms as Y, Auth as Z, getAuthToken as _, ApiKeyType as a, castObjectDates as a0, castJobDates as a1, getShortTime as a2, getProject as b, DEFAULT_IGNORED_FILES_GLOBS as c, BaseGameCommand as d, getProjectPlatformProgress as e, getShortDate as f, getUserCredentials as g, CapabilityTypeOption as h, isCWDGodotGame as i, BetaGroup as j, App as k, getGodotAppleBundleIdentifier as l, BundleId as m, getProjectCredentials as n, getAuthedHeaders as o, API_URL as p, Certificate as q, CertificateType as r, Profile as s, ProfileType as t, getGodotProjectCapabilities as u, CapabilityType as v, getProjects as w, GameEngine as x, getGodotVersion as y, createProject as z };
683
+ const DetailsFlags = {
684
+ name: Flags.string({ char: "n", description: "The name of the game" }),
685
+ buildNumber: Flags.integer({ char: "b", description: "Set the build number" }),
686
+ semanticVersion: Flags.string({ char: "s", description: "Set the semantic version" }),
687
+ gameEngine: Flags.string({ char: "e", description: "Set the game engine" }),
688
+ gameEngineVersion: Flags.string({ char: "v", description: "Set the game engine version" }),
689
+ iosBundleId: Flags.string({ char: "i", description: "Set the iOS bundle ID" }),
690
+ androidPackageName: Flags.string({ char: "a", description: "Set the Android package name" })
691
+ };
692
+
693
+ export { getJob as $, ApiKey as A, BaseAuthenticatedCommand as B, CredentialsType as C, DetailsFlags as D, startJobsFromUpload as E, getProjectJobs as F, GODOT_CAPABILITIES as G, getProject as H, getBuild as I, castArrayObjectDates as J, JobStatus as K, JobStage as L, LogLevel as M, getGodotAndroidPackageName as N, getGoogleStatus as O, Platform as P, inviteServiceAccount as Q, disconnectGoogle as R, BaseCommand as S, getSingleUseUrl as T, UserRole as U, setAuthToken as V, WEB_URL as W, acceptTerms as X, Auth as Y, castObjectDates as Z, getShortTime as _, ApiKeyType as a, getShortDateTime as a0, getShortTimeDelta as a1, queryClient as a2, getAuthToken as a3, WS_URL as a4, castJobDates as a5, getShortAuthRequiredUrl as a6, getGoogleAuthUrl as a7, getShortDate as b, BaseGameCommand as c, getGodotAppleBundleIdentifier as d, BundleId as e, App as f, getProjects as g, CapabilityTypeOption as h, BetaGroup as i, isCWDGodotGame as j, getProjectPlatformProgress as k, Certificate as l, CertificateType as m, Profile as n, ProfileType as o, getAuthedHeaders as p, API_URL as q, getGodotProjectCapabilities as r, CapabilityType as s, GameEngine as t, getGodotVersion as u, createProject as v, DEFAULT_IGNORED_FILES_GLOBS as w, DEFAULT_SHIPPED_FILES_GLOBS as x, getGodotProjectName as y, getNewUploadTicket as z };
@@ -0,0 +1,24 @@
1
+ import axios from 'axios';
2
+ import { p as getAuthedHeaders, q as API_URL, J as castArrayObjectDates } from './index-CF0fIsx2.js';
3
+ import 'fs';
4
+
5
+ async function getUserCredentials(pageSize = 100) {
6
+ const headers = getAuthedHeaders();
7
+ const { data } = await axios({
8
+ method: "get",
9
+ url: `${API_URL}/credentials?pageSize=${pageSize}`,
10
+ headers
11
+ });
12
+ return castArrayObjectDates(data.data);
13
+ }
14
+ async function getProjectCredentials(projectId, pageSize = 100) {
15
+ const headers = getAuthedHeaders();
16
+ const { data } = await axios({
17
+ method: "get",
18
+ url: `${API_URL}/projects/${projectId}/credentials?pageSize=${pageSize}`,
19
+ headers
20
+ });
21
+ return castArrayObjectDates(data.data);
22
+ }
23
+
24
+ export { getProjectCredentials as a, getUserCredentials as g };
@@ -2,13 +2,19 @@ import crypto from 'crypto';
2
2
  import fs__default from 'fs';
3
3
  import readlineSync from 'readline-sync';
4
4
  import { promises } from 'node:readline';
5
- import { K as JobStatus, P as Platform, R as JobStage, S as LogLevel } from './baseGameCommand-B3NbuvDu.js';
5
+ import path from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { K as JobStatus, P as Platform, L as JobStage, M as LogLevel } from './index-CF0fIsx2.js';
6
8
  import 'react';
7
9
  import 'axios';
8
10
  import '@tanstack/react-query';
9
11
  import 'luxon';
10
- import '@expo/apple-utils/build/index.js';
11
12
  import 'isomorphic-git';
13
+ import '@oclif/core';
14
+ import 'crypto-js';
15
+ import 'uuid';
16
+ import 'fast-glob';
17
+ import 'yazl';
12
18
  import 'socket.io-client';
13
19
 
14
20
  function getShortUUID(originalUuid) {
@@ -121,5 +127,10 @@ function generatePackageName(gameName) {
121
127
  }
122
128
  return prefix + normalizedGameName;
123
129
  }
130
+ function scriptDir(importMeta) {
131
+ const filename = fileURLToPath(importMeta.url);
132
+ const dirname = path.dirname(filename);
133
+ return dirname;
134
+ }
124
135
 
125
- export { getInput as a, generatePackageName as b, getPlatformName as c, getJobStatusColor as d, getFileHash as e, getMaskedInput as f, getShortUUID as g, getStageColor as h, isValidSemVer as i, getMessageColor as j, makeHumanReadable as m };
136
+ export { getInput as a, generatePackageName as b, getFileHash as c, getJobStatusColor as d, getMaskedInput as e, getStageColor as f, getShortUUID as g, getMessageColor as h, isValidSemVer as i, getPlatformName as j, makeHumanReadable as m, scriptDir as s };
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { o as getAuthedHeaders, p as API_URL } from './baseGameCommand-B3NbuvDu.js';
2
+ import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.js';
3
3
 
4
4
  async function getNewUploadTicket(projectId = null) {
5
5
  const url = projectId ? `${API_URL}/projects/${projectId}/credentials/url` : `${API_URL}/credentials/url`;
@@ -0,0 +1,52 @@
1
+ import { p as getAuthedHeaders, q as API_URL } from './index-CF0fIsx2.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] : undefined;
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,5 +1,5 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
- import { k as App } from './baseGameCommand-B3NbuvDu.js';
2
+ import { f as App } from './index-CF0fIsx2.js';
3
3
 
4
4
  const queryAppleApp = async ({ ctx, iosBundleId }) => {
5
5
  if (!iosBundleId) {
@@ -1,5 +1,5 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
- import { m as BundleId, u as getGodotProjectCapabilities, P as Platform, G as GODOT_CAPABILITIES, v as CapabilityType } from './baseGameCommand-B3NbuvDu.js';
2
+ import { e as BundleId, r as getGodotProjectCapabilities, P as Platform, G as GODOT_CAPABILITIES, s as CapabilityType } from './index-CF0fIsx2.js';
3
3
 
4
4
  async function getBundleIdCapabilities(bundleId) {
5
5
  const current = await bundleId.getBundleIdCapabilitiesAsync();
@@ -0,0 +1,27 @@
1
+ # Command: `game android apiKey connect`
2
+
3
+ ## Description
4
+
5
+ Connects ShipThis with Google for managing Service Account API Keys for an Android game
6
+
7
+ ## Help Output
8
+
9
+ ```
10
+ USAGE
11
+ $ shipthis game android apiKey connect [-g <value>] [-f] [-d]
12
+
13
+ FLAGS
14
+ -d, --disconnect
15
+ -f, --force
16
+ -g, --gameId=<value> The ID of the game
17
+
18
+ DESCRIPTION
19
+ Connects ShipThis with Google for managing Service Account API Keys for an Android game
20
+
21
+ EXAMPLES
22
+ $ shipthis game android apiKey connect
23
+
24
+ $ shipthis game android apiKey connect --force
25
+
26
+ $ shipthis game android apiKey connect --disconnect
27
+ ```
@@ -0,0 +1,25 @@
1
+ # Command: `game android apiKey create`
2
+
3
+ ## Description
4
+
5
+ Creates a new Android Service Account API Key for a game
6
+
7
+ ## Help Output
8
+
9
+ ```
10
+ USAGE
11
+ $ shipthis game android apiKey create [-g <value>] [-w] [-f]
12
+
13
+ FLAGS
14
+ -f, --force
15
+ -g, --gameId=<value> The ID of the game
16
+ -w, --waitForAuth Wait for Google Authentication (10 mins).
17
+
18
+ DESCRIPTION
19
+ Creates a new Android Service Account API Key for a game
20
+
21
+ EXAMPLES
22
+ $ shipthis game android apiKey create
23
+
24
+ $ shipthis game android apiKey create --gameId 0c179fc4
25
+ ```
@@ -0,0 +1,25 @@
1
+ # Command: `game android apiKey export`
2
+
3
+ ## Description
4
+
5
+ Saves the current Android Service Account API Key to a ZIP file
6
+
7
+ ## Help Output
8
+
9
+ ```
10
+ USAGE
11
+ $ shipthis game android apiKey export FILE [-g <value>] [-f]
12
+
13
+ ARGUMENTS
14
+ FILE Name of the ZIP file to create
15
+
16
+ FLAGS
17
+ -f, --force Overwrite the file if it already exists
18
+ -g, --gameId=<value> The ID of the game
19
+
20
+ DESCRIPTION
21
+ Saves the current Android Service Account API Key to a ZIP file
22
+
23
+ EXAMPLES
24
+ $ shipthis game android apiKey export keyStore.zip
25
+ ```
@@ -0,0 +1,25 @@
1
+ # Command: `game android apiKey import`
2
+
3
+ ## Description
4
+
5
+ Imports an Android Service Account API Key to your ShipThis account for the specified game.
6
+
7
+ ## Help Output
8
+
9
+ ```
10
+ USAGE
11
+ $ shipthis game android apiKey import FILE [-g <value>] [-f]
12
+
13
+ ARGUMENTS
14
+ FILE Name of the ZIP file to import (must be in the same format as the export)
15
+
16
+ FLAGS
17
+ -f, --force
18
+ -g, --gameId=<value> The ID of the game
19
+
20
+ DESCRIPTION
21
+ Imports an Android Service Account API Key to your ShipThis account for the specified game.
22
+
23
+ EXAMPLES
24
+ $ shipthis game android apiKey import
25
+ ```
@@ -0,0 +1,27 @@
1
+ # Command: `game android apiKey invite`
2
+
3
+ ## Description
4
+
5
+ Invites the Service Account to your Google Play Account.
6
+
7
+ ## Help Output
8
+
9
+ ```
10
+ USAGE
11
+ $ shipthis game android apiKey invite [ACCOUNTID] [-g <value>] [-p] [-p] [-w]
12
+
13
+ ARGUMENTS
14
+ ACCOUNTID The Google Play Account ID
15
+
16
+ FLAGS
17
+ -g, --gameId=<value> The ID of the game
18
+ -p, --prompt Prompt for the Google Play Account ID
19
+ -p, --waitForGoogleApp Waits for the Google Play app to be created (10 mins).
20
+ -w, --waitForAuth Wait for Google Authentication (10 mins).
21
+
22
+ DESCRIPTION
23
+ Invites the Service Account to your Google Play Account.
24
+
25
+ EXAMPLES
26
+ $ shipthis game android apiKey invite
27
+ ```
@@ -0,0 +1,23 @@
1
+ # Command: `game android apiKey status`
2
+
3
+ ## Description
4
+
5
+ Displays the status of the Android Service Account API Key for a specific game.
6
+
7
+ ## Help Output
8
+
9
+ ```
10
+ USAGE
11
+ $ shipthis game android apiKey status [-g <value>]
12
+
13
+ FLAGS
14
+ -g, --gameId=<value> The ID of the game
15
+
16
+ DESCRIPTION
17
+ Displays the status of the Android Service Account API Key for a specific game.
18
+
19
+ EXAMPLES
20
+ $ shipthis game android apiKey status
21
+
22
+ $ shipthis game android apiKey status --gameId 0c179fc4
23
+ ```