shipthis 0.1.30 → 0.1.32

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 (86) hide show
  1. package/README.md +122 -41
  2. package/assets/markdown/create-google-play-game.md +2 -4
  3. package/assets/markdown/ship-success.md +1 -1
  4. package/dist/{AppleBundleIdDetails-Fp5COwTa.js → AppleBundleIdDetails-6H3cNWxw.js} +17 -19
  5. package/dist/{Command-1p5alCz3.js → Command-WPpmLPkL.js} +13 -12
  6. package/dist/CommandGame-cxzWG4nT.js +7 -0
  7. package/dist/{Create-1xAdntNl.js → Create-3Ob8sjik.js} +20 -20
  8. package/dist/GameStatus-BQEtVKvv.js +137 -0
  9. package/dist/{Import-CzC-M4ln.js → Import-CFuPDI0K.js} +33 -35
  10. package/dist/{JobLogTail-CZxoMSd5.js → JobLogTail-0CBLoG8N.js} +53 -52
  11. package/dist/{JobProgress-BjNgtIjm.js → JobProgress-lKqVT88m.js} +46 -37
  12. package/dist/{JobStatusTable-BB-PWlwj.js → JobStatusTable-C_ZsZJCm.js} +14 -13
  13. package/dist/{NextSteps-CK9zHOCt.js → NextSteps-DbJHmscQ.js} +1 -3
  14. package/dist/{ProgressSpinner-6pw1T8Iw.js → ProgressSpinner-DGcakQSK.js} +1 -1
  15. package/dist/{ProjectCredentialsTable-DyZep993.js → ProjectCredentialsTable-B5pHOnGu.js} +11 -10
  16. package/dist/{StatusTable-Dm5St4g-.js → StatusTable-DzRWcMr4.js} +7 -9
  17. package/dist/{Table-CvM6pccN.js → Table-FaNgpyeq.js} +15 -15
  18. package/dist/{UserCredentialsTable-BraKyDWT.js → UserCredentialsTable-3W3qesh7.js} +18 -19
  19. package/dist/{baseAppleCommand-BHRIBtTj.js → baseAppleCommand-BGV088--.js} +1 -1
  20. package/dist/{baseGameAndroidCommand-SrDRbhAG.js → baseGameAndroidCommand-CsemgVjp.js} +23 -23
  21. package/dist/commands/apple/apiKey/create.js +35 -35
  22. package/dist/commands/apple/apiKey/export.js +26 -26
  23. package/dist/commands/apple/apiKey/import.js +27 -27
  24. package/dist/commands/apple/apiKey/status.js +31 -31
  25. package/dist/commands/apple/certificate/create.js +39 -39
  26. package/dist/commands/apple/certificate/export.js +26 -26
  27. package/dist/commands/apple/certificate/import.js +27 -27
  28. package/dist/commands/apple/certificate/status.js +31 -31
  29. package/dist/commands/apple/login.js +15 -15
  30. package/dist/commands/apple/status.js +28 -28
  31. package/dist/commands/dashboard.js +10 -10
  32. package/dist/commands/game/android/apiKey/connect.js +28 -28
  33. package/dist/commands/game/android/apiKey/create.js +28 -28
  34. package/dist/commands/game/android/apiKey/export.js +29 -29
  35. package/dist/commands/game/android/apiKey/import.js +31 -31
  36. package/dist/commands/game/android/apiKey/invite.js +14 -14
  37. package/dist/commands/game/android/apiKey/status.js +29 -29
  38. package/dist/commands/game/android/keyStore/create.js +24 -24
  39. package/dist/commands/game/android/keyStore/export.js +28 -28
  40. package/dist/commands/game/android/keyStore/import.js +35 -35
  41. package/dist/commands/game/android/keyStore/status.js +26 -26
  42. package/dist/commands/game/android/status.js +14 -58
  43. package/dist/commands/game/build/download.js +24 -24
  44. package/dist/commands/game/build/list.js +37 -37
  45. package/dist/commands/game/create.js +15 -15
  46. package/dist/commands/game/details.js +35 -36
  47. package/dist/commands/game/export.js +12 -12
  48. package/dist/commands/game/ios/app/addTester.js +24 -24
  49. package/dist/commands/game/ios/app/create.js +24 -24
  50. package/dist/commands/game/ios/app/status.js +29 -29
  51. package/dist/commands/game/ios/app/sync.js +31 -31
  52. package/dist/commands/game/ios/profile/create.js +30 -30
  53. package/dist/commands/game/ios/profile/export.js +28 -28
  54. package/dist/commands/game/ios/profile/import.js +32 -32
  55. package/dist/commands/game/ios/profile/status.js +36 -36
  56. package/dist/commands/game/ios/status.js +46 -58
  57. package/dist/commands/game/ios/wizard.js +31 -31
  58. package/dist/commands/game/job/list.js +34 -34
  59. package/dist/commands/game/job/status.js +31 -31
  60. package/dist/commands/game/list.js +45 -41
  61. package/dist/commands/game/ship.js +73 -70
  62. package/dist/commands/game/status.js +38 -82
  63. package/dist/commands/game/wizard.js +271 -307
  64. package/dist/commands/internal/fastlane.js +15 -17
  65. package/dist/commands/internal/readme.js +38 -36
  66. package/dist/commands/login.js +14 -14
  67. package/dist/commands/status.js +35 -33
  68. package/dist/{export-BKn02-NH.js → export-CXsVPXA1.js} +5 -5
  69. package/dist/{git-DREGq-jc.js → git-BpsfNFZ_.js} +8 -8
  70. package/dist/{import-CRMaNBVF.js → import-DGvG5REx.js} +14 -14
  71. package/dist/{index-DxzXU9Hd.js → index-BhhiXbey.js} +244 -221
  72. package/dist/{index-OZi8bvu8.js → index-C03TV1_J.js} +54 -38
  73. package/dist/{index-BTAL7EB_.js → index-C66Dd8Xc.js} +80 -79
  74. package/dist/{index-35Eswf6F.js → index-CGBdOm1q.js} +43 -27
  75. package/dist/{index--EbYyBAZ.js → index-CS9Gwcb0.js} +41 -43
  76. package/dist/{index-u1aj1OQW.js → index-CtTI85m-.js} +6 -6
  77. package/dist/{upload-Bw0zrS4M.js → upload-8y5MQEm9.js} +22 -22
  78. package/dist/{useAndroidServiceAccountTestResult-CJLIEYmA.js → useAndroidServiceAccountTestResult-DZk5SMxI.js} +11 -13
  79. package/dist/{useAppleApp-cnb8gX0x.js → useAppleApp-DWYGURwU.js} +4 -4
  80. package/dist/{useAppleBundleId-B0Etav8g.js → useAppleBundleId-PsTJ2g1B.js} +6 -6
  81. package/dist/{useProjectCredentials-DX3e_PPc.js → useProjectCredentials-BEphqa18.js} +10 -12
  82. package/dist/{useWebSocket-BOCa8v6o.js → useWebSocket-5PYa2QER.js} +1 -1
  83. package/dist/utils/help.js +4 -4
  84. package/package.json +4 -2
  85. package/dist/CommandGame-Z4eUQBjn.js +0 -9
  86. package/dist/{RunWithSpinner-BVXNWGD3.js → RunWithSpinner-gMVA07bZ.js} +2 -2
@@ -1,24 +1,24 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import React from 'react';
3
2
  import { Box, Text } from 'ink';
3
+ import React from 'react';
4
4
 
5
5
  const BASE_HEADER_PROPS = {
6
- color: "blue",
7
- bold: true
6
+ bold: true,
7
+ color: "blue"
8
8
  };
9
9
  const BASE_TEXT_PROPS = {
10
10
  color: "white"
11
11
  };
12
12
  function generateHeaders(data) {
13
- let headers = {};
14
- data.forEach((row) => {
15
- Object.keys(row).forEach((key) => {
13
+ const headers = {};
14
+ for (const row of data) {
15
+ for (const key of Object.keys(row)) {
16
16
  headers[key] = key;
17
- });
18
- });
17
+ }
18
+ }
19
19
  return headers;
20
20
  }
21
- const Table = ({ data, showHeaders = true, headerTextProps, columnTextProps, getTextProps }) => {
21
+ const Table = ({ columnTextProps, data, getTextProps, headerTextProps, showHeaders = true }) => {
22
22
  const columns = getColumns(data);
23
23
  const fullHeaderTextProps = {
24
24
  ...BASE_HEADER_PROPS,
@@ -38,13 +38,13 @@ const Table = ({ data, showHeaders = true, headerTextProps, columnTextProps, get
38
38
  ] });
39
39
  };
40
40
  function getColumns(data) {
41
- let columnWidths = {};
42
- data.forEach((row) => {
43
- Object.keys(row).forEach((key) => {
41
+ const columnWidths = {};
42
+ for (const row of data) {
43
+ for (const key of Object.keys(row)) {
44
44
  const valueLength = row[key]?.toString().length || 0;
45
45
  columnWidths[key] = Math.max(columnWidths[key] || key.length, valueLength);
46
- });
47
- });
46
+ }
47
+ }
48
48
  return Object.keys(columnWidths).map((key) => ({
49
49
  key,
50
50
  width: (columnWidths[key] ?? 0) + 2
@@ -76,7 +76,7 @@ function renderRow(row, columns, baseCellTextProps, columnTextProps, getTextProp
76
76
  const cellTextProps = getTextPropsForCell(row, column);
77
77
  return /* @__PURE__ */ jsxs(React.Fragment, { children: [
78
78
  index !== 0 && /* @__PURE__ */ jsx(Text, { children: "\u2502" }),
79
- /* @__PURE__ */ jsx(Box, { width: column.width, justifyContent: "center", children: /* @__PURE__ */ jsx(Text, { ...cellTextProps, children: getDisplayValue(row, column) }) })
79
+ /* @__PURE__ */ jsx(Box, { justifyContent: "center", width: column.width, children: /* @__PURE__ */ jsx(Text, { ...cellTextProps, children: getDisplayValue(row, column) }) })
80
80
  ] }, column.key);
81
81
  }),
82
82
  /* @__PURE__ */ jsx(Text, { children: "\u2502" })
@@ -1,27 +1,28 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Box, Text } from 'ink';
3
3
  import Spinner from 'ink-spinner';
4
- import 'crypto';
5
- import 'fs';
6
- import 'readline-sync';
7
- import 'node:readline';
4
+ import 'node:crypto';
5
+ import 'node:fs';
8
6
  import 'node:path';
7
+ import 'node:readline';
9
8
  import 'node:url';
9
+ import 'readline-sync';
10
10
  import 'luxon';
11
11
  import axios from 'axios';
12
12
  import 'isomorphic-git';
13
- import { b as getShortDate, p as getAuthedHeaders, q as API_URL, I as castArrayObjectDates } from './index-DxzXU9Hd.js';
13
+ import { b as getShortDate, p as getAuthedHeaders, o as API_URL, I as castArrayObjectDates } from './index-BhhiXbey.js';
14
14
  import '@oclif/core';
15
- import 'react';
16
15
  import { useQuery } from '@tanstack/react-query';
16
+ import 'react';
17
17
  import 'crypto-js';
18
18
  import 'uuid';
19
19
  import 'fast-glob';
20
20
  import 'yazl';
21
- import { c as cacheKeys } from './useAndroidServiceAccountTestResult-CJLIEYmA.js';
22
- import { g as getShortUUID } from './index-35Eswf6F.js';
21
+ import { c as cacheKeys } from './useAndroidServiceAccountTestResult-DZk5SMxI.js';
22
+ import { g as getShortUUID } from './index-CGBdOm1q.js';
23
23
  import 'socket.io-client';
24
- import { T as Table } from './Table-CvM6pccN.js';
24
+ import 'fullscreen-ink';
25
+ import { T as Table } from './Table-FaNgpyeq.js';
25
26
  import { T as Title } from './Title-BCQtayg6.js';
26
27
 
27
28
  async function queryUserCredentials(params) {
@@ -40,11 +41,11 @@ async function queryUserCredentials(params) {
40
41
  }
41
42
  function getUserCredentialSummary(credential) {
42
43
  return {
44
+ createdAt: getShortDate(credential.createdAt),
43
45
  id: getShortUUID(credential.id),
44
- type: credential.type,
45
- serial: credential.serialNumber,
46
46
  isActive: credential.isActive,
47
- createdAt: getShortDate(credential.createdAt)
47
+ serial: credential.serialNumber,
48
+ type: credential.type
48
49
  };
49
50
  }
50
51
  const useUserCredentials = ({
@@ -53,15 +54,13 @@ const useUserCredentials = ({
53
54
  ...pageAndSortParams
54
55
  }) => {
55
56
  const queryResult = useQuery({
56
- queryKey: cacheKeys.userCredentials(pageAndSortParams),
57
57
  queryFn: async () => queryUserCredentials(pageAndSortParams),
58
- select: (data) => {
58
+ queryKey: cacheKeys.userCredentials(pageAndSortParams),
59
+ select(data) {
59
60
  if (!(platform || type)) return data;
60
61
  return {
61
62
  ...data,
62
- data: data.data.filter((credential) => {
63
- return (!platform || credential.platform === platform) && (!type || credential.type === type);
64
- })
63
+ data: data.data.filter((credential) => (!platform || credential.platform === platform) && (!type || credential.type === type))
65
64
  };
66
65
  }
67
66
  });
@@ -69,11 +68,11 @@ const useUserCredentials = ({
69
68
  };
70
69
 
71
70
  const UserCredentialsTable = ({ credentialTypeName, queryProps, ...boxProps }) => {
72
- const { isLoading, data } = useUserCredentials(queryProps);
71
+ const { data, isLoading } = useUserCredentials(queryProps);
73
72
  const hasActive = data?.data.some((credential) => credential.isActive);
74
73
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, ...boxProps, children: [
75
74
  /* @__PURE__ */ jsx(Title, { children: `${credentialTypeName}s in your ShipThis account` }),
76
- /* @__PURE__ */ jsx(Box, { marginLeft: 2, marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsx(Text, { children: hasActive ? `You have an active ${credentialTypeName} in your ShipThis account.` : `You DO NOT have an active ${credentialTypeName} which ShipThis can use.` }) }),
75
+ /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 1, marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { children: hasActive ? `You have an active ${credentialTypeName} in your ShipThis account.` : `You DO NOT have an active ${credentialTypeName} which ShipThis can use.` }) }),
77
76
  isLoading && /* @__PURE__ */ jsx(Spinner, { type: "dots" }),
78
77
  data && data.data.length > 0 && /* @__PURE__ */ jsx(Table, { data: data.data.map(getUserCredentialSummary) })
79
78
  ] });
@@ -1,4 +1,4 @@
1
- import { B as BaseAuthenticatedCommand } from './index-DxzXU9Hd.js';
1
+ import { B as BaseAuthenticatedCommand } from './index-BhhiXbey.js';
2
2
 
3
3
  class BaseAppleCommand extends BaseAuthenticatedCommand {
4
4
  async init() {
@@ -1,28 +1,7 @@
1
- import { c as BaseGameCommand, Q as getGodotAndroidPackageName, R as getGoogleStatus } from './index-DxzXU9Hd.js';
2
- import { b as generatePackageName, a as getInput } from './index-35Eswf6F.js';
1
+ import { c as BaseGameCommand, Q as getGoogleStatus, R as getGodotAndroidPackageName } from './index-BhhiXbey.js';
2
+ import { b as generatePackageName, a as getInput } from './index-CGBdOm1q.js';
3
3
 
4
4
  class BaseGameAndroidCommand extends BaseGameCommand {
5
- async init() {
6
- await super.init();
7
- await this.ensureWeHaveAndroidPackageName();
8
- }
9
- // Prompts the user for the Android package name
10
- async getAndroidPackageName(gameId) {
11
- const game = await this.getGame();
12
- const generated = generatePackageName(game.name);
13
- const suggested = game.details?.iosBundleId || getGodotAndroidPackageName() || generated || "com.example.game";
14
- const question = `Please enter the Android Package Name, or press enter to use ${suggested}: `;
15
- const entered = await getInput(question);
16
- return entered || suggested;
17
- }
18
- // Forces us to have the androidPackageName in the game details
19
- async ensureWeHaveAndroidPackageName() {
20
- const game = await this.getGame();
21
- if (!game.details?.androidPackageName) {
22
- const androidPackageName = await this.getAndroidPackageName(game.id);
23
- await this.updateGame({ details: { ...game.details, androidPackageName } });
24
- }
25
- }
26
5
  async checkGoogleAuth(waitForAuth = false) {
27
6
  let status = await getGoogleStatus();
28
7
  if (status.isAuthenticated) return;
@@ -38,6 +17,27 @@ class BaseGameAndroidCommand extends BaseGameCommand {
38
17
  }
39
18
  this.error("Google authentication failed. Please try again.", { exit: 1 });
40
19
  }
20
+ // Forces us to have the androidPackageName in the game details
21
+ async ensureWeHaveAndroidPackageName() {
22
+ const game = await this.getGame();
23
+ if (!game.details?.androidPackageName) {
24
+ const androidPackageName = await this.getAndroidPackageName(game.id);
25
+ await this.updateGame({ details: { ...game.details, androidPackageName } });
26
+ }
27
+ }
28
+ // Prompts the user for the Android package name
29
+ async getAndroidPackageName(gameId) {
30
+ const game = await this.getGame();
31
+ const generated = generatePackageName(game.name);
32
+ const suggested = game.details?.iosBundleId || getGodotAndroidPackageName() || generated || "com.example.game";
33
+ const question = `Please enter the Android Package Name, or press enter to use ${suggested}: `;
34
+ const entered = await getInput(question);
35
+ return entered || suggested;
36
+ }
37
+ async init() {
38
+ await super.init();
39
+ await this.ensureWeHaveAndroidPackageName();
40
+ }
41
41
  }
42
42
 
43
43
  export { BaseGameAndroidCommand as B };
@@ -1,43 +1,43 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Flags } from '@oclif/core';
3
3
  import { render } from 'ink';
4
- import { P as Platform, C as CredentialsType, A as ApiKey, a as ApiKeyType, U as UserRole } from '../../../index-DxzXU9Hd.js';
5
- import { g as getUserCredentials } from '../../../index-u1aj1OQW.js';
6
- import 'react';
7
- import '../../../index-BTAL7EB_.js';
4
+ import { g as getUserCredentials } from '../../../index-CtTI85m-.js';
5
+ import { P as Platform, C as CredentialsType, A as ApiKey, U as UserRole, a as ApiKeyType } from '../../../index-BhhiXbey.js';
8
6
  import 'ink-spinner';
9
- import 'axios';
10
- import 'crypto-js';
11
- import 'uuid';
12
- import 'fs';
13
- import 'luxon';
14
- import '@inkjs/ui';
15
- import '@tanstack/react-query';
16
- import 'yazl';
17
- import 'crypto';
18
- import 'readline-sync';
19
- import 'node:readline';
7
+ import 'node:crypto';
8
+ import 'node:fs';
20
9
  import 'node:path';
10
+ import 'node:readline';
21
11
  import 'node:url';
12
+ import 'readline-sync';
13
+ import 'luxon';
14
+ import 'axios';
22
15
  import 'isomorphic-git';
16
+ import '@tanstack/react-query';
17
+ import 'react';
18
+ import 'crypto-js';
19
+ import 'uuid';
23
20
  import 'fast-glob';
21
+ import 'yazl';
24
22
  import 'socket.io-client';
23
+ import 'fullscreen-ink';
24
+ import 'string-length';
25
+ import 'strip-ansi';
25
26
  import 'open';
27
+ import '@inkjs/ui';
26
28
  import 'marked';
27
29
  import 'marked-terminal';
28
- import 'path';
29
30
  import 'qrcode';
30
- import { R as RunWithSpinner } from '../../../RunWithSpinner-BVXNWGD3.js';
31
- import 'string-length';
32
- import 'strip-ansi';
33
- import { C as Command } from '../../../Command-1p5alCz3.js';
34
- import { B as BaseAppleCommand } from '../../../baseAppleCommand-BHRIBtTj.js';
35
- import { u as uploadUserCredentials } from '../../../upload-Bw0zrS4M.js';
31
+ import { R as RunWithSpinner } from '../../../RunWithSpinner-gMVA07bZ.js';
32
+ import '../../../index-C66Dd8Xc.js';
33
+ import { C as Command } from '../../../Command-WPpmLPkL.js';
34
+ import { B as BaseAppleCommand } from '../../../baseAppleCommand-BGV088--.js';
35
+ import { u as uploadUserCredentials } from '../../../upload-8y5MQEm9.js';
36
36
  import '@expo/apple-utils/build/index.js';
37
- import 'ini';
38
37
  import 'deepmerge';
39
- import '../../../index-35Eswf6F.js';
40
- import '../../../useAndroidServiceAccountTestResult-CJLIEYmA.js';
38
+ import 'ini';
39
+ import '../../../index-CGBdOm1q.js';
40
+ import '../../../useAndroidServiceAccountTestResult-DZk5SMxI.js';
41
41
 
42
42
  class AppleApiKeyCreate extends BaseAppleCommand {
43
43
  static args = {};
@@ -54,32 +54,32 @@ class AppleApiKeyCreate extends BaseAppleCommand {
54
54
  const userAppleApiKeyCredentials = userCredentials.filter(
55
55
  (cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.KEY
56
56
  );
57
- if (userAppleApiKeyCredentials.length !== 0 && !force) {
57
+ if (userAppleApiKeyCredentials.length > 0 && !force) {
58
58
  this.error("An App Store Connect API already exists. Use --force to overwrite it.");
59
59
  }
60
60
  const authState = await this.refreshAppleAuthState();
61
61
  const ctx = authState.context;
62
62
  const createApiKey = async () => {
63
63
  const userKey = await ApiKey.createAsync(ctx, {
64
- nickname: `ShipThis ${Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3)}`,
65
64
  allAppsVisible: true,
66
- roles: [UserRole.ADMIN],
67
- keyType: ApiKeyType.PUBLIC_API
65
+ keyType: ApiKeyType.PUBLIC_API,
66
+ nickname: `ShipThis ${Math.floor(Date.now() / 1e3)}`,
67
+ roles: [UserRole.ADMIN]
68
68
  });
69
69
  const keyContent = await userKey.downloadAsync();
70
70
  if (!keyContent) throw new Error("Failed to download key content");
71
71
  const reloadedKey = await ApiKey.infoAsync(ctx, { id: userKey.id });
72
72
  const key = {
73
- keyId: userKey.id,
74
73
  issuer: `${reloadedKey.attributes.provider?.id}`,
74
+ keyId: userKey.id,
75
75
  p8Content: keyContent,
76
76
  serialNumber: userKey.id
77
77
  };
78
78
  await uploadUserCredentials({
79
- platform: Platform.IOS,
80
- type: CredentialsType.KEY,
81
79
  contents: key,
82
- serialNumber: key.serialNumber
80
+ platform: Platform.IOS,
81
+ serialNumber: key.serialNumber,
82
+ type: CredentialsType.KEY
83
83
  });
84
84
  };
85
85
  const handleComplete = async () => {
@@ -90,9 +90,9 @@ class AppleApiKeyCreate extends BaseAppleCommand {
90
90
  /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
91
91
  RunWithSpinner,
92
92
  {
93
- msgInProgress: `Creating App Store Connect API in the Apple Developer Portal...`,
94
- msgComplete: `App Store Connect API created and saved to ShipThis`,
95
93
  executeMethod: createApiKey,
94
+ msgComplete: `App Store Connect API created and saved to ShipThis`,
95
+ msgInProgress: `Creating App Store Connect API in the Apple Developer Portal...`,
96
96
  onComplete: handleComplete
97
97
  }
98
98
  ) })
@@ -1,42 +1,42 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
+ import * as fs from 'node:fs';
2
3
  import { Args, Flags } from '@oclif/core';
3
4
  import { render } from 'ink';
4
- import * as fs from 'fs';
5
- import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-DxzXU9Hd.js';
6
- import { g as getUserCredentials } from '../../../index-u1aj1OQW.js';
7
- import 'react';
8
- import '../../../index-BTAL7EB_.js';
5
+ import { g as getUserCredentials } from '../../../index-CtTI85m-.js';
6
+ import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-BhhiXbey.js';
9
7
  import 'ink-spinner';
10
- import 'axios';
11
- import 'crypto-js';
12
- import 'uuid';
13
- import 'luxon';
14
- import '@inkjs/ui';
15
- import '@tanstack/react-query';
16
- import 'yazl';
17
- import 'crypto';
18
- import 'readline-sync';
19
- import 'node:readline';
8
+ import 'node:crypto';
20
9
  import 'node:path';
10
+ import 'node:readline';
21
11
  import 'node:url';
12
+ import 'readline-sync';
13
+ import 'luxon';
14
+ import 'axios';
22
15
  import 'isomorphic-git';
16
+ import '@tanstack/react-query';
17
+ import 'react';
18
+ import 'crypto-js';
19
+ import 'uuid';
23
20
  import 'fast-glob';
21
+ import 'yazl';
24
22
  import 'socket.io-client';
23
+ import 'fullscreen-ink';
24
+ import 'string-length';
25
+ import 'strip-ansi';
25
26
  import 'open';
27
+ import '@inkjs/ui';
26
28
  import 'marked';
27
29
  import 'marked-terminal';
28
- import 'path';
29
30
  import 'qrcode';
30
- import { R as RunWithSpinner } from '../../../RunWithSpinner-BVXNWGD3.js';
31
- import 'string-length';
32
- import 'strip-ansi';
33
- import { C as Command } from '../../../Command-1p5alCz3.js';
34
- import { e as exportCredential } from '../../../export-BKn02-NH.js';
31
+ import { R as RunWithSpinner } from '../../../RunWithSpinner-gMVA07bZ.js';
32
+ import '../../../index-C66Dd8Xc.js';
33
+ import { C as Command } from '../../../Command-WPpmLPkL.js';
34
+ import { e as exportCredential } from '../../../export-CXsVPXA1.js';
35
35
  import '@expo/apple-utils/build/index.js';
36
- import 'ini';
37
36
  import 'deepmerge';
38
- import '../../../index-35Eswf6F.js';
39
- import '../../../useAndroidServiceAccountTestResult-CJLIEYmA.js';
37
+ import 'ini';
38
+ import '../../../index-CGBdOm1q.js';
39
+ import '../../../useAndroidServiceAccountTestResult-DZk5SMxI.js';
40
40
 
41
41
  class AppleApiKeyExport extends BaseAuthenticatedCommand {
42
42
  static args = {
@@ -68,9 +68,9 @@ class AppleApiKeyExport extends BaseAuthenticatedCommand {
68
68
  /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
69
69
  RunWithSpinner,
70
70
  {
71
- msgInProgress: `Exporting App Store Connect API Key to ${file}...`,
71
+ executeMethod: () => exportCredential({ credentialId: key.id, zipPath: file }),
72
72
  msgComplete: `App Store Connect API Key exported to ${file}`,
73
- executeMethod: () => exportCredential({ zipPath: file, credentialId: key.id }),
73
+ msgInProgress: `Exporting App Store Connect API Key to ${file}...`,
74
74
  onComplete: handleComplete
75
75
  }
76
76
  ) })
@@ -1,42 +1,42 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
+ import * as fs from 'node:fs';
2
3
  import { Args, Flags } from '@oclif/core';
3
4
  import { render } from 'ink';
4
- import * as fs from 'fs';
5
- import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-DxzXU9Hd.js';
6
- import { g as getUserCredentials } from '../../../index-u1aj1OQW.js';
7
- import 'react';
8
- import '../../../index-BTAL7EB_.js';
5
+ import { g as getUserCredentials } from '../../../index-CtTI85m-.js';
6
+ import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-BhhiXbey.js';
9
7
  import 'ink-spinner';
10
- import 'axios';
11
- import 'crypto-js';
12
- import 'uuid';
13
- import 'luxon';
14
- import '@inkjs/ui';
15
- import '@tanstack/react-query';
16
- import 'yazl';
17
- import 'crypto';
18
- import 'readline-sync';
19
- import 'node:readline';
8
+ import 'node:crypto';
20
9
  import 'node:path';
10
+ import 'node:readline';
21
11
  import 'node:url';
12
+ import 'readline-sync';
13
+ import 'luxon';
14
+ import 'axios';
22
15
  import 'isomorphic-git';
16
+ import '@tanstack/react-query';
17
+ import 'react';
18
+ import 'crypto-js';
19
+ import 'uuid';
23
20
  import 'fast-glob';
21
+ import 'yazl';
24
22
  import 'socket.io-client';
23
+ import 'fullscreen-ink';
24
+ import 'string-length';
25
+ import 'strip-ansi';
25
26
  import 'open';
27
+ import '@inkjs/ui';
26
28
  import 'marked';
27
29
  import 'marked-terminal';
28
- import 'path';
29
30
  import 'qrcode';
30
- import { R as RunWithSpinner } from '../../../RunWithSpinner-BVXNWGD3.js';
31
- import 'string-length';
32
- import 'strip-ansi';
33
- import { C as Command } from '../../../Command-1p5alCz3.js';
34
- import { i as importCredential } from '../../../import-CRMaNBVF.js';
31
+ import { R as RunWithSpinner } from '../../../RunWithSpinner-gMVA07bZ.js';
32
+ import '../../../index-C66Dd8Xc.js';
33
+ import { C as Command } from '../../../Command-WPpmLPkL.js';
34
+ import { i as importCredential } from '../../../import-DGvG5REx.js';
35
35
  import '@expo/apple-utils/build/index.js';
36
- import 'ini';
37
36
  import 'deepmerge';
38
- import '../../../index-35Eswf6F.js';
39
- import '../../../useAndroidServiceAccountTestResult-CJLIEYmA.js';
37
+ import 'ini';
38
+ import '../../../index-CGBdOm1q.js';
39
+ import '../../../useAndroidServiceAccountTestResult-DZk5SMxI.js';
40
40
 
41
41
  class AppleApiKeyImport extends BaseAuthenticatedCommand {
42
42
  static args = {
@@ -62,7 +62,7 @@ class AppleApiKeyImport extends BaseAuthenticatedCommand {
62
62
  const userAppleApiKeyCredentials = userCredentials.filter(
63
63
  (cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.KEY
64
64
  );
65
- if (userAppleApiKeyCredentials.length !== 0 && !force) {
65
+ if (userAppleApiKeyCredentials.length > 0 && !force) {
66
66
  this.error("An App Store Connect API Key already exists. Use --force to overwrite it.");
67
67
  }
68
68
  const handleComplete = async () => {
@@ -72,9 +72,9 @@ class AppleApiKeyImport extends BaseAuthenticatedCommand {
72
72
  /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
73
73
  RunWithSpinner,
74
74
  {
75
- msgInProgress: `Importing App Store Connect API from ${file}...`,
75
+ executeMethod: () => importCredential({ platform: Platform.IOS, type: CredentialsType.KEY, zipPath: file }),
76
76
  msgComplete: `App Store Connect API imported from ${file}`,
77
- executeMethod: () => importCredential({ zipPath: file, type: CredentialsType.KEY, platform: Platform.IOS }),
77
+ msgInProgress: `Importing App Store Connect API from ${file}...`,
78
78
  onComplete: handleComplete
79
79
  }
80
80
  ) })
@@ -1,43 +1,43 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { Flags } from '@oclif/core';
3
3
  import { Box, Text, render } from 'ink';
4
- import { b as getShortDate, A as ApiKey, C as CredentialsType, P as Platform, B as BaseAuthenticatedCommand } from '../../../index-DxzXU9Hd.js';
5
- import 'react';
6
- import '../../../index-BTAL7EB_.js';
4
+ import { b as getShortDate, A as ApiKey, C as CredentialsType, P as Platform, B as BaseAuthenticatedCommand } from '../../../index-BhhiXbey.js';
7
5
  import Spinner from 'ink-spinner';
8
- import 'axios';
9
- import 'crypto-js';
10
- import 'uuid';
11
- import 'fs';
12
- import { DateTime } from 'luxon';
13
- import '@inkjs/ui';
14
- import { useQuery } from '@tanstack/react-query';
15
- import 'yazl';
16
- import 'crypto';
17
- import 'readline-sync';
18
- import 'node:readline';
6
+ import 'node:crypto';
7
+ import 'node:fs';
19
8
  import 'node:path';
9
+ import 'node:readline';
20
10
  import 'node:url';
11
+ import 'readline-sync';
12
+ import { DateTime } from 'luxon';
13
+ import 'axios';
21
14
  import 'isomorphic-git';
15
+ import { useQuery } from '@tanstack/react-query';
16
+ import 'react';
17
+ import 'crypto-js';
18
+ import 'uuid';
22
19
  import 'fast-glob';
20
+ import 'yazl';
23
21
  import 'socket.io-client';
22
+ import 'fullscreen-ink';
23
+ import 'string-length';
24
+ import 'strip-ansi';
24
25
  import 'open';
26
+ import { u as useUserCredentials, U as UserCredentialsTable } from '../../../UserCredentialsTable-3W3qesh7.js';
27
+ import '@inkjs/ui';
25
28
  import 'marked';
26
29
  import 'marked-terminal';
27
- import 'path';
28
30
  import 'qrcode';
29
- import 'string-length';
30
- import 'strip-ansi';
31
- import { u as useUserCredentials, U as UserCredentialsTable } from '../../../UserCredentialsTable-BraKyDWT.js';
32
- import { T as Table } from '../../../Table-CvM6pccN.js';
31
+ import '../../../index-C66Dd8Xc.js';
32
+ import { T as Table } from '../../../Table-FaNgpyeq.js';
33
33
  import { T as Title } from '../../../Title-BCQtayg6.js';
34
- import { N as NextSteps } from '../../../NextSteps-CK9zHOCt.js';
35
- import { C as Command } from '../../../Command-1p5alCz3.js';
34
+ import { N as NextSteps } from '../../../NextSteps-DbJHmscQ.js';
35
+ import { C as Command } from '../../../Command-WPpmLPkL.js';
36
36
  import '@expo/apple-utils/build/index.js';
37
- import 'ini';
38
37
  import 'deepmerge';
39
- import '../../../index-35Eswf6F.js';
40
- import '../../../useAndroidServiceAccountTestResult-CJLIEYmA.js';
38
+ import 'ini';
39
+ import '../../../useAndroidServiceAccountTestResult-DZk5SMxI.js';
40
+ import '../../../index-CGBdOm1q.js';
41
41
 
42
42
  async function queryAppleApiKeys({ ctx }) {
43
43
  const keys = await ApiKey.getAsync(ctx);
@@ -50,17 +50,17 @@ const canAppleApiKeyBeUsed = (key, userCredentials) => {
50
50
  };
51
51
  function getAppleApiKeySummary(key, userCredentials) {
52
52
  return {
53
+ canBeUsed: canAppleApiKeyBeUsed(key, userCredentials),
53
54
  keyID: key.id,
54
- name: key.attributes.nickname,
55
- roles: key.attributes.roles?.join(", "),
56
55
  lastUsed: getShortDate(DateTime.fromISO(key.attributes.lastUsed)),
57
- canBeUsed: canAppleApiKeyBeUsed(key, userCredentials)
56
+ name: key.attributes.nickname,
57
+ roles: key.attributes.roles?.join(", ")
58
58
  };
59
59
  }
60
60
  const useAppleApiKeys = (props) => {
61
61
  const queryResult = useQuery({
62
- queryKey: ["appleApiKeys"],
63
- queryFn: () => queryAppleApiKeys(props)
62
+ queryFn: () => queryAppleApiKeys(props),
63
+ queryKey: ["appleApiKeys"]
64
64
  });
65
65
  return queryResult;
66
66
  };
@@ -74,7 +74,7 @@ const AppleApiKeysTable = ({ ctx, ...boxProps }) => {
74
74
  /* @__PURE__ */ jsx(Title, { children: "App Store Connect API Keys in your Apple account" }),
75
75
  isLoading && /* @__PURE__ */ jsx(Spinner, { type: "dots" }),
76
76
  keys && userCredentialsResponse && /* @__PURE__ */ jsxs(Fragment, { children: [
77
- /* @__PURE__ */ jsxs(Box, { marginLeft: 2, marginBottom: 1, flexDirection: "column", children: [
77
+ /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, marginLeft: 2, children: [
78
78
  /* @__PURE__ */ jsx(Text, { children: `You have ${keys.length} App Store Connect API Keys in your Apple account` }),
79
79
  /* @__PURE__ */ jsx(Text, { children: `${hasUsable ? "One" : "None"} of these can be used by ShipThis` })
80
80
  ] }),
@@ -110,7 +110,7 @@ class AppleApiKeyStatus extends BaseAuthenticatedCommand {
110
110
  UserCredentialsTable,
111
111
  {
112
112
  credentialTypeName: "App Store Connect API Key",
113
- queryProps: { type: CredentialsType.KEY, platform: Platform.IOS }
113
+ queryProps: { platform: Platform.IOS, type: CredentialsType.KEY }
114
114
  }
115
115
  ),
116
116
  showApple && /* @__PURE__ */ jsx(AppleApiKeysTable, { ctx })