nitor 1.6.0 → 1.7.1

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
@@ -68,3 +68,18 @@ For a complete list of changes and discussion, see [Issue #1](https://github.com
68
68
  `-state` / `-search` options.
69
69
 
70
70
  - [Issue #10](https://github.com/codebynithin/nitor/issues/10)
71
+
72
+ ## [1.7.0] - 2026-04-20
73
+
74
+ ### New Features
75
+
76
+ ### Security & Packaging
77
+
78
+ - Bumped `axios` to `~1.15.1` to resolve high-severity advisories
79
+ (GHSA-43fc-jf86-j433, GHSA-3p68-rc4w-qgx5, GHSA-fvcv-3m26-pcqx) and a
80
+ moderate `follow-redirects` advisory pulled in transitively.
81
+ - Added a top-level `LICENSE` file (ISC) and a `files` allowlist in
82
+ `package.json` so published tarballs only ship runtime assets.
83
+ - Removed unused `commander` and `compression` dependencies.
84
+ - Declared `engines.node >= 18` to reflect the actual minimum supported by
85
+ runtime dependencies (notably `@google/generative-ai`).
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2025 Nithin V <mails2nithin@gmail.com>
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -34,8 +34,8 @@ A CLI utility toolkit for automating and managing build, deploy, and status oper
34
34
 
35
35
  ## Requirements
36
36
 
37
- - Node.js >= 14.x
38
- - npm >= 6.x
37
+ - Node.js >= 18.x
38
+ - npm >= 9.x
39
39
  - A properly configured `.env.nu` file in your `~/Desktop` directory with required tokens and URLs:
40
40
  - `CSRF_TOKEN` - CSRF token for Gitlab (Copy from browser)
41
41
  - `COOKIE` - Cookie for Gitlab (Copy from browser)
package/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "nitor",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "description": "A comprehensive CLI toolkit for automating GitLab operations, AI-powered code review, build/deploy automation, MongoDB backup/restore, and developer productivity tools",
5
5
  "main": "index.js",
6
6
  "author": "Nithin V <mails2nithin@gmail.com>",
7
7
  "bin": "index.js",
8
+ "files": [
9
+ "index.js",
10
+ "services/",
11
+ "favicon.png",
12
+ "README.md",
13
+ "CHANGELOG.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
8
19
  "scripts": {
9
20
  "start": "node index",
10
21
  "start:dev": "nodemon index",
@@ -53,11 +64,9 @@
53
64
  "homepage": "https://github.com/codebynithin/nitor#readme",
54
65
  "dependencies": {
55
66
  "@google/generative-ai": "~0.24.1",
56
- "axios": "~1.12.2",
67
+ "axios": "~1.15.1",
57
68
  "chalk": "~4.1.2",
58
69
  "cheerio": "~1.0.0-rc.12",
59
- "commander": "~14.0.1",
60
- "compression": "~1.8.1",
61
70
  "date-fns": "~2.30.0",
62
71
  "date-fns-tz": "~2.0.1",
63
72
  "dotenv": "~16.4.5",
package/services/utils.js CHANGED
@@ -188,7 +188,7 @@ const generateBuildConfigs = (values = {}) => {
188
188
  variables_attributes.push({
189
189
  variable_type: 'env_var',
190
190
  key: 'TAG',
191
- secret_value: values.instance,
191
+ value: values.instance,
192
192
  });
193
193
 
194
194
  if (!values.branch) {
@@ -208,7 +208,7 @@ const generateBuildConfigs = (values = {}) => {
208
208
  // Client config
209
209
  if (values.components.includes('client')) {
210
210
  configs.client.config = makeConfig(`${gitlabConfig.url}/cxd/${project}-client/-/pipelines`, {
211
- ...dataBase,
211
+ pipeline: { ...dataBase },
212
212
  });
213
213
  }
214
214
 
@@ -227,16 +227,15 @@ const generateBuildConfigs = (values = {}) => {
227
227
  {
228
228
  variable_type: 'env_var',
229
229
  key: 'APPS',
230
- secret_value: apps.join(' '),
230
+ value: apps.join(' '),
231
231
  },
232
232
  ]
233
233
  : []),
234
234
  ],
235
235
  };
236
- configs.backend.config = makeConfig(
237
- `${gitlabConfig.url}/cxd/${project}-backend/-/pipelines`,
238
- backendData,
239
- );
236
+ configs.backend.config = makeConfig(`${gitlabConfig.url}/cxd/${project}-backend/-/pipelines`, {
237
+ pipeline: backendData,
238
+ });
240
239
  }
241
240
 
242
241
  return { configs: removeEmpty(configs, true) };
@@ -275,7 +274,7 @@ const generateDeployConfigs = (values = {}) => {
275
274
  variables_attributes.push({
276
275
  variable_type: 'env_var',
277
276
  key: 'IMAGE_TAG',
278
- secret_value: values.instance,
277
+ value: values.instance,
279
278
  });
280
279
  }
281
280
 
@@ -283,7 +282,7 @@ const generateDeployConfigs = (values = {}) => {
283
282
  variables_attributes.push({
284
283
  variable_type: 'env_var',
285
284
  key: 'INSTANCE',
286
- secret_value: imageTagMap[values.instance] || values.instance,
285
+ value: imageTagMap[values.instance] || values.instance,
287
286
  });
288
287
  }
289
288
 
@@ -291,20 +290,22 @@ const generateDeployConfigs = (values = {}) => {
291
290
  variables_attributes.push({
292
291
  variable_type: 'env_var',
293
292
  key: 'COMPONENT',
294
- secret_value: 'client-pilot',
293
+ value: 'client-pilot',
295
294
  });
296
295
  } else {
297
296
  variables_attributes.push({
298
297
  variable_type: 'env_var',
299
298
  key: 'COMPONENT',
300
- secret_value: values.components || 'client',
299
+ value: values.components || 'client',
301
300
  });
302
301
  }
303
302
 
304
303
  const project = projectMap[values.project] || projectMap.portal;
305
304
  const configs = makeConfig(`${gitlabConfig.url}/cxd/${project}-deployment/-/pipelines`, {
306
- ref: `refs/heads/${deploymentBranchMap[values.instance]}`,
307
- variables_attributes,
305
+ pipeline: {
306
+ ref: `refs/heads/${deploymentBranchMap[values.instance]}`,
307
+ variables_attributes,
308
+ },
308
309
  });
309
310
 
310
311
  return { configs: removeEmpty(configs, true) };
@@ -1,10 +0,0 @@
1
- {
2
- "extends": ["@commitlint/config-angular"],
3
- "rules": {
4
- "subject-case": [
5
- 2,
6
- "always",
7
- ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"]
8
- ]
9
- }
10
- }
package/.editorconfig DELETED
@@ -1,16 +0,0 @@
1
- # Editor configuration, see https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = space
7
- indent_size = 2
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.ts]
12
- quote_type = single
13
-
14
- [*.md]
15
- max_line_length = off
16
- trim_trailing_whitespace = false
package/.eslintrc.js DELETED
@@ -1,29 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- node: true,
5
- commonjs: true,
6
- },
7
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8
- overrides: [
9
- {
10
- env: {
11
- node: true,
12
- },
13
- files: ['.eslintrc.{js,cjs}'],
14
- parserOptions: {
15
- sourceType: 'script',
16
- },
17
- },
18
- ],
19
- parser: '@typescript-eslint/parser',
20
- parserOptions: {
21
- ecmaVersion: 'latest',
22
- sourceType: 'module',
23
- },
24
- plugins: ['@typescript-eslint'],
25
- rules: {
26
- '@typescript-eslint/no-unsafe-optional-chain': 'off',
27
- '@typescript-eslint/no-var-requires': 'off',
28
- },
29
- };
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- package-lock.json -diff -merge
2
- package-lock.json linguist-generated=true
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "printWidth": 100
5
- }
package/.releaserc.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "branches": ["master"],
3
- "plugins": [
4
- [
5
- "@semantic-release/commit-analyzer",
6
- {
7
- "preset": "angular",
8
- "releaseRules": [
9
- { "type": "feat", "release": "minor" },
10
- { "type": "fix", "release": "patch" },
11
- { "type": "docs", "release": false },
12
- { "type": "style", "release": false },
13
- { "type": "refactor", "release": "patch" },
14
- { "type": "perf", "release": "patch" },
15
- { "type": "breaking", "release": "major" }
16
- ],
17
- "parserOpts": {
18
- "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
19
- }
20
- }
21
- ],
22
- "@semantic-release/release-notes-generator",
23
- "@semantic-release/changelog",
24
- "@semantic-release/npm",
25
- "@semantic-release/github",
26
- [
27
- "@semantic-release/git",
28
- {
29
- "assets": ["CHANGELOG.md", "package.json"],
30
- "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
31
- }
32
- ]
33
- ]
34
- }
@@ -1,136 +0,0 @@
1
- # Autocomplete Setup Guide
2
-
3
- ## Overview
4
-
5
- Nitor supports shell autocomplete for commands, options, and values using the `omelette` library.
6
-
7
- ## Setup
8
-
9
- ### 1. Install Autocomplete
10
-
11
- After installing nitor globally, run:
12
-
13
- ```bash
14
- nitor completion
15
- ```
16
-
17
- ### 2. Activate Autocomplete
18
-
19
- Restart your terminal or source your shell configuration:
20
-
21
- **For Bash:**
22
-
23
- ```bash
24
- source ~/.bashrc
25
- ```
26
-
27
- **For Zsh:**
28
-
29
- ```bash
30
- source ~/.zshrc
31
- ```
32
-
33
- **For Fish:**
34
-
35
- ```bash
36
- source ~/.config/fish/config.fish
37
- ```
38
-
39
- ## Usage
40
-
41
- Once autocomplete is enabled, press `Tab` to see suggestions:
42
-
43
- ### Command Completion
44
-
45
- ```bash
46
- nitor <Tab>
47
- # Shows: build, deploy, build-deploy, create-branch, review, refactor, backup, merge, cleanup,
48
- # time-init, time-switch, time-add, time-update, time-delete, time-stats, time-entries,
49
- # time-zoho, time-gitlab, time-merge, version, help
50
- ```
51
-
52
- ### Option Completion
53
-
54
- ```bash
55
- nitor build -<Tab>
56
- # Shows: -project, -p, -components, -c, -instance, -i, -help, --h
57
- ```
58
-
59
- ### Value Completion
60
-
61
- ```bash
62
- nitor build -project <Tab>
63
- # Shows: portal, gateway, phr, configService, healthRecords, centralAuth, mpi, phrAdminBackend, phrAdminClient, terminologyService
64
-
65
- nitor build -instance <Tab>
66
- # Shows: dev, qa, pilot
67
-
68
- nitor create-branch -type <Tab>
69
- # Shows: feat, fix
70
- ```
71
-
72
- ## Supported Completions
73
-
74
- ### Commands
75
-
76
- - `build`, `deploy`, `build-deploy`
77
- - `create-branch`, `review`, `refactor`
78
- - `backup`, `merge`, `cleanup`
79
- - `time-init`, `time-switch`, `time-add`, `time-update`, `time-delete`
80
- - `time-stats`, `time-entries`, `time-zoho`, `time-gitlab`, `time-merge`
81
- - `version`, `help`, `completion`
82
-
83
- ### Options
84
-
85
- - Project names: `portal`, `gateway`, `phr`, etc.
86
- - Components: `client`, `administration`, `provider`, `rest-api`
87
- - Instances: `dev`, `qa`, `pilot`
88
- - Branch types: `feat`, `fix`
89
- - Repository names: `portalClient`, `portalBackend`, etc.
90
-
91
- ## Troubleshooting
92
-
93
- ### Autocomplete Not Working
94
-
95
- 1. **Verify installation:**
96
-
97
- ```bash
98
- nitor completion
99
- ```
100
-
101
- 2. **Check shell configuration:**
102
-
103
- - Bash: `~/.bashrc`
104
- - Zsh: `~/.zshrc`
105
- - Fish: `~/.config/fish/config.fish`
106
-
107
- 3. **Reload shell:**
108
- ```bash
109
- exec $SHELL
110
- ```
111
-
112
- ### Manual Setup
113
-
114
- If automatic setup doesn't work, add this to your shell configuration:
115
-
116
- **Bash (~/.bashrc):**
117
-
118
- ```bash
119
- # nitor autocomplete
120
- if type nitor > /dev/null 2>&1; then
121
- eval "$(nitor --completion)"
122
- fi
123
- ```
124
-
125
- **Zsh (~/.zshrc):**
126
-
127
- ```bash
128
- # nitor autocomplete
129
- if type nitor > /dev/null 2>&1; then
130
- eval "$(nitor --completion)"
131
- fi
132
- ```
133
-
134
- ## Uninstall Autocomplete
135
-
136
- To remove autocomplete, edit your shell configuration file and remove the nitor completion lines, then reload your shell.