@startanaicompany/cli 1.4.12 → 1.4.13
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/CLAUDE.md +2 -2
- package/OAUTH_FIX_COMPLETE.md +0 -0
- package/PUBLISHING.md +0 -0
- package/README.md +0 -0
- package/auth_session_update.md +0 -0
- package/bin/saac.js +0 -1
- package/create-application-update.md +0 -0
- package/git_auth.md +0 -0
- package/package.json +1 -1
- package/src/commands/create.js +25 -39
- package/src/commands/delete.js +0 -0
- package/src/commands/deploy.js +0 -0
- package/src/commands/domain.js +0 -0
- package/src/commands/env.js +0 -0
- package/src/commands/git.js +0 -0
- package/src/commands/init.js +0 -0
- package/src/commands/list.js +0 -0
- package/src/commands/login.js +0 -0
- package/src/commands/logout.js +0 -0
- package/src/commands/logoutAll.js +0 -0
- package/src/commands/logs.js +0 -0
- package/src/commands/manual.js +0 -0
- package/src/commands/register.js +0 -0
- package/src/commands/sessions.js +0 -0
- package/src/commands/status.js +0 -0
- package/src/commands/update.js +11 -3
- package/src/commands/verify.js +0 -0
- package/src/commands/whoami.js +0 -0
- package/src/lib/api.js +0 -0
- package/src/lib/config.js +0 -0
- package/src/lib/logger.js +0 -0
- package/src/lib/oauth.js +0 -0
- package/test-session-token.js +0 -0
package/CLAUDE.md
CHANGED
|
@@ -493,7 +493,7 @@ The wrapper API expects Git repositories to be hosted on the StartAnAiCompany Gi
|
|
|
493
493
|
- During registration, Gitea username can be auto-detected or manually provided
|
|
494
494
|
- Applications reference repositories in the format: `git@git.startanaicompany.com:user/repo.git`
|
|
495
495
|
|
|
496
|
-
## Current Status - Version 1.4.
|
|
496
|
+
## Current Status - Version 1.4.13
|
|
497
497
|
|
|
498
498
|
### Completed Features
|
|
499
499
|
|
|
@@ -706,4 +706,4 @@ Before publishing to npm:
|
|
|
706
706
|
- `dotenv` - Environment variables
|
|
707
707
|
- `open` - Open browser for OAuth (v8.4.2 for compatibility with chalk v4)
|
|
708
708
|
|
|
709
|
-
**Version:** 1.4.
|
|
709
|
+
**Version:** 1.4.13 (current)
|
package/OAUTH_FIX_COMPLETE.md
CHANGED
|
File without changes
|
package/PUBLISHING.md
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/auth_session_update.md
CHANGED
|
File without changes
|
package/bin/saac.js
CHANGED
|
@@ -117,7 +117,6 @@ program
|
|
|
117
117
|
// Required options
|
|
118
118
|
.option('-s, --subdomain <subdomain>', 'Subdomain')
|
|
119
119
|
.option('-r, --repository <url>', 'Git repository URL (SSH format)')
|
|
120
|
-
.option('-t, --git-token <token>', 'Git API token')
|
|
121
120
|
// Basic options
|
|
122
121
|
.option('-b, --branch <branch>', 'Git branch', 'master')
|
|
123
122
|
.option('-d, --domain-suffix <suffix>', 'Domain suffix', 'startanaicompany.com')
|
|
File without changes
|
package/git_auth.md
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/commands/create.js
CHANGED
|
@@ -29,7 +29,6 @@ async function create(name, options) {
|
|
|
29
29
|
logger.info('Required options:');
|
|
30
30
|
logger.log(' -s, --subdomain <subdomain> Subdomain for your app');
|
|
31
31
|
logger.log(' -r, --repository <url> Git repository URL (SSH format)');
|
|
32
|
-
logger.log(' -t, --git-token <token> Git API token (optional if OAuth connected)');
|
|
33
32
|
logger.newline();
|
|
34
33
|
logger.info('Optional options:');
|
|
35
34
|
logger.log(' -b, --branch <branch> Git branch (default: master)');
|
|
@@ -51,9 +50,9 @@ async function create(name, options) {
|
|
|
51
50
|
logger.log(' --env <KEY=VALUE> Environment variable (can be used multiple times)');
|
|
52
51
|
logger.newline();
|
|
53
52
|
logger.info('Example:');
|
|
54
|
-
logger.log(' saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git
|
|
55
|
-
logger.log(' saac create api -s api -r git@git...
|
|
56
|
-
logger.log(' saac create web -s web -r git@git...
|
|
53
|
+
logger.log(' saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git');
|
|
54
|
+
logger.log(' saac create api -s api -r git@git... --build-pack nixpacks --port 8080');
|
|
55
|
+
logger.log(' saac create web -s web -r git@git... --health-check --pre-deploy-cmd "npm run migrate"');
|
|
57
56
|
process.exit(1);
|
|
58
57
|
}
|
|
59
58
|
|
|
@@ -62,7 +61,8 @@ async function create(name, options) {
|
|
|
62
61
|
logger.newline();
|
|
63
62
|
logger.info('Example:');
|
|
64
63
|
logger.log(` saac create ${name} -s myapp -r git@git.startanaicompany.com:user/repo.git`);
|
|
65
|
-
logger.
|
|
64
|
+
logger.newline();
|
|
65
|
+
logger.info('Note: Git OAuth connection required. Connect with: saac git connect');
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -77,36 +77,16 @@ async function create(name, options) {
|
|
|
77
77
|
if (connection) {
|
|
78
78
|
logger.success(`Using connected account: ${connection.gitUsername}@${connection.gitHost}`);
|
|
79
79
|
logger.newline();
|
|
80
|
-
} else
|
|
81
|
-
// No OAuth connection
|
|
82
|
-
logger.
|
|
80
|
+
} else {
|
|
81
|
+
// No OAuth connection - must connect
|
|
82
|
+
logger.error(`Git account not connected for ${gitHost}`);
|
|
83
83
|
logger.newline();
|
|
84
|
-
|
|
85
|
-
const { shouldConnect } = await inquirer.prompt([
|
|
86
|
-
{
|
|
87
|
-
type: 'confirm',
|
|
88
|
-
name: 'shouldConnect',
|
|
89
|
-
message: 'Would you like to connect now?',
|
|
90
|
-
default: true,
|
|
91
|
-
},
|
|
92
|
-
]);
|
|
93
|
-
|
|
94
|
-
if (!shouldConnect) {
|
|
95
|
-
logger.newline();
|
|
96
|
-
logger.error('Cannot create application without Git authentication');
|
|
97
|
-
logger.newline();
|
|
98
|
-
logger.info('Options:');
|
|
99
|
-
logger.log(' 1. Connect Git account: saac git connect');
|
|
100
|
-
logger.log(' 2. Provide token: saac create ... --git-token <token>');
|
|
101
|
-
process.exit(1);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Initiate OAuth flow
|
|
105
|
-
await oauth.connectGitAccount(gitHost, user.sessionToken || user.apiKey);
|
|
106
|
-
|
|
84
|
+
logger.info('Git OAuth connection is required to create applications');
|
|
107
85
|
logger.newline();
|
|
108
|
-
logger.
|
|
86
|
+
logger.info('Connect now:');
|
|
87
|
+
logger.log(' saac git connect');
|
|
109
88
|
logger.newline();
|
|
89
|
+
process.exit(1);
|
|
110
90
|
}
|
|
111
91
|
|
|
112
92
|
// Build application payload
|
|
@@ -118,10 +98,8 @@ async function create(name, options) {
|
|
|
118
98
|
git_branch: options.branch || 'master',
|
|
119
99
|
};
|
|
120
100
|
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
appData.git_api_token = options.gitToken;
|
|
124
|
-
}
|
|
101
|
+
// OAuth tokens are retrieved from database by wrapper
|
|
102
|
+
// No manual git_api_token field needed
|
|
125
103
|
|
|
126
104
|
// Optional: Port configuration
|
|
127
105
|
if (options.port) {
|
|
@@ -304,9 +282,17 @@ async function create(name, options) {
|
|
|
304
282
|
logger.error('Validation failed');
|
|
305
283
|
if (data.details) {
|
|
306
284
|
logger.newline();
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
285
|
+
// Backend sends details as array: [{field, message, type}, ...]
|
|
286
|
+
if (Array.isArray(data.details)) {
|
|
287
|
+
data.details.forEach((detail) => {
|
|
288
|
+
logger.log(` ${logger.chalk.yellow(detail.field)}: ${detail.message}`);
|
|
289
|
+
});
|
|
290
|
+
} else {
|
|
291
|
+
// Fallback for object format: {field: message, ...}
|
|
292
|
+
Object.entries(data.details).forEach(([field, message]) => {
|
|
293
|
+
logger.log(` ${logger.chalk.yellow(field)}: ${message}`);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
310
296
|
} else {
|
|
311
297
|
logger.log(` ${data.message || data.error}`);
|
|
312
298
|
}
|
package/src/commands/delete.js
CHANGED
|
File without changes
|
package/src/commands/deploy.js
CHANGED
|
File without changes
|
package/src/commands/domain.js
CHANGED
|
File without changes
|
package/src/commands/env.js
CHANGED
|
File without changes
|
package/src/commands/git.js
CHANGED
|
File without changes
|
package/src/commands/init.js
CHANGED
|
File without changes
|
package/src/commands/list.js
CHANGED
|
File without changes
|
package/src/commands/login.js
CHANGED
|
File without changes
|
package/src/commands/logout.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/commands/logs.js
CHANGED
|
File without changes
|
package/src/commands/manual.js
CHANGED
|
File without changes
|
package/src/commands/register.js
CHANGED
|
File without changes
|
package/src/commands/sessions.js
CHANGED
|
File without changes
|
package/src/commands/status.js
CHANGED
|
File without changes
|
package/src/commands/update.js
CHANGED
|
@@ -259,9 +259,17 @@ async function update(options) {
|
|
|
259
259
|
logger.error('Validation failed');
|
|
260
260
|
if (data.details) {
|
|
261
261
|
logger.newline();
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
// Backend sends details as array: [{field, message, type}, ...]
|
|
263
|
+
if (Array.isArray(data.details)) {
|
|
264
|
+
data.details.forEach((detail) => {
|
|
265
|
+
logger.log(` ${logger.chalk.yellow(detail.field)}: ${detail.message}`);
|
|
266
|
+
});
|
|
267
|
+
} else {
|
|
268
|
+
// Fallback for object format: {field: message, ...}
|
|
269
|
+
Object.entries(data.details).forEach(([field, message]) => {
|
|
270
|
+
logger.log(` ${logger.chalk.yellow(field)}: ${message}`);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
265
273
|
} else {
|
|
266
274
|
logger.log(` ${data.message || data.error}`);
|
|
267
275
|
}
|
package/src/commands/verify.js
CHANGED
|
File without changes
|
package/src/commands/whoami.js
CHANGED
|
File without changes
|
package/src/lib/api.js
CHANGED
|
File without changes
|
package/src/lib/config.js
CHANGED
|
File without changes
|
package/src/lib/logger.js
CHANGED
|
File without changes
|
package/src/lib/oauth.js
CHANGED
|
File without changes
|
package/test-session-token.js
CHANGED
|
File without changes
|