shipthis 0.1.36 → 0.1.38

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 (101) hide show
  1. package/README.md +46 -33
  2. package/assets/markdown/confirm-delete-android-keystore.md.ejs +22 -0
  3. package/assets/markdown/confirm-delete-android-serviceaccountkey.md.ejs +24 -0
  4. package/assets/markdown/confirm-delete-apple-credential.md.ejs +29 -0
  5. package/assets/markdown/ship-success.md.ejs +4 -0
  6. package/dist/{AppleBundleIdDetails-pEVOUXTQ.js → AppleBundleIdDetails-CgleH2pl.js} +3 -3
  7. package/dist/{Command-DhAVAdiI.js → Command-7dCv1F9p.js} +1 -1
  8. package/dist/{CommandGame-C-oV-hb4.js → CommandGame-er5Ql6hq.js} +2 -2
  9. package/dist/{Create-Dg9ZlwEd.js → Create-pLXESvEq.js} +1 -1
  10. package/dist/{GameStatus-Dm9TqFfW.js → GameStatus-B_Iw9tYr.js} +1 -1
  11. package/dist/{Import-BFNNkN-I.js → Import-fIsrfsmr.js} +2 -2
  12. package/dist/{JobLogTail-RTNIiAUk.js → JobLogTail-BPcQ8ghI.js} +2 -2
  13. package/dist/{JobProgress-dFWcT0CQ.js → JobProgress-CpEatVPs.js} +10 -6
  14. package/dist/{JobStatusTable-BlvMuWF7.js → JobStatusTable-BmJLzsUN.js} +2 -2
  15. package/dist/{ProjectCredentialsTable-CMBnYLou.js → ProjectCredentialsTable-DvPDhi7C.js} +5 -3
  16. package/dist/{UserCredentialsTable-oxE3mDmE.js → UserCredentialsTable-MBm1vAP3.js} +4 -2
  17. package/dist/{baseAppleCommand-cnLvBz95.js → baseAppleCommand-uL0Gnav4.js} +1 -1
  18. package/dist/{baseGameAndroidCommand-DUDYisYm.js → baseGameAndroidCommand-CKTSQyZV.js} +1 -1
  19. package/dist/commands/apiKey/create.js +3 -2
  20. package/dist/commands/apiKey/list.js +3 -2
  21. package/dist/commands/apiKey/revoke.js +3 -2
  22. package/dist/commands/apple/apiKey/create.js +7 -6
  23. package/dist/commands/apple/apiKey/delete.js +118 -0
  24. package/dist/commands/apple/apiKey/export.js +6 -5
  25. package/dist/commands/apple/apiKey/import.js +6 -5
  26. package/dist/commands/apple/apiKey/status.js +4 -3
  27. package/dist/commands/apple/certificate/create.js +7 -6
  28. package/dist/commands/apple/certificate/delete.js +127 -0
  29. package/dist/commands/apple/certificate/export.js +6 -5
  30. package/dist/commands/apple/certificate/import.js +6 -5
  31. package/dist/commands/apple/certificate/status.js +4 -3
  32. package/dist/commands/apple/login.js +12 -3
  33. package/dist/commands/apple/status.js +3 -2
  34. package/dist/commands/dashboard.js +2 -1
  35. package/dist/commands/game/android/apiKey/connect.js +8 -7
  36. package/dist/commands/game/android/apiKey/create.js +10 -9
  37. package/dist/commands/game/android/apiKey/delete.js +100 -0
  38. package/dist/commands/game/android/apiKey/export.js +6 -5
  39. package/dist/commands/game/android/apiKey/import.js +6 -5
  40. package/dist/commands/game/android/apiKey/invite.js +3 -2
  41. package/dist/commands/game/android/apiKey/policy.js +3 -2
  42. package/dist/commands/game/android/apiKey/status.js +6 -5
  43. package/dist/commands/game/android/keyStore/create.js +7 -6
  44. package/dist/commands/game/android/keyStore/delete.js +100 -0
  45. package/dist/commands/game/android/keyStore/export.js +5 -4
  46. package/dist/commands/game/android/keyStore/import.js +8 -7
  47. package/dist/commands/game/android/keyStore/status.js +5 -4
  48. package/dist/commands/game/android/status.js +2 -1
  49. package/dist/commands/game/build/download.js +3 -2
  50. package/dist/commands/game/build/list.js +4 -3
  51. package/dist/commands/game/create.js +2 -1
  52. package/dist/commands/game/details.js +9 -5
  53. package/dist/commands/game/export.js +2 -1
  54. package/dist/commands/game/ios/app/addTester.js +4 -3
  55. package/dist/commands/game/ios/app/create.js +3 -2
  56. package/dist/commands/game/ios/app/status.js +6 -5
  57. package/dist/commands/game/ios/app/sync.js +4 -3
  58. package/dist/commands/game/ios/profile/create.js +6 -5
  59. package/dist/commands/game/ios/profile/delete.js +123 -0
  60. package/dist/commands/game/ios/profile/export.js +5 -4
  61. package/dist/commands/game/ios/profile/import.js +5 -4
  62. package/dist/commands/game/ios/profile/status.js +8 -47
  63. package/dist/commands/game/ios/status.js +8 -7
  64. package/dist/commands/game/ios/wizard.js +2 -2
  65. package/dist/commands/game/job/list.js +3 -2
  66. package/dist/commands/game/job/status.js +6 -5
  67. package/dist/commands/game/list.js +3 -2
  68. package/dist/commands/game/ship.js +18 -10
  69. package/dist/commands/game/status.js +5 -4
  70. package/dist/commands/game/wizard.js +14 -13
  71. package/dist/commands/internal/fastlane.js +2 -1
  72. package/dist/commands/internal/readme.js +2 -1
  73. package/dist/commands/login.js +2 -1
  74. package/dist/commands/status.js +2 -2
  75. package/dist/{export-Bd552LBe.js → export-BwwAjG_F.js} +1 -1
  76. package/dist/{import-D-EL9sQJ.js → import-OgFrUsqw.js} +1 -1
  77. package/dist/{index-DwATmUTQ.js → index-C1XpCT_9.js} +4 -4
  78. package/dist/index-C2omlhEs.js +48 -0
  79. package/dist/{index-BtPf4vzY.js → index-DHioYOIm.js} +6 -3
  80. package/dist/{index-DCN43FhY.js → index-DVEYxVsH.js} +3 -3
  81. package/dist/{upload-Dm38PqhN.js → upload-5s3sy2jF.js} +1 -1
  82. package/dist/{useAppleApp-BKPntZPm.js → useAppleApp-szQ_Kg5S.js} +1 -1
  83. package/dist/{useAppleBundleId-DvQKEEy4.js → useAppleBundleId-BarLcidd.js} +1 -1
  84. package/dist/useAppleProfiles-C2U4NzC3.js +63 -0
  85. package/dist/{useGoogleStatus-D9jjGa--.js → useGoogleStatus-zfnjhtNB.js} +1 -1
  86. package/dist/{useProjectCredentials-BjsS28hP.js → useProjectCredentials-DbynNY96.js} +1 -1
  87. package/dist/{useWebSocket-CIeyHqxG.js → useWebSocket-h7smqhZQ.js} +1 -1
  88. package/docs/apple/apiKey/delete.md +25 -0
  89. package/docs/apple/apiKey.md +26 -0
  90. package/docs/apple/certificate/delete.md +25 -0
  91. package/docs/apple/certificate.md +26 -0
  92. package/docs/game/android/apiKey/delete.md +25 -0
  93. package/docs/game/android/apiKey.md +26 -0
  94. package/docs/game/android/keyStore/delete.md +25 -0
  95. package/docs/game/android/keyStore.md +26 -0
  96. package/docs/game/details.md +13 -10
  97. package/docs/game/ios/profile/delete.md +26 -0
  98. package/docs/game/ios/profile.md +27 -0
  99. package/docs/game/ship.md +5 -4
  100. package/package.json +6 -1
  101. package/dist/index-1H48f5j2.js +0 -24
@@ -0,0 +1,118 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { P as Platform, C as CredentialsType, A as ApiKey, g as getShortUUID, b as getRenderedMarkdown, c as getInput } from '../../../index-DHioYOIm.js';
3
+ import 'node:fs';
4
+ import 'axios';
5
+ import 'crypto-js';
6
+ import 'uuid';
7
+ import 'luxon';
8
+ import { g as getUserCredentials, d as deleteUserCredential } from '../../../index-C2omlhEs.js';
9
+ import 'react/jsx-runtime';
10
+ import '@inkjs/ui';
11
+ import 'ink';
12
+ import 'ink-spinner';
13
+ import 'react';
14
+ import '@tanstack/react-query';
15
+ import 'fast-glob';
16
+ import 'yazl';
17
+ import 'socket.io-client';
18
+ import 'fullscreen-ink';
19
+ import 'string-length';
20
+ import 'strip-ansi';
21
+ import 'open';
22
+ import 'qrcode';
23
+ import { B as BaseAppleCommand } from '../../../baseAppleCommand-uL0Gnav4.js';
24
+ import 'node:path';
25
+ import 'chalk';
26
+ import '@expo/apple-utils/build/index.js';
27
+ import 'node:crypto';
28
+ import 'node:readline';
29
+ import 'node:url';
30
+ import 'readline-sync';
31
+ import 'isomorphic-git';
32
+ import 'deepmerge';
33
+ import 'ini';
34
+ import 'fs';
35
+ import 'path';
36
+ import 'marked';
37
+ import 'marked-terminal';
38
+
39
+ class AppleApiKeyDelete extends BaseAppleCommand {
40
+ static args = {};
41
+ static description = "Delete an Apple API Key from ShipThis and optionally from Apple";
42
+ static examples = [
43
+ "<%= config.bin %> <%= command.id %>",
44
+ "<%= config.bin %> <%= command.id %> --immediate --revokeInApple --iAmSure"
45
+ ];
46
+ static flags = {
47
+ immediate: Flags.boolean({
48
+ char: "i",
49
+ description: "Remove from storage immediately (rather than waiting for automatic cleanup - cannot be undone)",
50
+ required: false
51
+ }),
52
+ iAmSure: Flags.boolean({
53
+ char: "y",
54
+ description: "I am sure I want to do this - do not prompt me",
55
+ required: false
56
+ }),
57
+ revokeInApple: Flags.boolean({
58
+ char: "a",
59
+ description: "Also revoke the API Key in Apple (cannot be undone)",
60
+ required: false
61
+ })
62
+ };
63
+ async run() {
64
+ const { flags } = await this.parse(AppleApiKeyDelete);
65
+ const { immediate, iAmSure, revokeInApple } = flags;
66
+ const userCredentials = await getUserCredentials();
67
+ const userKeys = userCredentials.filter(
68
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.KEY && cred.isActive
69
+ );
70
+ if (userKeys.length === 0) {
71
+ this.error("No App Store Connect API Key found which can be deleted.");
72
+ }
73
+ const [key] = userKeys;
74
+ let appleKey = null;
75
+ if (revokeInApple) {
76
+ const authState = await this.refreshAppleAuthState();
77
+ const ctx = authState.context;
78
+ appleKey = await ApiKey.infoAsync(ctx, { id: key.serialNumber });
79
+ if (!appleKey?.id) {
80
+ this.error("The App Store Connect API Key was not found in Apple, so cannot be revoked there.");
81
+ }
82
+ }
83
+ const getAreYouSure = async () => {
84
+ if (iAmSure) return true;
85
+ const confirmString = getShortUUID(key.id);
86
+ const prompt = getRenderedMarkdown({
87
+ filename: "confirm-delete-apple-credential.md.ejs",
88
+ templateVars: {
89
+ confirmString,
90
+ credentialType: "App Store Connect API Key",
91
+ exportCommand: `shipthis apple apiKey export appleApiKey.zip`,
92
+ immediate,
93
+ revokeInApple
94
+ }
95
+ });
96
+ this.log(prompt);
97
+ const input = await getInput("");
98
+ return input.trim().toLowerCase() === confirmString.toLowerCase();
99
+ };
100
+ const areYouSure = await getAreYouSure();
101
+ if (!areYouSure) {
102
+ this.log("Aborting - not deleting the API Key");
103
+ this.exit(0);
104
+ }
105
+ await deleteUserCredential({
106
+ credentialId: key.id,
107
+ isImmediate: immediate
108
+ });
109
+ this.log("The API Key has been deleted from ShipThis.");
110
+ if (revokeInApple && appleKey?.id) {
111
+ await appleKey.revokeAsync();
112
+ this.log("The API Key has been revoked in Apple.");
113
+ }
114
+ await this.config.runCommand(`apple:apiKey:status`, [!revokeInApple ? "--noAppleAuth" : ""].filter(Boolean));
115
+ }
116
+ }
117
+
118
+ export { AppleApiKeyDelete as default };
@@ -2,8 +2,8 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import * as fs from 'node:fs';
3
3
  import { Args, Flags } from '@oclif/core';
4
4
  import { render } from 'ink';
5
- import { g as getUserCredentials } from '../../../index-1H48f5j2.js';
6
- import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-BtPf4vzY.js';
5
+ import { g as getUserCredentials } from '../../../index-C2omlhEs.js';
6
+ import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-DHioYOIm.js';
7
7
  import 'ink-spinner';
8
8
  import 'node:crypto';
9
9
  import 'node:path';
@@ -29,8 +29,9 @@ import 'marked';
29
29
  import 'marked-terminal';
30
30
  import 'qrcode';
31
31
  import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js';
32
- import { C as Command } from '../../../Command-DhAVAdiI.js';
33
- import { e as exportCredential } from '../../../export-Bd552LBe.js';
32
+ import { C as Command } from '../../../Command-7dCv1F9p.js';
33
+ import { e as exportCredential } from '../../../export-BwwAjG_F.js';
34
+ import 'chalk';
34
35
  import '@expo/apple-utils/build/index.js';
35
36
  import 'deepmerge';
36
37
  import 'ini';
@@ -56,7 +57,7 @@ class AppleApiKeyExport extends BaseAuthenticatedCommand {
56
57
  }
57
58
  const userCredentials = await getUserCredentials();
58
59
  const userAppleApiKeyCredentials = userCredentials.filter(
59
- (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.KEY
60
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.KEY && cred.isActive
60
61
  );
61
62
  if (userAppleApiKeyCredentials.length === 0) {
62
63
  this.error("No App Store Connect API Key found which can be exported.");
@@ -2,8 +2,8 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import * as fs from 'node:fs';
3
3
  import { Args, Flags } from '@oclif/core';
4
4
  import { render } from 'ink';
5
- import { g as getUserCredentials } from '../../../index-1H48f5j2.js';
6
- import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-BtPf4vzY.js';
5
+ import { g as getUserCredentials } from '../../../index-C2omlhEs.js';
6
+ import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-DHioYOIm.js';
7
7
  import 'ink-spinner';
8
8
  import 'node:crypto';
9
9
  import 'node:path';
@@ -29,8 +29,9 @@ import 'marked';
29
29
  import 'marked-terminal';
30
30
  import 'qrcode';
31
31
  import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js';
32
- import { C as Command } from '../../../Command-DhAVAdiI.js';
33
- import { i as importCredential } from '../../../import-D-EL9sQJ.js';
32
+ import { C as Command } from '../../../Command-7dCv1F9p.js';
33
+ import { i as importCredential } from '../../../import-OgFrUsqw.js';
34
+ import 'chalk';
34
35
  import '@expo/apple-utils/build/index.js';
35
36
  import 'deepmerge';
36
37
  import 'ini';
@@ -59,7 +60,7 @@ class AppleApiKeyImport extends BaseAuthenticatedCommand {
59
60
  }
60
61
  const userCredentials = await getUserCredentials();
61
62
  const userAppleApiKeyCredentials = userCredentials.filter(
62
- (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.KEY
63
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.KEY && cred.isActive
63
64
  );
64
65
  if (userAppleApiKeyCredentials.length > 0 && !force) {
65
66
  this.error("An App Store Connect API Key already exists. Use --force to overwrite it.");
@@ -1,7 +1,7 @@
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 { c as getShortDate, A as ApiKey, C as CredentialsType, P as Platform, B as BaseAuthenticatedCommand } from '../../../index-BtPf4vzY.js';
4
+ import { f as getShortDate, A as ApiKey, C as CredentialsType, P as Platform, B as BaseAuthenticatedCommand } from '../../../index-DHioYOIm.js';
5
5
  import Spinner from 'ink-spinner';
6
6
  import 'node:crypto';
7
7
  import 'node:fs';
@@ -23,7 +23,7 @@ import 'fullscreen-ink';
23
23
  import 'string-length';
24
24
  import 'strip-ansi';
25
25
  import 'open';
26
- import { u as useUserCredentials, U as UserCredentialsTable } from '../../../UserCredentialsTable-oxE3mDmE.js';
26
+ import { u as useUserCredentials, U as UserCredentialsTable } from '../../../UserCredentialsTable-MBm1vAP3.js';
27
27
  import '@inkjs/ui';
28
28
  import 'marked';
29
29
  import 'marked-terminal';
@@ -31,7 +31,8 @@ import 'qrcode';
31
31
  import { T as Table } from '../../../Table-FaNgpyeq.js';
32
32
  import { T as Title } from '../../../Title-BCQtayg6.js';
33
33
  import { N as NextSteps } from '../../../NextSteps-DbJHmscQ.js';
34
- import { C as Command } from '../../../Command-DhAVAdiI.js';
34
+ import { C as Command } from '../../../Command-7dCv1F9p.js';
35
+ import 'chalk';
35
36
  import '@expo/apple-utils/build/index.js';
36
37
  import 'deepmerge';
37
38
  import 'ini';
@@ -1,9 +1,9 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Flags } from '@oclif/core';
3
3
  import { render } from 'ink';
4
- import { g as getUserCredentials } from '../../../index-1H48f5j2.js';
4
+ import { g as getUserCredentials } from '../../../index-C2omlhEs.js';
5
5
  import forge from 'node-forge';
6
- import { p as CertificateType, o as Certificate, P as Platform, C as CredentialsType } from '../../../index-BtPf4vzY.js';
6
+ import { p as CertificateType, d as Certificate, P as Platform, C as CredentialsType } from '../../../index-DHioYOIm.js';
7
7
  import 'ink-spinner';
8
8
  import 'node:crypto';
9
9
  import 'node:fs';
@@ -30,9 +30,10 @@ import 'marked';
30
30
  import 'marked-terminal';
31
31
  import 'qrcode';
32
32
  import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js';
33
- import { C as Command } from '../../../Command-DhAVAdiI.js';
34
- import { B as BaseAppleCommand } from '../../../baseAppleCommand-cnLvBz95.js';
35
- import { u as uploadUserCredentials } from '../../../upload-Dm38PqhN.js';
33
+ import { C as Command } from '../../../Command-7dCv1F9p.js';
34
+ import { B as BaseAppleCommand } from '../../../baseAppleCommand-uL0Gnav4.js';
35
+ import { u as uploadUserCredentials } from '../../../upload-5s3sy2jF.js';
36
+ import 'chalk';
36
37
  import '@expo/apple-utils/build/index.js';
37
38
  import 'deepmerge';
38
39
  import 'ini';
@@ -90,7 +91,7 @@ class AppleCertificateCreate extends BaseAppleCommand {
90
91
  const { force } = flags;
91
92
  const userCredentials = await getUserCredentials();
92
93
  const userAppleDistCredentials = userCredentials.filter(
93
- (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE
94
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE && cred.isActive
94
95
  );
95
96
  if (userAppleDistCredentials.length > 0 && !force) {
96
97
  this.error("An Apple Distribution Certificate already exists. Use --force to overwrite it.");
@@ -0,0 +1,127 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { P as Platform, C as CredentialsType, d as Certificate, g as getShortUUID, b as getRenderedMarkdown, c as getInput } from '../../../index-DHioYOIm.js';
3
+ import 'node:fs';
4
+ import 'axios';
5
+ import 'crypto-js';
6
+ import 'uuid';
7
+ import 'luxon';
8
+ import { g as getUserCredentials, d as deleteUserCredential } from '../../../index-C2omlhEs.js';
9
+ import 'react/jsx-runtime';
10
+ import '@inkjs/ui';
11
+ import 'ink';
12
+ import 'ink-spinner';
13
+ import 'react';
14
+ import '@tanstack/react-query';
15
+ import 'fast-glob';
16
+ import 'yazl';
17
+ import 'socket.io-client';
18
+ import 'fullscreen-ink';
19
+ import 'string-length';
20
+ import 'strip-ansi';
21
+ import 'open';
22
+ import 'qrcode';
23
+ import { B as BaseAppleCommand } from '../../../baseAppleCommand-uL0Gnav4.js';
24
+ import 'node:path';
25
+ import 'chalk';
26
+ import '@expo/apple-utils/build/index.js';
27
+ import 'node:crypto';
28
+ import 'node:readline';
29
+ import 'node:url';
30
+ import 'readline-sync';
31
+ import 'isomorphic-git';
32
+ import 'deepmerge';
33
+ import 'ini';
34
+ import 'fs';
35
+ import 'path';
36
+ import 'marked';
37
+ import 'marked-terminal';
38
+
39
+ class AppleCertificateDelete extends BaseAppleCommand {
40
+ static args = {};
41
+ static description = "Delete an iOS Distribution Certificate from ShipThis and optionally from Apple";
42
+ static examples = [
43
+ "<%= config.bin %> <%= command.id %>",
44
+ "<%= config.bin %> <%= command.id %> --immediate --revokeInApple --iAmSure"
45
+ ];
46
+ static flags = {
47
+ immediate: Flags.boolean({
48
+ char: "i",
49
+ description: "Remove from storage immediately (rather than waiting for automatic cleanup - cannot be undone)",
50
+ required: false
51
+ }),
52
+ iAmSure: Flags.boolean({
53
+ char: "y",
54
+ description: "I am sure I want to do this - do not prompt me",
55
+ required: false
56
+ }),
57
+ revokeInApple: Flags.boolean({
58
+ char: "a",
59
+ description: "Also revoke the Certificate in Apple (cannot be undone)",
60
+ required: false
61
+ })
62
+ };
63
+ async run() {
64
+ const { flags } = await this.parse(AppleCertificateDelete);
65
+ const { immediate, iAmSure, revokeInApple } = flags;
66
+ const userCredentials = await getUserCredentials();
67
+ const userCerts = userCredentials.filter(
68
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE && cred.isActive
69
+ );
70
+ if (userCerts.length === 0) {
71
+ this.error("No iOS Distribution Certificate found which can be deleted.");
72
+ }
73
+ const [cert] = userCerts;
74
+ let appleCert = null;
75
+ let authState = null;
76
+ let ctx = null;
77
+ if (revokeInApple) {
78
+ authState = await this.refreshAppleAuthState();
79
+ ctx = authState.context;
80
+ const appleCerts = await Certificate.getAsync(ctx, {
81
+ query: {
82
+ filter: {
83
+ serialNumber: cert.serialNumber
84
+ }
85
+ }
86
+ });
87
+ if (appleCerts.length !== 1) {
88
+ this.error("The iOS Distribution Certificate was not found in Apple, so cannot be revoked there.");
89
+ }
90
+ appleCert = appleCerts[0];
91
+ }
92
+ const getAreYouSure = async () => {
93
+ if (iAmSure) return true;
94
+ const confirmString = getShortUUID(cert.id);
95
+ const prompt = getRenderedMarkdown({
96
+ filename: "confirm-delete-apple-credential.md.ejs",
97
+ templateVars: {
98
+ confirmString,
99
+ credentialType: "iOS Distribution Certificate",
100
+ exportCommand: `shipthis apple certificate export cert.zip`,
101
+ immediate,
102
+ revokeInApple
103
+ }
104
+ });
105
+ this.log(prompt);
106
+ const input = await getInput("");
107
+ return input.trim().toLowerCase() === confirmString.toLowerCase();
108
+ };
109
+ const areYouSure = await getAreYouSure();
110
+ if (!areYouSure) {
111
+ this.log("Aborting - not deleting the iOS Distribution Certificate");
112
+ this.exit(0);
113
+ }
114
+ await deleteUserCredential({
115
+ credentialId: cert.id,
116
+ isImmediate: immediate
117
+ });
118
+ this.log("The iOS Distribution Certificate has been deleted from ShipThis.");
119
+ if (revokeInApple && appleCert?.id) {
120
+ Certificate.deleteAsync(ctx, { id: appleCert.id });
121
+ this.log("The iOS Distribution Certificate has been deleted in Apple.");
122
+ }
123
+ await this.config.runCommand(`apple:certificate:status`, [!revokeInApple ? "--noAppleAuth" : ""].filter(Boolean));
124
+ }
125
+ }
126
+
127
+ export { AppleCertificateDelete as default };
@@ -2,8 +2,8 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import * as fs from 'node:fs';
3
3
  import { Args, Flags } from '@oclif/core';
4
4
  import { render } from 'ink';
5
- import { g as getUserCredentials } from '../../../index-1H48f5j2.js';
6
- import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-BtPf4vzY.js';
5
+ import { g as getUserCredentials } from '../../../index-C2omlhEs.js';
6
+ import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-DHioYOIm.js';
7
7
  import 'ink-spinner';
8
8
  import 'node:crypto';
9
9
  import 'node:path';
@@ -29,8 +29,9 @@ import 'marked';
29
29
  import 'marked-terminal';
30
30
  import 'qrcode';
31
31
  import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js';
32
- import { C as Command } from '../../../Command-DhAVAdiI.js';
33
- import { e as exportCredential } from '../../../export-Bd552LBe.js';
32
+ import { C as Command } from '../../../Command-7dCv1F9p.js';
33
+ import { e as exportCredential } from '../../../export-BwwAjG_F.js';
34
+ import 'chalk';
34
35
  import '@expo/apple-utils/build/index.js';
35
36
  import 'deepmerge';
36
37
  import 'ini';
@@ -56,7 +57,7 @@ class AppleCertificateExport extends BaseAuthenticatedCommand {
56
57
  }
57
58
  const userCredentials = await getUserCredentials();
58
59
  const userAppleDistCredentials = userCredentials.filter(
59
- (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE
60
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE && cred.isActive
60
61
  );
61
62
  if (userAppleDistCredentials.length === 0) {
62
63
  this.error("No Apple Distribution Certificate found which can be exported.");
@@ -2,8 +2,8 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import * as fs from 'node:fs';
3
3
  import { Args, Flags } from '@oclif/core';
4
4
  import { render } from 'ink';
5
- import { g as getUserCredentials } from '../../../index-1H48f5j2.js';
6
- import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-BtPf4vzY.js';
5
+ import { g as getUserCredentials } from '../../../index-C2omlhEs.js';
6
+ import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-DHioYOIm.js';
7
7
  import 'ink-spinner';
8
8
  import 'node:crypto';
9
9
  import 'node:path';
@@ -29,8 +29,9 @@ import 'marked';
29
29
  import 'marked-terminal';
30
30
  import 'qrcode';
31
31
  import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js';
32
- import { C as Command } from '../../../Command-DhAVAdiI.js';
33
- import { i as importCredential } from '../../../import-D-EL9sQJ.js';
32
+ import { C as Command } from '../../../Command-7dCv1F9p.js';
33
+ import { i as importCredential } from '../../../import-OgFrUsqw.js';
34
+ import 'chalk';
34
35
  import '@expo/apple-utils/build/index.js';
35
36
  import 'deepmerge';
36
37
  import 'ini';
@@ -59,7 +60,7 @@ class AppleCertificateImport extends BaseAuthenticatedCommand {
59
60
  }
60
61
  const userCredentials = await getUserCredentials();
61
62
  const userAppleDistCredentials = userCredentials.filter(
62
- (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE
63
+ (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE && cred.isActive
63
64
  );
64
65
  if (userAppleDistCredentials.length > 0 && !force) {
65
66
  this.error("An Apple Distribution Certificate already exists. Use --force to overwrite it.");
@@ -1,7 +1,7 @@
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 getShortUUID, c as getShortDate, o as Certificate, p as CertificateType, P as Platform, C as CredentialsType, B as BaseAuthenticatedCommand } from '../../../index-BtPf4vzY.js';
4
+ import { g as getShortUUID, f as getShortDate, d as Certificate, p as CertificateType, P as Platform, C as CredentialsType, B as BaseAuthenticatedCommand } from '../../../index-DHioYOIm.js';
5
5
  import Spinner from 'ink-spinner';
6
6
  import 'node:crypto';
7
7
  import 'node:fs';
@@ -23,7 +23,7 @@ import 'fullscreen-ink';
23
23
  import 'string-length';
24
24
  import 'strip-ansi';
25
25
  import 'open';
26
- import { u as useUserCredentials, U as UserCredentialsTable } from '../../../UserCredentialsTable-oxE3mDmE.js';
26
+ import { u as useUserCredentials, U as UserCredentialsTable } from '../../../UserCredentialsTable-MBm1vAP3.js';
27
27
  import '@inkjs/ui';
28
28
  import 'marked';
29
29
  import 'marked-terminal';
@@ -31,7 +31,8 @@ import 'qrcode';
31
31
  import { T as Table } from '../../../Table-FaNgpyeq.js';
32
32
  import { T as Title } from '../../../Title-BCQtayg6.js';
33
33
  import { N as NextSteps } from '../../../NextSteps-DbJHmscQ.js';
34
- import { C as Command } from '../../../Command-DhAVAdiI.js';
34
+ import { C as Command } from '../../../Command-7dCv1F9p.js';
35
+ import 'chalk';
35
36
  import '@expo/apple-utils/build/index.js';
36
37
  import 'deepmerge';
37
38
  import 'ini';
@@ -1,11 +1,12 @@
1
1
  import { Flags } from '@oclif/core';
2
- import { ak as Auth, B as BaseAuthenticatedCommand, e as getInput, al as getMaskedInput } from '../../index-BtPf4vzY.js';
2
+ import { ak as Auth, B as BaseAuthenticatedCommand, c as getInput, al as getMaskedInput } from '../../index-DHioYOIm.js';
3
3
  import 'node:fs';
4
4
  import 'axios';
5
5
  import 'crypto-js';
6
6
  import 'uuid';
7
7
  import 'luxon';
8
8
  import 'node:path';
9
+ import 'chalk';
9
10
  import '@expo/apple-utils/build/index.js';
10
11
  import 'node:crypto';
11
12
  import 'node:readline';
@@ -46,7 +47,8 @@ class AppleLogin extends BaseAuthenticatedCommand {
46
47
  static description = "Authenticate with Apple - saves the session to the auth file";
47
48
  static examples = [
48
49
  "<%= config.bin %> <%= command.id %>",
49
- "<%= config.bin %> <%= command.id %> --force --appleEmail me@email.nowhere"
50
+ "<%= config.bin %> <%= command.id %> --force --appleEmail me@email.nowhere",
51
+ "<%= config.bin %> <%= command.id %> --logout"
50
52
  ];
51
53
  static flags = {
52
54
  appleEmail: Flags.string({
@@ -54,10 +56,17 @@ class AppleLogin extends BaseAuthenticatedCommand {
54
56
  description: "Your Apple Developer email address"
55
57
  }),
56
58
  force: Flags.boolean({ char: "f" }),
57
- quiet: Flags.boolean({ char: "q", description: "Avoid output except for interactions and errors" })
59
+ quiet: Flags.boolean({ char: "q", description: "Avoid output except for interactions and errors" }),
60
+ logout: Flags.boolean({ char: "l", description: "Forget the saved Apple session (log out)" })
58
61
  };
59
62
  async run() {
60
63
  const { flags } = this;
64
+ if (flags.logout) {
65
+ await this.setAppleCookies(void 0);
66
+ if (!this.flags.quiet) this.log("You have been logged out of Apple.");
67
+ await this.config.runCommand(`apple:status`);
68
+ return;
69
+ }
61
70
  const isLoggedIn = await this.hasValidAppleAuthState();
62
71
  if (isLoggedIn && !flags.force) {
63
72
  throw new Error("You are already logged in to Apple. Use --force to re-authenticate.");
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { render } from 'ink';
3
- import { B as BaseAuthenticatedCommand } from '../../index-BtPf4vzY.js';
3
+ import { B as BaseAuthenticatedCommand } from '../../index-DHioYOIm.js';
4
4
  import 'ink-spinner';
5
5
  import 'node:crypto';
6
6
  import 'node:fs';
@@ -29,7 +29,8 @@ import 'marked';
29
29
  import 'marked-terminal';
30
30
  import { N as NextSteps } from '../../NextSteps-DbJHmscQ.js';
31
31
  import 'qrcode';
32
- import { C as Command } from '../../Command-DhAVAdiI.js';
32
+ import { C as Command } from '../../Command-7dCv1F9p.js';
33
+ import 'chalk';
33
34
  import '@expo/apple-utils/build/index.js';
34
35
  import 'deepmerge';
35
36
  import 'ini';
@@ -1,11 +1,12 @@
1
1
  import open from 'open';
2
- import { B as BaseAuthenticatedCommand, ah as getSingleUseUrl } from '../index-BtPf4vzY.js';
2
+ import { B as BaseAuthenticatedCommand, ah as getSingleUseUrl } from '../index-DHioYOIm.js';
3
3
  import 'node:fs';
4
4
  import 'axios';
5
5
  import 'crypto-js';
6
6
  import 'uuid';
7
7
  import 'luxon';
8
8
  import 'node:path';
9
+ import 'chalk';
9
10
  import '@oclif/core';
10
11
  import '@expo/apple-utils/build/index.js';
11
12
  import 'node:crypto';
@@ -1,7 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Flags } from '@oclif/core';
3
3
  import { render } from 'ink';
4
- import { a2 as getGoogleStatus, ab as disconnectGoogle } from '../../../../index-BtPf4vzY.js';
4
+ import { a2 as getGoogleStatus, ab as disconnectGoogle } from '../../../../index-DHioYOIm.js';
5
5
  import 'ink-spinner';
6
6
  import 'node:crypto';
7
7
  import 'node:fs';
@@ -22,22 +22,23 @@ import 'fullscreen-ink';
22
22
  import 'string-length';
23
23
  import 'strip-ansi';
24
24
  import 'open';
25
- import { C as ConnectGoogle } from '../../../../index-DCN43FhY.js';
25
+ import { C as ConnectGoogle } from '../../../../index-DVEYxVsH.js';
26
26
  import '@inkjs/ui';
27
27
  import 'marked';
28
28
  import 'marked-terminal';
29
29
  import 'qrcode';
30
- import { C as CommandGame } from '../../../../CommandGame-C-oV-hb4.js';
31
- import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DUDYisYm.js';
30
+ import { C as CommandGame } from '../../../../CommandGame-er5Ql6hq.js';
31
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-CKTSQyZV.js';
32
32
  import 'crypto-js';
33
+ import 'chalk';
33
34
  import '@expo/apple-utils/build/index.js';
34
35
  import 'deepmerge';
35
36
  import 'ini';
36
37
  import 'fs';
37
38
  import 'path';
38
- import '../../../../useGoogleStatus-D9jjGa--.js';
39
- import '../../../../useWebSocket-CIeyHqxG.js';
40
- import '../../../../Command-DhAVAdiI.js';
39
+ import '../../../../useGoogleStatus-zfnjhtNB.js';
40
+ import '../../../../useWebSocket-h7smqhZQ.js';
41
+ import '../../../../Command-7dCv1F9p.js';
41
42
 
42
43
  class GameAndroidApiKeyConnect extends BaseGameAndroidCommand {
43
44
  static args = {};
@@ -5,9 +5,9 @@ import 'node:fs';
5
5
  import 'axios';
6
6
  import 'crypto-js';
7
7
  import 'uuid';
8
- import { P as Platform, C as CredentialsType } from '../../../../index-BtPf4vzY.js';
8
+ import { P as Platform, C as CredentialsType } from '../../../../index-DHioYOIm.js';
9
9
  import 'luxon';
10
- import { a as getProjectCredentials } from '../../../../index-1H48f5j2.js';
10
+ import { a as getProjectCredentials } from '../../../../index-C2omlhEs.js';
11
11
  import 'ink-spinner';
12
12
  import 'node:crypto';
13
13
  import 'node:path';
@@ -28,19 +28,20 @@ import '@inkjs/ui';
28
28
  import 'marked';
29
29
  import 'marked-terminal';
30
30
  import 'qrcode';
31
- import { C as CreateServiceAccountKey } from '../../../../index-DwATmUTQ.js';
32
- import { C as CommandGame } from '../../../../CommandGame-C-oV-hb4.js';
33
- import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DUDYisYm.js';
31
+ import { C as CreateServiceAccountKey } from '../../../../index-C1XpCT_9.js';
32
+ import { C as CommandGame } from '../../../../CommandGame-er5Ql6hq.js';
33
+ import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-CKTSQyZV.js';
34
+ import 'chalk';
34
35
  import '@expo/apple-utils/build/index.js';
35
36
  import 'deepmerge';
36
37
  import 'ini';
37
38
  import 'fs';
38
39
  import 'path';
39
- import '../../../../useWebSocket-CIeyHqxG.js';
40
- import '../../../../useProjectCredentials-BjsS28hP.js';
41
- import '../../../../useGoogleStatus-D9jjGa--.js';
40
+ import '../../../../useWebSocket-h7smqhZQ.js';
41
+ import '../../../../useProjectCredentials-DbynNY96.js';
42
+ import '../../../../useGoogleStatus-zfnjhtNB.js';
42
43
  import '../../../../ProgressSpinner-Um6ARKlk.js';
43
- import '../../../../Command-DhAVAdiI.js';
44
+ import '../../../../Command-7dCv1F9p.js';
44
45
 
45
46
  class GameAndroidApiKeyCreate extends BaseGameAndroidCommand {
46
47
  static args = {};