nitor 1.3.4 → 1.4.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/README.md +1 -1
- package/package.json +1 -1
- package/services/mongodb-backup.js +3 -3
- package/services/process-commands.js +18 -19
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ A CLI utility toolkit for automating and managing build, deploy, and status oper
|
|
|
48
48
|
- `RESTORE_CONFIG` - Restore configuration
|
|
49
49
|
- `ZOHO_COOKIE` - Zoho cookie for authentication
|
|
50
50
|
- `ZOHO_CUSTOMVIEW_ID` - Zoho custom view ID
|
|
51
|
-
- `
|
|
51
|
+
- `ZOHO_DEFAULT_PROJECT_ID` - Default Zoho project ID
|
|
52
52
|
- `ZOHO_PORTAL_ID` - Zoho portal ID
|
|
53
53
|
- `ZOHO_PROJECTS` - Zoho projects configuration
|
|
54
54
|
- `ZOHO_SESSION_ID` - Zoho session ID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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>",
|
|
@@ -13,7 +13,7 @@ const colors = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Execute MongoDB restore from local backup to Docker container
|
|
15
15
|
* @param {Object} config - Restore configuration
|
|
16
|
-
* @param {boolean} config.mongoInDocker - If
|
|
16
|
+
* @param {boolean} config.mongoInDocker - If true, restore to MongoDB running inside Docker container
|
|
17
17
|
* @param {string} config.containerName - Name of the Docker container (default: 'mongodb')
|
|
18
18
|
* @param {string} config.localBackupPath - Local path where backup is stored (default: '~/backups/mongo')
|
|
19
19
|
* @param {string} config.containerBackupPath - Path inside container for backup (default: '/data/backup')
|
|
@@ -78,12 +78,12 @@ const executeMongoRestore = async (config) => {
|
|
|
78
78
|
stdio: 'inherit',
|
|
79
79
|
shell: isWindows ? 'cmd.exe' : '/bin/sh',
|
|
80
80
|
});
|
|
81
|
-
console.log(`${colors.green}
|
|
81
|
+
console.log(`${colors.green}Mongorestore completed successfully${colors.reset}`);
|
|
82
82
|
} catch (error) {
|
|
83
83
|
// mongorestore returns non-zero even for partial success (e.g., duplicate keys)
|
|
84
84
|
// Log the warning but don't throw unless it's a critical failure
|
|
85
85
|
console.log(
|
|
86
|
-
`${colors.red}
|
|
86
|
+
`${colors.red}Mongorestore completed with some errors (this may be expected if data already exists)${colors.reset}`,
|
|
87
87
|
);
|
|
88
88
|
console.log(`Check the output above for details`);
|
|
89
89
|
}
|
|
@@ -41,7 +41,7 @@ const processArgs = async (type, value) => {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (values === null) {
|
|
44
|
-
|
|
44
|
+
process.exit(1);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
switch (type) {
|
|
@@ -57,7 +57,7 @@ Options:
|
|
|
57
57
|
-c, --components <name> component name | client, administration, provider, rest-api
|
|
58
58
|
-i, --instance <name> instance name | dev, qa, pilot`);
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
break;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
await build(values);
|
|
@@ -77,7 +77,7 @@ Options:
|
|
|
77
77
|
-c, --components <name> component name | client, administration, provider, rest-api
|
|
78
78
|
-i, --instance <name> instance name | dev, qa, pilot`);
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
break;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const configs = await build(values);
|
|
@@ -110,7 +110,7 @@ Options:
|
|
|
110
110
|
-c, --components <name> component name | client, administration, provider, rest-api
|
|
111
111
|
-i, --instance <name> instance name | dev, qa, pilot`);
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
break;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
await deploy(values);
|
|
@@ -131,7 +131,7 @@ Options:
|
|
|
131
131
|
-d, --description <description> description
|
|
132
132
|
-p, --project <project short name> project short name | portal, gateway, phr, configService, healthRecords, centralAuth, mpi, phrAdminBackend, phrAdminClient, terminologyService`);
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
break;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
await createBranch(values);
|
|
@@ -147,11 +147,10 @@ Options:
|
|
|
147
147
|
Review merge request
|
|
148
148
|
|
|
149
149
|
Options:
|
|
150
|
-
-p, --project <project short name>
|
|
151
|
-
-mId, --mergeId <merge id>
|
|
152
|
-
-r, --repository <repository name> repository name
|
|
150
|
+
-p, --project <project short name>
|
|
151
|
+
-mId, --mergeId <merge id>
|
|
153
152
|
|
|
154
|
-
|
|
153
|
+
Project list:
|
|
155
154
|
centralAuth
|
|
156
155
|
configService
|
|
157
156
|
gatewayBackend
|
|
@@ -170,7 +169,7 @@ Repository list:
|
|
|
170
169
|
portalDeployment
|
|
171
170
|
terminologyService`);
|
|
172
171
|
|
|
173
|
-
|
|
172
|
+
break;
|
|
174
173
|
}
|
|
175
174
|
|
|
176
175
|
await mrAIReview(values);
|
|
@@ -184,7 +183,7 @@ Repository list:
|
|
|
184
183
|
|
|
185
184
|
Enhance the provided text for improved clarity, conciseness, and professional quality.`);
|
|
186
185
|
|
|
187
|
-
|
|
186
|
+
break;
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
await refactor(values);
|
|
@@ -196,7 +195,7 @@ Enhance the provided text for improved clarity, conciseness, and professional qu
|
|
|
196
195
|
if (value === '-help' || value === '--h') {
|
|
197
196
|
console.log(`Usage: \tnu backup [-project <project name>] [-components <component name>]
|
|
198
197
|
|
|
199
|
-
Backup
|
|
198
|
+
Backup MongoDB for specified project and components.
|
|
200
199
|
|
|
201
200
|
project list:
|
|
202
201
|
- configService
|
|
@@ -204,7 +203,7 @@ project list:
|
|
|
204
203
|
- medicaPortal
|
|
205
204
|
- phr`);
|
|
206
205
|
|
|
207
|
-
|
|
206
|
+
break;
|
|
208
207
|
}
|
|
209
208
|
|
|
210
209
|
await backup(values);
|
|
@@ -230,7 +229,7 @@ This command will:
|
|
|
230
229
|
4. Merge source into target
|
|
231
230
|
5. Push changes`);
|
|
232
231
|
|
|
233
|
-
|
|
232
|
+
break;
|
|
234
233
|
}
|
|
235
234
|
|
|
236
235
|
await merge(values);
|
|
@@ -250,7 +249,7 @@ This command will:
|
|
|
250
249
|
|
|
251
250
|
Note: This operation cannot be undone. Make sure you have pushed any important changes.`);
|
|
252
251
|
|
|
253
|
-
|
|
252
|
+
break;
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
await cleanup();
|
|
@@ -296,7 +295,7 @@ View task stats
|
|
|
296
295
|
Options:
|
|
297
296
|
-t, --task <number> task number`);
|
|
298
297
|
|
|
299
|
-
|
|
298
|
+
break;
|
|
300
299
|
}
|
|
301
300
|
|
|
302
301
|
const spinner = createSpinner('Fetching task statistics');
|
|
@@ -366,7 +365,7 @@ Get task details
|
|
|
366
365
|
Options:
|
|
367
366
|
-t, --task <numbers with space> task numbers with space`);
|
|
368
367
|
|
|
369
|
-
|
|
368
|
+
break;
|
|
370
369
|
}
|
|
371
370
|
|
|
372
371
|
if (!values.task) {
|
|
@@ -548,7 +547,7 @@ Time Entry commands:
|
|
|
548
547
|
time-update : Update existing time entry
|
|
549
548
|
time-zoho : Sync time entries to Zoho
|
|
550
549
|
|
|
551
|
-
For details of each
|
|
550
|
+
For details of each action run 'nitor <action> -help'
|
|
552
551
|
|
|
553
552
|
Example usage:\n
|
|
554
553
|
nitor build -project <project> -components <components> -instance <instance>
|
|
@@ -572,7 +571,7 @@ Running 'nitor help' will list available subcommands and provide some conceptual
|
|
|
572
571
|
default: {
|
|
573
572
|
console.error(`nitor: '${type}' is not a nitor command. See 'nitor help'.`);
|
|
574
573
|
|
|
575
|
-
|
|
574
|
+
break;
|
|
576
575
|
}
|
|
577
576
|
}
|
|
578
577
|
|