@doist/outline-cli 1.5.3 → 1.6.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 +6 -0
- package/dist/commands/auth.js +28 -134
- 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-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 +10 -0
- package/dist/lib/auth-provider.js +198 -0
- package/dist/lib/auth-provider.js.map +1 -0
- package/dist/lib/auth.d.ts +6 -2
- package/dist/lib/auth.js +11 -12
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/config.d.ts +3 -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/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 +8 -3
- package/dist/lib/skills/content.js.map +1 -1
- 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,9 @@
|
|
|
1
|
+
## [1.6.0](https://github.com/Doist/outline-cli/compare/v1.5.3...v1.6.0) (2026-05-15)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **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))
|
|
6
|
+
|
|
1
7
|
## [1.5.3](https://github.com/Doist/outline-cli/compare/v1.5.2...v1.5.3) (2026-05-11)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
package/dist/commands/auth.js
CHANGED
|
@@ -1,147 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attachLoginCommand } 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 {
|
|
4
|
+
import { renderError, renderSuccess } from '../lib/auth-pages.js';
|
|
5
|
+
import { createOutlineAuthProvider, createOutlineTokenStore } from '../lib/auth-provider.js';
|
|
6
|
+
import { clearConfig, getBaseUrl, getTokenSource } from '../lib/auth.js';
|
|
8
7
|
import { formatError } from '../lib/output.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
finally {
|
|
16
|
-
rl.close();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function parseCallbackPort(rawPort) {
|
|
20
|
-
const parsed = Number(rawPort);
|
|
8
|
+
const DEFAULT_OAUTH_CALLBACK_PORT = 54969;
|
|
9
|
+
function resolvePreferredCallbackPort() {
|
|
10
|
+
const raw = process.env.OUTLINE_OAUTH_CALLBACK_PORT?.trim();
|
|
11
|
+
if (!raw)
|
|
12
|
+
return DEFAULT_OAUTH_CALLBACK_PORT;
|
|
13
|
+
const parsed = Number(raw);
|
|
21
14
|
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 65_535) {
|
|
22
|
-
return
|
|
15
|
+
return DEFAULT_OAUTH_CALLBACK_PORT;
|
|
23
16
|
}
|
|
24
17
|
return parsed;
|
|
25
18
|
}
|
|
26
19
|
export function registerAuthCommand(program) {
|
|
27
20
|
const auth = program.command('auth').description('Manage authentication');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
const provider = createOutlineAuthProvider();
|
|
22
|
+
const store = createOutlineTokenStore();
|
|
23
|
+
attachLoginCommand(auth, {
|
|
24
|
+
provider,
|
|
25
|
+
store,
|
|
26
|
+
preferredPort: resolvePreferredCallbackPort(),
|
|
27
|
+
resolveScopes: () => [],
|
|
28
|
+
renderSuccess,
|
|
29
|
+
renderError,
|
|
30
|
+
onSuccess({ view, account }) {
|
|
31
|
+
if (view.json || view.ndjson)
|
|
32
|
+
return;
|
|
33
|
+
console.log(chalk.green(`Authenticated to ${account.teamName} as ${account.label}`));
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
.description('Authenticate with an Outline instance via OAuth')
|
|
31
37
|
.option('--base-url <url>', 'Outline base URL to use for this login (saved for future logins)')
|
|
32
|
-
.option('--client-id <clientId>', 'OAuth client ID to use for this login (saved for future logins)')
|
|
33
|
-
.option('--callback-port <port>', `Local OAuth callback port (default: ${DEFAULT_OAUTH_CALLBACK_PORT})`)
|
|
34
|
-
.action(async (options) => {
|
|
35
|
-
const configuredBaseUrl = await getBaseUrl();
|
|
36
|
-
const optionBaseUrl = options.baseUrl?.trim();
|
|
37
|
-
const envBaseUrl = process.env.OUTLINE_URL?.trim();
|
|
38
|
-
let url = optionBaseUrl || envBaseUrl;
|
|
39
|
-
if (!url) {
|
|
40
|
-
const baseUrlInput = await prompt(`Base URL (default: ${configuredBaseUrl}): `);
|
|
41
|
-
url = baseUrlInput.trim() || configuredBaseUrl;
|
|
42
|
-
}
|
|
43
|
-
url = url.replace(/\/$/, '');
|
|
44
|
-
const optionClientId = options.clientId?.trim();
|
|
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);
|
|
57
|
-
}
|
|
58
|
-
callbackPort = parsedPort;
|
|
59
|
-
}
|
|
60
|
-
if (options.token) {
|
|
61
|
-
await saveConfig(options.token.trim(), url, optionClientId);
|
|
62
|
-
try {
|
|
63
|
-
const { data } = await apiRequest('auth.info');
|
|
64
|
-
console.log(chalk.green(`Authenticated to ${data.team.name} as ${data.user.name}`));
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
console.log(chalk.yellow('Token saved, but could not verify:'), err.message);
|
|
68
|
-
}
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const existingClientId = await getOAuthClientId();
|
|
72
|
-
let clientId = optionClientId || existingClientId;
|
|
73
|
-
if (!clientId) {
|
|
74
|
-
const clientIdInput = await prompt('OAuth Client ID: ');
|
|
75
|
-
clientId = clientIdInput.trim();
|
|
76
|
-
}
|
|
77
|
-
if (!clientId) {
|
|
78
|
-
console.error(formatError('OAUTH_CLIENT_ID_REQUIRED', 'OAuth client ID is required.', [
|
|
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",
|
|
100
|
-
];
|
|
101
|
-
if (error.code === 'EADDRINUSE') {
|
|
102
|
-
hints.unshift(`Port ${callbackPort} is already in use. Close the other process using it.`);
|
|
103
|
-
}
|
|
104
|
-
console.error(formatError('OAUTH_CALLBACK_SERVER_FAILED', `Could not start local OAuth callback server: ${error.message}`, hints));
|
|
105
|
-
process.exit(1);
|
|
106
|
-
}
|
|
107
|
-
const authorizationUrl = buildAuthorizationUrl({
|
|
108
|
-
baseUrl: url,
|
|
109
|
-
clientId,
|
|
110
|
-
redirectUri: callbackServer.redirectUri,
|
|
111
|
-
codeChallenge,
|
|
112
|
-
state,
|
|
113
|
-
});
|
|
114
|
-
try {
|
|
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
|
-
});
|
|
38
|
+
.option('--client-id <clientId>', 'OAuth client ID to use for this login (saved for future logins)');
|
|
145
39
|
auth.command('status')
|
|
146
40
|
.description('Show current authentication state')
|
|
147
41
|
.action(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,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,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,EAA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AI,EAAE;QACf,MAAM,WAAW,EAAE,CAAA;QACnB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACV,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,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,EAAE,yBAAyB,EA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,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;IACjE,gBAAgB,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAA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;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,101 @@
|
|
|
1
|
+
function escapeHtml(text) {
|
|
2
|
+
return text
|
|
3
|
+
.replaceAll('&', '&')
|
|
4
|
+
.replaceAll('<', '<')
|
|
5
|
+
.replaceAll('>', '>')
|
|
6
|
+
.replaceAll('"', '"')
|
|
7
|
+
.replaceAll("'", ''');
|
|
8
|
+
}
|
|
9
|
+
function renderPage(title, subtitle, body) {
|
|
10
|
+
return `<!doctype html>
|
|
11
|
+
<html lang="en">
|
|
12
|
+
<head>
|
|
13
|
+
<meta charset="utf-8">
|
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
15
|
+
<title>${escapeHtml(title)} - Outline CLI</title>
|
|
16
|
+
<style>
|
|
17
|
+
:root {
|
|
18
|
+
--bg: #f5f7fb;
|
|
19
|
+
--surface: #ffffff;
|
|
20
|
+
--border: #e6e9f0;
|
|
21
|
+
--text: #1e2430;
|
|
22
|
+
--muted: #586178;
|
|
23
|
+
--ok: #15803d;
|
|
24
|
+
--ok-soft: #dcfce7;
|
|
25
|
+
--err: #b91c1c;
|
|
26
|
+
--err-soft: #fee2e2;
|
|
27
|
+
--radius: 14px;
|
|
28
|
+
}
|
|
29
|
+
* { box-sizing: border-box; }
|
|
30
|
+
body {
|
|
31
|
+
margin: 0;
|
|
32
|
+
min-height: 100vh;
|
|
33
|
+
display: grid;
|
|
34
|
+
place-items: center;
|
|
35
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
36
|
+
background: radial-gradient(1200px 500px at 50% -10%, #dbeafe 0%, var(--bg) 60%);
|
|
37
|
+
color: var(--text);
|
|
38
|
+
line-height: 1.5;
|
|
39
|
+
padding: 20px;
|
|
40
|
+
}
|
|
41
|
+
.card {
|
|
42
|
+
width: min(560px, 100%);
|
|
43
|
+
background: var(--surface);
|
|
44
|
+
border: 1px solid var(--border);
|
|
45
|
+
border-radius: var(--radius);
|
|
46
|
+
padding: 24px;
|
|
47
|
+
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
|
|
48
|
+
}
|
|
49
|
+
h1 {
|
|
50
|
+
margin: 0 0 8px;
|
|
51
|
+
font-size: 24px;
|
|
52
|
+
letter-spacing: -0.01em;
|
|
53
|
+
}
|
|
54
|
+
.subtitle {
|
|
55
|
+
margin: 0 0 16px;
|
|
56
|
+
color: var(--muted);
|
|
57
|
+
font-size: 15px;
|
|
58
|
+
}
|
|
59
|
+
.message {
|
|
60
|
+
border-radius: 12px;
|
|
61
|
+
padding: 14px 16px;
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
}
|
|
64
|
+
.success {
|
|
65
|
+
background: var(--ok-soft);
|
|
66
|
+
color: #14532d;
|
|
67
|
+
}
|
|
68
|
+
.error {
|
|
69
|
+
background: var(--err-soft);
|
|
70
|
+
color: #7f1d1d;
|
|
71
|
+
}
|
|
72
|
+
.hint {
|
|
73
|
+
margin-top: 14px;
|
|
74
|
+
color: var(--muted);
|
|
75
|
+
font-size: 13px;
|
|
76
|
+
}
|
|
77
|
+
code {
|
|
78
|
+
font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
79
|
+
background: #eef2ff;
|
|
80
|
+
border-radius: 6px;
|
|
81
|
+
padding: 2px 6px;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
84
|
+
</head>
|
|
85
|
+
<body>
|
|
86
|
+
<main class="card">
|
|
87
|
+
<h1>${escapeHtml(title)}</h1>
|
|
88
|
+
<p class="subtitle">${escapeHtml(subtitle)}</p>
|
|
89
|
+
${body}
|
|
90
|
+
<p class="hint">Return to your terminal and continue with <code>ol</code> commands.</p>
|
|
91
|
+
</main>
|
|
92
|
+
</body>
|
|
93
|
+
</html>`;
|
|
94
|
+
}
|
|
95
|
+
export function renderSuccess() {
|
|
96
|
+
return renderPage('Login complete', 'Outline CLI is now authenticated.', '<div class="message success">You can close this tab now.</div>');
|
|
97
|
+
}
|
|
98
|
+
export function renderError(message) {
|
|
99
|
+
return renderPage('Authentication failed', 'Outline CLI could not finish OAuth login.', `<div class="message error">${escapeHtml(message)}</div>`);
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=auth-pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-pages.js","sourceRoot":"","sources":["../../src/lib/auth-pages.ts"],"names":[],"mappings":"AAAA,SAAS,UAAU,CAAC,IAAY;IAC5B,OAAO,IAAI;SACN,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;SACxB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC;SACzB,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,QAAgB,EAAE,IAAY;IAC7D,OAAO;;;;;WAKA,UAAU,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAwElB,UAAU,CAAC,KAAK,CAAC;0BACD,UAAU,CAAC,QAAQ,CAAC;MACxC,IAAI;;;;QAIF,CAAA;AACR,CAAC;AAED,MAAM,UAAU,aAAa;IACzB,OAAO,UAAU,CACb,gBAAgB,EAChB,mCAAmC,EACnC,gEAAgE,CACnE,CAAA;AACL,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe;IACvC,OAAO,UAAU,CACb,uBAAuB,EACvB,2CAA2C,EAC3C,8BAA8B,UAAU,CAAC,OAAO,CAAC,QAAQ,CAC5D,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AuthAccount, type AuthProvider, type TokenStore } from '@doist/cli-core/auth';
|
|
2
|
+
export type OutlineAccount = AuthAccount & {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
oauthClientId: string;
|
|
7
|
+
teamName?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function createOutlineAuthProvider(): AuthProvider<OutlineAccount>;
|
|
10
|
+
export declare function createOutlineTokenStore(): TokenStore<OutlineAccount>;
|