@mx-space/cli 0.1.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/LICENSE +33 -0
- package/README.md +375 -0
- package/ROADMAP.md +42 -0
- package/bin/mxs.cjs +40 -0
- package/dist/Lexical.dev-DpU35QTu.mjs +10992 -0
- package/dist/Lexical.dev-DpU35QTu.mjs.map +1 -0
- package/dist/Lexical.node-gYNDt_p9.mjs +247 -0
- package/dist/Lexical.node-gYNDt_p9.mjs.map +1 -0
- package/dist/Lexical.prod-t4c3bHV3.mjs +5579 -0
- package/dist/Lexical.prod-t4c3bHV3.mjs.map +1 -0
- package/dist/LexicalClipboard.dev-CdeeWCIq.mjs +496 -0
- package/dist/LexicalClipboard.dev-CdeeWCIq.mjs.map +1 -0
- package/dist/LexicalClipboard.node-0e9GBL1g.mjs +26 -0
- package/dist/LexicalClipboard.node-0e9GBL1g.mjs.map +1 -0
- package/dist/LexicalClipboard.prod-CsCWYmV7.mjs +293 -0
- package/dist/LexicalClipboard.prod-CsCWYmV7.mjs.map +1 -0
- package/dist/LexicalCodeCore.dev-haI2cqH8.mjs +539 -0
- package/dist/LexicalCodeCore.dev-haI2cqH8.mjs.map +1 -0
- package/dist/LexicalCodeCore.prod-D_k7zuE5.mjs +383 -0
- package/dist/LexicalCodeCore.prod-D_k7zuE5.mjs.map +1 -0
- package/dist/LexicalDragon.dev-CAggdFh_.mjs +90 -0
- package/dist/LexicalDragon.dev-CAggdFh_.mjs.map +1 -0
- package/dist/LexicalDragon.node-QMR_wqJg.mjs +15 -0
- package/dist/LexicalDragon.node-QMR_wqJg.mjs.map +1 -0
- package/dist/LexicalDragon.prod-OssQhwS-.mjs +61 -0
- package/dist/LexicalDragon.prod-OssQhwS-.mjs.map +1 -0
- package/dist/LexicalExtension.dev-CtDZiMCU.mjs +1665 -0
- package/dist/LexicalExtension.dev-CtDZiMCU.mjs.map +1 -0
- package/dist/LexicalExtension.node-BM0gh8zu.mjs +51 -0
- package/dist/LexicalExtension.node-BM0gh8zu.mjs.map +1 -0
- package/dist/LexicalExtension.prod-Ug6emhEO.mjs +971 -0
- package/dist/LexicalExtension.prod-Ug6emhEO.mjs.map +1 -0
- package/dist/LexicalHeadless.dev-D4yQpl_s.mjs +45 -0
- package/dist/LexicalHeadless.dev-D4yQpl_s.mjs.map +1 -0
- package/dist/LexicalHeadless.prod-jeN65B3k.mjs +31 -0
- package/dist/LexicalHeadless.prod-jeN65B3k.mjs.map +1 -0
- package/dist/LexicalHtml.dev-BdU1_ITQ.mjs +686 -0
- package/dist/LexicalHtml.dev-BdU1_ITQ.mjs.map +1 -0
- package/dist/LexicalHtml.node-DLtAh00E.mjs +26 -0
- package/dist/LexicalHtml.node-DLtAh00E.mjs.map +1 -0
- package/dist/LexicalHtml.prod-DdLE1HHT.mjs +432 -0
- package/dist/LexicalHtml.prod-DdLE1HHT.mjs.map +1 -0
- package/dist/LexicalLink.dev-DK87Biuy.mjs +1084 -0
- package/dist/LexicalLink.dev-DK87Biuy.mjs.map +1 -0
- package/dist/LexicalLink.prod-fssuv6Sf.mjs +717 -0
- package/dist/LexicalLink.prod-fssuv6Sf.mjs.map +1 -0
- package/dist/LexicalList.dev-BJ4dr_rk.mjs +1352 -0
- package/dist/LexicalList.dev-BJ4dr_rk.mjs.map +1 -0
- package/dist/LexicalList.prod-jWBbaWfi.mjs +841 -0
- package/dist/LexicalList.prod-jWBbaWfi.mjs.map +1 -0
- package/dist/LexicalMarkdown.dev-C8e-eh6y.mjs +1207 -0
- package/dist/LexicalMarkdown.dev-C8e-eh6y.mjs.map +1 -0
- package/dist/LexicalMarkdown.prod-k73tZVb2.mjs +756 -0
- package/dist/LexicalMarkdown.prod-k73tZVb2.mjs.map +1 -0
- package/dist/LexicalRichText.dev-CrSqq3K-.mjs +645 -0
- package/dist/LexicalRichText.dev-CrSqq3K-.mjs.map +1 -0
- package/dist/LexicalRichText.node-B7k7wlQz.mjs +106 -0
- package/dist/LexicalRichText.node-B7k7wlQz.mjs.map +1 -0
- package/dist/LexicalRichText.prod-CqvyxQ9m.mjs +429 -0
- package/dist/LexicalRichText.prod-CqvyxQ9m.mjs.map +1 -0
- package/dist/LexicalSelection.dev-sNOHKHe_.mjs +725 -0
- package/dist/LexicalSelection.dev-sNOHKHe_.mjs.map +1 -0
- package/dist/LexicalSelection.node-Di7GwBCZ.mjs +38 -0
- package/dist/LexicalSelection.node-Di7GwBCZ.mjs.map +1 -0
- package/dist/LexicalSelection.prod-SWllPJop.mjs +388 -0
- package/dist/LexicalSelection.prod-SWllPJop.mjs.map +1 -0
- package/dist/LexicalTable.dev-CQkLHXJx.mjs +3262 -0
- package/dist/LexicalTable.dev-CQkLHXJx.mjs.map +1 -0
- package/dist/LexicalTable.prod-BtqCwKSi.mjs +2218 -0
- package/dist/LexicalTable.prod-BtqCwKSi.mjs.map +1 -0
- package/dist/LexicalUtils.dev-DiUpsXE8.mjs +850 -0
- package/dist/LexicalUtils.dev-DiUpsXE8.mjs.map +1 -0
- package/dist/LexicalUtils.node-CmK462d1.mjs +66 -0
- package/dist/LexicalUtils.node-CmK462d1.mjs.map +1 -0
- package/dist/LexicalUtils.prod-bWwV4GAF.mjs +377 -0
- package/dist/LexicalUtils.prod-bWwV4GAF.mjs.map +1 -0
- package/dist/auth-DIFZzoMm.mjs +211 -0
- package/dist/auth-DIFZzoMm.mjs.map +1 -0
- package/dist/bin/mxs.d.mts +927 -0
- package/dist/bin/mxs.mjs +3249 -0
- package/dist/bin/mxs.mjs.map +1 -0
- package/dist/chunk-hT5z_Zn9.mjs +35 -0
- package/dist/config-store-DIu7x0ao.mjs +121 -0
- package/dist/config-store-DIu7x0ao.mjs.map +1 -0
- package/dist/create-B2AOQL1e.mjs +24 -0
- package/dist/create-B2AOQL1e.mjs.map +1 -0
- package/dist/create-CwjGcv2n.mjs +23 -0
- package/dist/create-CwjGcv2n.mjs.map +1 -0
- package/dist/create-DT1l2hue.mjs +23 -0
- package/dist/create-DT1l2hue.mjs.map +1 -0
- package/dist/create-DjlRHPXy.mjs +23 -0
- package/dist/create-DjlRHPXy.mjs.map +1 -0
- package/dist/create-Dz6rJJSS.mjs +19 -0
- package/dist/create-Dz6rJJSS.mjs.map +1 -0
- package/dist/delete-B4dGrrus.mjs +22 -0
- package/dist/delete-B4dGrrus.mjs.map +1 -0
- package/dist/delete-BH6ZngTz.mjs +22 -0
- package/dist/delete-BH6ZngTz.mjs.map +1 -0
- package/dist/delete-BrY5zJ6S.mjs +22 -0
- package/dist/delete-BrY5zJ6S.mjs.map +1 -0
- package/dist/delete-CaG2d_xt.mjs +31 -0
- package/dist/delete-CaG2d_xt.mjs.map +1 -0
- package/dist/delete-YzRliRn8.mjs +31 -0
- package/dist/delete-YzRliRn8.mjs.map +1 -0
- package/dist/document-output-BVB8emLt.mjs +145 -0
- package/dist/document-output-BVB8emLt.mjs.map +1 -0
- package/dist/edit-Bb0Ze4w6.mjs +79 -0
- package/dist/edit-Bb0Ze4w6.mjs.map +1 -0
- package/dist/edit-BeFmC3XD.mjs +80 -0
- package/dist/edit-BeFmC3XD.mjs.map +1 -0
- package/dist/edit-DLDw_ZWX.mjs +86 -0
- package/dist/edit-DLDw_ZWX.mjs.map +1 -0
- package/dist/edit-z55ofr1S.mjs +40 -0
- package/dist/edit-z55ofr1S.mjs.map +1 -0
- package/dist/editor-xrF-j3UE.mjs +42 -0
- package/dist/editor-xrF-j3UE.mjs.map +1 -0
- package/dist/envelope-overlays-DPAlMNW1.mjs +26 -0
- package/dist/envelope-overlays-DPAlMNW1.mjs.map +1 -0
- package/dist/get-2qjq0wgG.mjs +28 -0
- package/dist/get-2qjq0wgG.mjs.map +1 -0
- package/dist/get-BGAk1Zmv.mjs +14 -0
- package/dist/get-BGAk1Zmv.mjs.map +1 -0
- package/dist/get-CRR13lgj.mjs +10 -0
- package/dist/get-CRR13lgj.mjs.map +1 -0
- package/dist/get-ClkpDBTL.mjs +13 -0
- package/dist/get-ClkpDBTL.mjs.map +1 -0
- package/dist/get-DJfUJ3sP.mjs +10 -0
- package/dist/get-DJfUJ3sP.mjs.map +1 -0
- package/dist/get-DiqaQvoS.mjs +14 -0
- package/dist/get-DiqaQvoS.mjs.map +1 -0
- package/dist/index.d.mts +338 -0
- package/dist/index.mjs +10 -0
- package/dist/list-BYzhflDg.mjs +14 -0
- package/dist/list-BYzhflDg.mjs.map +1 -0
- package/dist/list-DY-tPNG-.mjs +10 -0
- package/dist/list-DY-tPNG-.mjs.map +1 -0
- package/dist/list-DlQSkbqx.mjs +10 -0
- package/dist/list-DlQSkbqx.mjs.map +1 -0
- package/dist/list-DsrA5wIz.mjs +15 -0
- package/dist/list-DsrA5wIz.mjs.map +1 -0
- package/dist/list-Fp4nKfQb.mjs +10 -0
- package/dist/list-Fp4nKfQb.mjs.map +1 -0
- package/dist/list-s_tloiEX.mjs +10 -0
- package/dist/list-s_tloiEX.mjs.map +1 -0
- package/dist/litexml-codec-CDoRloiR.mjs +13451 -0
- package/dist/litexml-codec-CDoRloiR.mjs.map +1 -0
- package/dist/login-CLOJ-fTJ.mjs +579 -0
- package/dist/login-CLOJ-fTJ.mjs.map +1 -0
- package/dist/logout-v8ihxsim.mjs +11 -0
- package/dist/logout-v8ihxsim.mjs.map +1 -0
- package/dist/onboarding-640IldLz.mjs +888 -0
- package/dist/onboarding-640IldLz.mjs.map +1 -0
- package/dist/output-BM7aBFwt.mjs +120 -0
- package/dist/output-BM7aBFwt.mjs.map +1 -0
- package/dist/output-CTnO1lYt.d.mts +16 -0
- package/dist/payload-CN11pUto.mjs +547 -0
- package/dist/payload-CN11pUto.mjs.map +1 -0
- package/dist/publish-DkTYB-eK.mjs +23 -0
- package/dist/publish-DkTYB-eK.mjs.map +1 -0
- package/dist/publish-pRBfTJfe.mjs +23 -0
- package/dist/publish-pRBfTJfe.mjs.map +1 -0
- package/dist/resolve-BogJOR7R.mjs +119 -0
- package/dist/resolve-BogJOR7R.mjs.map +1 -0
- package/dist/resolve-Bp1AfBmM.mjs +26 -0
- package/dist/resolve-Bp1AfBmM.mjs.map +1 -0
- package/dist/resolve-Bw5Po9yK.mjs +16 -0
- package/dist/resolve-Bw5Po9yK.mjs.map +1 -0
- package/dist/resolve-CyjMlaoJ.mjs +23 -0
- package/dist/resolve-CyjMlaoJ.mjs.map +1 -0
- package/dist/resolve-helpers-CahPoJ0Y.mjs +30 -0
- package/dist/resolve-helpers-CahPoJ0Y.mjs.map +1 -0
- package/dist/set-BEGQz2si.mjs +43 -0
- package/dist/set-BEGQz2si.mjs.map +1 -0
- package/dist/shared-D0HVBDHI.mjs +39 -0
- package/dist/shared-D0HVBDHI.mjs.map +1 -0
- package/dist/status-LXrN9fI-.mjs +22 -0
- package/dist/status-LXrN9fI-.mjs.map +1 -0
- package/dist/update-B9ynFCdZ.mjs +30 -0
- package/dist/update-B9ynFCdZ.mjs.map +1 -0
- package/dist/update-BMZQPOvR.mjs +28 -0
- package/dist/update-BMZQPOvR.mjs.map +1 -0
- package/dist/update-BXz0l7Lz.mjs +36 -0
- package/dist/update-BXz0l7Lz.mjs.map +1 -0
- package/dist/update-Dx6AF8tf.mjs +30 -0
- package/dist/update-Dx6AF8tf.mjs.map +1 -0
- package/dist/update-q66TLS38.mjs +37 -0
- package/dist/update-q66TLS38.mjs.map +1 -0
- package/dist/whoami-CTkctOEd.mjs +22 -0
- package/dist/whoami-CTkctOEd.mjs.map +1 -0
- package/package.json +77 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { a as emitSuccess, i as emitInfo, n as defaultOutputOptions, o as emitWarn, r as emitError, s as renderTable, t as OutputOptions } from "./output-CTnO1lYt.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/core/config-store.d.ts
|
|
4
|
+
interface ConfigShape {
|
|
5
|
+
api_url?: string;
|
|
6
|
+
api_base?: string;
|
|
7
|
+
auth_base?: string;
|
|
8
|
+
api_version?: number;
|
|
9
|
+
client_id?: string;
|
|
10
|
+
}
|
|
11
|
+
interface CredentialsShape {
|
|
12
|
+
access_token: string;
|
|
13
|
+
refresh_token?: string;
|
|
14
|
+
expires_at: number;
|
|
15
|
+
user?: {
|
|
16
|
+
id?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface ResolvedConfig {
|
|
22
|
+
apiUrl: string;
|
|
23
|
+
apiBase: string;
|
|
24
|
+
authBase: string;
|
|
25
|
+
apiVersion: number;
|
|
26
|
+
clientId: string;
|
|
27
|
+
token?: string;
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
configPath: string;
|
|
30
|
+
credentialsPath: string;
|
|
31
|
+
}
|
|
32
|
+
interface StoreOverrides {
|
|
33
|
+
apiUrl?: string;
|
|
34
|
+
token?: string;
|
|
35
|
+
apiKey?: string;
|
|
36
|
+
}
|
|
37
|
+
declare function getConfigDir(): string;
|
|
38
|
+
declare function getConfigPath(): string;
|
|
39
|
+
declare function getCredentialsPath(): string;
|
|
40
|
+
declare function readConfig(): Promise<ConfigShape>;
|
|
41
|
+
declare function writeConfig(cfg: ConfigShape): Promise<void>;
|
|
42
|
+
declare function readCredentials(): Promise<CredentialsShape | null>;
|
|
43
|
+
declare function writeCredentials(cred: CredentialsShape): Promise<void>;
|
|
44
|
+
declare function deleteCredentials(): Promise<void>;
|
|
45
|
+
declare function enforceCredentialsMode(p?: string): Promise<boolean>;
|
|
46
|
+
declare function normalizeApiUrl(input: string): string;
|
|
47
|
+
declare function resolveConfig(overrides?: StoreOverrides): Promise<ResolvedConfig>;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/core/auth.d.ts
|
|
50
|
+
declare const SUPPORTED_API_VERSIONS: readonly [2];
|
|
51
|
+
interface DeviceCodeResponse {
|
|
52
|
+
device_code: string;
|
|
53
|
+
user_code: string;
|
|
54
|
+
verification_uri: string;
|
|
55
|
+
verification_uri_complete?: string;
|
|
56
|
+
expires_in: number;
|
|
57
|
+
interval: number;
|
|
58
|
+
}
|
|
59
|
+
interface DeviceTokenResponse {
|
|
60
|
+
access_token: string;
|
|
61
|
+
token_type: string;
|
|
62
|
+
expires_in: number;
|
|
63
|
+
refresh_token?: string;
|
|
64
|
+
scope?: string;
|
|
65
|
+
user?: {
|
|
66
|
+
id?: string;
|
|
67
|
+
email?: string;
|
|
68
|
+
name?: string;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
interface ProbeResult {
|
|
72
|
+
apiUrl: string;
|
|
73
|
+
apiBase: string;
|
|
74
|
+
authBase: string;
|
|
75
|
+
apiVersion: number;
|
|
76
|
+
}
|
|
77
|
+
interface AuthHttp {
|
|
78
|
+
fetch: typeof fetch;
|
|
79
|
+
}
|
|
80
|
+
declare function probeAuthEndpoint(apiUrl: string, http?: AuthHttp): Promise<ProbeResult>;
|
|
81
|
+
declare function requestDeviceCode(authBase: string, clientId: string, scope?: string, http?: AuthHttp): Promise<DeviceCodeResponse>;
|
|
82
|
+
interface PollOptions {
|
|
83
|
+
intervalSec: number;
|
|
84
|
+
expiresInSec: number;
|
|
85
|
+
signal?: AbortSignal;
|
|
86
|
+
onTick?: (state: 'pending' | 'slow_down') => void;
|
|
87
|
+
http?: AuthHttp;
|
|
88
|
+
}
|
|
89
|
+
declare function pollDeviceToken(authBase: string, clientId: string, deviceCode: string, opts: PollOptions): Promise<DeviceTokenResponse>;
|
|
90
|
+
declare function toCredentials(resp: DeviceTokenResponse): CredentialsShape;
|
|
91
|
+
declare function isExpiringSoon(cred: CredentialsShape, bufferMs?: number): boolean;
|
|
92
|
+
declare function refreshAccessToken(authBase: string, clientId: string, cred: CredentialsShape, http?: AuthHttp): Promise<CredentialsShape | null>;
|
|
93
|
+
declare function loadCredentialsOrThrow(): Promise<CredentialsShape>;
|
|
94
|
+
declare function ensureFreshToken(authBase: string, clientId: string, http?: AuthHttp): Promise<CredentialsShape>;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/core/api-client.d.ts
|
|
97
|
+
interface ApiClientContext {
|
|
98
|
+
apiBase: string;
|
|
99
|
+
authBase: string;
|
|
100
|
+
clientId: string;
|
|
101
|
+
token?: string;
|
|
102
|
+
apiKey?: string;
|
|
103
|
+
autoRefresh?: boolean;
|
|
104
|
+
verbose?: boolean;
|
|
105
|
+
http?: AuthHttp;
|
|
106
|
+
}
|
|
107
|
+
interface RequestOptions {
|
|
108
|
+
method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
109
|
+
body?: unknown;
|
|
110
|
+
query?: Record<string, unknown>;
|
|
111
|
+
headers?: Record<string, string>;
|
|
112
|
+
signal?: AbortSignal;
|
|
113
|
+
}
|
|
114
|
+
interface ApiResponse<T> {
|
|
115
|
+
ok: boolean;
|
|
116
|
+
status: number;
|
|
117
|
+
data: T;
|
|
118
|
+
}
|
|
119
|
+
declare class ApiClient {
|
|
120
|
+
private ctx;
|
|
121
|
+
private http;
|
|
122
|
+
private token?;
|
|
123
|
+
private refreshed;
|
|
124
|
+
constructor(ctx: ApiClientContext);
|
|
125
|
+
get apiBase(): string;
|
|
126
|
+
request<T = unknown>(path: string, options?: RequestOptions): Promise<ApiResponse<T>>;
|
|
127
|
+
private tryRefresh;
|
|
128
|
+
}
|
|
129
|
+
declare function createApiClient(ctx: ApiClientContext): Promise<ApiClient>;
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/core/content-spec.d.ts
|
|
132
|
+
interface ContentSource {
|
|
133
|
+
text: string;
|
|
134
|
+
origin: 'inline' | 'file' | 'stdin';
|
|
135
|
+
path?: string;
|
|
136
|
+
}
|
|
137
|
+
declare function readContentSpec(spec: string | undefined, {
|
|
138
|
+
cwd
|
|
139
|
+
}?: {
|
|
140
|
+
cwd?: string;
|
|
141
|
+
}): Promise<ContentSource | null>;
|
|
142
|
+
declare function readJsonSpec(spec: string | undefined): Promise<unknown>;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/core/editor.d.ts
|
|
145
|
+
interface EditorOptions {
|
|
146
|
+
filename: string;
|
|
147
|
+
initialContent: string;
|
|
148
|
+
editor?: string;
|
|
149
|
+
}
|
|
150
|
+
declare function runEditorRoundTrip(opts: EditorOptions): Promise<string>;
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/core/document-output.d.ts
|
|
153
|
+
type DocumentKind = 'post' | 'note' | 'page';
|
|
154
|
+
declare function emitDocument(kind: DocumentKind, data: unknown, opts: OutputOptions): void;
|
|
155
|
+
declare function renderReadableDocument(kind: DocumentKind, data: unknown): string;
|
|
156
|
+
declare function renderDocumentEnvelope(kind: DocumentKind, data: unknown): string;
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/core/envelope.d.ts
|
|
159
|
+
type EnvelopeKind = 'post' | 'note';
|
|
160
|
+
interface ParsedEnvelope {
|
|
161
|
+
kind: EnvelopeKind;
|
|
162
|
+
meta: Record<string, unknown>;
|
|
163
|
+
contentXml: string;
|
|
164
|
+
sourceMap: Record<string, number>;
|
|
165
|
+
}
|
|
166
|
+
declare function flagToTag(flag: string): string;
|
|
167
|
+
declare function tagToFlag(tag: string): string;
|
|
168
|
+
declare function parseEnvelope(xml: string, kind: EnvelopeKind): ParsedEnvelope;
|
|
169
|
+
interface EnvelopeMeta {
|
|
170
|
+
title?: string;
|
|
171
|
+
slug?: string;
|
|
172
|
+
category?: string;
|
|
173
|
+
topic?: string;
|
|
174
|
+
state?: 'publish' | 'draft';
|
|
175
|
+
summary?: string;
|
|
176
|
+
copyright?: boolean;
|
|
177
|
+
pin?: string;
|
|
178
|
+
pinOrder?: number;
|
|
179
|
+
related?: string[];
|
|
180
|
+
tags?: string[];
|
|
181
|
+
mood?: string;
|
|
182
|
+
weather?: string;
|
|
183
|
+
publicAt?: string;
|
|
184
|
+
password?: string;
|
|
185
|
+
bookmark?: boolean;
|
|
186
|
+
location?: string;
|
|
187
|
+
subtitle?: string;
|
|
188
|
+
order?: number;
|
|
189
|
+
format?: 'lexical' | 'markdown';
|
|
190
|
+
}
|
|
191
|
+
declare function coerceMeta(raw: Record<string, unknown>): EnvelopeMeta;
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/core/errors.d.ts
|
|
194
|
+
type MxsErrorCode = 'generic' | 'argv.parse' | 'auth.missing' | 'auth.expired' | 'auth.denied' | 'auth.probe' | 'network.timeout' | 'network.dns' | 'network.refused' | 'validation.failed' | 'validation.xml' | 'server.error' | 'resource.not_found' | 'config.missing.api_url' | 'config.missing.token' | (string & {});
|
|
195
|
+
interface MxsErrorOptions {
|
|
196
|
+
code: MxsErrorCode;
|
|
197
|
+
message: string;
|
|
198
|
+
details?: unknown;
|
|
199
|
+
hint?: string;
|
|
200
|
+
cause?: unknown;
|
|
201
|
+
}
|
|
202
|
+
declare class MxsError extends Error {
|
|
203
|
+
readonly code: MxsErrorCode;
|
|
204
|
+
readonly details?: unknown;
|
|
205
|
+
readonly hint?: string;
|
|
206
|
+
constructor(options: MxsErrorOptions);
|
|
207
|
+
toJSON(): {
|
|
208
|
+
hint?: string | undefined;
|
|
209
|
+
details?: {} | null | undefined;
|
|
210
|
+
ok: false;
|
|
211
|
+
code: MxsErrorCode;
|
|
212
|
+
message: string;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
declare function exitCodeForError(err: unknown): number;
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/core/litexml-codec.d.ts
|
|
218
|
+
interface LexicalState {
|
|
219
|
+
root: {
|
|
220
|
+
type: 'root';
|
|
221
|
+
children: unknown[];
|
|
222
|
+
direction?: 'ltr' | 'rtl' | null;
|
|
223
|
+
format?: string;
|
|
224
|
+
indent?: number;
|
|
225
|
+
version?: number;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
declare function parseToLexical(xml: string): LexicalState;
|
|
229
|
+
declare function serializeFromLexical(state: LexicalState): string;
|
|
230
|
+
declare function deriveTextFromLexical(state: LexicalState): string;
|
|
231
|
+
declare function emptyLexicalState(): LexicalState;
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/core/onboarding.d.ts
|
|
234
|
+
interface OnboardingResult {
|
|
235
|
+
apiUrl: string;
|
|
236
|
+
apiBase: string;
|
|
237
|
+
authBase: string;
|
|
238
|
+
apiVersion: number;
|
|
239
|
+
}
|
|
240
|
+
interface OnboardingOptions {
|
|
241
|
+
http?: AuthHttp;
|
|
242
|
+
initialApiUrl?: string;
|
|
243
|
+
isTTY?: boolean;
|
|
244
|
+
prompt?: (question: string) => Promise<string>;
|
|
245
|
+
}
|
|
246
|
+
declare function runOnboarding(opts?: OnboardingOptions): Promise<OnboardingResult>;
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/core/payload.d.ts
|
|
249
|
+
type ContentFormat = 'lexical' | 'markdown';
|
|
250
|
+
interface PostFlagInputs {
|
|
251
|
+
title?: string;
|
|
252
|
+
slug?: string;
|
|
253
|
+
category?: string;
|
|
254
|
+
content?: string;
|
|
255
|
+
format?: ContentFormat;
|
|
256
|
+
summary?: string;
|
|
257
|
+
state?: 'publish' | 'draft';
|
|
258
|
+
tags?: string[];
|
|
259
|
+
copyright?: boolean;
|
|
260
|
+
pin?: string;
|
|
261
|
+
pinOrder?: number;
|
|
262
|
+
related?: string[];
|
|
263
|
+
meta?: string;
|
|
264
|
+
file?: string;
|
|
265
|
+
}
|
|
266
|
+
interface NoteFlagInputs {
|
|
267
|
+
title?: string;
|
|
268
|
+
slug?: string;
|
|
269
|
+
topic?: string;
|
|
270
|
+
content?: string;
|
|
271
|
+
format?: ContentFormat;
|
|
272
|
+
state?: 'publish' | 'draft';
|
|
273
|
+
mood?: string;
|
|
274
|
+
weather?: string;
|
|
275
|
+
publicAt?: string;
|
|
276
|
+
password?: string;
|
|
277
|
+
bookmark?: boolean;
|
|
278
|
+
coords?: string;
|
|
279
|
+
location?: string;
|
|
280
|
+
images?: string;
|
|
281
|
+
meta?: string;
|
|
282
|
+
file?: string;
|
|
283
|
+
}
|
|
284
|
+
interface PageFlagInputs {
|
|
285
|
+
title?: string;
|
|
286
|
+
slug?: string;
|
|
287
|
+
subtitle?: string;
|
|
288
|
+
order?: number;
|
|
289
|
+
content?: string;
|
|
290
|
+
format?: ContentFormat;
|
|
291
|
+
meta?: string;
|
|
292
|
+
file?: string;
|
|
293
|
+
}
|
|
294
|
+
interface BuiltPayload {
|
|
295
|
+
payload: Record<string, unknown>;
|
|
296
|
+
envelopeMeta?: EnvelopeMeta;
|
|
297
|
+
contentSource?: 'flag' | 'envelope' | 'none';
|
|
298
|
+
}
|
|
299
|
+
declare function buildPostPayload(flags: PostFlagInputs): Promise<BuiltPayload>;
|
|
300
|
+
declare function buildNotePayload(flags: NoteFlagInputs): Promise<BuiltPayload>;
|
|
301
|
+
declare function buildPagePayload(flags: PageFlagInputs): Promise<BuiltPayload>;
|
|
302
|
+
declare function emptyPayload(format: ContentFormat): {
|
|
303
|
+
content: string;
|
|
304
|
+
text: string;
|
|
305
|
+
};
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/core/resolve.d.ts
|
|
308
|
+
interface ResolvableItem {
|
|
309
|
+
id: string;
|
|
310
|
+
slug?: string;
|
|
311
|
+
name?: string;
|
|
312
|
+
}
|
|
313
|
+
interface ResolverFetchers {
|
|
314
|
+
fetchCategories?: () => Promise<ResolvableItem[]>;
|
|
315
|
+
fetchTopics?: () => Promise<ResolvableItem[]>;
|
|
316
|
+
}
|
|
317
|
+
declare function isSnowflakeId(value: string): boolean;
|
|
318
|
+
declare class NameResolver {
|
|
319
|
+
private fetchers;
|
|
320
|
+
private cache;
|
|
321
|
+
private ttlMs;
|
|
322
|
+
constructor(fetchers: ResolverFetchers, {
|
|
323
|
+
ttlMs
|
|
324
|
+
}?: {
|
|
325
|
+
ttlMs?: number;
|
|
326
|
+
});
|
|
327
|
+
resolveCategory(value: string): Promise<string>;
|
|
328
|
+
resolveTopic(value: string): Promise<string>;
|
|
329
|
+
invalidate(kind?: string): void;
|
|
330
|
+
private resolveWith;
|
|
331
|
+
private load;
|
|
332
|
+
}
|
|
333
|
+
declare function matchItem(items: ReadonlyArray<ResolvableItem>, value: string): ResolvableItem | null;
|
|
334
|
+
declare function levenshtein(a: string, b: string): number;
|
|
335
|
+
declare function fuzzySuggest(items: ReadonlyArray<ResolvableItem>, value: string, maxDistance?: number): string[];
|
|
336
|
+
//#endregion
|
|
337
|
+
export { ApiClient, type ApiClientContext, type ApiResponse, type AuthHttp, type BuiltPayload, type ConfigShape, type ContentFormat, type ContentSource, type CredentialsShape, type DeviceCodeResponse, type DeviceTokenResponse, type DocumentKind, type EnvelopeKind, type EnvelopeMeta, type LexicalState, MxsError, type MxsErrorCode, type MxsErrorOptions, NameResolver, type NoteFlagInputs, type OnboardingResult, type OutputOptions, type PageFlagInputs, type ParsedEnvelope, type PostFlagInputs, type ProbeResult, type RequestOptions, type ResolvableItem, type ResolvedConfig, type ResolverFetchers, SUPPORTED_API_VERSIONS, buildNotePayload, buildPagePayload, buildPostPayload, coerceMeta, createApiClient, defaultOutputOptions, deleteCredentials, deriveTextFromLexical, emitDocument, emitError, emitInfo, emitSuccess, emitWarn, emptyLexicalState, emptyPayload, enforceCredentialsMode, ensureFreshToken, exitCodeForError, flagToTag, fuzzySuggest, getConfigDir, getConfigPath, getCredentialsPath, isExpiringSoon, isSnowflakeId, levenshtein, loadCredentialsOrThrow, matchItem, normalizeApiUrl, parseEnvelope, parseToLexical, pollDeviceToken, probeAuthEndpoint, readConfig, readContentSpec, readCredentials, readJsonSpec, refreshAccessToken, renderDocumentEnvelope, renderReadableDocument, renderTable, requestDeviceCode, resolveConfig, runEditorRoundTrip, runOnboarding, serializeFromLexical, tagToFlag, toCredentials, writeConfig, writeCredentials };
|
|
338
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as emitWarn, c as exitCodeForError, i as emitSuccess, n as emitError, o as renderTable, r as emitInfo, s as MxsError, t as defaultOutputOptions } from "./output-BM7aBFwt.mjs";
|
|
2
|
+
import { a as getCredentialsPath, c as readCredentials, d as writeCredentials, i as getConfigPath, l as resolveConfig, n as enforceCredentialsMode, o as normalizeApiUrl, r as getConfigDir, s as readConfig, t as deleteCredentials, u as writeConfig } from "./config-store-DIu7x0ao.mjs";
|
|
3
|
+
import { a as loadCredentialsOrThrow, c as refreshAccessToken, i as isExpiringSoon, l as requestDeviceCode, o as pollDeviceToken, r as ensureFreshToken, s as probeAuthEndpoint, t as SUPPORTED_API_VERSIONS, u as toCredentials } from "./auth-DIFZzoMm.mjs";
|
|
4
|
+
import { n as ApiClient, r as createApiClient, t as runOnboarding } from "./onboarding-640IldLz.mjs";
|
|
5
|
+
import { a as coerceMeta, c as tagToFlag, i as emptyPayload, l as readContentSpec, n as buildPagePayload, o as flagToTag, r as buildPostPayload, s as parseEnvelope, t as buildNotePayload, u as readJsonSpec } from "./payload-CN11pUto.mjs";
|
|
6
|
+
import { t as runEditorRoundTrip } from "./editor-xrF-j3UE.mjs";
|
|
7
|
+
import { i as serializeFromLexical, n as emptyLexicalState, r as parseToLexical, t as deriveTextFromLexical } from "./litexml-codec-CDoRloiR.mjs";
|
|
8
|
+
import { n as renderDocumentEnvelope, r as renderReadableDocument, t as emitDocument } from "./document-output-BVB8emLt.mjs";
|
|
9
|
+
import { a as matchItem, i as levenshtein, n as fuzzySuggest, r as isSnowflakeId, t as NameResolver } from "./resolve-BogJOR7R.mjs";
|
|
10
|
+
export { ApiClient, MxsError, NameResolver, SUPPORTED_API_VERSIONS, buildNotePayload, buildPagePayload, buildPostPayload, coerceMeta, createApiClient, defaultOutputOptions, deleteCredentials, deriveTextFromLexical, emitDocument, emitError, emitInfo, emitSuccess, emitWarn, emptyLexicalState, emptyPayload, enforceCredentialsMode, ensureFreshToken, exitCodeForError, flagToTag, fuzzySuggest, getConfigDir, getConfigPath, getCredentialsPath, isExpiringSoon, isSnowflakeId, levenshtein, loadCredentialsOrThrow, matchItem, normalizeApiUrl, parseEnvelope, parseToLexical, pollDeviceToken, probeAuthEndpoint, readConfig, readContentSpec, readCredentials, readJsonSpec, refreshAccessToken, renderDocumentEnvelope, renderReadableDocument, renderTable, requestDeviceCode, resolveConfig, runEditorRoundTrip, runOnboarding, serializeFromLexical, tagToFlag, toCredentials, writeConfig, writeCredentials };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { i as emitSuccess } from "./output-BM7aBFwt.mjs";
|
|
2
|
+
import { n as resolveContext, t as buildApiClient } from "./shared-D0HVBDHI.mjs";
|
|
3
|
+
//#region src/commands/note/list.ts
|
|
4
|
+
async function run(opts, flags, out) {
|
|
5
|
+
emitSuccess((await buildApiClient(await resolveContext(flags, out), flags).request("/notes", { query: {
|
|
6
|
+
page: opts.page,
|
|
7
|
+
size: opts.size,
|
|
8
|
+
sortBy: opts.sort
|
|
9
|
+
} })).data, out);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { run };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=list-BYzhflDg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-BYzhflDg.mjs","names":[],"sources":["../src/commands/note/list.ts"],"sourcesContent":["import { emitSuccess, type OutputOptions } from '../../core/output'\nimport { buildApiClient, type GlobalFlags, resolveContext } from '../internal/shared'\n\nexport interface NoteListFlags {\n page?: number\n size?: number\n state?: string\n sort?: string\n}\n\nexport async function run(\n opts: NoteListFlags,\n flags: GlobalFlags,\n out: OutputOptions,\n) {\n const ctx = await resolveContext(flags, out)\n const client = buildApiClient(ctx, flags)\n const res = await client.request<{ data: unknown[] }>('/notes', {\n query: {\n page: opts.page,\n size: opts.size,\n sortBy: opts.sort,\n },\n })\n emitSuccess(res.data, out)\n}\n"],"mappings":";;;AAUA,eAAsB,IACpB,MACA,OACA,KACA;CAUA,aAAY,MARG,eAAe,MADZ,eAAe,OAAO,GAAG,GACR,KACZ,EAAE,QAA6B,UAAU,EAC9D,OAAO;EACL,MAAM,KAAK;EACX,MAAM,KAAK;EACX,QAAQ,KAAK;CACf,EACF,CAAC,GACe,MAAM,GAAG;AAC3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { i as emitSuccess } from "./output-BM7aBFwt.mjs";
|
|
2
|
+
import { n as resolveContext, t as buildApiClient } from "./shared-D0HVBDHI.mjs";
|
|
3
|
+
//#region src/commands/config/list.ts
|
|
4
|
+
async function run(flags, out) {
|
|
5
|
+
emitSuccess((await buildApiClient(await resolveContext(flags, out), flags).request("/options")).data, out);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { run };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=list-DY-tPNG-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-DY-tPNG-.mjs","names":[],"sources":["../src/commands/config/list.ts"],"sourcesContent":["import { emitSuccess, type OutputOptions } from '../../core/output'\nimport { buildApiClient, type GlobalFlags, resolveContext } from '../internal/shared'\n\nexport async function run(flags: GlobalFlags, out: OutputOptions) {\n const ctx = await resolveContext(flags, out)\n const client = buildApiClient(ctx, flags)\n const res = await client.request('/options')\n emitSuccess(res.data, out)\n}\n"],"mappings":";;;AAGA,eAAsB,IAAI,OAAoB,KAAoB;CAIhE,aAAY,MAFG,eAAe,MADZ,eAAe,OAAO,GAAG,GACR,KACZ,EAAE,QAAQ,UAAU,GAC3B,MAAM,GAAG;AAC3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { i as emitSuccess } from "./output-BM7aBFwt.mjs";
|
|
2
|
+
import { n as resolveContext, t as buildApiClient } from "./shared-D0HVBDHI.mjs";
|
|
3
|
+
//#region src/commands/page/list.ts
|
|
4
|
+
async function run(_opts, flags, out) {
|
|
5
|
+
emitSuccess((await buildApiClient(await resolveContext(flags, out), flags).request("/pages")).data, out);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { run };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=list-DlQSkbqx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-DlQSkbqx.mjs","names":[],"sources":["../src/commands/page/list.ts"],"sourcesContent":["import { emitSuccess, type OutputOptions } from '../../core/output'\nimport { buildApiClient, type GlobalFlags, resolveContext } from '../internal/shared'\n\nexport async function run(\n _opts: unknown,\n flags: GlobalFlags,\n out: OutputOptions,\n) {\n const ctx = await resolveContext(flags, out)\n const client = buildApiClient(ctx, flags)\n const res = await client.request<{ data: unknown[] }>('/pages')\n emitSuccess(res.data, out)\n}\n"],"mappings":";;;AAGA,eAAsB,IACpB,OACA,OACA,KACA;CAIA,aAAY,MAFG,eAAe,MADZ,eAAe,OAAO,GAAG,GACR,KACZ,EAAE,QAA6B,QAAQ,GAC9C,MAAM,GAAG;AAC3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { i as emitSuccess } from "./output-BM7aBFwt.mjs";
|
|
2
|
+
import { n as resolveContext, t as buildApiClient } from "./shared-D0HVBDHI.mjs";
|
|
3
|
+
//#region src/commands/post/list.ts
|
|
4
|
+
async function run(opts, flags, out) {
|
|
5
|
+
emitSuccess((await buildApiClient(await resolveContext(flags, out), flags).request("/posts", { query: {
|
|
6
|
+
page: opts.page,
|
|
7
|
+
size: opts.size,
|
|
8
|
+
state: opts.state,
|
|
9
|
+
sortBy: opts.sort
|
|
10
|
+
} })).data, out);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { run };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=list-DsrA5wIz.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-DsrA5wIz.mjs","names":[],"sources":["../src/commands/post/list.ts"],"sourcesContent":["import { emitSuccess, type OutputOptions } from '../../core/output'\nimport { buildApiClient, type GlobalFlags, resolveContext } from '../internal/shared'\n\nexport interface PostListFlags {\n page?: number\n size?: number\n state?: string\n sort?: string\n}\n\nexport async function run(\n opts: PostListFlags,\n flags: GlobalFlags,\n out: OutputOptions,\n) {\n const ctx = await resolveContext(flags, out)\n const client = buildApiClient(ctx, flags)\n const res = await client.request<{\n data: unknown[]\n pagination?: unknown\n }>('/posts', {\n query: {\n page: opts.page,\n size: opts.size,\n state: opts.state,\n sortBy: opts.sort,\n },\n })\n emitSuccess(res.data, out)\n}\n"],"mappings":";;;AAUA,eAAsB,IACpB,MACA,OACA,KACA;CAcA,aAAY,MAZG,eAAe,MADZ,eAAe,OAAO,GAAG,GACR,KACZ,EAAE,QAGtB,UAAU,EACX,OAAO;EACL,MAAM,KAAK;EACX,MAAM,KAAK;EACX,OAAO,KAAK;EACZ,QAAQ,KAAK;CACf,EACF,CAAC,GACe,MAAM,GAAG;AAC3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { i as emitSuccess } from "./output-BM7aBFwt.mjs";
|
|
2
|
+
import { n as resolveContext, t as buildApiClient } from "./shared-D0HVBDHI.mjs";
|
|
3
|
+
//#region src/commands/category/list.ts
|
|
4
|
+
async function run(flags, out) {
|
|
5
|
+
emitSuccess((await buildApiClient(await resolveContext(flags, out), flags).request("/categories")).data, out);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { run };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=list-Fp4nKfQb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-Fp4nKfQb.mjs","names":[],"sources":["../src/commands/category/list.ts"],"sourcesContent":["import { emitSuccess, type OutputOptions } from '../../core/output'\nimport { buildApiClient, type GlobalFlags, resolveContext } from '../internal/shared'\n\nexport async function run(flags: GlobalFlags, out: OutputOptions) {\n const ctx = await resolveContext(flags, out)\n const client = buildApiClient(ctx, flags)\n const res = await client.request<{ data: unknown[] }>('/categories')\n emitSuccess(res.data, out)\n}\n"],"mappings":";;;AAGA,eAAsB,IAAI,OAAoB,KAAoB;CAIhE,aAAY,MAFG,eAAe,MADZ,eAAe,OAAO,GAAG,GACR,KACZ,EAAE,QAA6B,aAAa,GACnD,MAAM,GAAG;AAC3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { i as emitSuccess } from "./output-BM7aBFwt.mjs";
|
|
2
|
+
import { n as resolveContext, t as buildApiClient } from "./shared-D0HVBDHI.mjs";
|
|
3
|
+
//#region src/commands/topic/list.ts
|
|
4
|
+
async function run(flags, out) {
|
|
5
|
+
emitSuccess((await buildApiClient(await resolveContext(flags, out), flags).request("/topics/all")).data, out);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { run };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=list-s_tloiEX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-s_tloiEX.mjs","names":[],"sources":["../src/commands/topic/list.ts"],"sourcesContent":["import { emitSuccess, type OutputOptions } from '../../core/output'\nimport { buildApiClient, type GlobalFlags, resolveContext } from '../internal/shared'\n\nexport async function run(flags: GlobalFlags, out: OutputOptions) {\n const ctx = await resolveContext(flags, out)\n const client = buildApiClient(ctx, flags)\n const res = await client.request<{ data: unknown[] } | unknown[]>(\n '/topics/all',\n )\n emitSuccess(res.data, out)\n}\n"],"mappings":";;;AAGA,eAAsB,IAAI,OAAoB,KAAoB;CAMhE,aAAY,MAJG,eAAe,MADZ,eAAe,OAAO,GAAG,GACR,KACZ,EAAE,QACvB,aACF,GACgB,MAAM,GAAG;AAC3B"}
|