@norrix/cli 0.0.25 → 0.0.27

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,45 @@
1
+ ## 0.0.26 (2025-12-31)
2
+
3
+ ### 🚀 Features
4
+
5
+ - allow standalone project scoping ([b0a23a9](https://github.com/norrixnet/norrix/commit/b0a23a9))
6
+ - **cli:** workspace handling and extra options ([65c4925](https://github.com/norrixnet/norrix/commit/65c4925))
7
+ - **cli:** nx workspace compatibility ([e3c184a](https://github.com/norrixnet/norrix/commit/e3c184a))
8
+ - env handling ([2352f6d](https://github.com/norrixnet/norrix/commit/2352f6d))
9
+ - **next-app,norrix-cli:** add CLI organization selection via X-Norrix-Org-Id ([79e39d0](https://github.com/norrixnet/norrix/commit/79e39d0))
10
+
11
+ ### 🩹 Fixes
12
+
13
+ - **cli:** trim user input values ([28e5e0f](https://github.com/norrixnet/norrix/commit/28e5e0f))
14
+
15
+ ### ❤️ Thank You
16
+
17
+ - Nathan Walker
18
+ - Owen Carey @owenthcarey
19
+
20
+ ## 0.0.25 (2025-12-29)
21
+
22
+ ### 🚀 Features
23
+
24
+ - **cli:** workspace support ([8737c10](https://github.com/norrixnet/norrix/commit/8737c10))
25
+ - **cli:** pass verbose flag usage to cloud commands ([79d43f1](https://github.com/norrixnet/norrix/commit/79d43f1))
26
+ - **cli:** distribution type for appstore, adhoc and enterprise ([3e6e5b3](https://github.com/norrixnet/norrix/commit/3e6e5b3))
27
+ - **norrix-cli:** add prod/dev profiles via --env/--dev ([94779f7](https://github.com/norrixnet/norrix/commit/94779f7))
28
+ - **next-app,norrix-cli,workflows:** expose norrixEnv routing info ([7d321e0](https://github.com/norrixnet/norrix/commit/7d321e0))
29
+ - **workflows,norrix-cli,next-app:** split dev/prod execution context and harden CLI env loading ([0cbf369](https://github.com/norrixnet/norrix/commit/0cbf369))
30
+ - **cli:** improve success output ([5e63a08](https://github.com/norrixnet/norrix/commit/5e63a08))
31
+ - **cli:** improve success output to include version/build ([df6c98e](https://github.com/norrixnet/norrix/commit/df6c98e))
32
+ - **cli:** fingerprint handling ([e8c8a81](https://github.com/norrixnet/norrix/commit/e8c8a81))
33
+
34
+ ### 🩹 Fixes
35
+
36
+ - **cli:** config parsing ([5cb0a42](https://github.com/norrixnet/norrix/commit/5cb0a42))
37
+
38
+ ### ❤️ Thank You
39
+
40
+ - Nathan Walker
41
+ - Owen Carey @owenthcarey
42
+
1
43
  ## 0.0.24 (2025-12-28)
2
44
 
3
45
  ### 🚀 Features
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import { Command } from 'commander';
3
3
  import { readFileSync } from 'fs';
4
4
  import { fileURLToPath } from 'url';
5
5
  import path from 'path';
6
- import { build, submit, update, buildStatus, submitStatus, updateStatus, initNorrixCli, signIn, signOut, uploadFile, currentUser, billingCheckout, billingPortal, printFingerprint, compareFingerprint, } from './lib/commands.js';
6
+ import { build, submit, update, buildStatus, submitStatus, updateStatus, orgsList, orgsSelect, orgsCurrent, initNorrixCli, signIn, signOut, uploadFile, currentUser, billingCheckout, billingPortal, printFingerprint, compareFingerprint, envSet, envSetFile, envList, envDelete, envDeleteFile, } from './lib/commands.js';
7
7
  import { assertNorrixCliEnv } from './lib/defaults.js';
8
8
  /**
9
9
  * Norrix CLI
@@ -57,45 +57,74 @@ program
57
57
  .argument('[platform]', 'Target platform (android, ios or visionos)')
58
58
  .argument('[configuration]', 'Build configuration (debug or release)')
59
59
  .argument('[distribution]', 'iOS distribution type for release builds (appstore, adhoc, or enterprise)')
60
- .option('-p, --project <name>', 'Nx project name (for workspace builds from root)')
60
+ .option('-p, --project <name>', 'Project name (for workspace builds from root)')
61
+ .option('-c, --nx-config <config>', 'Nx build configuration (e.g., prod, stg, dev)')
62
+ .option('--org <orgId>', 'Target organization id')
61
63
  .option('-t, --team-id <id>', 'Apple Developer Team ID (for iOS signing)')
62
64
  .option('-v, --version <version>', 'App version (e.g., 1.0.0)')
63
65
  .option('-b, --build-number <number>', 'Build number')
64
66
  .option('-n, --non-interactive', 'Run without prompts (use defaults/config file)')
67
+ // iOS signing credential flags
68
+ .option('--p12 <path>', 'Path to iOS .p12 certificate')
69
+ .option('--p12-password <password>', 'Password for .p12 certificate')
70
+ .option('--profile <path>', 'Path to iOS .mobileprovision file')
71
+ .option('--asc-key-id <id>', 'App Store Connect API Key ID')
72
+ .option('--asc-issuer-id <id>', 'App Store Connect Issuer ID')
73
+ .option('--asc-key <path>', 'Path to App Store Connect .p8 private key')
74
+ // Android package type flags (override distributionType logic)
75
+ .option('--apk', 'Build APK instead of AAB for Android (overrides distributionType)')
76
+ .option('--aab', 'Build AAB for Android (default for appstore, explicit override)')
65
77
  .action((platform, configuration, distribution, options) => build(platform, configuration, distribution, isVerbose, {
66
78
  project: options?.project,
79
+ nxConfiguration: options?.nxConfig,
80
+ org: options?.org,
67
81
  teamId: options?.teamId,
68
82
  version: options?.version,
69
83
  buildNumber: options?.buildNumber,
70
84
  nonInteractive: options?.nonInteractive,
85
+ p12Path: options?.p12,
86
+ p12Password: options?.p12Password,
87
+ profilePath: options?.profile,
88
+ ascKeyId: options?.ascKeyId,
89
+ ascIssuerId: options?.ascIssuerId,
90
+ ascKeyPath: options?.ascKey,
91
+ androidPackageType: options?.apk ? 'apk' : options?.aab ? 'aab' : undefined,
71
92
  }));
72
93
  program
73
94
  .command('build-status')
74
95
  .description('Check the status of a build')
75
96
  .argument('<buildId>', 'Build ID to check')
76
- .action((buildId) => buildStatus(buildId, isVerbose));
97
+ .option('--org <orgId>', 'Target organization id')
98
+ .action((buildId, options) => buildStatus(buildId, isVerbose, { org: options?.org }));
77
99
  program
78
100
  .command('submit')
79
101
  .description('Submit your app to app stores')
80
102
  .argument('[platform]', 'Target platform (android, ios or visionos)')
81
103
  .argument('[track]', 'Release track (production, beta, alpha, internal)')
82
- .action((platform, track) => submit(platform, track, isVerbose));
104
+ .option('--org <orgId>', 'Target organization id')
105
+ .option('-n, --non-interactive', 'Skip organization prompt (requires --org or previously selected org)')
106
+ .action((platform, track, options) => submit(platform, track, isVerbose, { org: options?.org, nonInteractive: options?.nonInteractive }));
83
107
  program
84
108
  .command('submit-status')
85
109
  .description('Check the status of a submission')
86
110
  .argument('<submitId>', 'Submission ID to check')
87
- .action((submitId) => submitStatus(submitId, isVerbose));
111
+ .option('--org <orgId>', 'Target organization id')
112
+ .action((submitId, options) => submitStatus(submitId, isVerbose, { org: options?.org }));
88
113
  program
89
114
  .command('update')
90
115
  .description('Publish over-the-air updates to deployed apps')
91
116
  .argument('[platform]', 'Target platform (android, ios or visionos)')
92
117
  .argument('[version]', 'Update version (e.g. 2.0.0)')
93
- .option('-p, --project <name>', 'Nx project name (for workspace builds from root)')
118
+ .option('-p, --project <name>', 'Project name (for workspace builds from root)')
119
+ .option('-c, --nx-config <config>', 'Nx build configuration (e.g., prod, stg, dev)')
120
+ .option('--org <orgId>', 'Target organization id')
94
121
  .option('-a, --app-id <id>', 'App identifier (bundle ID)')
95
122
  .option('-b, --build-number <number>', 'Build number')
96
123
  .option('-n, --non-interactive', 'Run without prompts (use defaults/config file)')
97
124
  .action((platform, version, options) => update(platform, version, isVerbose, {
98
125
  project: options?.project,
126
+ nxConfiguration: options?.nxConfig,
127
+ org: options?.org,
99
128
  appId: options?.appId,
100
129
  buildNumber: options?.buildNumber,
101
130
  nonInteractive: options?.nonInteractive,
@@ -104,7 +133,24 @@ program
104
133
  .command('update-status')
105
134
  .description('Check the status of an update')
106
135
  .argument('<updateId>', 'Update ID to check')
107
- .action((updateId) => updateStatus(updateId, isVerbose));
136
+ .option('--org <orgId>', 'Target organization id')
137
+ .action((updateId, options) => updateStatus(updateId, isVerbose, { org: options?.org }));
138
+ // Organization selection commands
139
+ const orgsCommand = program
140
+ .command('orgs')
141
+ .description('List and select the default organization used by the CLI');
142
+ orgsCommand
143
+ .command('list')
144
+ .description('List organizations you belong to')
145
+ .action(() => orgsList(isVerbose));
146
+ orgsCommand
147
+ .command('select')
148
+ .description('Select the default organization for the current environment')
149
+ .action(() => orgsSelect(isVerbose));
150
+ orgsCommand
151
+ .command('current')
152
+ .description('Show the current default organization for the current environment')
153
+ .action(() => orgsCurrent());
108
154
  const fingerprintCommand = program
109
155
  .command('fingerprint')
110
156
  .description('Fingerprint utilities for build/update compatibility checks');
@@ -151,5 +197,50 @@ program
151
197
  .command('billing-portal')
152
198
  .description('Open Stripe Billing Portal for the current organization')
153
199
  .action(() => billingPortal(isVerbose));
200
+ // Environment variables management commands
201
+ const envCommand = program
202
+ .command('env')
203
+ .description('Manage environment variables for build-time injection');
204
+ envCommand
205
+ .command('set')
206
+ .description('Set an environment variable')
207
+ .argument('<name>', 'Env var name (will be available at build time)')
208
+ .argument('<value>', 'Env var value')
209
+ .option('-p, --project <name>', 'Project name to scope this variable to')
210
+ .option('-v, --visibility <type>', 'Visibility type: plaintext | secret (default: secret)')
211
+ .action((name, value, options) => envSet(name, value, isVerbose, {
212
+ project: options?.project,
213
+ visibilityType: options?.visibility,
214
+ }));
215
+ envCommand
216
+ .command('set-file')
217
+ .description('Upload an environment file for build-time injection')
218
+ .argument('<name>', 'File identifier (e.g., .env.azconfig)')
219
+ .argument('<path>', 'Path to the local file to upload')
220
+ .option('-p, --project <name>', 'Project name to scope this file to')
221
+ .option('-d, --dest-path <path>', 'Destination path in CI (defaults to name)')
222
+ .option('-v, --visibility <type>', 'Visibility type: plaintext | secret (default: secret)')
223
+ .action((name, filePath, options) => envSetFile(name, filePath, isVerbose, {
224
+ project: options?.project,
225
+ destPath: options?.destPath,
226
+ visibilityType: options?.visibility,
227
+ }));
228
+ envCommand
229
+ .command('list')
230
+ .description('List all environment variables for a project')
231
+ .option('-p, --project <name>', 'Project name to filter by')
232
+ .action((options) => envList(isVerbose, { project: options?.project }));
233
+ envCommand
234
+ .command('delete')
235
+ .description('Delete an environment variable')
236
+ .argument('<name>', 'Env var name to delete')
237
+ .option('-p, --project <name>', 'Project name scope')
238
+ .action((name, options) => envDelete(name, isVerbose, { project: options?.project }));
239
+ envCommand
240
+ .command('delete-file')
241
+ .description('Delete an environment file')
242
+ .argument('<name>', 'File identifier to delete')
243
+ .option('-p, --project <name>', 'Project name scope')
244
+ .action((name, options) => envDeleteFile(name, isVerbose, { project: options?.project }));
154
245
  program.parse();
155
246
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,yEAAyE;AACzE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAC9D,IAAI,UAAU,GAAG,OAAO,CAAC;AACzB,IAAI,CAAC;IACH,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C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E,OAAO,EAAE,UAAU;CACpC,CAAC,CACH,CAAC;AAEJ,UAAU;KACP,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,8CAA8C,CAAC;KAC3D,MAAM,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;KAC3D,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AAE1E,UAAU;KACP,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,gCAAgC,CAAC;KAC7C,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;KAC5C,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;KACpD,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CACxB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAC1D,CAAC;AAEJ,UAAU;KACP,OAAO,CAAC,aAAa,CAAC;KACtB,WAAW,CAAC,4BAA4B,CAAC;KACzC,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;KAC/C,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;KACpD,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CACxB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAC9D,CAAC;AAEJ,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -195,4 +195,3 @@ export function configureAmplify(env = 'prod') {
195
195
  // so setting the storage afterwards guarantees our implementation sticks.
196
196
  cognitoUserPoolsTokenProvider.setKeyValueStorage(persistentStorage);
197
197
  }
198
- //# sourceMappingURL=amplify-config.js.map
@@ -0,0 +1,15 @@
1
+ import type { NorrixCliEnv } from './defaults.js';
2
+ type CliProfile = {
3
+ selectedOrgId?: string;
4
+ selectedAt?: string;
5
+ };
6
+ type CliSettings = {
7
+ profiles?: Record<string, CliProfile>;
8
+ };
9
+ export declare function cliProfileKey(env: NorrixCliEnv, apiUrl: string): string;
10
+ export declare function readCliSettings(): CliSettings;
11
+ export declare function writeCliSettings(settings: CliSettings): void;
12
+ export declare function getSelectedOrgId(env: NorrixCliEnv, apiUrl: string): string | undefined;
13
+ export declare function setSelectedOrgId(env: NorrixCliEnv, apiUrl: string, orgId: string): void;
14
+ export declare function clearSelectedOrgId(env: NorrixCliEnv, apiUrl: string): void;
15
+ export {};
@@ -0,0 +1,50 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import * as os from 'os';
4
+ const CONFIG_DIR = path.join(os.homedir(), '.config', 'norrix');
5
+ const SETTINGS_FILE = path.join(CONFIG_DIR, 'cli-config.json');
6
+ function ensureDir() {
7
+ fs.mkdirSync(CONFIG_DIR, { recursive: true });
8
+ }
9
+ export function cliProfileKey(env, apiUrl) {
10
+ return `${env}|${apiUrl}`;
11
+ }
12
+ export function readCliSettings() {
13
+ try {
14
+ if (!fs.existsSync(SETTINGS_FILE))
15
+ return {};
16
+ const raw = fs.readFileSync(SETTINGS_FILE, 'utf8');
17
+ const parsed = JSON.parse(raw);
18
+ return parsed && typeof parsed === 'object' ? parsed : {};
19
+ }
20
+ catch {
21
+ return {};
22
+ }
23
+ }
24
+ export function writeCliSettings(settings) {
25
+ ensureDir();
26
+ fs.writeFileSync(SETTINGS_FILE, JSON.stringify(settings ?? {}, null, 2), 'utf8');
27
+ }
28
+ export function getSelectedOrgId(env, apiUrl) {
29
+ const key = cliProfileKey(env, apiUrl);
30
+ const settings = readCliSettings();
31
+ const orgId = settings?.profiles?.[key]?.selectedOrgId;
32
+ const v = (orgId ?? '').toString().trim();
33
+ return v ? v : undefined;
34
+ }
35
+ export function setSelectedOrgId(env, apiUrl, orgId) {
36
+ const key = cliProfileKey(env, apiUrl);
37
+ const settings = readCliSettings();
38
+ const profiles = settings.profiles ?? {};
39
+ profiles[key] = { selectedOrgId: orgId, selectedAt: new Date().toISOString() };
40
+ writeCliSettings({ ...settings, profiles });
41
+ }
42
+ export function clearSelectedOrgId(env, apiUrl) {
43
+ const key = cliProfileKey(env, apiUrl);
44
+ const settings = readCliSettings();
45
+ const profiles = settings.profiles ?? {};
46
+ if (profiles[key]) {
47
+ delete profiles[key];
48
+ writeCliSettings({ ...settings, profiles });
49
+ }
50
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-settings.js","sourceRoot":"","sources":["../../src/lib/cli-settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAYzB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAChE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE/D,SAAS,SAAS;IAChB,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAiB,EAAE,MAAc;IAC7D,OAAO,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC;YAAE,OAAO,EAAE,CAAC;QAC7C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;QAC9C,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ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,MAAM,UAAU,kBAAkB,CAAC,GAAiB,EAAE,MAAc;IAClE,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;IACzC,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;QACrB,gBAAgB,CAAC,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
@@ -8,6 +8,9 @@ import type { NorrixCliEnv } from './defaults.js';
8
8
  * - Computes the API base URL used by commands
9
9
  */
10
10
  export declare function initNorrixCli(env?: NorrixCliEnv): void;
11
+ export declare function orgsList(verbose?: boolean): Promise<void>;
12
+ export declare function orgsSelect(verbose?: boolean): Promise<void>;
13
+ export declare function orgsCurrent(): Promise<void>;
11
14
  export declare function printFingerprint(cliPlatformArg?: string, appId?: string, verbose?: boolean): Promise<void>;
12
15
  export declare function compareFingerprint(fromId: string, toArg?: string, verbose?: boolean): Promise<void>;
13
16
  /**
@@ -16,6 +19,10 @@ export declare function compareFingerprint(fromId: string, toArg?: string, verbo
16
19
  export interface BuildOptions {
17
20
  /** Nx project name (for workspace builds from root) */
18
21
  project?: string;
22
+ /** Nx build configuration (e.g., 'prod', 'stg', 'dev') */
23
+ nxConfiguration?: string;
24
+ /** Target organization id (overrides persisted selection) */
25
+ org?: string;
19
26
  /** Apple Developer Team ID (for iOS signing) */
20
27
  teamId?: string;
21
28
  /** App version override */
@@ -24,6 +31,20 @@ export interface BuildOptions {
24
31
  buildNumber?: string;
25
32
  /** Skip confirmation prompts (use defaults/config file) */
26
33
  nonInteractive?: boolean;
34
+ /** Path to iOS .p12 certificate */
35
+ p12Path?: string;
36
+ /** Password for .p12 certificate */
37
+ p12Password?: string;
38
+ /** Path to iOS .mobileprovision file */
39
+ profilePath?: string;
40
+ /** App Store Connect API Key ID */
41
+ ascKeyId?: string;
42
+ /** App Store Connect Issuer ID */
43
+ ascIssuerId?: string;
44
+ /** Path to App Store Connect .p8 private key */
45
+ ascKeyPath?: string;
46
+ /** Android package type override (apk or aab) - takes precedence over distributionType */
47
+ androidPackageType?: 'apk' | 'aab';
27
48
  }
28
49
  /**
29
50
  * Build command implementation
@@ -34,13 +55,20 @@ export declare function build(cliPlatformArg?: string, cliConfigurationArg?: str
34
55
  * Submit command implementation
35
56
  * Submits the built app to app stores via the Next.js API gateway
36
57
  */
37
- export declare function submit(cliPlatformArg?: string, cliTrackArg?: string, verbose?: boolean): Promise<void>;
58
+ export declare function submit(cliPlatformArg?: string, cliTrackArg?: string, verbose?: boolean, options?: {
59
+ org?: string;
60
+ nonInteractive?: boolean;
61
+ }): Promise<void>;
38
62
  /**
39
63
  * Update command options passed from CLI flags
40
64
  */
41
65
  export interface UpdateOptions {
42
66
  /** Nx project name (for workspace builds from root) */
43
67
  project?: string;
68
+ /** Nx build configuration (e.g., 'prod', 'stg', 'dev') */
69
+ nxConfiguration?: string;
70
+ /** Target organization id (overrides persisted selection) */
71
+ org?: string;
44
72
  /** App identifier (bundle ID) */
45
73
  appId?: string;
46
74
  /** Build number override */
@@ -57,17 +85,23 @@ export declare function update(cliPlatformArg?: string, cliVersionArg?: string,
57
85
  * Build Status command implementation
58
86
  * Checks the status of a build via the Next.js API gateway
59
87
  */
60
- export declare function buildStatus(buildId: string, verbose?: boolean): Promise<void>;
88
+ export declare function buildStatus(buildId: string, verbose?: boolean, options?: {
89
+ org?: string;
90
+ }): Promise<void>;
61
91
  /**
62
92
  * Submit Status command implementation
63
93
  * Checks the status of a submission via the Next.js API gateway
64
94
  */
65
- export declare function submitStatus(submitId: string, verbose?: boolean): Promise<void>;
95
+ export declare function submitStatus(submitId: string, verbose?: boolean, options?: {
96
+ org?: string;
97
+ }): Promise<void>;
66
98
  /**
67
99
  * Update Status command implementation
68
100
  * Checks the status of an update via the Next.js API gateway
69
101
  */
70
- export declare function updateStatus(updateId: string, verbose?: boolean): Promise<void>;
102
+ export declare function updateStatus(updateId: string, verbose?: boolean, options?: {
103
+ org?: string;
104
+ }): Promise<void>;
71
105
  /**
72
106
  * Sign-In command implementation (email / password via Cognito)
73
107
  */
@@ -94,3 +128,39 @@ export declare function billingCheckout(priceId?: string, verbose?: boolean): Pr
94
128
  * Open Stripe billing portal for the current organization
95
129
  */
96
130
  export declare function billingPortal(verbose?: boolean): Promise<void>;
131
+ export type EnvVisibilityType = 'plaintext' | 'secret';
132
+ export interface EnvSetOptions {
133
+ project?: string;
134
+ visibilityType?: string;
135
+ }
136
+ export interface EnvSetFileOptions {
137
+ project?: string;
138
+ destPath?: string;
139
+ visibilityType?: string;
140
+ }
141
+ export interface EnvListOptions {
142
+ project?: string;
143
+ }
144
+ export interface EnvDeleteOptions {
145
+ project?: string;
146
+ }
147
+ /**
148
+ * Set an environment variable for build-time injection
149
+ */
150
+ export declare function envSet(name: string, value: string, verbose?: boolean, options?: EnvSetOptions): Promise<void>;
151
+ /**
152
+ * Upload an environment file for build-time injection
153
+ */
154
+ export declare function envSetFile(name: string, filePath: string, verbose?: boolean, options?: EnvSetFileOptions): Promise<void>;
155
+ /**
156
+ * List all environment variables/files for a project
157
+ */
158
+ export declare function envList(verbose?: boolean, options?: EnvListOptions): Promise<void>;
159
+ /**
160
+ * Delete an environment variable
161
+ */
162
+ export declare function envDelete(name: string, verbose?: boolean, options?: EnvDeleteOptions): Promise<void>;
163
+ /**
164
+ * Delete an environment file
165
+ */
166
+ export declare function envDeleteFile(name: string, verbose?: boolean, options?: EnvDeleteOptions): Promise<void>;