@doist/outline-cli 1.5.3 → 1.7.0
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 +12 -0
- package/dist/commands/auth.d.ts +12 -0
- package/dist/commands/auth.js +110 -158
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/changelog.d.ts +1 -6
- package/dist/commands/changelog.js +8 -88
- package/dist/commands/changelog.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/api.d.ts +5 -1
- package/dist/lib/api.js +9 -6
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/auth-constants.d.ts +18 -0
- package/dist/lib/auth-constants.js +25 -0
- package/dist/lib/auth-constants.js.map +1 -0
- package/dist/lib/auth-pages.d.ts +2 -0
- package/dist/lib/auth-pages.js +101 -0
- package/dist/lib/auth-pages.js.map +1 -0
- package/dist/lib/auth-provider.d.ts +59 -0
- package/dist/lib/auth-provider.js +299 -0
- package/dist/lib/auth-provider.js.map +1 -0
- package/dist/lib/auth.d.ts +24 -7
- package/dist/lib/auth.js +53 -36
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/config.d.ts +23 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +3 -1
- package/dist/lib/errors.js +1 -0
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/global-args.d.ts +1 -0
- package/dist/lib/global-args.js +4 -0
- package/dist/lib/global-args.js.map +1 -1
- package/dist/lib/migrate-auth.d.ts +11 -0
- package/dist/lib/migrate-auth.js +92 -0
- package/dist/lib/migrate-auth.js.map +1 -0
- package/dist/lib/outline-account.d.ts +26 -0
- package/dist/lib/outline-account.js +12 -0
- package/dist/lib/outline-account.js.map +1 -0
- package/dist/lib/output.d.ts +6 -0
- package/dist/lib/output.js +16 -4
- package/dist/lib/output.js.map +1 -1
- package/dist/lib/skills/content.d.ts +1 -1
- package/dist/lib/skills/content.js +10 -3
- package/dist/lib/skills/content.js.map +1 -1
- package/dist/lib/user-records.d.ts +14 -0
- package/dist/lib/user-records.js +89 -0
- package/dist/lib/user-records.js.map +1 -0
- package/package.json +2 -2
- package/dist/lib/oauth-server.d.ts +0 -14
- package/dist/lib/oauth-server.js +0 -203
- package/dist/lib/oauth-server.js.map +0 -1
- package/dist/lib/oauth.d.ts +0 -17
- package/dist/lib/oauth.js +0 -42
- package/dist/lib/oauth.js.map +0 -1
- package/dist/lib/pkce.d.ts +0 -3
- package/dist/lib/pkce.js +0 -16
- package/dist/lib/pkce.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.7.0](https://github.com/Doist/outline-cli/compare/v1.6.0...v1.7.0) (2026-05-17)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **auth:** store API tokens in the OS keyring via @doist/cli-core ([#73](https://github.com/Doist/outline-cli/issues/73)) ([b353aea](https://github.com/Doist/outline-cli/commit/b353aeae3cdcc63308ec8de899f08c1dda23f22c))
|
|
6
|
+
|
|
7
|
+
## [1.6.0](https://github.com/Doist/outline-cli/compare/v1.5.3...v1.6.0) (2026-05-15)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **auth:** adopt cli-core 0.12.0 multi-user TokenStore shape ([#71](https://github.com/Doist/outline-cli/issues/71)) ([53487b7](https://github.com/Doist/outline-cli/commit/53487b707b9a980c401ef19b3e37c08299aa6abe))
|
|
12
|
+
|
|
1
13
|
## [1.5.3](https://github.com/Doist/outline-cli/compare/v1.5.2...v1.5.3) (2026-05-11)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/dist/commands/auth.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
import { type TokenStorageResult } from '@doist/cli-core/auth';
|
|
1
2
|
import type { Command } from 'commander';
|
|
3
|
+
/**
|
|
4
|
+
* Surface a `TokenStorageResult` from a save/clear: the human-readable
|
|
5
|
+
* confirmation goes to stdout, any keyring-fallback warning goes to stderr.
|
|
6
|
+
* Pass `isMachineOutput: true` to suppress the stdout confirmation in
|
|
7
|
+
* `--json` / `--ndjson` mode while still routing the warning to stderr.
|
|
8
|
+
*
|
|
9
|
+
* Exported for direct unit testing — the alternative (driving this via
|
|
10
|
+
* mocked cli-core login/logout hooks) would require stubbing the entire
|
|
11
|
+
* store contract just to assert two console calls.
|
|
12
|
+
*/
|
|
13
|
+
export declare function logTokenStorageResult(result: TokenStorageResult, secureStoreMessage: string, isMachineOutput?: boolean): void;
|
|
2
14
|
export declare function registerAuthCommand(program: Command): void;
|
package/dist/commands/auth.js
CHANGED
|
@@ -1,176 +1,128 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attachLoginCommand, attachLogoutCommand, attachStatusCommand, } from '@doist/cli-core/auth';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import open from 'open';
|
|
4
3
|
import { apiRequest } from '../lib/api.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
finally {
|
|
16
|
-
rl.close();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function parseCallbackPort(rawPort) {
|
|
20
|
-
const parsed = Number(rawPort);
|
|
4
|
+
import { renderError, renderSuccess } from '../lib/auth-pages.js';
|
|
5
|
+
import { createOutlineAuthProvider, createOutlineTokenStore, getActiveTokenSource, } from '../lib/auth-provider.js';
|
|
6
|
+
import { CliError } from '../lib/errors.js';
|
|
7
|
+
const DEFAULT_OAUTH_CALLBACK_PORT = 54969;
|
|
8
|
+
function resolvePreferredCallbackPort() {
|
|
9
|
+
const raw = process.env.OUTLINE_OAUTH_CALLBACK_PORT?.trim();
|
|
10
|
+
if (!raw)
|
|
11
|
+
return DEFAULT_OAUTH_CALLBACK_PORT;
|
|
12
|
+
const parsed = Number(raw);
|
|
21
13
|
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 65_535) {
|
|
22
|
-
return
|
|
14
|
+
return DEFAULT_OAUTH_CALLBACK_PORT;
|
|
23
15
|
}
|
|
24
16
|
return parsed;
|
|
25
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Surface a `TokenStorageResult` from a save/clear: the human-readable
|
|
20
|
+
* confirmation goes to stdout, any keyring-fallback warning goes to stderr.
|
|
21
|
+
* Pass `isMachineOutput: true` to suppress the stdout confirmation in
|
|
22
|
+
* `--json` / `--ndjson` mode while still routing the warning to stderr.
|
|
23
|
+
*
|
|
24
|
+
* Exported for direct unit testing — the alternative (driving this via
|
|
25
|
+
* mocked cli-core login/logout hooks) would require stubbing the entire
|
|
26
|
+
* store contract just to assert two console calls.
|
|
27
|
+
*/
|
|
28
|
+
export function logTokenStorageResult(result, secureStoreMessage, isMachineOutput = false) {
|
|
29
|
+
if (!isMachineOutput && result.storage === 'secure-store') {
|
|
30
|
+
console.log(chalk.dim(secureStoreMessage));
|
|
31
|
+
}
|
|
32
|
+
if (result.warning) {
|
|
33
|
+
console.error(chalk.yellow('Warning:'), result.warning);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
26
36
|
export function registerAuthCommand(program) {
|
|
27
37
|
const auth = program.command('auth').description('Manage authentication');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const optionCallbackPort = options.callbackPort?.trim();
|
|
46
|
-
const envCallbackPort = process.env.OUTLINE_OAUTH_CALLBACK_PORT?.trim();
|
|
47
|
-
const rawCallbackPort = optionCallbackPort || envCallbackPort;
|
|
48
|
-
let callbackPort = DEFAULT_OAUTH_CALLBACK_PORT;
|
|
49
|
-
if (rawCallbackPort) {
|
|
50
|
-
const parsedPort = parseCallbackPort(rawCallbackPort);
|
|
51
|
-
if (!parsedPort) {
|
|
52
|
-
console.error(formatError('OAUTH_CALLBACK_PORT_INVALID', `Invalid callback port: ${rawCallbackPort}`, [
|
|
53
|
-
'Use an integer between 1 and 65535',
|
|
54
|
-
'Set via --callback-port or OUTLINE_OAUTH_CALLBACK_PORT',
|
|
55
|
-
]));
|
|
56
|
-
process.exit(1);
|
|
38
|
+
const provider = createOutlineAuthProvider();
|
|
39
|
+
const store = createOutlineTokenStore();
|
|
40
|
+
attachLoginCommand(auth, {
|
|
41
|
+
provider,
|
|
42
|
+
store,
|
|
43
|
+
preferredPort: resolvePreferredCallbackPort(),
|
|
44
|
+
resolveScopes: () => [],
|
|
45
|
+
renderSuccess,
|
|
46
|
+
renderError,
|
|
47
|
+
onSuccess({ view, account }) {
|
|
48
|
+
const isMachineOutput = view.json || view.ndjson;
|
|
49
|
+
if (!isMachineOutput) {
|
|
50
|
+
console.log(chalk.green(`Authenticated to ${account.teamName} as ${account.label}`));
|
|
51
|
+
}
|
|
52
|
+
const result = store.getLastStorageResult();
|
|
53
|
+
if (result) {
|
|
54
|
+
logTokenStorageResult(result, 'Token stored securely in the system credential manager', isMachineOutput);
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
.description('Authenticate with an Outline instance via OAuth')
|
|
59
|
+
.option('--base-url <url>', 'Outline base URL to use for this login (saved for future logins)')
|
|
60
|
+
.option('--client-id <clientId>', 'OAuth client ID to use for this login (saved for future logins)');
|
|
61
|
+
// `attachStatusCommand` guarantees `fetchLive` runs before `renderText` /
|
|
62
|
+
// `renderJson` within a single invocation, so the stash is always
|
|
63
|
+
// populated by the time the render hooks read it.
|
|
64
|
+
let statusData = null;
|
|
65
|
+
attachStatusCommand(auth, {
|
|
66
|
+
store,
|
|
67
|
+
description: 'Show current authentication state',
|
|
68
|
+
async fetchLive({ token, account }) {
|
|
62
69
|
try {
|
|
63
|
-
const { data } = await
|
|
64
|
-
|
|
70
|
+
const [{ data: info }, source] = await Promise.all([
|
|
71
|
+
apiRequest('auth.info', {}, { token, baseUrl: account.baseUrl }),
|
|
72
|
+
getActiveTokenSource(),
|
|
73
|
+
]);
|
|
74
|
+
statusData = { email: info.user.email, source };
|
|
75
|
+
return {
|
|
76
|
+
...account,
|
|
77
|
+
id: info.user.id,
|
|
78
|
+
label: info.user.name,
|
|
79
|
+
teamName: info.team.name,
|
|
80
|
+
};
|
|
65
81
|
}
|
|
66
82
|
catch (err) {
|
|
67
|
-
|
|
83
|
+
const message = err instanceof Error ? err.message : '';
|
|
84
|
+
if (/\b401\b/.test(message) || /Authentication required/i.test(message)) {
|
|
85
|
+
throw new CliError('NO_TOKEN', 'Not authenticated (token expired or invalid)', [
|
|
86
|
+
'Run `ol auth login` to re-authenticate',
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
throw err;
|
|
68
90
|
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'Create a public OAuth app in Outline settings',
|
|
80
|
-
'Use --client-id <id> for this login',
|
|
81
|
-
'Set OUTLINE_OAUTH_CLIENT_ID or enter it here',
|
|
82
|
-
]));
|
|
83
|
-
process.exit(1);
|
|
84
|
-
}
|
|
85
|
-
const codeVerifier = generateCodeVerifier();
|
|
86
|
-
const codeChallenge = generateCodeChallenge(codeVerifier);
|
|
87
|
-
const state = generateState();
|
|
88
|
-
let callbackServer;
|
|
89
|
-
try {
|
|
90
|
-
callbackServer = await startOAuthCallbackServer({
|
|
91
|
-
state,
|
|
92
|
-
port: callbackPort,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
const error = err;
|
|
97
|
-
const hints = [
|
|
98
|
-
`Ensure http://localhost:${callbackPort}/callback is reachable from your browser`,
|
|
99
|
-
"Re-run with 'ol auth login --token <token>' for manual auth",
|
|
91
|
+
},
|
|
92
|
+
renderText({ account }) {
|
|
93
|
+
if (!statusData)
|
|
94
|
+
throw new Error('status renderText called before fetchLive');
|
|
95
|
+
return [
|
|
96
|
+
`${chalk.green('✓')} Authenticated`,
|
|
97
|
+
` Team: ${chalk.bold(account.teamName ?? '')}`,
|
|
98
|
+
` User: ${account.label} (${statusData.email})`,
|
|
99
|
+
` Base URL: ${account.baseUrl}`,
|
|
100
|
+
` Token source: ${statusData.source}`,
|
|
100
101
|
];
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
await open(authorizationUrl);
|
|
116
|
-
}
|
|
117
|
-
catch (err) {
|
|
118
|
-
console.log(chalk.yellow('Could not open browser automatically.'), chalk.dim(authorizationUrl));
|
|
119
|
-
console.log(chalk.dim(err.message));
|
|
120
|
-
}
|
|
121
|
-
console.log(chalk.dim('Waiting for OAuth authorization...'));
|
|
122
|
-
try {
|
|
123
|
-
const code = await callbackServer.waitForCode;
|
|
124
|
-
const token = await exchangeCodeForToken({
|
|
125
|
-
baseUrl: url,
|
|
126
|
-
clientId,
|
|
127
|
-
redirectUri: callbackServer.redirectUri,
|
|
128
|
-
codeVerifier,
|
|
129
|
-
code,
|
|
130
|
-
});
|
|
131
|
-
await saveConfig(token, url, clientId);
|
|
132
|
-
const { data } = await apiRequest('auth.info');
|
|
133
|
-
console.log(chalk.green(`Authenticated to ${data.team.name} as ${data.user.name}`));
|
|
134
|
-
}
|
|
135
|
-
catch (err) {
|
|
136
|
-
callbackServer.close();
|
|
137
|
-
console.error(formatError('OAUTH_LOGIN_FAILED', `OAuth login failed: ${err.message}`, [
|
|
138
|
-
'Confirm the OAuth app redirect URI matches the CLI callback',
|
|
139
|
-
'Verify --base-url or OUTLINE_URL points to your Outline instance',
|
|
140
|
-
"Re-run with 'ol auth login --token' for manual auth",
|
|
141
|
-
]));
|
|
142
|
-
process.exit(1);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
auth.command('status')
|
|
146
|
-
.description('Show current authentication state')
|
|
147
|
-
.action(async () => {
|
|
148
|
-
const source = await getTokenSource();
|
|
149
|
-
if (!source) {
|
|
150
|
-
console.log(chalk.yellow('Not authenticated. Run: ol auth login'));
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
console.log(chalk.dim(`Token source: ${source}`));
|
|
154
|
-
console.log(chalk.dim(`Base URL: ${await getBaseUrl()}`));
|
|
155
|
-
try {
|
|
156
|
-
const { data } = await apiRequest('auth.info');
|
|
157
|
-
console.log(`Team: ${chalk.bold(data.team.name)}`);
|
|
158
|
-
console.log(`User: ${data.user.name} (${data.user.email})`);
|
|
159
|
-
}
|
|
160
|
-
catch (err) {
|
|
161
|
-
console.error(formatError('AUTH_VERIFICATION_FAILED', `Could not fetch auth info: ${err.message}`, [
|
|
162
|
-
'Check that your API token is valid',
|
|
163
|
-
'Verify the base URL is correct',
|
|
164
|
-
"Run 'ol auth login' to re-authenticate",
|
|
165
|
-
]));
|
|
166
|
-
process.exit(1);
|
|
167
|
-
}
|
|
102
|
+
},
|
|
103
|
+
renderJson({ account }) {
|
|
104
|
+
if (!statusData)
|
|
105
|
+
throw new Error('status renderJson called before fetchLive');
|
|
106
|
+
return {
|
|
107
|
+
id: account.id,
|
|
108
|
+
team: account.teamName,
|
|
109
|
+
baseUrl: account.baseUrl,
|
|
110
|
+
source: statusData.source,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
onNotAuthenticated() {
|
|
114
|
+
throw new CliError('NOT_AUTHENTICATED', 'Not authenticated. Run: ol auth login');
|
|
115
|
+
},
|
|
168
116
|
});
|
|
169
|
-
auth
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
117
|
+
attachLogoutCommand(auth, {
|
|
118
|
+
store,
|
|
119
|
+
description: 'Clear saved authentication',
|
|
120
|
+
onCleared({ view }) {
|
|
121
|
+
const result = store.getLastClearResult();
|
|
122
|
+
if (!result)
|
|
123
|
+
return;
|
|
124
|
+
logTokenStorageResult(result, 'Stored token removed from the system credential manager', view.json || view.ndjson);
|
|
125
|
+
},
|
|
174
126
|
});
|
|
175
127
|
}
|
|
176
128
|
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GAEtB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAEH,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,GAGvB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,MAAM,2BAA2B,GAAG,KAAK,CAAA;AAOzC,SAAS,4BAA4B;IACjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,IAAI,EAAE,CAAA;IAC3D,IAAI,CAAC,GAAG;QAAE,OAAO,2BAA2B,CAAA;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;IAC1B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAA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,EAAE,CAAA;YACzC,IAAI,CAAC,MAAM;gBAAE,OAAM;YACnB,qBAAqB,CACjB,MAAM,EACN,yDAAyD,EACzD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAC3B,CAAA;QACL,CAAC;KACJ,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
interface ChangelogOptions {
|
|
3
|
-
count: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function changelogAction(options: ChangelogOptions): Promise<void>;
|
|
1
|
+
import type { Command } from 'commander';
|
|
6
2
|
export declare function registerChangelogCommand(program: Command): void;
|
|
7
|
-
export {};
|
|
@@ -1,95 +1,15 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
1
|
import { dirname, join } from 'node:path';
|
|
3
2
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import
|
|
3
|
+
import { registerChangelogCommand as registerCoreChangelogCommand } from '@doist/cli-core/commands';
|
|
5
4
|
import packageJson from '../../package.json' with { type: 'json' };
|
|
6
5
|
const CHANGELOG_PATH = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'CHANGELOG.md');
|
|
7
|
-
const
|
|
8
|
-
function formatInline(text) {
|
|
9
|
-
return text
|
|
10
|
-
.replace(/\*\*([^*]+)\*\*/g, (_, content) => chalk.bold(content))
|
|
11
|
-
.replace(/`([^`]+)`/g, (_, code) => chalk.cyan(code));
|
|
12
|
-
}
|
|
13
|
-
function formatForTerminal(text) {
|
|
14
|
-
return text
|
|
15
|
-
.split('\n')
|
|
16
|
-
.map((line) => {
|
|
17
|
-
// Version headers: ## 1.25.0 (date) → bold green
|
|
18
|
-
if (line.startsWith('## ')) {
|
|
19
|
-
return chalk.green.bold(line.slice(3));
|
|
20
|
-
}
|
|
21
|
-
// Section headers: ### Features → bold
|
|
22
|
-
if (line.startsWith('### ')) {
|
|
23
|
-
return chalk.bold(line.slice(4));
|
|
24
|
-
}
|
|
25
|
-
// Bullet items: * or - description → dimmed bullet + text
|
|
26
|
-
if (line.startsWith('* ')) {
|
|
27
|
-
return ` ${chalk.dim('•')} ${formatInline(line.slice(2))}`;
|
|
28
|
-
}
|
|
29
|
-
if (line.startsWith('- ')) {
|
|
30
|
-
return ` ${chalk.dim('•')} ${formatInline(line.slice(2))}`;
|
|
31
|
-
}
|
|
32
|
-
return formatInline(line);
|
|
33
|
-
})
|
|
34
|
-
.join('\n');
|
|
35
|
-
}
|
|
36
|
-
function cleanChangelog(text) {
|
|
37
|
-
return (text
|
|
38
|
-
// Version headers: ## [1.25.0](https://...) (date) → ## 1.25.0 (date)
|
|
39
|
-
.replace(/## \[([^\]]+)\]\([^)]*\)/g, '## $1')
|
|
40
|
-
// Remove commit hash links: ([abc1234](https://...))
|
|
41
|
-
.replace(/ \([a-f0-9]{7}\)/g, '')
|
|
42
|
-
.replace(/ \(\[[a-f0-9]{7}\]\([^)]*\)\)/g, '')
|
|
43
|
-
// Issue/PR links: [#151](https://...) → #151
|
|
44
|
-
.replace(/\[#(\d+)\]\([^)]*\)/g, '#$1')
|
|
45
|
-
// Remove **deps:** dependency update lines (not useful to end users)
|
|
46
|
-
.replace(/^[*-] \*\*deps:\*\*.*$/gm, '')
|
|
47
|
-
// Remove **scope:** prefixes but keep the text: **task:** foo → foo
|
|
48
|
-
.replace(/\*\*[\w-]+:\*\* /g, '')
|
|
49
|
-
// Clean up blank lines left by removed dep lines
|
|
50
|
-
.replace(/\n{3,}/g, '\n\n')
|
|
51
|
-
// Remove section headers left empty after filtering (e.g. ### Bug Fixes with no items)
|
|
52
|
-
.replace(/### [\w ]+\n\n(?=#|$)/gm, ''));
|
|
53
|
-
}
|
|
54
|
-
function parseChangelog(content, count) {
|
|
55
|
-
const sections = content.split(/\n(?=## (?:\d|\[))/);
|
|
56
|
-
const versionSections = sections.filter((s) => /^## (?:\d|\[)/.test(s));
|
|
57
|
-
const selected = versionSections.slice(0, count);
|
|
58
|
-
if (selected.length === 0) {
|
|
59
|
-
return { text: 'No changelog entries found.', hasMore: false };
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
text: cleanChangelog(selected.join('\n').trimEnd()),
|
|
63
|
-
hasMore: versionSections.length > count,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export async function changelogAction(options) {
|
|
67
|
-
const count = Number(options.count);
|
|
68
|
-
if (!Number.isInteger(count) || count < 1) {
|
|
69
|
-
console.error(chalk.red('Error:'), 'Count must be a positive number');
|
|
70
|
-
process.exitCode = 1;
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
let content;
|
|
74
|
-
try {
|
|
75
|
-
content = await readFile(CHANGELOG_PATH, 'utf-8');
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
console.error(chalk.red('Error:'), 'Could not read changelog file');
|
|
79
|
-
process.exitCode = 1;
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const { text, hasMore } = parseChangelog(content, count);
|
|
83
|
-
console.log(formatForTerminal(text));
|
|
84
|
-
if (hasMore) {
|
|
85
|
-
console.log(chalk.dim(`\nView full changelog: ${CHANGELOG_URL}`));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
6
|
+
const REPO_URL = packageJson.repository.url.replace(/^git\+/, '').replace(/\.git$/, '');
|
|
88
7
|
export function registerChangelogCommand(program) {
|
|
89
|
-
program
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.
|
|
93
|
-
|
|
8
|
+
registerCoreChangelogCommand(program, {
|
|
9
|
+
path: CHANGELOG_PATH,
|
|
10
|
+
repoUrl: REPO_URL,
|
|
11
|
+
version: packageJson.version,
|
|
12
|
+
bulletMarkers: ['*', '-'],
|
|
13
|
+
});
|
|
94
14
|
}
|
|
95
15
|
//# sourceMappingURL=changelog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/commands/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/commands/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,wBAAwB,IAAI,4BAA4B,EAAE,MAAM,0BAA0B,CAAA;AAEnG,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAElE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAA;AAChG,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AAEvF,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACrD,4BAA4B,CAAC,OAAO,EAAE;QAClC,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;KAC5B,CAAC,CAAA;AACN,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,9 @@ import { registerDocumentCommand } from './commands/document.js';
|
|
|
8
8
|
import { registerSearchCommand } from './commands/search.js';
|
|
9
9
|
import { registerSkillCommand } from './commands/skill.js';
|
|
10
10
|
import { registerUpdateCommand } from './commands/update/index.js';
|
|
11
|
+
import { BaseCliError } from './lib/errors.js';
|
|
12
|
+
import { isJsonMode } from './lib/global-args.js';
|
|
13
|
+
import { formatError, formatErrorJson } from './lib/output.js';
|
|
11
14
|
const program = new Command();
|
|
12
15
|
program
|
|
13
16
|
.name('ol')
|
|
@@ -27,7 +30,12 @@ registerSkillCommand(program);
|
|
|
27
30
|
registerChangelogCommand(program);
|
|
28
31
|
registerUpdateCommand(program);
|
|
29
32
|
program.parseAsync().catch((err) => {
|
|
30
|
-
|
|
33
|
+
if (err instanceof BaseCliError) {
|
|
34
|
+
console.error(isJsonMode() ? formatErrorJson(err) : formatError(err));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.error(err.message);
|
|
38
|
+
}
|
|
31
39
|
process.exit(1);
|
|
32
40
|
});
|
|
33
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,E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Ae,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IACzE,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAC9B,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC,CAAC,CAAA"}
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -7,8 +7,12 @@ export interface PaginatedResult<T> {
|
|
|
7
7
|
data: T;
|
|
8
8
|
pagination?: Pagination;
|
|
9
9
|
}
|
|
10
|
+
export type ApiRequestOverrides = {
|
|
11
|
+
token?: string;
|
|
12
|
+
baseUrl?: string;
|
|
13
|
+
};
|
|
10
14
|
/**
|
|
11
15
|
* Public API request function that wraps rawApiRequest with automatic spinners.
|
|
12
16
|
* Spinner messages are configured per API path in API_SPINNER_CONFIG.
|
|
13
17
|
*/
|
|
14
|
-
export declare function apiRequest<T>(path: string, body?: object): Promise<PaginatedResult<T>>;
|
|
18
|
+
export declare function apiRequest<T>(path: string, body?: object, overrides?: ApiRequestOverrides): Promise<PaginatedResult<T>>;
|
package/dist/lib/api.js
CHANGED
|
@@ -25,15 +25,18 @@ const API_SPINNER_CONFIG = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Core API request function without spinner wrapping.
|
|
27
27
|
*/
|
|
28
|
-
async function rawApiRequest(path, body = {}) {
|
|
29
|
-
const [
|
|
28
|
+
async function rawApiRequest(path, body = {}, overrides = {}) {
|
|
29
|
+
const [resolvedBaseUrl, resolvedToken] = await Promise.all([
|
|
30
|
+
overrides.baseUrl ? Promise.resolve(overrides.baseUrl.replace(/\/$/, '')) : getBaseUrl(),
|
|
31
|
+
overrides.token ? Promise.resolve(overrides.token) : getApiToken(),
|
|
32
|
+
]);
|
|
30
33
|
const res = await fetchWithRetry({
|
|
31
|
-
url: `${
|
|
34
|
+
url: `${resolvedBaseUrl}/api/${path}`,
|
|
32
35
|
options: {
|
|
33
36
|
method: 'POST',
|
|
34
37
|
headers: {
|
|
35
38
|
'Content-Type': 'application/json',
|
|
36
|
-
Authorization: `Bearer ${
|
|
39
|
+
Authorization: `Bearer ${resolvedToken}`,
|
|
37
40
|
},
|
|
38
41
|
body: JSON.stringify(body),
|
|
39
42
|
},
|
|
@@ -55,11 +58,11 @@ async function rawApiRequest(path, body = {}) {
|
|
|
55
58
|
* Public API request function that wraps rawApiRequest with automatic spinners.
|
|
56
59
|
* Spinner messages are configured per API path in API_SPINNER_CONFIG.
|
|
57
60
|
*/
|
|
58
|
-
export async function apiRequest(path, body = {}) {
|
|
61
|
+
export async function apiRequest(path, body = {}, overrides = {}) {
|
|
59
62
|
const spinnerConfig = API_SPINNER_CONFIG[path] ?? {
|
|
60
63
|
text: 'Loading...',
|
|
61
64
|
color: 'blue',
|
|
62
65
|
};
|
|
63
|
-
return withSpinner(spinnerConfig, () => rawApiRequest(path, body));
|
|
66
|
+
return withSpinner(spinnerConfig, () => rawApiRequest(path, body, overrides));
|
|
64
67
|
}
|
|
65
68
|
//# sourceMappingURL=api.js.map
|
package/dist/lib/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAuB,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/D;;;GAGG;AACH,MAAM,kBAAkB,GAAmC;IACvD,WAAW,EAAE,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,MAAM,EAAE;IAClE,kBAAkB,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,EAAE;IACrE,gBAAgB,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE;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,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAA;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC5B,IAAY,EACZ,OAAe,EAAE,EACjB,YAAiC,EAAE;IAEnC,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI;QAC9C,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,MAAe;KACzB,CAAA;IAED,OAAO,WAAW,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,CAAI,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAA;AACpF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Config } from './config.js';
|
|
2
|
+
/** OS keyring `service` identifier for every outline-cli secret. */
|
|
3
|
+
export declare const SECURE_STORE_SERVICE = "outline-cli";
|
|
4
|
+
/** Env var that short-circuits the token store with a manually-supplied token. */
|
|
5
|
+
export declare const TOKEN_ENV_VAR = "OUTLINE_API_TOKEN";
|
|
6
|
+
/**
|
|
7
|
+
* Legacy single-user keyring slot. Outline never wrote a token to the
|
|
8
|
+
* keyring before this migration, so there is no real legacy slot to read —
|
|
9
|
+
* `migrateLegacyAuth` still expects the option, and its best-effort delete
|
|
10
|
+
* after migration is a harmless no-op on an empty entry.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LEGACY_KEYRING_ACCOUNT = "api-token";
|
|
13
|
+
/**
|
|
14
|
+
* `updateConfig` payload that wipes every v1 auth key. Used by both the
|
|
15
|
+
* one-shot migration `cleanupLegacyConfig` and the runtime
|
|
16
|
+
* `dischargeLegacyState` so both paths stay in lockstep.
|
|
17
|
+
*/
|
|
18
|
+
export declare const LEGACY_CLEAR_PAYLOAD: Partial<Config>;
|