@intranefr/superbackend 1.7.7 → 1.7.9

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 (119) hide show
  1. package/.beads/.br_history/issues.20260314_212352_900045509.jsonl +0 -0
  2. package/.beads/.br_history/issues.20260314_212352_900045509.jsonl.meta.json +1 -0
  3. package/.beads/.br_history/issues.20260314_212353_087140743.jsonl +1 -0
  4. package/.beads/.br_history/issues.20260314_212353_087140743.jsonl.meta.json +1 -0
  5. package/.beads/.br_history/issues.20260314_212353_285881504.jsonl +2 -0
  6. package/.beads/.br_history/issues.20260314_212353_285881504.jsonl.meta.json +1 -0
  7. package/.beads/.br_history/issues.20260314_212353_473915419.jsonl +3 -0
  8. package/.beads/.br_history/issues.20260314_212353_473915419.jsonl.meta.json +1 -0
  9. package/.beads/.br_history/issues.20260314_212353_659476307.jsonl +4 -0
  10. package/.beads/.br_history/issues.20260314_212353_659476307.jsonl.meta.json +1 -0
  11. package/.beads/.br_history/issues.20260314_212353_869998925.jsonl +5 -0
  12. package/.beads/.br_history/issues.20260314_212353_869998925.jsonl.meta.json +1 -0
  13. package/.beads/.br_history/issues.20260314_212354_054785029.jsonl +6 -0
  14. package/.beads/.br_history/issues.20260314_212354_054785029.jsonl.meta.json +1 -0
  15. package/.beads/.br_history/issues.20260314_213336_175893691.jsonl +7 -0
  16. package/.beads/.br_history/issues.20260314_213336_175893691.jsonl.meta.json +1 -0
  17. package/.beads/.br_history/issues.20260314_213336_338509797.jsonl +7 -0
  18. package/.beads/.br_history/issues.20260314_213336_338509797.jsonl.meta.json +1 -0
  19. package/.beads/.br_history/issues.20260314_213336_515443192.jsonl +7 -0
  20. package/.beads/.br_history/issues.20260314_213336_515443192.jsonl.meta.json +1 -0
  21. package/.beads/.br_history/issues.20260314_213336_676417592.jsonl +7 -0
  22. package/.beads/.br_history/issues.20260314_213336_676417592.jsonl.meta.json +1 -0
  23. package/.beads/.br_history/issues.20260314_213336_839182422.jsonl +7 -0
  24. package/.beads/.br_history/issues.20260314_213336_839182422.jsonl.meta.json +1 -0
  25. package/.beads/.br_history/issues.20260314_213337_004349113.jsonl +7 -0
  26. package/.beads/.br_history/issues.20260314_213337_004349113.jsonl.meta.json +1 -0
  27. package/.beads/.br_history/issues.20260314_213337_179824080.jsonl +7 -0
  28. package/.beads/.br_history/issues.20260314_213337_179824080.jsonl.meta.json +1 -0
  29. package/.beads/.br_history/issues.20260314_213701_705075332.jsonl +7 -0
  30. package/.beads/.br_history/issues.20260314_213701_705075332.jsonl.meta.json +1 -0
  31. package/.beads/.br_history/issues.20260314_213706_783128702.jsonl +8 -0
  32. package/.beads/.br_history/issues.20260314_213706_783128702.jsonl.meta.json +1 -0
  33. package/.beads/config.yaml +4 -0
  34. package/.beads/issues.jsonl +8 -0
  35. package/.beads/metadata.json +4 -0
  36. package/.env.example +8 -0
  37. package/autochangelog/.env.example +36 -0
  38. package/autochangelog/README.md +412 -0
  39. package/autochangelog/config/database.js +27 -0
  40. package/autochangelog/package.json +47 -0
  41. package/autochangelog/public/landing.html +581 -0
  42. package/autochangelog/server.js +104 -0
  43. package/autochangelog/src/app.js +181 -0
  44. package/autochangelog/src/config/database.js +26 -0
  45. package/autochangelog/src/controllers/auth.js +488 -0
  46. package/autochangelog/src/controllers/changelog.js +682 -0
  47. package/autochangelog/src/controllers/project.js +580 -0
  48. package/autochangelog/src/controllers/repository.js +780 -0
  49. package/autochangelog/src/middleware/auth.js +386 -0
  50. package/autochangelog/src/models/Changelog.js +443 -0
  51. package/autochangelog/src/models/Project.js +226 -0
  52. package/autochangelog/src/models/Repository.js +366 -0
  53. package/autochangelog/src/models/User.js +223 -0
  54. package/autochangelog/src/routes/auth.routes.js +32 -0
  55. package/autochangelog/src/routes/changelog.routes.js +42 -0
  56. package/autochangelog/src/routes/github-auth.routes.js +102 -0
  57. package/autochangelog/src/routes/project.routes.js +50 -0
  58. package/autochangelog/src/routes/repository.routes.js +54 -0
  59. package/autochangelog/src/services/changelog.js +722 -0
  60. package/autochangelog/src/services/github.js +243 -0
  61. package/autochangelog/utils/logger.js +77 -0
  62. package/autochangelog/views/404.ejs +18 -0
  63. package/autochangelog/views/dashboard.ejs +596 -0
  64. package/autochangelog/views/index.ejs +231 -0
  65. package/autochangelog/views/layouts/main.ejs +44 -0
  66. package/autochangelog/views/login.ejs +104 -0
  67. package/autochangelog/views/partials/footer.ejs +20 -0
  68. package/autochangelog/views/partials/navbar.ejs +51 -0
  69. package/autochangelog/views/register.ejs +109 -0
  70. package/autochangelog-cli/README.md +266 -0
  71. package/autochangelog-cli/bin/autochangelog +120 -0
  72. package/autochangelog-cli/package.json +46 -0
  73. package/autochangelog-cli/src/cli/commands/auth.js +291 -0
  74. package/autochangelog-cli/src/cli/commands/changelog.js +619 -0
  75. package/autochangelog-cli/src/cli/commands/project.js +427 -0
  76. package/autochangelog-cli/src/cli/commands/repo.js +557 -0
  77. package/autochangelog-cli/src/cli/commands/stats.js +706 -0
  78. package/autochangelog-cli/src/cli/utils/config.js +277 -0
  79. package/autochangelog-cli/src/cli/utils/errors.js +307 -0
  80. package/autochangelog-cli/src/cli/utils/logger.js +75 -0
  81. package/autochangelog-cli/src/cli/utils/output.js +357 -0
  82. package/package.json +8 -3
  83. package/plugins/supercli/README.md +108 -0
  84. package/plugins/supercli/plugin.json +123 -0
  85. package/server.js +1 -1
  86. package/src/cli/api.js +380 -0
  87. package/src/cli/direct/agent-utils.js +61 -0
  88. package/src/cli/direct/cli-utils.js +112 -0
  89. package/src/cli/direct/data-seeding.js +307 -0
  90. package/src/cli/direct/db-admin.js +84 -0
  91. package/src/cli/direct/db-advanced.js +372 -0
  92. package/src/cli/direct/db-utils.js +558 -0
  93. package/src/cli/direct/help.js +195 -0
  94. package/src/cli/direct/migration.js +107 -0
  95. package/src/cli/direct/rbac-advanced.js +132 -0
  96. package/src/cli/direct/resources-additional.js +400 -0
  97. package/src/cli/direct/resources-cms-advanced.js +173 -0
  98. package/src/cli/direct/resources-cms.js +247 -0
  99. package/src/cli/direct/resources-core.js +253 -0
  100. package/src/cli/direct/resources-execution.js +367 -0
  101. package/src/cli/direct/resources-health.js +152 -0
  102. package/src/cli/direct/resources-integrations.js +182 -0
  103. package/src/cli/direct/resources-logs.js +204 -0
  104. package/src/cli/direct/resources-org-rbac.js +187 -0
  105. package/src/cli/direct/resources-system.js +236 -0
  106. package/src/cli/direct.js +556 -0
  107. package/src/controllers/admin.controller.js +4 -0
  108. package/src/controllers/auth.controller.js +148 -1
  109. package/src/controllers/waitingList.controller.js +130 -1
  110. package/src/models/RbacRole.js +1 -1
  111. package/src/models/User.js +39 -5
  112. package/src/routes/auth.routes.js +6 -0
  113. package/src/routes/waitingList.routes.js +12 -2
  114. package/src/routes/waitingListAdmin.routes.js +3 -0
  115. package/src/services/email.service.js +1 -0
  116. package/src/services/github.service.js +255 -0
  117. package/src/services/rateLimiter.service.js +29 -1
  118. package/src/services/waitingListJson.service.js +32 -3
  119. package/views/admin-waiting-list.ejs +386 -3
@@ -0,0 +1,266 @@
1
+ # AutoChangelog CLI
2
+
3
+ Agent-friendly command-line interface for the AutoChangelog platform.
4
+
5
+ ## Features
6
+
7
+ - **Authentication Management**: Secure GitHub authentication with token management
8
+ - **Project Management**: Create, list, update, and delete projects
9
+ - **Repository Management**: Add, list, update, and remove repositories
10
+ - **Changelog Generation**: Generate changelogs with customizable options
11
+ - **Statistics & Utilities**: System info, health checks, and usage statistics
12
+ - **Agent-Friendly**: JSON output, error handling, and structured responses
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install -g autochangelog-cli
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ### Authentication
23
+
24
+ First, authenticate with GitHub:
25
+
26
+ ```bash
27
+ autochangelog auth login
28
+ ```
29
+
30
+ ### Create a Project
31
+
32
+ ```bash
33
+ autochangelog project create --name "My Project" --plan free
34
+ ```
35
+
36
+ ### Add a Repository
37
+
38
+ ```bash
39
+ autochangelog repo add --project-id <project-id> --repo "owner/repo-name"
40
+ ```
41
+
42
+ ### Generate a Changelog
43
+
44
+ ```bash
45
+ autochangelog changelog generate --project-id <project-id> --repo "owner/repo-name" --format markdown
46
+ ```
47
+
48
+ ## Commands
49
+
50
+ ### Authentication
51
+
52
+ ```bash
53
+ # Login with GitHub
54
+ autochangelog auth login
55
+
56
+ # Check authentication status
57
+ autochangelog auth status
58
+
59
+ # Get current token
60
+ autochangelog auth token
61
+
62
+ # Logout
63
+ autochangelog auth logout
64
+ ```
65
+
66
+ ### Projects
67
+
68
+ ```bash
69
+ # Create a new project
70
+ autochangelog project create --name "Project Name" --plan free
71
+
72
+ # List all projects
73
+ autochangelog project list
74
+
75
+ # Get project details
76
+ autochangelog project get <project-id>
77
+
78
+ # Update a project
79
+ autochangelog project update <project-id> --name "New Name"
80
+
81
+ # Delete a project
82
+ autochangelog project delete <project-id>
83
+ ```
84
+
85
+ ### Repositories
86
+
87
+ ```bash
88
+ # Add a repository to a project
89
+ autochangelog repo add --project-id <project-id> --repo "owner/repo-name"
90
+
91
+ # List repositories for a project
92
+ autochangelog repo list --project-id <project-id>
93
+
94
+ # Get repository details
95
+ autochangelog repo get <repo-id>
96
+
97
+ # Update a repository
98
+ autochangelog repo update <repo-id> --private true
99
+
100
+ # Remove a repository
101
+ autochangelog repo remove <repo-id>
102
+ ```
103
+
104
+ ### Changelogs
105
+
106
+ ```bash
107
+ # Generate a changelog
108
+ autochangelog changelog generate --project-id <project-id> --repo "owner/repo-name" --format markdown
109
+
110
+ # List changelogs for a project
111
+ autochangelog changelog list --project-id <project-id>
112
+
113
+ # Get changelog details
114
+ autochangelog changelog get <changelog-id>
115
+
116
+ # Update a changelog
117
+ autochangelog changelog update <changelog-id> --public true
118
+
119
+ # Delete a changelog
120
+ autochangelog changelog delete <changelog-id>
121
+ ```
122
+
123
+ ### Statistics
124
+
125
+ ```bash
126
+ # Show system information
127
+ autochangelog stats system
128
+
129
+ # Check system health
130
+ autochangelog stats health
131
+
132
+ # Show project statistics
133
+ autochangelog stats project <project-id> --detailed
134
+
135
+ # Show usage statistics
136
+ autochangelog stats usage
137
+ ```
138
+
139
+ ## Options
140
+
141
+ ### Global Options
142
+
143
+ - `--json`: Output in JSON format (default in non-TTY)
144
+ - `--verbose`: Enable verbose logging
145
+ - `--no-color`: Disable colored output
146
+ - `--config <path>`: Path to config file
147
+ - `--timeout <ms>`: Request timeout in milliseconds
148
+
149
+ ### Authentication Options
150
+
151
+ - `--token <token>`: GitHub personal access token
152
+ - `--scopes <scopes>`: Required scopes (default: repo,user)
153
+
154
+ ### Project Options
155
+
156
+ - `--name <name>`: Project name
157
+ - `--plan <plan>`: Project plan (free, pro, enterprise)
158
+ - `--description <desc>`: Project description
159
+
160
+ ### Repository Options
161
+
162
+ - `--repo <repo>`: Repository in format "owner/repo-name"
163
+ - `--private <bool>`: Whether repository is private
164
+ - `--sync <bool>`: Whether to sync repository
165
+
166
+ ### Changelog Options
167
+
168
+ - `--format <format>`: Output format (markdown, json, html)
169
+ - `--public <bool>`: Whether changelog is public
170
+ - `--template <template>`: Custom template name
171
+ - `--from <date>`: Start date for changelog
172
+ - `--to <date>`: End date for changelog
173
+
174
+ ## Configuration
175
+
176
+ The CLI stores configuration in `~/.autochangelog/config.json`:
177
+
178
+ ```json
179
+ {
180
+ "github_token": "ghp_...",
181
+ "api_base_url": "https://api.autochangelog.com",
182
+ "timeout": 30000,
183
+ "default_format": "markdown"
184
+ }
185
+ ```
186
+
187
+ ## Environment Variables
188
+
189
+ - `AUTOCHANGELOG_API_URL`: API base URL
190
+ - `AUTOCHANGELOG_GITHUB_TOKEN`: GitHub token
191
+ - `AUTOCHANGELOG_CONFIG_PATH`: Config file path
192
+ - `AUTOCHANGELOG_CACHE_PATH`: Cache directory path
193
+
194
+ ## Error Handling
195
+
196
+ The CLI provides structured error responses:
197
+
198
+ ```json
199
+ {
200
+ "error": {
201
+ "message": "Authentication failed",
202
+ "type": "authentication_failed",
203
+ "code": 401,
204
+ "details": {
205
+ "stack": "..."
206
+ },
207
+ "suggestions": [
208
+ "Check your GitHub token",
209
+ "Run 'autochangelog auth login'"
210
+ ],
211
+ "recoverable": true,
212
+ "retry_after": null
213
+ }
214
+ }
215
+ ```
216
+
217
+ ## JSON Output
218
+
219
+ For automation and scripting, use the `--json` flag:
220
+
221
+ ```bash
222
+ autochangelog project list --json
223
+ ```
224
+
225
+ ## Development
226
+
227
+ ### Running from Source
228
+
229
+ ```bash
230
+ cd autochangelog-cli
231
+ npm install
232
+ node bin/autochangelog --help
233
+ ```
234
+
235
+ ### Testing
236
+
237
+ ```bash
238
+ npm test
239
+ ```
240
+
241
+ ### Building
242
+
243
+ ```bash
244
+ npm run build
245
+ ```
246
+
247
+ ## Contributing
248
+
249
+ 1. Fork the repository
250
+ 2. Create a feature branch
251
+ 3. Make your changes
252
+ 4. Add tests for new functionality
253
+ 5. Run the test suite
254
+ 6. Submit a pull request
255
+
256
+ ## License
257
+
258
+ MIT License - see LICENSE file for details.
259
+
260
+ ## Support
261
+
262
+ For support and questions:
263
+
264
+ - Create an issue on GitHub
265
+ - Check the documentation
266
+ - Contact the development team
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * AutoChangelog CLI Entry Point
5
+ * Agent-friendly command-line interface for AutoChangelog platform
6
+ */
7
+
8
+ // Ensure we're using the correct Node.js version
9
+ const { engines } = require('../package.json');
10
+ const semver = require('semver');
11
+
12
+ if (!semver.satisfies(process.version, engines.node)) {
13
+ console.error(`❌ Node.js ${engines.node} is required. You are using ${process.version}`);
14
+ process.exit(1);
15
+ }
16
+
17
+ // Import CLI framework
18
+ const { program } = require('commander');
19
+ const chalk = require('chalk');
20
+ const path = require('path');
21
+
22
+ // Import CLI modules
23
+ const { setupGlobalOptions, handleGlobalErrors } = require('../src/cli/utils/config');
24
+ const { setupOutput } = require('../src/cli/utils/output');
25
+ const { setupLogger } = require('../src/cli/utils/logger');
26
+
27
+ // Import command modules
28
+ const authCommands = require('../src/cli/commands/auth');
29
+ const projectCommands = require('../src/cli/commands/project');
30
+ const repoCommands = require('../src/cli/commands/repo');
31
+ const changelogCommands = require('../src/cli/commands/changelog');
32
+ const statsCommands = require('../src/cli/commands/stats');
33
+
34
+ // Setup global configuration
35
+ const logger = setupLogger();
36
+ const output = setupOutput();
37
+
38
+ // Handle global errors
39
+ handleGlobalErrors(logger);
40
+
41
+ // Setup program
42
+ program
43
+ .name('autochangelog')
44
+ .description('Agent-friendly CLI for AutoChangelog platform')
45
+ .version(require('../package.json').version)
46
+ .option('--json', 'Output in JSON format (default in non-TTY)')
47
+ .option('--verbose', 'Enable verbose logging')
48
+ .option('--no-color', 'Disable colored output')
49
+ .option('--config <path>', 'Path to config file')
50
+ .option('--timeout <ms>', 'Request timeout in milliseconds', parseInt)
51
+ .hook('preAction', (thisCommand) => {
52
+ // Apply global options to all commands
53
+ const options = thisCommand.opts();
54
+
55
+ if (options.json !== undefined) {
56
+ output.setJsonMode(options.json);
57
+ }
58
+
59
+ if (options.verbose) {
60
+ logger.level = 'debug';
61
+ }
62
+
63
+ if (options.noColor) {
64
+ chalk.level = 0;
65
+ }
66
+
67
+ if (options.timeout) {
68
+ process.env.REQUEST_TIMEOUT = options.timeout.toString();
69
+ }
70
+ });
71
+
72
+ // Setup commands
73
+ authCommands(program);
74
+ projectCommands(program);
75
+ repoCommands(program);
76
+ changelogCommands(program);
77
+ statsCommands(program);
78
+
79
+ // Setup help
80
+ program.configureHelp({
81
+ sortSubcommands: true,
82
+ subcommandTerm: (cmd) => cmd.name() + (cmd.alias() ? '|' + cmd.alias() : ''),
83
+ });
84
+
85
+ // Handle unknown commands
86
+ program.on('command:*', (operands) => {
87
+ logger.error(`❌ Unknown command: ${operands[0]}`);
88
+ logger.info(`Use ${chalk.cyan('autochangelog --help')} to see available commands`);
89
+ process.exit(1);
90
+ });
91
+
92
+ // Handle version command
93
+ program.on('option:version', () => {
94
+ if (output.isJsonMode()) {
95
+ console.log(JSON.stringify({
96
+ version: program.version(),
97
+ node: process.version,
98
+ platform: process.platform,
99
+ arch: process.arch
100
+ }));
101
+ } else {
102
+ console.log(chalk.cyan(`AutoChangelog CLI v${program.version()}`));
103
+ console.log(chalk.gray(`Node.js: ${process.version}`));
104
+ console.log(chalk.gray(`Platform: ${process.platform} ${process.arch}`));
105
+ }
106
+ process.exit(0);
107
+ });
108
+
109
+ // Parse arguments and run
110
+ try {
111
+ program.parse();
112
+
113
+ // If no command provided, show help
114
+ if (!program.args.length && !program.commands.find(cmd => cmd._name === program.args[0])) {
115
+ program.outputHelp();
116
+ }
117
+ } catch (error) {
118
+ logger.error('❌ CLI execution failed:', error);
119
+ process.exit(1);
120
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "autochangelog-cli",
3
+ "version": "1.0.0",
4
+ "description": "Agent-friendly CLI for AutoChangelog platform",
5
+ "main": "src/cli/index.js",
6
+ "bin": {
7
+ "autochangelog": "bin/autochangelog"
8
+ },
9
+ "scripts": {
10
+ "start": "node bin/autochangelog",
11
+ "dev": "node --inspect bin/autochangelog",
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
14
+ "keywords": [
15
+ "cli",
16
+ "autochangelog",
17
+ "github",
18
+ "changelog",
19
+ "agent-friendly",
20
+ "devops"
21
+ ],
22
+ "author": "AutoChangelog Team",
23
+ "license": "MIT",
24
+ "dependencies": {
25
+ "commander": "^11.0.0",
26
+ "dotenv": "^16.3.1",
27
+ "winston": "^3.10.0",
28
+ "axios": "^1.5.0",
29
+ "simple-git": "^3.19.1",
30
+ "conventional-commits-parser": "^5.0.0",
31
+ "mongoose": "^7.5.0",
32
+ "jsonwebtoken": "^9.0.2",
33
+ "bcryptjs": "^2.4.3",
34
+ "chalk": "^4.1.2",
35
+ "ora": "^8.0.1",
36
+ "inquirer": "^9.2.7",
37
+ "fs-extra": "^11.1.1",
38
+ "path": "^0.12.7"
39
+ },
40
+ "devDependencies": {
41
+ "nodemon": "^3.0.1"
42
+ },
43
+ "engines": {
44
+ "node": ">=16.0.0"
45
+ }
46
+ }