Skip to content

Commit b63f34e

Browse files
committed
fix: fix PR comments
1 parent 9ca5ba5 commit b63f34e

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

docs/man_pages/publishing/apple-login.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if (isJekyll) { %>---
2-
title: tns appstore
2+
title: tns apple-login
33
position: 5
44
---<% } %>
55

@@ -15,15 +15,11 @@ Usage | Synopsis
1515
---|---
1616
General | `$ tns apple-login [<Apple ID>] [<Password>]`
1717

18-
<% if((isConsole && isMacOS) || isHtml) { %>
19-
20-
### Options
21-
2218
### Arguments
2319

2420
* `<Apple ID>` and `<Password>` are your credentials for logging into iTunes Connect.
2521

26-
### Command Limitations
22+
<% if(isHtml) { %>s
2723

2824
### Related Commands
2925

docs/man_pages/publishing/appstore-upload.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ position: 1
88
### Description
99

1010
Uploads project to iTunes Connect. The command either issues a production build and uploads it to iTunes Connect, or uses an already built package to upload.
11+
The user will be prompted interactively for verification code when two-factor authentication enabled account is used. As on non-interactive console (CI), you will not be prompt for verification code. In this case, you need to generate a login session for your apple's account in advance using `tns apple-login` command. The generated value must be provided via the `--appleSessionBase64` option and is only valid for up to a month. Meaning you'll need to create a new session every month.
1112

1213
<% if(isConsole && (isLinux || isWindows)) { %>WARNING: You can run this command only on macOS systems. To view the complete help for this command, run `$ tns help appstore upload`<% } %>
1314
<% if((isConsole && isMacOS) || isHtml) { %>
@@ -22,8 +23,8 @@ Upload package | `$ tns appstore upload [<Apple ID> [<Password>]] --ipa <Ipa Fil
2223
### Options
2324

2425
* `--ipa` - If set, will use provided .ipa file instead of building the project.
25-
* `--appleApplicationSpecificPassword` - Specified the password for your Apple ID that let you sign in to your account and securely access the information you stores from iTunes Transporter application.
26-
* `--appleSessionBase64` - The session that will be reused instead of triggering a new login each time NativeScript CLI communicates with Apple's APIs.
26+
* `--appleApplicationSpecificPassword` - Specifies the password for accessing the information you store in iTunes Transporter application.
27+
* `--appleSessionBase64` - The session that will be used instead of triggering a new login each time NativeScript CLI communicates with Apple's APIs.
2728

2829
### Arguments
2930

docs/man_pages/publishing/publish-ios.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ position: 3
88
### Description
99

1010
Uploads project to iTunes Connect. The command either issues a production build and uploads it to iTunes Connect, or uses an already built package to upload.
11+
The user will be prompted interactively for verification code when two-factor authentication enabled account is used. As on non-interactive console (CI), you will not be prompt for verification code. In this case, you need to generate a login session for your apple's account in advance using `tns apple-login` command. The generated value must be provided via the `--appleSessionBase64` option and is only valid for up to a month. Meaning you'll need to create a new session every month.
1112

1213
<% if(isConsole && (isLinux || isWindows)) { %>WARNING: You can run this command only on macOS systems. To view the complete help for this command, run `$ tns help publish ios`<% } %>
1314

@@ -24,8 +25,8 @@ Upload package | `$ tns publish ios [<Apple ID> [<Password>]] --ipa <Ipa File Pa
2425

2526
* `--ipa` - If set, will use provided .ipa file instead of building the project.
2627
* `--team-id` - Specified the team id for which Xcode will try to find distribution certificate and provisioning profile when exporting for AppStore submission.
27-
* `--appleApplicationSpecificPassword` - Specified the password for your Apple ID that let you sign in to your account and securely access the information you stores from iTunes Transporter application.
28-
* `--appleSessionBase64` - The session that will be reused instead of triggering a new login each time NativeScript CLI communicates with Apple's APIs.
28+
* `--appleApplicationSpecificPassword` - Specifies the password for accessing the information you store in iTunes Transporter application.
29+
* `--appleSessionBase64` - The session that will be used instead of triggering a new login each time NativeScript CLI communicates with Apple's APIs.
2930

3031
### Arguments
3132

lib/commands/appstore-list.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export class ListiOSApps implements ICommand {
1212
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
1313
private $platformValidationService: IPlatformValidationService,
1414
private $errors: IErrors,
15-
private $prompter: IPrompter) {
15+
private $prompter: IPrompter,
16+
private $options: IOptions) {
1617
this.$projectData.initializeProjectData();
1718
}
1819

@@ -32,7 +33,9 @@ export class ListiOSApps implements ICommand {
3233
password = await this.$prompter.getPassword("Apple ID password");
3334
}
3435

35-
const user = await this.$applePortalSessionService.createUserSession({ username, password });
36+
const user = await this.$applePortalSessionService.createUserSession({ username, password }, {
37+
sessionBase64: this.$options.appleSessionBase64,
38+
});
3639
if (!user.areCredentialsValid) {
3740
this.$errors.failWithoutHelp(`Invalid username and password combination. Used '${username}' as the username.`);
3841
}

lib/commands/appstore-upload.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class PublishIOS implements ICommand {
4242
const user = await this.$applePortalSessionService.createUserSession({ username, password }, {
4343
applicationSpecificPassword: this.$options.appleApplicationSpecificPassword,
4444
sessionBase64: this.$options.appleSessionBase64,
45-
ensureConsoleIsInteractive: true
45+
requireInteractiveConsole: true
4646
});
4747
if (!user.areCredentialsValid) {
4848
this.$errors.failWithoutHelp(`Invalid username and password combination. Used '${username}' as the username.`);

lib/services/apple-portal/apple-portal-session-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ To generate an application-specific password, please go to https://appleid.apple
102102
This password will be used for the iTunes Transporter, which is used to upload your application.`);
103103
}
104104

105-
if (result.isTwoFactorAuthenticationEnabled && opts && opts.ensureConsoleIsInteractive && !isInteractive()) {
105+
if (result.isTwoFactorAuthenticationEnabled && opts && opts.requireInteractiveConsole && !isInteractive()) {
106106
this.$errors.failWithoutHelp(`Your account has two-factor authentication enabled, but your console is not interactive.
107107
For more details how to set up your environment, please execute "tns publish ios --help".`);
108108
}

lib/services/apple-portal/definitions.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ interface IApplePortalApplicationService {
1616
}
1717

1818
interface IAppleCreateUserSessionOptions {
19-
applicationSpecificPassword: string;
19+
applicationSpecificPassword?: string;
2020
sessionBase64: string;
21-
ensureConsoleIsInteractive: boolean;
21+
requireInteractiveConsole?: boolean;
2222
}
2323

2424
interface IAppleLoginResult {

0 commit comments

Comments
 (0)