shipthis 0.1.24 → 0.1.25

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 (89) hide show
  1. package/README.md +25 -16
  2. package/docs/assets/ship-outputx0.8.gif +0 -0
  3. package/package.json +1 -1
  4. package/bin/readme.sh +0 -15
  5. package/dist/AppleBundleIdDetails-mPUG2R4N.js +0 -76
  6. package/dist/Command-B3AmRt2w.js +0 -28
  7. package/dist/CommandGame-BCMzP9pc.js +0 -9
  8. package/dist/Create-CsJxpzUs.js +0 -59
  9. package/dist/Import-v0M_ygyF.js +0 -110
  10. package/dist/JobProgress-9uvq8IBn.js +0 -121
  11. package/dist/JobStatusTable-Bf7J9WXe.js +0 -191
  12. package/dist/NextSteps-CK9zHOCt.js +0 -18
  13. package/dist/ProgressSpinner-6pw1T8Iw.js +0 -16
  14. package/dist/ProjectCredentialsTable-CTkP1mvy.js +0 -37
  15. package/dist/RunWithSpinner-BVXNWGD3.js +0 -27
  16. package/dist/StatusTable-Dm5St4g-.js +0 -33
  17. package/dist/Table-CvM6pccN.js +0 -101
  18. package/dist/Title-BCQtayg6.js +0 -6
  19. package/dist/UserCredentialsTable-DhtM_iTG.js +0 -82
  20. package/dist/baseAppleCommand-IGl6KTvv.js +0 -10
  21. package/dist/baseGameAndroidCommand-DFn4zMvq.js +0 -43
  22. package/dist/commands/apple/apiKey/create.js +0 -103
  23. package/dist/commands/apple/apiKey/export.js +0 -81
  24. package/dist/commands/apple/apiKey/import.js +0 -85
  25. package/dist/commands/apple/apiKey/status.js +0 -122
  26. package/dist/commands/apple/certificate/create.js +0 -133
  27. package/dist/commands/apple/certificate/export.js +0 -81
  28. package/dist/commands/apple/certificate/import.js +0 -85
  29. package/dist/commands/apple/certificate/status.js +0 -130
  30. package/dist/commands/apple/login.js +0 -76
  31. package/dist/commands/apple/status.js +0 -79
  32. package/dist/commands/dashboard.js +0 -38
  33. package/dist/commands/game/android/apiKey/connect.js +0 -74
  34. package/dist/commands/game/android/apiKey/create.js +0 -74
  35. package/dist/commands/game/android/apiKey/export.js +0 -84
  36. package/dist/commands/game/android/apiKey/import.js +0 -93
  37. package/dist/commands/game/android/apiKey/invite.js +0 -81
  38. package/dist/commands/game/android/apiKey/status.js +0 -87
  39. package/dist/commands/game/android/keyStore/create.js +0 -69
  40. package/dist/commands/game/android/keyStore/export.js +0 -83
  41. package/dist/commands/game/android/keyStore/import.js +0 -112
  42. package/dist/commands/game/android/keyStore/status.js +0 -70
  43. package/dist/commands/game/android/status.js +0 -84
  44. package/dist/commands/game/build/download.js +0 -80
  45. package/dist/commands/game/build/list.js +0 -94
  46. package/dist/commands/game/create.js +0 -67
  47. package/dist/commands/game/details.js +0 -113
  48. package/dist/commands/game/export.js +0 -58
  49. package/dist/commands/game/ios/app/addTester.js +0 -124
  50. package/dist/commands/game/ios/app/create.js +0 -117
  51. package/dist/commands/game/ios/app/status.js +0 -66
  52. package/dist/commands/game/ios/app/sync.js +0 -95
  53. package/dist/commands/game/ios/profile/create.js +0 -129
  54. package/dist/commands/game/ios/profile/export.js +0 -83
  55. package/dist/commands/game/ios/profile/import.js +0 -92
  56. package/dist/commands/game/ios/profile/status.js +0 -139
  57. package/dist/commands/game/ios/status.js +0 -92
  58. package/dist/commands/game/ios/wizard.js +0 -153
  59. package/dist/commands/game/job/list.js +0 -91
  60. package/dist/commands/game/job/status.js +0 -91
  61. package/dist/commands/game/list.js +0 -83
  62. package/dist/commands/game/ship.js +0 -216
  63. package/dist/commands/game/status.js +0 -114
  64. package/dist/commands/game/wizard.js +0 -686
  65. package/dist/commands/internal/fastlane.js +0 -74
  66. package/dist/commands/internal/readme.js +0 -937
  67. package/dist/commands/login.js +0 -92
  68. package/dist/commands/status.js +0 -76
  69. package/dist/export-CVs_xoDN.js +0 -36
  70. package/dist/git-DREGq-jc.js +0 -32
  71. package/dist/import-Ch5O7xfN.js +0 -47
  72. package/dist/index-BB00V5oF.js +0 -136
  73. package/dist/index-BD1WLuFJ.js +0 -125
  74. package/dist/index-CIa2EDQ6.js +0 -24
  75. package/dist/index-CboPN9aq.js +0 -138
  76. package/dist/index-DkNQs11R.js +0 -711
  77. package/dist/index-nnzhQ3nY.js +0 -209
  78. package/dist/index.d.ts +0 -1
  79. package/dist/index.js +0 -1
  80. package/dist/upload-CRE2nVdd.js +0 -60
  81. package/dist/useAndroidServiceAccountTestResult-DcYDam-p.js +0 -52
  82. package/dist/useAppleApp-B16WbUxJ.js +0 -32
  83. package/dist/useAppleBundleId-DobPATan.js +0 -64
  84. package/dist/useJobWatching--BvVn7xS.js +0 -45
  85. package/dist/useProjectCredentials-Btnr7WK3.js +0 -54
  86. package/dist/useWebSocket-ByuNoqRw.js +0 -36
  87. package/dist/utils/help.js +0 -14
  88. package/npm-shrinkwrap.json +0 -14011
  89. package/oclif.manifest.json +0 -2286
@@ -1,66 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { render } from 'ink';
3
- import { Flags } from '@oclif/core';
4
- import 'react';
5
- import '../../../../index-nnzhQ3nY.js';
6
- import { c as BaseGameCommand } from '../../../../index-DkNQs11R.js';
7
- import 'ink-spinner';
8
- import 'axios';
9
- import 'crypto-js';
10
- import 'uuid';
11
- import 'fs';
12
- import 'luxon';
13
- import '@inkjs/ui';
14
- import '@tanstack/react-query';
15
- import 'yazl';
16
- import 'crypto';
17
- import 'readline-sync';
18
- import 'node:readline';
19
- import 'node:path';
20
- import 'node:url';
21
- import 'isomorphic-git';
22
- import 'fast-glob';
23
- import 'socket.io-client';
24
- import 'open';
25
- import 'marked';
26
- import 'marked-terminal';
27
- import 'path';
28
- import { N as NextSteps } from '../../../../NextSteps-CK9zHOCt.js';
29
- import 'qrcode';
30
- import 'string-length';
31
- import 'strip-ansi';
32
- import { A as AppleAppDetails, a as AppleBundleIdDetails } from '../../../../AppleBundleIdDetails-mPUG2R4N.js';
33
- import { C as Command } from '../../../../Command-B3AmRt2w.js';
34
- import '../../../../index-BB00V5oF.js';
35
- import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
36
- import '@expo/apple-utils/build/index.js';
37
- import 'ini';
38
- import 'deepmerge';
39
- import '../../../../Title-BCQtayg6.js';
40
- import '../../../../useAppleApp-B16WbUxJ.js';
41
- import '../../../../Table-CvM6pccN.js';
42
- import '../../../../useAppleBundleId-DobPATan.js';
43
-
44
- class GameIosAppStatus extends BaseGameCommand {
45
- static args = {};
46
- static description = "Shows the Game iOS App status. ";
47
- static examples = ["<%= config.bin %> <%= command.id %>"];
48
- static flags = {
49
- gameId: Flags.string({ char: "g", description: "The ID of the game" })
50
- };
51
- async run() {
52
- const game = await this.getGame();
53
- const authState = await this.refreshAppleAuthState();
54
- const ctx = authState.context;
55
- const steps = [];
56
- render(
57
- /* @__PURE__ */ jsxs(Command, { command: this, children: [
58
- /* @__PURE__ */ jsx(AppleAppDetails, { iosBundleId: game.details?.iosBundleId, ctx }),
59
- /* @__PURE__ */ jsx(AppleBundleIdDetails, { iosBundleId: game.details?.iosBundleId, ctx }),
60
- /* @__PURE__ */ jsx(NextSteps, { steps })
61
- ] })
62
- );
63
- }
64
- }
65
-
66
- export { GameIosAppStatus as default };
@@ -1,95 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { render } from 'ink';
3
- import { Flags } from '@oclif/core';
4
- import 'react';
5
- import '../../../../index-nnzhQ3nY.js';
6
- import { c as BaseGameCommand, h as CapabilityTypeOption } from '../../../../index-DkNQs11R.js';
7
- import 'ink-spinner';
8
- import 'axios';
9
- import 'crypto-js';
10
- import 'uuid';
11
- import 'fs';
12
- import 'luxon';
13
- import '@inkjs/ui';
14
- import '@tanstack/react-query';
15
- import 'yazl';
16
- import 'crypto';
17
- import 'readline-sync';
18
- import 'node:readline';
19
- import 'node:path';
20
- import 'node:url';
21
- import 'isomorphic-git';
22
- import { f as fetchBundleId } from '../../../../useAppleBundleId-DobPATan.js';
23
- import 'fast-glob';
24
- import 'socket.io-client';
25
- import 'open';
26
- import 'marked';
27
- import 'marked-terminal';
28
- import 'path';
29
- 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-B3AmRt2w.js';
34
- import '../../../../index-BB00V5oF.js';
35
- import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
36
- import '@expo/apple-utils/build/index.js';
37
- import 'ini';
38
- import 'deepmerge';
39
-
40
- class GameIosAppSync extends BaseGameCommand {
41
- static args = {};
42
- static description = 'Synchronies the Apple App "BundleId" with the capabilities from the local project.';
43
- static examples = ["<%= config.bin %> <%= command.id %>"];
44
- static flags = {
45
- quiet: Flags.boolean({ char: "q", description: "Avoid output except for interactions and errors" }),
46
- gameId: Flags.string({ char: "g", description: "The ID of the game" }),
47
- force: Flags.boolean({ char: "f" })
48
- // not used but don't remove or the wizard breaks
49
- };
50
- async run() {
51
- const game = await this.getGame();
52
- const authState = await this.refreshAppleAuthState();
53
- const ctx = authState.context;
54
- if (!game.details?.iosBundleId) return this.error("Please run `shipthis game ios app create` first");
55
- const { iosBundleId } = game.details;
56
- const syncCapabilities = async () => {
57
- const bundleQueryResponse = await fetchBundleId({ ctx, iosBundleId });
58
- const { bundleId, capabilities: existing, projectCapabilities } = bundleQueryResponse;
59
- if (!bundleId) return this.error("BundleId not found");
60
- if (!projectCapabilities) return this.error("Project capabilities not loaded");
61
- const unRemovable = ["IN_APP_PURCHASE"];
62
- const toRemove = existing.filter((c) => !projectCapabilities.includes(c) && !unRemovable.includes(c));
63
- const toAdd = projectCapabilities.filter((c) => !existing.includes(c));
64
- for (const capability of toRemove) {
65
- await bundleId.updateBundleIdCapabilityAsync({
66
- capabilityType: capability,
67
- option: CapabilityTypeOption.OFF
68
- });
69
- }
70
- for (const capability of toAdd) {
71
- await bundleId.updateBundleIdCapabilityAsync({
72
- capabilityType: capability,
73
- option: CapabilityTypeOption.ON
74
- });
75
- }
76
- };
77
- const handleComplete = async () => {
78
- await this.config.runCommand("game:ios:app:status", ["--gameId", game.id]);
79
- };
80
- if (this.flags.quiet) return await syncCapabilities();
81
- render(
82
- /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
83
- RunWithSpinner,
84
- {
85
- msgInProgress: "Syncing App Store BundleId capabilities",
86
- msgComplete: "App Store BundleId capabilities synced",
87
- executeMethod: syncCapabilities,
88
- onComplete: handleComplete
89
- }
90
- ) })
91
- );
92
- }
93
- }
94
-
95
- export { GameIosAppSync as default };
@@ -1,129 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { render } from 'ink';
3
- import { Flags } from '@oclif/core';
4
- import axios from 'axios';
5
- import 'react';
6
- import '../../../../index-nnzhQ3nY.js';
7
- import { c as BaseGameCommand, P as Platform, C as CredentialsType, l as Certificate, m as CertificateType, n as Profile, o as ProfileType } from '../../../../index-DkNQs11R.js';
8
- import 'ink-spinner';
9
- import 'crypto-js';
10
- import 'uuid';
11
- import 'fs';
12
- import 'luxon';
13
- import { a as getProjectCredentials, g as getUserCredentials } from '../../../../index-CIa2EDQ6.js';
14
- import '@inkjs/ui';
15
- import '@tanstack/react-query';
16
- import 'yazl';
17
- import 'crypto';
18
- import 'readline-sync';
19
- import 'node:readline';
20
- import 'node:path';
21
- import 'node:url';
22
- import 'isomorphic-git';
23
- import { f as fetchBundleId } from '../../../../useAppleBundleId-DobPATan.js';
24
- import 'fast-glob';
25
- import 'socket.io-client';
26
- import 'open';
27
- import 'marked';
28
- import 'marked-terminal';
29
- import 'path';
30
- import 'qrcode';
31
- import { R as RunWithSpinner } from '../../../../RunWithSpinner-BVXNWGD3.js';
32
- import 'string-length';
33
- import 'strip-ansi';
34
- import { C as Command } from '../../../../Command-B3AmRt2w.js';
35
- import { a as uploadProjectCredentials } from '../../../../upload-CRE2nVdd.js';
36
- import '../../../../index-BB00V5oF.js';
37
- import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
38
- import '@expo/apple-utils/build/index.js';
39
- import 'ini';
40
- import 'deepmerge';
41
-
42
- class GameIosProfileCreate extends BaseGameCommand {
43
- static args = {};
44
- static description = "Creates a Mobile Provisioning Profile in the Apple Developer Portal.";
45
- static examples = ["<%= config.bin %> <%= command.id %>"];
46
- static flags = {
47
- quiet: Flags.boolean({ char: "q", description: "Avoid output except for interactions and errors" }),
48
- gameId: Flags.string({ char: "g", description: "The ID of the game" }),
49
- force: Flags.boolean({ char: "f" })
50
- };
51
- async run() {
52
- const game = await this.getGame();
53
- const authState = await this.refreshAppleAuthState();
54
- const ctx = authState.context;
55
- const { flags } = this;
56
- const { force } = flags;
57
- const projectCredentials = await getProjectCredentials(game.id);
58
- const projectAppleProfileCredentials = projectCredentials.filter(
59
- (cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.CERTIFICATE
60
- );
61
- if (projectAppleProfileCredentials.length !== 0 && !force) {
62
- this.error("A Mobile Provisioning Profile already exists. Use --force to overwrite it.");
63
- }
64
- const createProfile = async () => {
65
- if (!game.details?.iosBundleId) throw new Error("iosBundleId not found in game details");
66
- const { iosBundleId } = game.details;
67
- const { bundleId } = await fetchBundleId({ ctx, iosBundleId });
68
- if (!bundleId) throw new Error("BundleId not found");
69
- const appleCerts = await Certificate.getAsync(ctx, {
70
- query: {
71
- filter: {
72
- certificateType: [CertificateType.DISTRIBUTION, CertificateType.IOS_DISTRIBUTION]
73
- }
74
- }
75
- });
76
- const userCerts = await getUserCredentials();
77
- const validCert = userCerts.find(
78
- (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.CERTIFICATE && cred.isActive == true
79
- );
80
- const validAppleCert = appleCerts.find(
81
- (cert) => validCert && cert.attributes.serialNumber === validCert.serialNumber
82
- );
83
- if (!validCert || !validAppleCert)
84
- throw new Error(
85
- 'No usable iOS Distribution Certificate found. Please run "shipthis apple certificate create" first.'
86
- );
87
- const profile = await Profile.createAsync(ctx, {
88
- bundleId: bundleId.id,
89
- certificates: [validAppleCert.id],
90
- devices: [],
91
- name: `ShipThis Profile for ${iosBundleId}`,
92
- profileType: ProfileType.IOS_APP_STORE
93
- });
94
- const { data: contents } = await axios({
95
- method: "get",
96
- url: validCert.url
97
- });
98
- const userCertContent = contents;
99
- const projectCertContent = {
100
- ...userCertContent,
101
- mobileProvisionBase64: `${profile.attributes.profileContent}`
102
- };
103
- await uploadProjectCredentials(game.id, {
104
- contents: projectCertContent,
105
- platform: Platform.IOS,
106
- type: CredentialsType.CERTIFICATE,
107
- serialNumber: validCert.serialNumber,
108
- identifier: iosBundleId
109
- });
110
- };
111
- const handleComplete = async () => {
112
- await this.config.runCommand("game:ios:profile:status", ["--gameId", game.id]);
113
- };
114
- if (this.flags.quiet) return await createProfile();
115
- render(
116
- /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
117
- RunWithSpinner,
118
- {
119
- msgInProgress: "Creating Mobile Provisioning Profile in the Apple Developer Portal",
120
- msgComplete: "Mobile Provisioning Profile created",
121
- executeMethod: createProfile,
122
- onComplete: handleComplete
123
- }
124
- ) })
125
- );
126
- }
127
- }
128
-
129
- export { GameIosProfileCreate as default };
@@ -1,83 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Args, Flags } from '@oclif/core';
3
- import { render } from 'ink';
4
- import * as fs from 'fs';
5
- import { c as BaseGameCommand, P as Platform, C as CredentialsType } from '../../../../index-DkNQs11R.js';
6
- import { a as getProjectCredentials } from '../../../../index-CIa2EDQ6.js';
7
- import 'react';
8
- import '../../../../index-nnzhQ3nY.js';
9
- 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';
20
- import 'node:path';
21
- import 'node:url';
22
- import 'isomorphic-git';
23
- import 'fast-glob';
24
- import 'socket.io-client';
25
- import 'open';
26
- import 'marked';
27
- import 'marked-terminal';
28
- import 'path';
29
- 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-B3AmRt2w.js';
34
- import { e as exportCredential } from '../../../../export-CVs_xoDN.js';
35
- import '@expo/apple-utils/build/index.js';
36
- import 'ini';
37
- import 'deepmerge';
38
- import '../../../../index-BB00V5oF.js';
39
- import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
40
-
41
- class GameIosProfileExport extends BaseGameCommand {
42
- static args = {
43
- file: Args.string({ description: "Name of the ZIP file to create", required: true })
44
- };
45
- static description = "Saves the current Mobile Provisioning Profile to a ZIP file";
46
- static examples = ["<%= config.bin %> <%= command.id %> userProfile.zip"];
47
- static flags = {
48
- gameId: Flags.string({ char: "g", description: "The ID of the game" }),
49
- force: Flags.boolean({ char: "f", description: "Overwrite the file if it already exists" })
50
- };
51
- async run() {
52
- const { args, flags } = this;
53
- const { file } = args;
54
- const { force } = flags;
55
- const game = await this.getGame();
56
- const zipAlreadyExists = fs.existsSync(file);
57
- if (zipAlreadyExists && !force) {
58
- this.error(`The file ${file} already exists. Use --force to overwrite it.`);
59
- }
60
- const projectCredentials = await getProjectCredentials(game.id);
61
- const userAppleProfileCredentials = projectCredentials.filter(
62
- (cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.CERTIFICATE
63
- );
64
- if (userAppleProfileCredentials.length === 0) {
65
- this.error("No Mobile Provisioning Profile found which can be exported.");
66
- }
67
- const [profile] = userAppleProfileCredentials;
68
- const handleComplete = async () => process.exit(0);
69
- render(
70
- /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
71
- RunWithSpinner,
72
- {
73
- msgInProgress: `Exporting Mobile Provisioning Profile to ${file}...`,
74
- msgComplete: `Mobile Provisioning Profile exported to ${file}`,
75
- executeMethod: () => exportCredential({ zipPath: file, credentialId: profile.id, projectId: game.id }),
76
- onComplete: handleComplete
77
- }
78
- ) })
79
- );
80
- }
81
- }
82
-
83
- export { GameIosProfileExport as default };
@@ -1,92 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Args, Flags } from '@oclif/core';
3
- import { render } from 'ink';
4
- import * as fs from 'fs';
5
- import { c as BaseGameCommand, P as Platform, C as CredentialsType } from '../../../../index-DkNQs11R.js';
6
- import { a as getProjectCredentials } from '../../../../index-CIa2EDQ6.js';
7
- import 'react';
8
- import '../../../../index-nnzhQ3nY.js';
9
- 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';
20
- import 'node:path';
21
- import 'node:url';
22
- import 'isomorphic-git';
23
- import 'fast-glob';
24
- import 'socket.io-client';
25
- import 'open';
26
- import 'marked';
27
- import 'marked-terminal';
28
- import 'path';
29
- 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-B3AmRt2w.js';
34
- import { i as importCredential } from '../../../../import-Ch5O7xfN.js';
35
- import '@expo/apple-utils/build/index.js';
36
- import 'ini';
37
- import 'deepmerge';
38
- import '../../../../index-BB00V5oF.js';
39
- import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
40
-
41
- class GameIosProfileImport extends BaseGameCommand {
42
- static args = {
43
- file: Args.string({
44
- description: "Name of the ZIP file to import (must be in the same format as the export)",
45
- required: true
46
- })
47
- };
48
- static description = "Imports an Mobile Provisioning Profile to your ShipThis account";
49
- static examples = ["<%= config.bin %> <%= command.id %> profile.zip"];
50
- static flags = {
51
- gameId: Flags.string({ char: "g", description: "The ID of the game" }),
52
- force: Flags.boolean({ char: "f" })
53
- };
54
- async run() {
55
- const { args, flags } = this;
56
- const { file } = args;
57
- const { force } = flags;
58
- const game = await this.getGame();
59
- const zipFound = fs.existsSync(file);
60
- if (!zipFound) {
61
- this.error(`The file ${file} does not exist.`);
62
- }
63
- const projectCredentials = await getProjectCredentials(game.id);
64
- const projectAppleProfileCredentials = projectCredentials.filter(
65
- (cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.CERTIFICATE
66
- );
67
- if (projectAppleProfileCredentials.length !== 0 && !force) {
68
- this.error("A Mobile Provisioning Profile already exists. Use --force to overwrite it.");
69
- }
70
- const handleComplete = async () => {
71
- await this.config.runCommand(`game:ios:profile:status`, ["--noAppleAuth", "--gameId", game.id]);
72
- };
73
- render(
74
- /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
75
- RunWithSpinner,
76
- {
77
- msgInProgress: `Importing Mobile Provisioning Profile from ${file}...`,
78
- msgComplete: `Mobile Provisioning Profile imported from ${file}`,
79
- executeMethod: () => importCredential({
80
- zipPath: file,
81
- type: CredentialsType.CERTIFICATE,
82
- platform: Platform.IOS,
83
- projectId: game.id
84
- }),
85
- onComplete: handleComplete
86
- }
87
- ) })
88
- );
89
- }
90
- }
91
-
92
- export { GameIosProfileImport as default };
@@ -1,139 +0,0 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { Box, Text, render } from 'ink';
3
- import { Flags } from '@oclif/core';
4
- import 'react';
5
- import '../../../../index-nnzhQ3nY.js';
6
- import { b as getShortDate, n as Profile, o as ProfileType, C as CredentialsType, P as Platform, c as BaseGameCommand } from '../../../../index-DkNQs11R.js';
7
- 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';
19
- import 'node:path';
20
- import 'node:url';
21
- import 'isomorphic-git';
22
- import 'fast-glob';
23
- import 'socket.io-client';
24
- import 'open';
25
- import 'marked';
26
- import 'marked-terminal';
27
- import 'path';
28
- import 'qrcode';
29
- import 'string-length';
30
- import 'strip-ansi';
31
- import { u as useProjectCredentials } from '../../../../useProjectCredentials-Btnr7WK3.js';
32
- import { T as Table } from '../../../../Table-CvM6pccN.js';
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-B3AmRt2w.js';
36
- import { P as ProjectCredentialsTable } from '../../../../ProjectCredentialsTable-CTkP1mvy.js';
37
- import '../../../../index-BB00V5oF.js';
38
- import '../../../../useAndroidServiceAccountTestResult-DcYDam-p.js';
39
- import '@expo/apple-utils/build/index.js';
40
- import 'ini';
41
- import 'deepmerge';
42
-
43
- async function queryAppleProfiles({ ctx }) {
44
- const appleProfiles = await Profile.getAsync(ctx, {
45
- query: {
46
- filter: {
47
- profileType: [ProfileType.IOS_APP_STORE]
48
- }
49
- }
50
- });
51
- return appleProfiles;
52
- }
53
- const canAppleProfileBeUsed = (appleProfile, project, projectCredentials) => {
54
- try {
55
- if (!appleProfile.isValid) return false;
56
- const profileBundleId = appleProfile.attributes.bundleId?.attributes.identifier;
57
- const profileCertificateSerialNumber = appleProfile.attributes.certificates?.[0]?.attributes.serialNumber;
58
- if (profileBundleId !== project.details?.iosBundleId) return false;
59
- return projectCredentials.some(
60
- (credential) => credential.isActive && credential.serialNumber === profileCertificateSerialNumber
61
- );
62
- } catch (e) {
63
- console.log(e);
64
- return false;
65
- }
66
- };
67
- function getAppleProfileSummary(appleProfile, project, projectCredentials) {
68
- return {
69
- id: appleProfile.id,
70
- name: appleProfile.attributes.name,
71
- platform: appleProfile.attributes.platform,
72
- expires: getShortDate(DateTime.fromISO(appleProfile.attributes.expirationDate)),
73
- canBeUsed: canAppleProfileBeUsed(appleProfile, project, projectCredentials)
74
- };
75
- }
76
- const useAppleProfiles = (props) => {
77
- const queryResult = useQuery({
78
- queryKey: ["appleProfiles"],
79
- queryFn: () => queryAppleProfiles(props)
80
- });
81
- return queryResult;
82
- };
83
-
84
- const AppleProfilesTable = ({ ctx, project, ...boxProps }) => {
85
- const { data: credentialsResponse } = useProjectCredentials({
86
- projectId: project.id,
87
- platform: Platform.IOS,
88
- type: CredentialsType.CERTIFICATE
89
- });
90
- const { data: profiles, isLoading } = useAppleProfiles({ ctx });
91
- const hasUsable = profiles && credentialsResponse && profiles.some((cert) => canAppleProfileBeUsed(cert, project, credentialsResponse.data));
92
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, ...boxProps, children: [
93
- /* @__PURE__ */ jsx(Title, { children: "Mobile Provisioning Profiles in your Apple account" }),
94
- isLoading && /* @__PURE__ */ jsx(Spinner, { type: "dots" }),
95
- profiles && credentialsResponse && /* @__PURE__ */ jsxs(Fragment, { children: [
96
- /* @__PURE__ */ jsxs(Box, { marginLeft: 2, marginBottom: 1, flexDirection: "column", children: [
97
- /* @__PURE__ */ jsx(Text, { children: `You have ${profiles.length} Mobile Provisioning Profiles in your Apple account` }),
98
- /* @__PURE__ */ jsx(Text, { children: `${hasUsable ? "One" : "None"} of these can be used by ShipThis` })
99
- ] }),
100
- profiles.length > 0 && /* @__PURE__ */ jsx(Table, { data: profiles.map((cert) => getAppleProfileSummary(cert, project, credentialsResponse.data)) }),
101
- !hasUsable && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { bold: true, children: "You do not have a usable Mobile Provisioning Profile. To ship an iOS game, you will need a usable Mobile Provisioning Profile." }) })
102
- ] }),
103
- profiles && !hasUsable && /* @__PURE__ */ jsx(NextSteps, { steps: ["shipthis game ios profile create"] })
104
- ] });
105
- };
106
-
107
- class GameIosProfileStatus extends BaseGameCommand {
108
- static args = {};
109
- static description = "Shows the Game iOS Mobile Provisioning Profile Status.";
110
- static examples = ["<%= config.bin %> <%= command.id %>"];
111
- static flags = {
112
- gameId: Flags.string({ char: "g", description: "The ID of the game" }),
113
- noAppleAuth: Flags.boolean({ char: "f" })
114
- };
115
- async run() {
116
- const { flags } = this;
117
- const showApple = !flags.noAppleAuth;
118
- const game = await this.getGame();
119
- let ctx = null;
120
- if (showApple) {
121
- const authState = await this.refreshAppleAuthState();
122
- ctx = authState.context;
123
- }
124
- render(
125
- /* @__PURE__ */ jsxs(Command, { command: this, children: [
126
- /* @__PURE__ */ jsx(
127
- ProjectCredentialsTable,
128
- {
129
- credentialTypeName: "Mobile Provisioning Profile",
130
- queryProps: { platform: Platform.IOS, type: CredentialsType.CERTIFICATE, projectId: game.id }
131
- }
132
- ),
133
- showApple && /* @__PURE__ */ jsx(AppleProfilesTable, { ctx, project: game })
134
- ] })
135
- );
136
- }
137
- }
138
-
139
- export { GameIosProfileStatus as default };