not-manage 0.2.1 → 0.2.2
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 +7 -7
- package/package.json +1 -2
- package/src/postinstall.js +0 -140
package/README.md
CHANGED
|
@@ -16,13 +16,18 @@ This project is a terminal CLI from [Not Operations](https://notoperations.com/l
|
|
|
16
16
|
npm i -g not-manage && not-manage
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
The package does not run install-time scripts. Setup starts when you launch `not-manage`.
|
|
20
20
|
|
|
21
21
|
What happens next:
|
|
22
22
|
|
|
23
23
|
- first-time setup: `not-manage` starts guided setup
|
|
24
24
|
- returning setup: `not-manage` opens normally and can verify the saved connection
|
|
25
|
-
-
|
|
25
|
+
- setup warning: the CLI reminds you that output may contain confidential client data and that redaction is best-effort only
|
|
26
|
+
|
|
27
|
+
Network behavior:
|
|
28
|
+
|
|
29
|
+
- the CLI uses HTTPS requests to Clio API/auth hosts for your selected region (`app.clio.com`, `ca.app.clio.com`, `eu.app.clio.com`, or `au.app.clio.com`)
|
|
30
|
+
- during OAuth login it also accepts a local loopback callback on `127.0.0.1`
|
|
26
31
|
|
|
27
32
|
You can also run the command separately after install:
|
|
28
33
|
|
|
@@ -36,11 +41,6 @@ or:
|
|
|
36
41
|
not-manage setup
|
|
37
42
|
```
|
|
38
43
|
|
|
39
|
-
To suppress the install-time prompt entirely:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
NOT_MANAGE_SKIP_POSTINSTALL_SETUP=1 npm i -g not-manage && not-manage
|
|
43
|
-
```
|
|
44
44
|
|
|
45
45
|
For local development:
|
|
46
46
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "not-manage",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Unofficial command-line tool for Clio Manage integrations",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"docs:generate": "node scripts/generate-readme-cli-reference.js",
|
|
40
40
|
"hooks:install": "node scripts/install-git-hooks.js",
|
|
41
41
|
"pack:check": "npm pack --dry-run",
|
|
42
|
-
"postinstall": "node src/postinstall.js",
|
|
43
42
|
"seed:handbook-imports": "node scripts/generate-handbook-import-csvs.js",
|
|
44
43
|
"seed:historical": "node scripts/seed-historical-data.js",
|
|
45
44
|
"smoke:live": "node scripts/smoke-read-only-live.js",
|
package/src/postinstall.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
const { setupWizard } = require("./commands-auth");
|
|
2
|
-
const { ask, withPrompt } = require("./prompt");
|
|
3
|
-
const { findConfig } = require("./store");
|
|
4
|
-
|
|
5
|
-
const SKIP_POSTINSTALL_ENV_VARS = [
|
|
6
|
-
"NOT_MANAGE_SKIP_POSTINSTALL_SETUP",
|
|
7
|
-
"CLIO_MANAGE_SKIP_POSTINSTALL_SETUP",
|
|
8
|
-
];
|
|
9
|
-
|
|
10
|
-
function printConfidentialityNotice(log = console.log) {
|
|
11
|
-
log("Confidentiality notice:");
|
|
12
|
-
log(" not-manage can display client-identifying, confidential, or privileged matter data.");
|
|
13
|
-
log(" `--redacted` is best-effort only and may miss identifiers in labels, custom fields, or free text.");
|
|
14
|
-
log(" Review all output before sharing it with AI tools, tickets, chats, or other third parties.");
|
|
15
|
-
log(" Use only with workflows and vendors your firm has approved.");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function shouldShowPostinstallNotice(options = {}) {
|
|
19
|
-
const env = options.env || process.env;
|
|
20
|
-
|
|
21
|
-
if (SKIP_POSTINSTALL_ENV_VARS.some((name) => env[name] === "1")) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (env.CI) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (env.npm_config_global !== "true") {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function shouldRunPostinstallOnboarding(options = {}) {
|
|
37
|
-
const stdin = options.stdin || process.stdin;
|
|
38
|
-
const stdout = options.stdout || process.stdout;
|
|
39
|
-
|
|
40
|
-
if (!shouldShowPostinstallNotice(options)) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (!stdin.isTTY || !stdout.isTTY) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function printPostinstallIntro(log = console.log) {
|
|
52
|
-
log("");
|
|
53
|
-
log("+===========================================+");
|
|
54
|
-
log("| NOT MANAGE IS INSTALLED |");
|
|
55
|
-
log("+===========================================+");
|
|
56
|
-
log("| Start first-time setup from npm? |");
|
|
57
|
-
log("+===========================================+");
|
|
58
|
-
log("");
|
|
59
|
-
log("This prompt only appears on fresh interactive global installs.");
|
|
60
|
-
log("If you skip it now, run `not-manage setup` whenever you are ready.");
|
|
61
|
-
log("");
|
|
62
|
-
printConfidentialityNotice(log);
|
|
63
|
-
log("");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function printPostinstallInstalledNotice(log = console.log) {
|
|
67
|
-
log("");
|
|
68
|
-
log("not-manage is installed.");
|
|
69
|
-
printConfidentialityNotice(log);
|
|
70
|
-
log("Run `not-manage setup` whenever you are ready.");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function printPostinstallWelcomeBack(log = console.log) {
|
|
74
|
-
log("");
|
|
75
|
-
log("Welcome back. Clio is already configured on this machine.");
|
|
76
|
-
log("Run `not-manage auth status` to verify the current connection, or `not-manage setup` to reconfigure.");
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async function maybeRunPostinstallOnboarding(options = {}) {
|
|
80
|
-
const log = options.log || console.log;
|
|
81
|
-
const findConfigFn = options.findConfig || findConfig;
|
|
82
|
-
const setupWizardFn = options.setupWizard || setupWizard;
|
|
83
|
-
const withPromptFn = options.withPrompt || withPrompt;
|
|
84
|
-
const askFn = options.ask || ask;
|
|
85
|
-
|
|
86
|
-
if (!shouldShowPostinstallNotice(options)) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const config = await findConfigFn();
|
|
91
|
-
if (config) {
|
|
92
|
-
printPostinstallWelcomeBack(log);
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (!shouldRunPostinstallOnboarding(options)) {
|
|
97
|
-
printPostinstallInstalledNotice(log);
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
printPostinstallIntro(log);
|
|
102
|
-
|
|
103
|
-
const answer = String(
|
|
104
|
-
await withPromptFn((rl) => askFn(rl, "Start guided Clio setup now", "yes"))
|
|
105
|
-
)
|
|
106
|
-
.trim()
|
|
107
|
-
.toLowerCase();
|
|
108
|
-
|
|
109
|
-
if (["n", "no", "skip"].includes(answer)) {
|
|
110
|
-
log("Skipping setup for now. Run `not-manage setup` when you are ready.");
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
await setupWizardFn();
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
async function main(options = {}) {
|
|
119
|
-
const log = options.log || console.log;
|
|
120
|
-
const errorLog = options.errorLog || console.error;
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
await maybeRunPostinstallOnboarding(options);
|
|
124
|
-
} catch (_error) {
|
|
125
|
-
errorLog("Post-install setup was skipped.");
|
|
126
|
-
log("Run `not-manage setup` when you are ready.");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (require.main === module) {
|
|
131
|
-
main();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
module.exports = {
|
|
135
|
-
main,
|
|
136
|
-
maybeRunPostinstallOnboarding,
|
|
137
|
-
printConfidentialityNotice,
|
|
138
|
-
shouldShowPostinstallNotice,
|
|
139
|
-
shouldRunPostinstallOnboarding,
|
|
140
|
-
};
|