@mx-space/cli 0.13.3 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as drain, $a as identity, $i as reduce$1, $n as try_, $r as get$
|
|
1
|
+
import { $ as drain, $a as identity, $i as reduce$1, $n as try_, $r as get$17, $t as either, A as compose, Aa as pipeArguments, Ai as empty$11, An as orElse$3, Ar as Scope, At as encodeSync, B as ensuring$2, Ba as cached, Bi as head$2, Bn as scoped, Br as set$3, Bt as async, C as Number$, Ca as some, Ci as isConfigError, Cn as match$2, Ct as currentContext, D as String$, Da as left, Di as appendAll, Dn as onError, Dr as taggedEnum, Dt as unsafeMake, Ea as string$1, Ei as append$2, En as negate, Er as tagged, Et as get$21, Fa as redact$1, Fi as findFirstIndex, Fn as retry, Fr as isFailure, Ft as addFinalizer, G as mapError$1, Gi as join$1, Gn as suspend, Gr as updateAs, Gt as catchIf, H as fromChannel, Ha as hash, Hi as isArray$1, Hn as serviceOption, Hr as updateAndGet, Ht as catchAll, I as make$22, Ia as symbolRedactable, Ii as findLast, In as runFork$1, Ir as void_$1, It as all$5, J as splitLines, Ja as globalValue, Ji as match$1, Jn as tapError, Jr as cons$1, Jt as catchTags, K as run$6, Ka as isObject, Ki as make$23, Kn as sync, Kr as CommitPrototype, Kt as catchSome, L as isConfig, La as toStringUnknown, Li as flatMap$4, Ln as runSync, Lr as ParentSpan, Lt as annotateLogs, M as decodeUnknown, Ma as Class, Mi as filter$2, Mn as provide$1, Mr as isInterrupted, Mt as _void, N as int, Na as NodeInspectSymbol, Ni as filterMap, Nn as provideService, Nr as isInterruptedOnly, Nt as acquireRelease, O as TaggedError, Oa as merge$2, Oi as contains, On as onInterrupt, Or as error$1, Ot as nominal, P as optional$9, Pa as format$3, Pi as findFirst, Pn as repeatN, Pr as fail$3, Pt as acquireUseRelease, Q as unwrapScoped, Qa as dual, Qi as prepend$1, Qn as tryPromise, Qr as fromIterable$2, Qt as dieMessage, R as asyncScoped, Ra as equals, Ri as fromIterable$1, Rn as runtime, Rr as get$16, Rt as as, S as Literal, Sa as orElse$2, Si as omit, Sn as mapInputContext, Sr as unsafeDone, St as succeed$2, Ta as mapInput, Ti as allocate, Tn as matchEffect, Tr as TaggedError$1, Tt as currentTracerEnabled, Ua as string, Ui as isEmptyReadonlyArray, Un as sleep$1, Ur as allLevels, Ut as catchAllCause, Va as combine$2, Vi as headNonEmpty, Vn as serviceFunctions, Vr as update$9, Vt as cached$1, W as mapChunks, Wa as symbol$1, Wi as isNonEmptyReadonlyArray, Wn as succeed$1, Wr as getOrDefault, Wt as catchAllDefect, X as transduce, Xa as constUndefined, Xi as matchRight, Xn as timeout, Xr as of$3, Xt as contextWithEffect, Y as suspend$2, Ya as constFalse, Yi as matchLeft, Yn as tapErrorCause, Yr as isNil, Yt as context, Z as unwrap$17, Za as constVoid, Zi as of$2, Zn as tryMap, Zr as empty$12, Zt as die, _ as fromString, _a as isOption, _i as Reference, _n as logError, _r as failCause, _t as effect, a as make$30, aa as tailNonEmpty, ai as add$1, an as filterOrDieMessage, ar as useSpan, at as embedInput, b as Defect, ba as match, bi as getOption, bn as mapBoth, br as make$28, bt as provideMerge, c as defaultLogger, ci as remove$4, cn as fnUntraced, cr as withParentSpan, ct as fromEffect, d as get$18, da as flatMap$3, di as map$9, dn as forkScoped, dr as zipRight, dt as write, ea as reduceRight, ei as has, en as ensuring, eo as pipe, er as uninterruptible, et as foldLeftChunks, f as make$26, fa as fromNullable, fi as of$1, fn as gen, fr as zipWith, ft as spaced, g as when, ga as isNone, gi as GenericTag, gn as locally, gr as fail$4, gt as make$29, h as value$1, ha as getOrUndefined, hi as unsafeFromArray, hn as isEffect, hr as complete, ht as get$19, i as isMailbox, ia as splitAt, ii as make$27, in as filter$1, io as __toESM, ir as unsafeMakeSemaphore, it as acquireUseRelease$1, ja as BaseProto, ji as every, jn as orElseFail, jr as addFinalizer$1, jt as is$2, k as Union, ka as right, ki as drop, kn as orDie, kr as log, kt as decodeSync, l as prettyLoggerDefault, la as map$10, li as seconds, ln as forEach$1, lr as zip, lt as suspend$1, m as orElse$1, ma as getOrThrow, mi as toArray, mn as interruptible, mr as _await, mt as updateContext, n as make$31, na as sort$2, ni as make$25, nn as failCause$1, no as __exportAll, nr as unlessEffect, nt as fromChannel$1, o as toChannel, oa as take, oi as fromIterable$3, on as flatMap$1, or as when$1, ot as ensuring$1, p as updateEffect, pa as getOrElse, pi as reduce$2, pn as ignore, pr as DeferredTypeId, pt as runFork, q as runCollect, qa as isTagged, qi as map$7, qn as tap, qr as round, qt as catchTag, r as unsafeAdd, ra as span, ri as set$2, rn as failSync, ro as __require, rr as unsafeMakeLatch, rt as unwrapScoped$1, s as unify, sa as unsafeGet, si as has$1, sn as flatten$3, sr as withFiberRuntime, st as flatMap$2, t as join$2, ta as some$1, ti as isEmpty$5, tn as fail$2, to as __commonJSMin, tr as uninterruptibleMask, tt as forEach, u as withMinimumLogLevel, ua as filter$3, ui as appendAll$1, un as forkDaemon, ur as zipLeft, ut as void_, v as Cause, va as isSome, vi as Tag$2, vn as logWarning, vr as interrupt, vt as mergeAll, w as NumberFromString, wa as boolean$3, wi as isMissingDataOnly, wn as matchCauseEffect, wr as Error$1, wt as currentLoggers, x as Int, xa as none$3, xi as merge$3, xn as mapError, xr as succeed$3, xt as scoped$1, y as Date$, ya as map$8, yi as get$20, yn as map$6, yr as isDone, yt as provide, z as bufferChunks, za as symbol$2, zi as getSomes, zn as scope, zr as make$24, zt as asVoid } from "./esm-BNu4sUWV.mjs";
|
|
2
2
|
import { _ as LinkNode, a as HeadingNode, b as CodeHighlightNode, d as ListItemNode, f as ListNode, g as AutoLinkNode, o as QuoteNode, x as CodeNode } from "./LexicalRichText.node-BUJZAiap.mjs";
|
|
3
3
|
import { a as HorizontalRuleNode } from "./LexicalExtension.node-BWH6xbzG.mjs";
|
|
4
4
|
import { dn as ElementNode, un as DecoratorNode } from "./Lexical.node-BlCLnfA6.mjs";
|
|
@@ -2164,16 +2164,16 @@ const spans = (spans) => {
|
|
|
2164
2164
|
return empty$7;
|
|
2165
2165
|
};
|
|
2166
2166
|
/** @internal */
|
|
2167
|
-
const isEmpty$3 = (self) => size$
|
|
2167
|
+
const isEmpty$3 = (self) => size$10(self) === 0;
|
|
2168
2168
|
/** @internal */
|
|
2169
|
-
const size$
|
|
2169
|
+
const size$10 = (self) => {
|
|
2170
2170
|
switch (self._tag) {
|
|
2171
2171
|
case "Text":
|
|
2172
2172
|
case "URI": return self.value.length;
|
|
2173
2173
|
case "Highlight":
|
|
2174
2174
|
case "Strong":
|
|
2175
|
-
case "Weak": return size$
|
|
2176
|
-
case "Sequence": return size$
|
|
2175
|
+
case "Weak": return size$10(self.value);
|
|
2176
|
+
case "Sequence": return size$10(self.left) + size$10(self.right);
|
|
2177
2177
|
}
|
|
2178
2178
|
};
|
|
2179
2179
|
/** @internal */
|
|
@@ -4503,7 +4503,7 @@ const wizardInternal$2 = (self, config) => {
|
|
|
4503
4503
|
message: toAnsiText(pipe(getHelpInternal$2(self), sequence(repeatHelp))).trimEnd(),
|
|
4504
4504
|
min: getMinSizeInternal$1(self),
|
|
4505
4505
|
max: getMaxSizeInternal$1(self)
|
|
4506
|
-
}).pipe(zipLeft(log()), flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$24(empty$11()).pipe(flatMap$1((ref) => wizardInternal$2(self.args, config).pipe(flatMap$1((args) => update$
|
|
4506
|
+
}).pipe(zipLeft(log()), flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$24(empty$11()).pipe(flatMap$1((ref) => wizardInternal$2(self.args, config).pipe(flatMap$1((args) => update$9(ref, appendAll(args))), repeatN(n - 1), zipRight(get$16(ref)), tap((args) => validateInternal(self, args, config)))))));
|
|
4507
4507
|
}
|
|
4508
4508
|
case "WithDefault": {
|
|
4509
4509
|
const defaultHelp = p$1(`This argument is optional - use the default?`);
|
|
@@ -4640,7 +4640,7 @@ const levensteinDistance = (first, second, config) => {
|
|
|
4640
4640
|
//#endregion
|
|
4641
4641
|
//#region ../../node_modules/.pnpm/@effect+cli@0.75.2_@effect+platform@0.96.2_effect@3.21.4__@effect+printer-ansi@0.49.0_@_01a8c4d9bc0f75ad9760cebe2a3dffeb/node_modules/@effect/cli/dist/esm/internal/prompt/list.js
|
|
4642
4642
|
/** @internal */
|
|
4643
|
-
const list$
|
|
4643
|
+
const list$16 = (options) => text$9(options).pipe(map$3((output) => output.split(options.delimiter || ",")));
|
|
4644
4644
|
/** @internal */
|
|
4645
4645
|
const OptionsTypeId = /*#__PURE__*/ Symbol.for("@effect/cli/Options");
|
|
4646
4646
|
const proto$2 = {
|
|
@@ -4980,7 +4980,7 @@ const parseInternal$1 = (self, args, config) => {
|
|
|
4980
4980
|
switch (self._tag) {
|
|
4981
4981
|
case "Empty": return _void;
|
|
4982
4982
|
case "Single": {
|
|
4983
|
-
const singleNames = filterMap(getNames$1(self), (name) => get$
|
|
4983
|
+
const singleNames = filterMap(getNames$1(self), (name) => get$17(args, name));
|
|
4984
4984
|
if (isNonEmptyReadonlyArray(singleNames)) {
|
|
4985
4985
|
const head = headNonEmpty(singleNames);
|
|
4986
4986
|
if (isEmptyReadonlyArray(tailNonEmpty(singleNames))) {
|
|
@@ -5028,7 +5028,7 @@ const parseInternal$1 = (self, args, config) => {
|
|
|
5028
5028
|
case "Variadic": {
|
|
5029
5029
|
const min = getOrElse(self.min, () => 0);
|
|
5030
5030
|
const max = getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);
|
|
5031
|
-
const matchedArgument = filterMap(getNames$1(self), (name) => get$
|
|
5031
|
+
const matchedArgument = filterMap(getNames$1(self), (name) => get$17(args, name));
|
|
5032
5032
|
const validateMinMax = (values) => {
|
|
5033
5033
|
if (values.length < min) return fail$2(invalidValue(p$1(`Expected at least ${min} value(s) for option: '${self.argumentOption.fullName}'`)));
|
|
5034
5034
|
if (values.length > max) return fail$2(invalidValue(p$1(`Expected at most ${max} value(s) for option: '${self.argumentOption.fullName}'`)));
|
|
@@ -5060,7 +5060,7 @@ const wizardInternal$1 = (self, config) => {
|
|
|
5060
5060
|
return parseCommandLine(self, args, config).pipe(as(args));
|
|
5061
5061
|
}), zipLeft(log()));
|
|
5062
5062
|
}
|
|
5063
|
-
case "KeyValueMap": return list$
|
|
5063
|
+
case "KeyValueMap": return list$16({
|
|
5064
5064
|
message: toAnsiText(p$1("Enter `key=value` pairs separated by spaces")).trim(),
|
|
5065
5065
|
delimiter: " "
|
|
5066
5066
|
}).pipe(flatMap$1((args) => {
|
|
@@ -5088,7 +5088,7 @@ const wizardInternal$1 = (self, config) => {
|
|
|
5088
5088
|
message: toAnsiText(pipe(getHelpInternal$1(self), sequence(repeatHelp))).trimEnd(),
|
|
5089
5089
|
min: getMinSizeInternal(self),
|
|
5090
5090
|
max: getMaxSizeInternal(self)
|
|
5091
|
-
}).pipe(flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$24(empty$11()).pipe(flatMap$1((ref) => wizardInternal$1(self.argumentOption, config).pipe(flatMap$1((args) => update$
|
|
5091
|
+
}).pipe(flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$24(empty$11()).pipe(flatMap$1((ref) => wizardInternal$1(self.argumentOption, config).pipe(flatMap$1((args) => update$9(ref, appendAll(args))), repeatN(n - 1), zipRight(get$16(ref)))))));
|
|
5092
5092
|
}
|
|
5093
5093
|
case "WithDefault": {
|
|
5094
5094
|
if (isBoolInternal(self.options)) return wizardInternal$1(self.options, config);
|
|
@@ -5496,7 +5496,7 @@ const merge$1 = (map1, map2) => {
|
|
|
5496
5496
|
if (isNonEmptyReadonlyArray(map2)) {
|
|
5497
5497
|
const head = headNonEmpty(map2);
|
|
5498
5498
|
const tail = tailNonEmpty(map2);
|
|
5499
|
-
return merge$1(match(get$
|
|
5499
|
+
return merge$1(match(get$17(map1, head[0]), {
|
|
5500
5500
|
onNone: () => set$2(map1, head[0], head[1]),
|
|
5501
5501
|
onSome: (elems) => set$2(map1, head[0], appendAll(elems, head[1]))
|
|
5502
5502
|
}), tail);
|
|
@@ -5829,10 +5829,10 @@ const getHelpInternal = (self, config) => {
|
|
|
5829
5829
|
}
|
|
5830
5830
|
};
|
|
5831
5831
|
const printSubcommands = (subcommands) => {
|
|
5832
|
-
const maxUsageLength = reduceRight(subcommands, 0, (max, [usage]) => Math.max(size$
|
|
5832
|
+
const maxUsageLength = reduceRight(subcommands, 0, (max, [usage]) => Math.max(size$10(usage), max));
|
|
5833
5833
|
const documents = map$7(subcommands, ([usage, desc]) => p$1(spans([
|
|
5834
5834
|
usage,
|
|
5835
|
-
text$10(" ".repeat(maxUsageLength - size$
|
|
5835
|
+
text$10(" ".repeat(maxUsageLength - size$10(usage) + 2)),
|
|
5836
5836
|
desc
|
|
5837
5837
|
])));
|
|
5838
5838
|
if (isNonEmptyReadonlyArray(documents)) return enumeration(documents);
|
|
@@ -6047,7 +6047,7 @@ const wizardInternal = (self, prefix, config) => {
|
|
|
6047
6047
|
switch (self._tag) {
|
|
6048
6048
|
case "GetUserInput":
|
|
6049
6049
|
case "Standard": return gen(function* () {
|
|
6050
|
-
const logCurrentCommand = get$
|
|
6050
|
+
const logCurrentCommand = get$16(commandLineRef).pipe(flatMap$1((commandLine) => {
|
|
6051
6051
|
return log(toAnsiText(p$1(pipe(strong(highlight("COMMAND:", cyan)), concat$1(space), concat$1(highlight(join$1(commandLine, " "), magenta))))));
|
|
6052
6052
|
}));
|
|
6053
6053
|
if (isStandard(self)) {
|
|
@@ -6064,7 +6064,7 @@ const wizardInternal = (self, prefix, config) => {
|
|
|
6064
6064
|
yield* logCurrentCommand;
|
|
6065
6065
|
}
|
|
6066
6066
|
}
|
|
6067
|
-
return yield* get$
|
|
6067
|
+
return yield* get$16(commandLineRef);
|
|
6068
6068
|
});
|
|
6069
6069
|
case "Map": return loop(self.command, commandLineRef);
|
|
6070
6070
|
case "Subcommands": {
|
|
@@ -6077,11 +6077,11 @@ const wizardInternal = (self, prefix, config) => {
|
|
|
6077
6077
|
return loop(self.parent, commandLineRef).pipe(zipRight(select({
|
|
6078
6078
|
message,
|
|
6079
6079
|
choices
|
|
6080
|
-
}).pipe(tap(([name]) => update$
|
|
6080
|
+
}).pipe(tap(([name]) => update$9(commandLineRef, append$2(name))), zipLeft(log()), flatMap$1(([, nextIndex]) => loop(self.children[nextIndex], commandLineRef)))));
|
|
6081
6081
|
}
|
|
6082
6082
|
}
|
|
6083
6083
|
};
|
|
6084
|
-
return make$24(prefix).pipe(flatMap$1((commandLineRef) => loop(self, commandLineRef).pipe(zipRight(get$
|
|
6084
|
+
return make$24(prefix).pipe(flatMap$1((commandLineRef) => loop(self, commandLineRef).pipe(zipRight(get$16(commandLineRef)))));
|
|
6085
6085
|
};
|
|
6086
6086
|
const getShortDescription = (self) => {
|
|
6087
6087
|
switch (self._tag) {
|
|
@@ -6125,7 +6125,7 @@ const traverseCommand = (self, initialState, f) => make$26(initialState).pipe(fl
|
|
|
6125
6125
|
}
|
|
6126
6126
|
}
|
|
6127
6127
|
};
|
|
6128
|
-
return suspend(() => loop(self, empty$11(), empty$11(), 0)).pipe(zipRight(get$
|
|
6128
|
+
return suspend(() => loop(self, empty$11(), empty$11(), 0)).pipe(zipRight(get$18(ref)));
|
|
6129
6129
|
}));
|
|
6130
6130
|
const indentAll = /*#__PURE__*/ dual(2, (self, indent) => {
|
|
6131
6131
|
const indentation = allocate(indent + 1).join(" ");
|
|
@@ -7350,7 +7350,7 @@ const watchNode = (path, options) => asyncScoped((emit) => acquireRelease(sync((
|
|
|
7350
7350
|
});
|
|
7351
7351
|
return watcher;
|
|
7352
7352
|
}), (watcher) => sync(() => watcher.close())));
|
|
7353
|
-
const watch = (backend, path, options) => stat(path).pipe(map$6((stat) => backend.pipe(flatMap$3((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, options)))), unwrap$
|
|
7353
|
+
const watch = (backend, path, options) => stat(path).pipe(map$6((stat) => backend.pipe(flatMap$3((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, options)))), unwrap$17);
|
|
7354
7354
|
const writeFile = (path, data, options) => async((resume, signal) => {
|
|
7355
7355
|
try {
|
|
7356
7356
|
NFS.writeFile(path, data, {
|
|
@@ -7467,7 +7467,7 @@ const layer$3 = /* @__PURE__ */ scoped$1(Terminal, /*#__PURE__*/ (/* @__PURE__ *
|
|
|
7467
7467
|
const rows = sync(() => stdout.rows ?? 0);
|
|
7468
7468
|
const isTTY = sync(() => Boolean(stdout.isTTY));
|
|
7469
7469
|
const readInput = gen(function* () {
|
|
7470
|
-
yield* get$
|
|
7470
|
+
yield* get$19(rlRef);
|
|
7471
7471
|
const mailbox = yield* make$30();
|
|
7472
7472
|
const handleKeypress = (s, k) => {
|
|
7473
7473
|
const userInput = {
|
|
@@ -7486,7 +7486,7 @@ const layer$3 = /* @__PURE__ */ scoped$1(Terminal, /*#__PURE__*/ (/* @__PURE__ *
|
|
|
7486
7486
|
stdin.on("keypress", handleKeypress);
|
|
7487
7487
|
return mailbox;
|
|
7488
7488
|
});
|
|
7489
|
-
const readLine = get$
|
|
7489
|
+
const readLine = get$19(rlRef).pipe(flatMap$1((readlineInterface) => async((resume) => {
|
|
7490
7490
|
const onLine = (line) => resume(succeed$1(line));
|
|
7491
7491
|
readlineInterface.once("line", onLine);
|
|
7492
7492
|
return sync(() => readlineInterface.off("line", onLine));
|
|
@@ -8350,7 +8350,7 @@ const make$11 = (method) => (url, options) => modify(empty, {
|
|
|
8350
8350
|
...options ?? void 0
|
|
8351
8351
|
});
|
|
8352
8352
|
/** @internal */
|
|
8353
|
-
const get$
|
|
8353
|
+
const get$15 = /*#__PURE__*/ make$11("GET");
|
|
8354
8354
|
/** @internal */
|
|
8355
8355
|
const post$1 = /*#__PURE__*/ make$11("POST");
|
|
8356
8356
|
/** @internal */
|
|
@@ -8358,7 +8358,7 @@ const put$1 = /*#__PURE__*/ make$11("PUT");
|
|
|
8358
8358
|
/** @internal */
|
|
8359
8359
|
const patch$1 = /*#__PURE__*/ make$11("PATCH");
|
|
8360
8360
|
/** @internal */
|
|
8361
|
-
const del$
|
|
8361
|
+
const del$15 = /*#__PURE__*/ make$11("DELETE");
|
|
8362
8362
|
/** @internal */
|
|
8363
8363
|
const head$1 = /*#__PURE__*/ make$11("HEAD");
|
|
8364
8364
|
/** @internal */
|
|
@@ -8452,7 +8452,7 @@ const ClientProto = {
|
|
|
8452
8452
|
return { _id: "@effect/platform/HttpClient" };
|
|
8453
8453
|
},
|
|
8454
8454
|
get(url, options) {
|
|
8455
|
-
return this.execute(get$
|
|
8455
|
+
return this.execute(get$15(url, options));
|
|
8456
8456
|
},
|
|
8457
8457
|
head(url, options) {
|
|
8458
8458
|
return this.execute(head$1(url, options));
|
|
@@ -8467,7 +8467,7 @@ const ClientProto = {
|
|
|
8467
8467
|
return this.execute(patch$1(url, options));
|
|
8468
8468
|
},
|
|
8469
8469
|
del(url, options) {
|
|
8470
|
-
return this.execute(del$
|
|
8470
|
+
return this.execute(del$15(url, options));
|
|
8471
8471
|
},
|
|
8472
8472
|
options(url, options) {
|
|
8473
8473
|
return this.execute(options$1(url, options));
|
|
@@ -8536,7 +8536,7 @@ const make$10 = (f) => makeWith((effect) => flatMap$1(effect, (request) => withF
|
|
|
8536
8536
|
}
|
|
8537
8537
|
}));
|
|
8538
8538
|
}
|
|
8539
|
-
return useSpan(get$
|
|
8539
|
+
return useSpan(get$20(fiber.currentContext, SpanNameGenerator)(request), {
|
|
8540
8540
|
kind: "client",
|
|
8541
8541
|
captureStackTrace: false
|
|
8542
8542
|
}, (span) => {
|
|
@@ -8630,7 +8630,7 @@ var InterruptibleResponse = class {
|
|
|
8630
8630
|
return this.original[NodeInspectSymbol]();
|
|
8631
8631
|
}
|
|
8632
8632
|
};
|
|
8633
|
-
const { del: del$
|
|
8633
|
+
const { del: del$14, execute, get: get$14, head, options, patch, post, put } = /*#__PURE__*/ serviceFunctions(tag);
|
|
8634
8634
|
/** @internal */
|
|
8635
8635
|
const transformResponse = /*#__PURE__*/ dual(2, (self, f) => {
|
|
8636
8636
|
const client = self;
|
|
@@ -9919,7 +9919,7 @@ function makeApiService(http, config, auth, opts) {
|
|
|
9919
9919
|
})));
|
|
9920
9920
|
const maybeEmitBanner = (resolved) => gen(function* () {
|
|
9921
9921
|
if (!resolved.isProduction || opts.quiet) return;
|
|
9922
|
-
if (yield* get$
|
|
9922
|
+
if (yield* get$16(bannerEmitted)) return;
|
|
9923
9923
|
yield* set$3(bannerEmitted, true);
|
|
9924
9924
|
yield* sync(() => {
|
|
9925
9925
|
process.stderr.write(`mxs: profile=${resolved.profileName} (production) → ${resolved.apiUrl}\n`);
|
|
@@ -10011,7 +10011,7 @@ function makeApiService(http, config, auth, opts) {
|
|
|
10011
10011
|
}
|
|
10012
10012
|
const body = yield* parseBody(res);
|
|
10013
10013
|
if (opts.verbose) {
|
|
10014
|
-
if (!(yield* get$
|
|
10014
|
+
if (!(yield* get$16(detectedWire))) {
|
|
10015
10015
|
const sniffed = detectWireVersion(body);
|
|
10016
10016
|
if (sniffed) {
|
|
10017
10017
|
yield* set$3(detectedWire, sniffed);
|
|
@@ -10151,7 +10151,7 @@ function refreshOnce(auth, config, resolved, currentToken) {
|
|
|
10151
10151
|
}
|
|
10152
10152
|
//#endregion
|
|
10153
10153
|
//#region src/services/Ai.ts
|
|
10154
|
-
const unwrapData = (raw) => {
|
|
10154
|
+
const unwrapData$1 = (raw) => {
|
|
10155
10155
|
if (raw && typeof raw === "object" && !Array.isArray(raw)) {
|
|
10156
10156
|
const env = raw;
|
|
10157
10157
|
if ("data" in env) return env.data;
|
|
@@ -10160,14 +10160,14 @@ const unwrapData = (raw) => {
|
|
|
10160
10160
|
};
|
|
10161
10161
|
const asRecord$1 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
10162
10162
|
const readCreateTask = (raw) => {
|
|
10163
|
-
const inner = asRecord$1(unwrapData(raw));
|
|
10163
|
+
const inner = asRecord$1(unwrapData$1(raw));
|
|
10164
10164
|
return {
|
|
10165
10165
|
taskId: typeof inner.taskId === "string" ? inner.taskId : void 0,
|
|
10166
10166
|
created: typeof inner.created === "boolean" ? inner.created : void 0
|
|
10167
10167
|
};
|
|
10168
10168
|
};
|
|
10169
10169
|
const readTaskRecord = (raw) => {
|
|
10170
|
-
const inner = asRecord$1(unwrapData(raw));
|
|
10170
|
+
const inner = asRecord$1(unwrapData$1(raw));
|
|
10171
10171
|
const result = asRecord$1(inner.result);
|
|
10172
10172
|
const payload = asRecord$1(inner.payload);
|
|
10173
10173
|
const errField = inner.error;
|
|
@@ -10289,7 +10289,7 @@ const make$5 = (api) => {
|
|
|
10289
10289
|
page,
|
|
10290
10290
|
size: SIZE
|
|
10291
10291
|
} });
|
|
10292
|
-
const data = unwrapData(raw);
|
|
10292
|
+
const data = unwrapData$1(raw);
|
|
10293
10293
|
const groups = Array.isArray(data) ? data : [];
|
|
10294
10294
|
for (const group of groups) for (const item of groupedItems(group, itemKeys)) {
|
|
10295
10295
|
const r = asRecord$1(item);
|
|
@@ -11664,7 +11664,7 @@ function customAlphabet(alphabet, size = 21) {
|
|
|
11664
11664
|
return customRandom(alphabet, size, random);
|
|
11665
11665
|
}
|
|
11666
11666
|
//#endregion
|
|
11667
|
-
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.
|
|
11667
|
+
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.30.0_typescript@6.0.3/node_modules/@haklex/rich-litexml/dist/src-B0q3dIvF.js
|
|
11668
11668
|
var impl = null;
|
|
11669
11669
|
function registerParseHTML(fn) {
|
|
11670
11670
|
impl = fn;
|
|
@@ -16423,7 +16423,7 @@ const BLOCK_ELEMENTS = /* @__PURE__ */ new Set([
|
|
|
16423
16423
|
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
16424
16424
|
//#endregion
|
|
16425
16425
|
//#region ../../node_modules/.pnpm/linkedom@0.18.12/node_modules/linkedom/esm/shared/object.js
|
|
16426
|
-
const { assign, create: create$
|
|
16426
|
+
const { assign, create: create$9, defineProperties, entries, getOwnPropertyDescriptors, keys, setPrototypeOf } = Object;
|
|
16427
16427
|
//#endregion
|
|
16428
16428
|
//#region ../../node_modules/.pnpm/linkedom@0.18.12/node_modules/linkedom/esm/shared/utils.js
|
|
16429
16429
|
const $String = String;
|
|
@@ -19327,7 +19327,7 @@ const { add } = Set.prototype;
|
|
|
19327
19327
|
const addTokens = (self, tokens) => {
|
|
19328
19328
|
for (const token of tokens) if (token) add.call(self, token);
|
|
19329
19329
|
};
|
|
19330
|
-
const update$
|
|
19330
|
+
const update$8 = ({ [OWNER_ELEMENT]: ownerElement, value }) => {
|
|
19331
19331
|
const attribute = ownerElement.getAttributeNode("class");
|
|
19332
19332
|
if (attribute) attribute.value = value;
|
|
19333
19333
|
else setAttribute(ownerElement, new Attr$1(ownerElement.ownerDocument, "class", value));
|
|
@@ -19353,7 +19353,7 @@ var DOMTokenList = class extends Set {
|
|
|
19353
19353
|
*/
|
|
19354
19354
|
add(...tokens) {
|
|
19355
19355
|
addTokens(this, tokens);
|
|
19356
|
-
update$
|
|
19356
|
+
update$8(this);
|
|
19357
19357
|
}
|
|
19358
19358
|
/**
|
|
19359
19359
|
* @param {string} token
|
|
@@ -19366,7 +19366,7 @@ var DOMTokenList = class extends Set {
|
|
|
19366
19366
|
*/
|
|
19367
19367
|
remove(...tokens) {
|
|
19368
19368
|
for (const token of tokens) this.delete(token);
|
|
19369
|
-
update$
|
|
19369
|
+
update$8(this);
|
|
19370
19370
|
}
|
|
19371
19371
|
/**
|
|
19372
19372
|
* @param {string} token
|
|
@@ -19376,10 +19376,10 @@ var DOMTokenList = class extends Set {
|
|
|
19376
19376
|
if (this.has(token)) {
|
|
19377
19377
|
if (force) return true;
|
|
19378
19378
|
this.delete(token);
|
|
19379
|
-
update$
|
|
19379
|
+
update$8(this);
|
|
19380
19380
|
} else if (force || arguments.length === 1) {
|
|
19381
19381
|
super.add(token);
|
|
19382
|
-
update$
|
|
19382
|
+
update$8(this);
|
|
19383
19383
|
return true;
|
|
19384
19384
|
}
|
|
19385
19385
|
return false;
|
|
@@ -19392,7 +19392,7 @@ var DOMTokenList = class extends Set {
|
|
|
19392
19392
|
if (this.has(token)) {
|
|
19393
19393
|
this.delete(token);
|
|
19394
19394
|
super.add(newToken);
|
|
19395
|
-
update$
|
|
19395
|
+
update$8(this);
|
|
19396
19396
|
return true;
|
|
19397
19397
|
}
|
|
19398
19398
|
return false;
|
|
@@ -19636,7 +19636,7 @@ var ShadowRoot$1 = class extends NonElementParentNode {
|
|
|
19636
19636
|
const attributesHandler = { get(target, key) {
|
|
19637
19637
|
return key in target ? target[key] : target.find(({ name }) => name === key);
|
|
19638
19638
|
} };
|
|
19639
|
-
const create$
|
|
19639
|
+
const create$8 = (ownerDocument, element, localName) => {
|
|
19640
19640
|
if ("ownerSVGElement" in element) {
|
|
19641
19641
|
const svg = ownerDocument.createElementNS(SVG_NAMESPACE, localName);
|
|
19642
19642
|
svg.ownerSVGElement = element.ownerSVGElement;
|
|
@@ -19946,7 +19946,7 @@ var Element$1 = class extends ParentNode {
|
|
|
19946
19946
|
knownAdjacent($next, next);
|
|
19947
19947
|
$next = next;
|
|
19948
19948
|
};
|
|
19949
|
-
const clone = create$
|
|
19949
|
+
const clone = create$8(ownerDocument, this, localName);
|
|
19950
19950
|
let parentNode = clone, $next = clone;
|
|
19951
19951
|
let { [NEXT]: next, [END]: prev } = this;
|
|
19952
19952
|
while (next !== prev && (deep || next.nodeType === 2)) {
|
|
@@ -19957,7 +19957,7 @@ var Element$1 = class extends ParentNode {
|
|
|
19957
19957
|
parentNode = parentNode.parentNode;
|
|
19958
19958
|
break;
|
|
19959
19959
|
case 1: {
|
|
19960
|
-
const node = create$
|
|
19960
|
+
const node = create$8(ownerDocument, next, next.localName);
|
|
19961
19961
|
addNext(node);
|
|
19962
19962
|
parentNode = node;
|
|
19963
19963
|
break;
|
|
@@ -23845,7 +23845,7 @@ var Document$1 = class extends NonElementParentNode {
|
|
|
23845
23845
|
return this.createTreeWalker(root, whatToShow);
|
|
23846
23846
|
}
|
|
23847
23847
|
createEvent(name) {
|
|
23848
|
-
const event = create$
|
|
23848
|
+
const event = create$9(name === "Event" ? new GlobalEvent("") : new CustomEvent(""));
|
|
23849
23849
|
event.initEvent = event.initCustomEvent = (type, canBubble = false, cancelable = false, detail) => {
|
|
23850
23850
|
event.bubbles = !!canBubble;
|
|
23851
23851
|
defineProperties(event, {
|
|
@@ -24059,7 +24059,7 @@ function Document() {
|
|
|
24059
24059
|
}
|
|
24060
24060
|
setPrototypeOf(Document, Document$1).prototype = Document$1.prototype;
|
|
24061
24061
|
//#endregion
|
|
24062
|
-
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.
|
|
24062
|
+
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.30.0_typescript@6.0.3/node_modules/@haklex/rich-litexml/dist/node.mjs
|
|
24063
24063
|
registerParseHTML((html) => parseHTML(html).document);
|
|
24064
24064
|
//#endregion
|
|
24065
24065
|
//#region ../editor/src/core/litexml.ts
|
|
@@ -24200,7 +24200,7 @@ mod$1.UNORDERED_LIST;
|
|
|
24200
24200
|
mod$1.isTableRowDivider;
|
|
24201
24201
|
mod$1.registerMarkdownShortcuts;
|
|
24202
24202
|
//#endregion
|
|
24203
|
-
//#region ../../node_modules/.pnpm/@haklex+rich-headless@0.
|
|
24203
|
+
//#region ../../node_modules/.pnpm/@haklex+rich-headless@0.30.0_lexical@0.46.0_typescript@6.0.3__typescript@6.0.3/node_modules/@haklex/rich-headless/dist/transformers.mjs
|
|
24204
24204
|
/**
|
|
24205
24205
|
* Headless Markdown transformers — export-only (Lexical → Markdown).
|
|
24206
24206
|
* Import stubs are no-ops; used only for $convertToMarkdownString.
|
|
@@ -24627,7 +24627,7 @@ function $toMarkdown() {
|
|
|
24627
24627
|
return $convertToMarkdownString(allHeadlessTransformers);
|
|
24628
24628
|
}
|
|
24629
24629
|
//#endregion
|
|
24630
|
-
//#region ../../node_modules/.pnpm/@haklex+rich-headless@0.
|
|
24630
|
+
//#region ../../node_modules/.pnpm/@haklex+rich-headless@0.30.0_lexical@0.46.0_typescript@6.0.3__typescript@6.0.3/node_modules/@haklex/rich-headless/dist/index.mjs
|
|
24631
24631
|
var INTRINSIC_TYPES = [
|
|
24632
24632
|
"root",
|
|
24633
24633
|
"paragraph",
|
|
@@ -25026,6 +25026,191 @@ var ChatNode = headlessDecorator("chat", [
|
|
|
25026
25026
|
participants: [],
|
|
25027
25027
|
messages: []
|
|
25028
25028
|
});
|
|
25029
|
+
var BannerNode = class BannerNode extends DecoratorNode {
|
|
25030
|
+
static getType() {
|
|
25031
|
+
return "banner";
|
|
25032
|
+
}
|
|
25033
|
+
constructor(key) {
|
|
25034
|
+
super(key);
|
|
25035
|
+
this.__bannerType = "note";
|
|
25036
|
+
this.__contentState = null;
|
|
25037
|
+
}
|
|
25038
|
+
static clone(node) {
|
|
25039
|
+
const n = new BannerNode(node.__key);
|
|
25040
|
+
n.__bannerType = node.__bannerType;
|
|
25041
|
+
n.__contentState = node.__contentState;
|
|
25042
|
+
return n;
|
|
25043
|
+
}
|
|
25044
|
+
static importJSON(_json) {
|
|
25045
|
+
const json = _json;
|
|
25046
|
+
const node = new BannerNode();
|
|
25047
|
+
node.__bannerType = json.bannerType ?? "note";
|
|
25048
|
+
node.__contentState = json.content ?? null;
|
|
25049
|
+
return node;
|
|
25050
|
+
}
|
|
25051
|
+
exportJSON() {
|
|
25052
|
+
return {
|
|
25053
|
+
type: "banner",
|
|
25054
|
+
version: 1,
|
|
25055
|
+
bannerType: this.__bannerType,
|
|
25056
|
+
content: this.__contentState
|
|
25057
|
+
};
|
|
25058
|
+
}
|
|
25059
|
+
createDOM() {
|
|
25060
|
+
return stubDOM();
|
|
25061
|
+
}
|
|
25062
|
+
updateDOM() {
|
|
25063
|
+
return false;
|
|
25064
|
+
}
|
|
25065
|
+
decorate() {
|
|
25066
|
+
return null;
|
|
25067
|
+
}
|
|
25068
|
+
isInline() {
|
|
25069
|
+
return false;
|
|
25070
|
+
}
|
|
25071
|
+
getTextContent() {
|
|
25072
|
+
return extractText(this.__contentState);
|
|
25073
|
+
}
|
|
25074
|
+
};
|
|
25075
|
+
var AlertQuoteNode = class AlertQuoteNode extends DecoratorNode {
|
|
25076
|
+
static getType() {
|
|
25077
|
+
return "alert-quote";
|
|
25078
|
+
}
|
|
25079
|
+
constructor(key) {
|
|
25080
|
+
super(key);
|
|
25081
|
+
this.__alertType = "note";
|
|
25082
|
+
this.__contentState = null;
|
|
25083
|
+
}
|
|
25084
|
+
static clone(node) {
|
|
25085
|
+
const n = new AlertQuoteNode(node.__key);
|
|
25086
|
+
n.__alertType = node.__alertType;
|
|
25087
|
+
n.__contentState = node.__contentState;
|
|
25088
|
+
return n;
|
|
25089
|
+
}
|
|
25090
|
+
static importJSON(_json) {
|
|
25091
|
+
const json = _json;
|
|
25092
|
+
const node = new AlertQuoteNode();
|
|
25093
|
+
node.__alertType = json.alertType ?? "note";
|
|
25094
|
+
node.__contentState = json.content ?? null;
|
|
25095
|
+
return node;
|
|
25096
|
+
}
|
|
25097
|
+
exportJSON() {
|
|
25098
|
+
return {
|
|
25099
|
+
type: "alert-quote",
|
|
25100
|
+
version: 1,
|
|
25101
|
+
alertType: this.__alertType,
|
|
25102
|
+
content: this.__contentState
|
|
25103
|
+
};
|
|
25104
|
+
}
|
|
25105
|
+
createDOM() {
|
|
25106
|
+
return stubDOM();
|
|
25107
|
+
}
|
|
25108
|
+
updateDOM() {
|
|
25109
|
+
return false;
|
|
25110
|
+
}
|
|
25111
|
+
decorate() {
|
|
25112
|
+
return null;
|
|
25113
|
+
}
|
|
25114
|
+
isInline() {
|
|
25115
|
+
return false;
|
|
25116
|
+
}
|
|
25117
|
+
getTextContent() {
|
|
25118
|
+
return extractText(this.__contentState);
|
|
25119
|
+
}
|
|
25120
|
+
};
|
|
25121
|
+
var NestedDocNode = class NestedDocNode extends DecoratorNode {
|
|
25122
|
+
static getType() {
|
|
25123
|
+
return "nested-doc";
|
|
25124
|
+
}
|
|
25125
|
+
constructor(key) {
|
|
25126
|
+
super(key);
|
|
25127
|
+
this.__contentState = null;
|
|
25128
|
+
}
|
|
25129
|
+
static clone(node) {
|
|
25130
|
+
const n = new NestedDocNode(node.__key);
|
|
25131
|
+
n.__contentState = node.__contentState;
|
|
25132
|
+
return n;
|
|
25133
|
+
}
|
|
25134
|
+
static importJSON(_json) {
|
|
25135
|
+
const json = _json;
|
|
25136
|
+
const node = new NestedDocNode();
|
|
25137
|
+
node.__contentState = json.content ?? null;
|
|
25138
|
+
return node;
|
|
25139
|
+
}
|
|
25140
|
+
exportJSON() {
|
|
25141
|
+
return {
|
|
25142
|
+
type: "nested-doc",
|
|
25143
|
+
version: 1,
|
|
25144
|
+
content: this.__contentState
|
|
25145
|
+
};
|
|
25146
|
+
}
|
|
25147
|
+
createDOM() {
|
|
25148
|
+
return stubDOM();
|
|
25149
|
+
}
|
|
25150
|
+
updateDOM() {
|
|
25151
|
+
return false;
|
|
25152
|
+
}
|
|
25153
|
+
decorate() {
|
|
25154
|
+
return null;
|
|
25155
|
+
}
|
|
25156
|
+
isInline() {
|
|
25157
|
+
return false;
|
|
25158
|
+
}
|
|
25159
|
+
getTextContent() {
|
|
25160
|
+
return extractText(this.__contentState);
|
|
25161
|
+
}
|
|
25162
|
+
};
|
|
25163
|
+
var GridContainerNode = class GridContainerNode extends DecoratorNode {
|
|
25164
|
+
static getType() {
|
|
25165
|
+
return "grid-container";
|
|
25166
|
+
}
|
|
25167
|
+
constructor(key) {
|
|
25168
|
+
super(key);
|
|
25169
|
+
this.__cols = 2;
|
|
25170
|
+
this.__gap = "16px";
|
|
25171
|
+
this.__cells = [];
|
|
25172
|
+
}
|
|
25173
|
+
static clone(node) {
|
|
25174
|
+
const n = new GridContainerNode(node.__key);
|
|
25175
|
+
n.__cols = node.__cols;
|
|
25176
|
+
n.__gap = node.__gap;
|
|
25177
|
+
n.__cells = node.__cells;
|
|
25178
|
+
return n;
|
|
25179
|
+
}
|
|
25180
|
+
static importJSON(_json) {
|
|
25181
|
+
const json = _json;
|
|
25182
|
+
const node = new GridContainerNode();
|
|
25183
|
+
node.__cols = json.cols ?? 2;
|
|
25184
|
+
const rawGap = json.gap;
|
|
25185
|
+
node.__gap = typeof rawGap === "number" ? `${rawGap}px` : rawGap ?? "16px";
|
|
25186
|
+
node.__cells = json.cells ?? [];
|
|
25187
|
+
return node;
|
|
25188
|
+
}
|
|
25189
|
+
exportJSON() {
|
|
25190
|
+
return {
|
|
25191
|
+
type: "grid-container",
|
|
25192
|
+
version: 1,
|
|
25193
|
+
cols: this.__cols,
|
|
25194
|
+
gap: this.__gap,
|
|
25195
|
+
cells: this.__cells
|
|
25196
|
+
};
|
|
25197
|
+
}
|
|
25198
|
+
createDOM() {
|
|
25199
|
+
return stubDOM();
|
|
25200
|
+
}
|
|
25201
|
+
updateDOM() {
|
|
25202
|
+
return false;
|
|
25203
|
+
}
|
|
25204
|
+
decorate() {
|
|
25205
|
+
return null;
|
|
25206
|
+
}
|
|
25207
|
+
isInline() {
|
|
25208
|
+
return false;
|
|
25209
|
+
}
|
|
25210
|
+
getTextContent() {
|
|
25211
|
+
return this.__cells.map((cell) => extractText(cell)).join("\n");
|
|
25212
|
+
}
|
|
25213
|
+
};
|
|
25029
25214
|
var customHeadlessNodes = [
|
|
25030
25215
|
SpoilerNode,
|
|
25031
25216
|
RubyNode,
|
|
@@ -25048,195 +25233,22 @@ var customHeadlessNodes = [
|
|
|
25048
25233
|
DynamicNode,
|
|
25049
25234
|
TagNode,
|
|
25050
25235
|
CommentNode,
|
|
25051
|
-
|
|
25052
|
-
|
|
25053
|
-
|
|
25054
|
-
|
|
25055
|
-
constructor(key) {
|
|
25056
|
-
super(key);
|
|
25057
|
-
this.__bannerType = "note";
|
|
25058
|
-
this.__contentState = null;
|
|
25059
|
-
}
|
|
25060
|
-
static clone(node) {
|
|
25061
|
-
const n = new BannerNode(node.__key);
|
|
25062
|
-
n.__bannerType = node.__bannerType;
|
|
25063
|
-
n.__contentState = node.__contentState;
|
|
25064
|
-
return n;
|
|
25065
|
-
}
|
|
25066
|
-
static importJSON(_json) {
|
|
25067
|
-
const json = _json;
|
|
25068
|
-
const node = new BannerNode();
|
|
25069
|
-
node.__bannerType = json.bannerType ?? "note";
|
|
25070
|
-
node.__contentState = json.content ?? null;
|
|
25071
|
-
return node;
|
|
25072
|
-
}
|
|
25073
|
-
exportJSON() {
|
|
25074
|
-
return {
|
|
25075
|
-
type: "banner",
|
|
25076
|
-
version: 1,
|
|
25077
|
-
bannerType: this.__bannerType,
|
|
25078
|
-
content: this.__contentState
|
|
25079
|
-
};
|
|
25080
|
-
}
|
|
25081
|
-
createDOM() {
|
|
25082
|
-
return stubDOM();
|
|
25083
|
-
}
|
|
25084
|
-
updateDOM() {
|
|
25085
|
-
return false;
|
|
25086
|
-
}
|
|
25087
|
-
decorate() {
|
|
25088
|
-
return null;
|
|
25089
|
-
}
|
|
25090
|
-
isInline() {
|
|
25091
|
-
return false;
|
|
25092
|
-
}
|
|
25093
|
-
getTextContent() {
|
|
25094
|
-
return extractText(this.__contentState);
|
|
25095
|
-
}
|
|
25096
|
-
},
|
|
25097
|
-
class AlertQuoteNode extends DecoratorNode {
|
|
25098
|
-
static getType() {
|
|
25099
|
-
return "alert-quote";
|
|
25100
|
-
}
|
|
25101
|
-
constructor(key) {
|
|
25102
|
-
super(key);
|
|
25103
|
-
this.__alertType = "note";
|
|
25104
|
-
this.__contentState = null;
|
|
25105
|
-
}
|
|
25106
|
-
static clone(node) {
|
|
25107
|
-
const n = new AlertQuoteNode(node.__key);
|
|
25108
|
-
n.__alertType = node.__alertType;
|
|
25109
|
-
n.__contentState = node.__contentState;
|
|
25110
|
-
return n;
|
|
25111
|
-
}
|
|
25112
|
-
static importJSON(_json) {
|
|
25113
|
-
const json = _json;
|
|
25114
|
-
const node = new AlertQuoteNode();
|
|
25115
|
-
node.__alertType = json.alertType ?? "note";
|
|
25116
|
-
node.__contentState = json.content ?? null;
|
|
25117
|
-
return node;
|
|
25118
|
-
}
|
|
25119
|
-
exportJSON() {
|
|
25120
|
-
return {
|
|
25121
|
-
type: "alert-quote",
|
|
25122
|
-
version: 1,
|
|
25123
|
-
alertType: this.__alertType,
|
|
25124
|
-
content: this.__contentState
|
|
25125
|
-
};
|
|
25126
|
-
}
|
|
25127
|
-
createDOM() {
|
|
25128
|
-
return stubDOM();
|
|
25129
|
-
}
|
|
25130
|
-
updateDOM() {
|
|
25131
|
-
return false;
|
|
25132
|
-
}
|
|
25133
|
-
decorate() {
|
|
25134
|
-
return null;
|
|
25135
|
-
}
|
|
25136
|
-
isInline() {
|
|
25137
|
-
return false;
|
|
25138
|
-
}
|
|
25139
|
-
getTextContent() {
|
|
25140
|
-
return extractText(this.__contentState);
|
|
25141
|
-
}
|
|
25142
|
-
},
|
|
25143
|
-
class NestedDocNode extends DecoratorNode {
|
|
25144
|
-
static getType() {
|
|
25145
|
-
return "nested-doc";
|
|
25146
|
-
}
|
|
25147
|
-
constructor(key) {
|
|
25148
|
-
super(key);
|
|
25149
|
-
this.__contentState = null;
|
|
25150
|
-
}
|
|
25151
|
-
static clone(node) {
|
|
25152
|
-
const n = new NestedDocNode(node.__key);
|
|
25153
|
-
n.__contentState = node.__contentState;
|
|
25154
|
-
return n;
|
|
25155
|
-
}
|
|
25156
|
-
static importJSON(_json) {
|
|
25157
|
-
const json = _json;
|
|
25158
|
-
const node = new NestedDocNode();
|
|
25159
|
-
node.__contentState = json.content ?? null;
|
|
25160
|
-
return node;
|
|
25161
|
-
}
|
|
25162
|
-
exportJSON() {
|
|
25163
|
-
return {
|
|
25164
|
-
type: "nested-doc",
|
|
25165
|
-
version: 1,
|
|
25166
|
-
content: this.__contentState
|
|
25167
|
-
};
|
|
25168
|
-
}
|
|
25169
|
-
createDOM() {
|
|
25170
|
-
return stubDOM();
|
|
25171
|
-
}
|
|
25172
|
-
updateDOM() {
|
|
25173
|
-
return false;
|
|
25174
|
-
}
|
|
25175
|
-
decorate() {
|
|
25176
|
-
return null;
|
|
25177
|
-
}
|
|
25178
|
-
isInline() {
|
|
25179
|
-
return false;
|
|
25180
|
-
}
|
|
25181
|
-
getTextContent() {
|
|
25182
|
-
return extractText(this.__contentState);
|
|
25183
|
-
}
|
|
25184
|
-
},
|
|
25185
|
-
class GridContainerNode extends DecoratorNode {
|
|
25186
|
-
static getType() {
|
|
25187
|
-
return "grid-container";
|
|
25188
|
-
}
|
|
25189
|
-
constructor(key) {
|
|
25190
|
-
super(key);
|
|
25191
|
-
this.__cols = 2;
|
|
25192
|
-
this.__gap = "16px";
|
|
25193
|
-
this.__cells = [];
|
|
25194
|
-
}
|
|
25195
|
-
static clone(node) {
|
|
25196
|
-
const n = new GridContainerNode(node.__key);
|
|
25197
|
-
n.__cols = node.__cols;
|
|
25198
|
-
n.__gap = node.__gap;
|
|
25199
|
-
n.__cells = node.__cells;
|
|
25200
|
-
return n;
|
|
25201
|
-
}
|
|
25202
|
-
static importJSON(_json) {
|
|
25203
|
-
const json = _json;
|
|
25204
|
-
const node = new GridContainerNode();
|
|
25205
|
-
node.__cols = json.cols ?? 2;
|
|
25206
|
-
const rawGap = json.gap;
|
|
25207
|
-
node.__gap = typeof rawGap === "number" ? `${rawGap}px` : rawGap ?? "16px";
|
|
25208
|
-
node.__cells = json.cells ?? [];
|
|
25209
|
-
return node;
|
|
25210
|
-
}
|
|
25211
|
-
exportJSON() {
|
|
25212
|
-
return {
|
|
25213
|
-
type: "grid-container",
|
|
25214
|
-
version: 1,
|
|
25215
|
-
cols: this.__cols,
|
|
25216
|
-
gap: this.__gap,
|
|
25217
|
-
cells: this.__cells
|
|
25218
|
-
};
|
|
25219
|
-
}
|
|
25220
|
-
createDOM() {
|
|
25221
|
-
return stubDOM();
|
|
25222
|
-
}
|
|
25223
|
-
updateDOM() {
|
|
25224
|
-
return false;
|
|
25225
|
-
}
|
|
25226
|
-
decorate() {
|
|
25227
|
-
return null;
|
|
25228
|
-
}
|
|
25229
|
-
isInline() {
|
|
25230
|
-
return false;
|
|
25231
|
-
}
|
|
25232
|
-
getTextContent() {
|
|
25233
|
-
return this.__cells.map((cell) => extractText(cell)).join("\n");
|
|
25234
|
-
}
|
|
25235
|
-
},
|
|
25236
|
+
BannerNode,
|
|
25237
|
+
AlertQuoteNode,
|
|
25238
|
+
NestedDocNode,
|
|
25239
|
+
GridContainerNode,
|
|
25236
25240
|
PollNode,
|
|
25237
25241
|
ChatNode
|
|
25238
25242
|
];
|
|
25239
25243
|
var allHeadlessNodes = [...builtinNodes, ...customHeadlessNodes];
|
|
25244
|
+
//#endregion
|
|
25245
|
+
//#region ../editor/src/core/haklex-isinline-patch.ts
|
|
25246
|
+
for (const klass of [
|
|
25247
|
+
BannerNode,
|
|
25248
|
+
AlertQuoteNode,
|
|
25249
|
+
GridContainerNode,
|
|
25250
|
+
NestedDocNode
|
|
25251
|
+
]) klass.prototype.isInline = () => false;
|
|
25240
25252
|
const createHeadlessEditor = (await (process.env.NODE_ENV !== "production" ? import("./LexicalHeadless.dev-DJp__UcP.mjs") : import("./LexicalHeadless.prod-o0v9cIu5.mjs"))).createHeadlessEditor;
|
|
25241
25253
|
//#endregion
|
|
25242
25254
|
//#region ../editor/src/core/nodes/litexml.ts
|
|
@@ -30954,7 +30966,7 @@ const renderReadableGeneric = (data) => renderReadableLines(data, 0).join("\n");
|
|
|
30954
30966
|
//#endregion
|
|
30955
30967
|
//#region src/services/Renderer/service.ts
|
|
30956
30968
|
const makeService$3 = () => {
|
|
30957
|
-
const getOpts = get$
|
|
30969
|
+
const getOpts = get$21(currentOutputOptions);
|
|
30958
30970
|
const emitSuccessSync = (data, opts) => {
|
|
30959
30971
|
if (opts.json || opts.output === "json") {
|
|
30960
30972
|
writeStdout(`${JSON.stringify({
|
|
@@ -31293,12 +31305,12 @@ const resolveArticleId = (resolver, ref) => gen(function* () {
|
|
|
31293
31305
|
});
|
|
31294
31306
|
//#endregion
|
|
31295
31307
|
//#region src/cli/ai/insights/by-article.ts
|
|
31296
|
-
const id$
|
|
31308
|
+
const id$12 = text$6({ name: "idOrSlug" });
|
|
31297
31309
|
const lang$3 = text$4("lang").pipe(optional$4);
|
|
31298
31310
|
const onlyDb$1 = boolean("only-db").pipe(withDescription$3("do not auto-generate on miss"));
|
|
31299
|
-
const unwrap$
|
|
31311
|
+
const unwrap$16 = (value) => getOrUndefined(value);
|
|
31300
31312
|
const byArticle$2 = make$14("by-article", {
|
|
31301
|
-
id: id$
|
|
31313
|
+
id: id$12,
|
|
31302
31314
|
lang: lang$3,
|
|
31303
31315
|
onlyDb: onlyDb$1
|
|
31304
31316
|
}, ({ id, lang, onlyDb }) => gen(function* () {
|
|
@@ -31306,12 +31318,12 @@ const byArticle$2 = make$14("by-article", {
|
|
|
31306
31318
|
const renderer = yield* Renderer;
|
|
31307
31319
|
const refId = yield* resolveArticleId(yield* Resolver, id);
|
|
31308
31320
|
const res = yield* ai.getInsightsByArticle(refId, {
|
|
31309
|
-
lang: unwrap$
|
|
31321
|
+
lang: unwrap$16(lang),
|
|
31310
31322
|
onlyDb
|
|
31311
31323
|
});
|
|
31312
31324
|
yield* renderer.emitSuccess(res);
|
|
31313
31325
|
})).pipe(withDescription("show an article's AI insights"));
|
|
31314
|
-
const del$
|
|
31326
|
+
const del$13 = make$14("delete", {
|
|
31315
31327
|
recordId: text$6({ name: "recordId" }),
|
|
31316
31328
|
force: boolean("force").pipe(withDescription$3("skip the non-TTY guard"))
|
|
31317
31329
|
}, ({ recordId, force }) => gen(function* () {
|
|
@@ -32167,7 +32179,7 @@ const edit$9 = make$14("edit", { recordId: recordId$9 }, ({ recordId }) => gen(f
|
|
|
32167
32179
|
const res = yield* ai.updateInsights(recordId, parsed);
|
|
32168
32180
|
yield* renderer.emitSuccess(res);
|
|
32169
32181
|
})).pipe(withDescription("edit AI insights via $EDITOR"));
|
|
32170
|
-
const get$
|
|
32182
|
+
const get$13 = make$14("get", { recordId: text$6({ name: "recordId" }) }, ({ recordId }) => gen(function* () {
|
|
32171
32183
|
const ai = yield* Ai;
|
|
32172
32184
|
const renderer = yield* Renderer;
|
|
32173
32185
|
const res = yield* ai.getInsights(recordId);
|
|
@@ -32175,20 +32187,20 @@ const get$12 = make$14("get", { recordId: text$6({ name: "recordId" }) }, ({ rec
|
|
|
32175
32187
|
})).pipe(withDescription("get AI insights by record id"));
|
|
32176
32188
|
//#endregion
|
|
32177
32189
|
//#region src/cli/ai/insights/list.ts
|
|
32178
|
-
const page$
|
|
32179
|
-
const size$
|
|
32190
|
+
const page$9 = integer("page").pipe(optional$4);
|
|
32191
|
+
const size$9 = integer("size").pipe(optional$4);
|
|
32180
32192
|
const grouped$1 = boolean("grouped").pipe(withDescription$3("group rows by article"));
|
|
32181
|
-
const unwrap$
|
|
32182
|
-
const list$
|
|
32183
|
-
page: page$
|
|
32184
|
-
size: size$
|
|
32193
|
+
const unwrap$15 = (value) => getOrUndefined(value);
|
|
32194
|
+
const list$15 = make$14("list", {
|
|
32195
|
+
page: page$9,
|
|
32196
|
+
size: size$9,
|
|
32185
32197
|
grouped: grouped$1
|
|
32186
32198
|
}, ({ page, size, grouped }) => gen(function* () {
|
|
32187
32199
|
const ai = yield* Ai;
|
|
32188
32200
|
const renderer = yield* Renderer;
|
|
32189
32201
|
const res = yield* ai.listInsights({
|
|
32190
|
-
page: unwrap$
|
|
32191
|
-
size: unwrap$
|
|
32202
|
+
page: unwrap$15(page),
|
|
32203
|
+
size: unwrap$15(size),
|
|
32192
32204
|
grouped
|
|
32193
32205
|
});
|
|
32194
32206
|
yield* renderer.emitSuccess(res);
|
|
@@ -32274,20 +32286,20 @@ const refresh = make$14("refresh", {
|
|
|
32274
32286
|
//#region src/cli/ai/insights/index.ts
|
|
32275
32287
|
const insightsCmd = make$14("insights").pipe(withDescription("manage AI insights"), withSubcommands([
|
|
32276
32288
|
refresh,
|
|
32277
|
-
list$
|
|
32278
|
-
get$
|
|
32289
|
+
list$15,
|
|
32290
|
+
get$13,
|
|
32279
32291
|
byArticle$2,
|
|
32280
32292
|
edit$9,
|
|
32281
|
-
del$
|
|
32293
|
+
del$13
|
|
32282
32294
|
]));
|
|
32283
32295
|
//#endregion
|
|
32284
32296
|
//#region src/cli/ai/summary/by-article.ts
|
|
32285
|
-
const id$
|
|
32297
|
+
const id$10 = text$6({ name: "idOrSlug" });
|
|
32286
32298
|
const lang$2 = text$4("lang").pipe(optional$4);
|
|
32287
32299
|
const onlyDb = boolean("only-db").pipe(withDescription$3("do not auto-generate on miss"));
|
|
32288
|
-
const unwrap$
|
|
32300
|
+
const unwrap$14 = (value) => getOrUndefined(value);
|
|
32289
32301
|
const byArticle$1 = make$14("by-article", {
|
|
32290
|
-
id: id$
|
|
32302
|
+
id: id$10,
|
|
32291
32303
|
lang: lang$2,
|
|
32292
32304
|
onlyDb
|
|
32293
32305
|
}, ({ id, lang, onlyDb }) => gen(function* () {
|
|
@@ -32295,12 +32307,12 @@ const byArticle$1 = make$14("by-article", {
|
|
|
32295
32307
|
const renderer = yield* Renderer;
|
|
32296
32308
|
const refId = yield* resolveArticleId(yield* Resolver, id);
|
|
32297
32309
|
const res = yield* ai.getSummariesByArticle(refId, {
|
|
32298
|
-
lang: unwrap$
|
|
32310
|
+
lang: unwrap$14(lang),
|
|
32299
32311
|
onlyDb
|
|
32300
32312
|
});
|
|
32301
32313
|
yield* renderer.emitSuccess(res);
|
|
32302
32314
|
})).pipe(withDescription("show an article's AI summary"));
|
|
32303
|
-
const del$
|
|
32315
|
+
const del$12 = make$14("delete", {
|
|
32304
32316
|
recordId: text$6({ name: "recordId" }),
|
|
32305
32317
|
force: boolean("force").pipe(withDescription$3("skip the non-TTY guard"))
|
|
32306
32318
|
}, ({ recordId, force }) => gen(function* () {
|
|
@@ -32351,7 +32363,7 @@ const edit$8 = make$14("edit", { recordId: recordId$6 }, ({ recordId }) => gen(f
|
|
|
32351
32363
|
const res = yield* ai.updateSummary(recordId, parsed);
|
|
32352
32364
|
yield* renderer.emitSuccess(res);
|
|
32353
32365
|
})).pipe(withDescription("edit an AI summary via $EDITOR"));
|
|
32354
|
-
const get$
|
|
32366
|
+
const get$12 = make$14("get", { recordId: text$6({ name: "recordId" }) }, ({ recordId }) => gen(function* () {
|
|
32355
32367
|
const ai = yield* Ai;
|
|
32356
32368
|
const renderer = yield* Renderer;
|
|
32357
32369
|
const res = yield* ai.getSummary(recordId);
|
|
@@ -32359,20 +32371,20 @@ const get$11 = make$14("get", { recordId: text$6({ name: "recordId" }) }, ({ rec
|
|
|
32359
32371
|
})).pipe(withDescription("get an AI summary by record id"));
|
|
32360
32372
|
//#endregion
|
|
32361
32373
|
//#region src/cli/ai/summary/list.ts
|
|
32362
|
-
const page$
|
|
32363
|
-
const size$
|
|
32374
|
+
const page$8 = integer("page").pipe(optional$4);
|
|
32375
|
+
const size$8 = integer("size").pipe(optional$4);
|
|
32364
32376
|
const grouped = boolean("grouped").pipe(withDescription$3("group rows by article"));
|
|
32365
|
-
const unwrap$
|
|
32366
|
-
const list$
|
|
32367
|
-
page: page$
|
|
32368
|
-
size: size$
|
|
32377
|
+
const unwrap$13 = (value) => getOrUndefined(value);
|
|
32378
|
+
const list$14 = make$14("list", {
|
|
32379
|
+
page: page$8,
|
|
32380
|
+
size: size$8,
|
|
32369
32381
|
grouped
|
|
32370
32382
|
}, ({ page, size, grouped }) => gen(function* () {
|
|
32371
32383
|
const ai = yield* Ai;
|
|
32372
32384
|
const renderer = yield* Renderer;
|
|
32373
32385
|
const res = yield* ai.listSummaries({
|
|
32374
|
-
page: unwrap$
|
|
32375
|
-
size: unwrap$
|
|
32386
|
+
page: unwrap$13(page),
|
|
32387
|
+
size: unwrap$13(size),
|
|
32376
32388
|
grouped
|
|
32377
32389
|
});
|
|
32378
32390
|
yield* renderer.emitSuccess(res);
|
|
@@ -32395,28 +32407,28 @@ const regen = make$14("regen", {
|
|
|
32395
32407
|
//#region src/cli/ai/summary/index.ts
|
|
32396
32408
|
const summaryCmd = make$14("summary").pipe(withDescription("manage AI summaries"), withSubcommands([
|
|
32397
32409
|
regen,
|
|
32398
|
-
list$
|
|
32399
|
-
get$
|
|
32410
|
+
list$14,
|
|
32411
|
+
get$12,
|
|
32400
32412
|
byArticle$1,
|
|
32401
32413
|
edit$8,
|
|
32402
|
-
del$
|
|
32414
|
+
del$12
|
|
32403
32415
|
]));
|
|
32404
32416
|
//#endregion
|
|
32405
32417
|
//#region src/cli/ai/translate/by-article.ts
|
|
32406
|
-
const id$
|
|
32418
|
+
const id$8 = text$6({ name: "idOrSlug" });
|
|
32407
32419
|
const lang$1 = text$4("lang").pipe(optional$4);
|
|
32408
|
-
const unwrap$
|
|
32420
|
+
const unwrap$12 = (value) => getOrUndefined(value);
|
|
32409
32421
|
const byArticle = make$14("by-article", {
|
|
32410
|
-
id: id$
|
|
32422
|
+
id: id$8,
|
|
32411
32423
|
lang: lang$1
|
|
32412
32424
|
}, ({ id, lang }) => gen(function* () {
|
|
32413
32425
|
const ai = yield* Ai;
|
|
32414
32426
|
const renderer = yield* Renderer;
|
|
32415
32427
|
const refId = yield* resolveArticleId(yield* Resolver, id);
|
|
32416
|
-
const res = yield* ai.getTranslationsByArticle(refId, { lang: unwrap$
|
|
32428
|
+
const res = yield* ai.getTranslationsByArticle(refId, { lang: unwrap$12(lang) });
|
|
32417
32429
|
yield* renderer.emitSuccess(res);
|
|
32418
32430
|
})).pipe(withDescription("show an article's translations"));
|
|
32419
|
-
const del$
|
|
32431
|
+
const del$11 = make$14("delete", {
|
|
32420
32432
|
recordId: text$6({ name: "recordId" }),
|
|
32421
32433
|
force: boolean("force").pipe(withDescription$3("skip the non-TTY guard"))
|
|
32422
32434
|
}, ({ recordId, force }) => gen(function* () {
|
|
@@ -32503,7 +32515,7 @@ const edit$7 = make$14("edit", { recordId: recordId$3 }, ({ recordId }) => gen(f
|
|
|
32503
32515
|
const res = yield* ai.updateTranslation(recordId, parsed);
|
|
32504
32516
|
yield* renderer.emitSuccess(res);
|
|
32505
32517
|
})).pipe(withDescription("edit an AI translation via $EDITOR"));
|
|
32506
|
-
const del$
|
|
32518
|
+
const del$10 = make$14("delete", {
|
|
32507
32519
|
recordId: text$6({ name: "recordId" }),
|
|
32508
32520
|
force: boolean("force").pipe(withDescription$3("skip the non-TTY guard"))
|
|
32509
32521
|
}, ({ recordId, force }) => gen(function* () {
|
|
@@ -32584,36 +32596,36 @@ const generate = make$14("generate", {
|
|
|
32584
32596
|
})).pipe(withDescription("regenerate translation entries"));
|
|
32585
32597
|
//#endregion
|
|
32586
32598
|
//#region src/cli/ai/translate/entries/list.ts
|
|
32587
|
-
const page$
|
|
32588
|
-
const size$
|
|
32599
|
+
const page$7 = integer("page").pipe(optional$4);
|
|
32600
|
+
const size$7 = integer("size").pipe(optional$4);
|
|
32589
32601
|
const keyPath = text$4("key-path").pipe(optional$4);
|
|
32590
32602
|
const lang = text$4("lang").pipe(optional$4);
|
|
32591
|
-
const unwrap$
|
|
32592
|
-
const list$
|
|
32593
|
-
page: page$
|
|
32594
|
-
size: size$
|
|
32603
|
+
const unwrap$11 = (value) => getOrUndefined(value);
|
|
32604
|
+
const list$13 = make$14("list", {
|
|
32605
|
+
page: page$7,
|
|
32606
|
+
size: size$7,
|
|
32595
32607
|
keyPath,
|
|
32596
32608
|
lang
|
|
32597
32609
|
}, ({ page, size, keyPath, lang }) => gen(function* () {
|
|
32598
32610
|
const ai = yield* Ai;
|
|
32599
32611
|
const renderer = yield* Renderer;
|
|
32600
32612
|
const res = yield* ai.listEntries({
|
|
32601
|
-
page: unwrap$
|
|
32602
|
-
size: unwrap$
|
|
32603
|
-
keyPath: unwrap$
|
|
32604
|
-
lang: unwrap$
|
|
32613
|
+
page: unwrap$11(page),
|
|
32614
|
+
size: unwrap$11(size),
|
|
32615
|
+
keyPath: unwrap$11(keyPath),
|
|
32616
|
+
lang: unwrap$11(lang)
|
|
32605
32617
|
});
|
|
32606
32618
|
yield* renderer.emitSuccess(res);
|
|
32607
32619
|
})).pipe(withDescription("list AI translation entries (i18n dictionary)"));
|
|
32608
32620
|
//#endregion
|
|
32609
32621
|
//#region src/cli/ai/translate/entries/index.ts
|
|
32610
32622
|
const entriesCmd = make$14("entries").pipe(withDescription("manage translation entries (i18n dictionary)"), withSubcommands([
|
|
32611
|
-
list$
|
|
32623
|
+
list$13,
|
|
32612
32624
|
generate,
|
|
32613
32625
|
edit$6,
|
|
32614
|
-
del$
|
|
32626
|
+
del$10
|
|
32615
32627
|
]));
|
|
32616
|
-
const get$
|
|
32628
|
+
const get$11 = make$14("get", { recordId: text$6({ name: "recordId" }) }, ({ recordId }) => gen(function* () {
|
|
32617
32629
|
const ai = yield* Ai;
|
|
32618
32630
|
const renderer = yield* Renderer;
|
|
32619
32631
|
const res = yield* ai.getTranslation(recordId);
|
|
@@ -32628,18 +32640,18 @@ const languages = make$14("languages", { id: text$6({ name: "idOrSlug" }) }, ({
|
|
|
32628
32640
|
})).pipe(withDescription("list languages an article has been translated into"));
|
|
32629
32641
|
//#endregion
|
|
32630
32642
|
//#region src/cli/ai/translate/list.ts
|
|
32631
|
-
const page$
|
|
32632
|
-
const size$
|
|
32633
|
-
const unwrap$
|
|
32634
|
-
const list$
|
|
32635
|
-
page: page$
|
|
32636
|
-
size: size$
|
|
32643
|
+
const page$6 = integer("page").pipe(optional$4);
|
|
32644
|
+
const size$6 = integer("size").pipe(optional$4);
|
|
32645
|
+
const unwrap$10 = (value) => getOrUndefined(value);
|
|
32646
|
+
const list$12 = make$14("list", {
|
|
32647
|
+
page: page$6,
|
|
32648
|
+
size: size$6
|
|
32637
32649
|
}, ({ page, size }) => gen(function* () {
|
|
32638
32650
|
const ai = yield* Ai;
|
|
32639
32651
|
const renderer = yield* Renderer;
|
|
32640
32652
|
const res = yield* ai.listTranslations({
|
|
32641
|
-
page: unwrap$
|
|
32642
|
-
size: unwrap$
|
|
32653
|
+
page: unwrap$10(page),
|
|
32654
|
+
size: unwrap$10(size),
|
|
32643
32655
|
grouped: true
|
|
32644
32656
|
});
|
|
32645
32657
|
yield* renderer.emitSuccess(res);
|
|
@@ -32663,17 +32675,17 @@ const run$1 = make$14("run", {
|
|
|
32663
32675
|
//#region src/cli/ai/translate/index.ts
|
|
32664
32676
|
const translateCmd = make$14("translate").pipe(withDescription("manage AI translations"), withSubcommands([
|
|
32665
32677
|
run$1,
|
|
32666
|
-
list$
|
|
32667
|
-
get$
|
|
32678
|
+
list$12,
|
|
32679
|
+
get$11,
|
|
32668
32680
|
byArticle,
|
|
32669
32681
|
languages,
|
|
32670
32682
|
edit$7,
|
|
32671
|
-
del$
|
|
32683
|
+
del$11,
|
|
32672
32684
|
entriesCmd
|
|
32673
32685
|
]));
|
|
32674
32686
|
//#endregion
|
|
32675
32687
|
//#region src/cli/ai/index.ts
|
|
32676
|
-
const help$
|
|
32688
|
+
const help$14 = registerCommandHelp({
|
|
32677
32689
|
name: "ai",
|
|
32678
32690
|
description: "manage AI artifacts (summary, translation, insights)",
|
|
32679
32691
|
skillChapter: "commands-ai",
|
|
@@ -32695,7 +32707,7 @@ const help$13 = registerCommandHelp({
|
|
|
32695
32707
|
}
|
|
32696
32708
|
]
|
|
32697
32709
|
});
|
|
32698
|
-
const aiCmd = make$14("ai").pipe(withDescription(help$
|
|
32710
|
+
const aiCmd = make$14("ai").pipe(withDescription(help$14.description), withSubcommands([
|
|
32699
32711
|
summaryCmd,
|
|
32700
32712
|
translateCmd,
|
|
32701
32713
|
insightsCmd
|
|
@@ -33518,7 +33530,7 @@ const login = make$14("login", { production: production$1 }, ({ production }) =>
|
|
|
33518
33530
|
const editor = yield* Editor;
|
|
33519
33531
|
const renderer = yield* Renderer;
|
|
33520
33532
|
const opts = yield* renderer.options;
|
|
33521
|
-
const flagProfile = yield* get$
|
|
33533
|
+
const flagProfile = yield* get$21(currentProfileFlag);
|
|
33522
33534
|
const resolved = yield* profile.resolve(flagProfile ? { profile: flagProfile } : {}).pipe(catchTags({
|
|
33523
33535
|
Generic: (e) => {
|
|
33524
33536
|
return e.cause?._tag === "ConfigMissingApiUrl" ? succeed$1(null) : fail$2(e);
|
|
@@ -33714,7 +33726,7 @@ const whoami = make$14("whoami", {}, () => gen(function* () {
|
|
|
33714
33726
|
}));
|
|
33715
33727
|
//#endregion
|
|
33716
33728
|
//#region src/cli/auth/index.ts
|
|
33717
|
-
const help$
|
|
33729
|
+
const help$13 = registerCommandHelp({
|
|
33718
33730
|
name: "auth",
|
|
33719
33731
|
description: "authentication",
|
|
33720
33732
|
skillChapter: "commands-auth",
|
|
@@ -33738,13 +33750,13 @@ const help$12 = registerCommandHelp({
|
|
|
33738
33750
|
}
|
|
33739
33751
|
]
|
|
33740
33752
|
});
|
|
33741
|
-
const authCmd = make$14("auth").pipe(withDescription(help$
|
|
33753
|
+
const authCmd = make$14("auth").pipe(withDescription(help$13.description), withSubcommands([
|
|
33742
33754
|
login,
|
|
33743
33755
|
logout,
|
|
33744
33756
|
whoami,
|
|
33745
33757
|
status
|
|
33746
33758
|
]));
|
|
33747
|
-
const create$
|
|
33759
|
+
const create$7 = make$14("create", {
|
|
33748
33760
|
name: text$4("name"),
|
|
33749
33761
|
slug: text$4("slug"),
|
|
33750
33762
|
type: choice("type", ["category", "tag"]).pipe(optional$4),
|
|
@@ -33766,7 +33778,7 @@ const create$6 = make$14("create", {
|
|
|
33766
33778
|
});
|
|
33767
33779
|
yield* renderer.emitSuccess(res);
|
|
33768
33780
|
}));
|
|
33769
|
-
const del$
|
|
33781
|
+
const del$9 = make$14("delete", {
|
|
33770
33782
|
slugOrId: text$6({ name: "slugOrId" }),
|
|
33771
33783
|
force: boolean("force")
|
|
33772
33784
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
@@ -33777,7 +33789,7 @@ const del$8 = make$14("delete", {
|
|
|
33777
33789
|
yield* api.request(`/categories/${id}`, { method: "DELETE" });
|
|
33778
33790
|
yield* renderer.emitSuccess({ deleted: id });
|
|
33779
33791
|
}));
|
|
33780
|
-
const get$
|
|
33792
|
+
const get$10 = make$14("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
33781
33793
|
const api = yield* Api;
|
|
33782
33794
|
const renderer = yield* Renderer;
|
|
33783
33795
|
const res = yield* api.request(`/categories/${encodeURIComponent(slugOrId)}`);
|
|
@@ -33785,13 +33797,13 @@ const get$9 = make$14("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slug
|
|
|
33785
33797
|
}));
|
|
33786
33798
|
//#endregion
|
|
33787
33799
|
//#region src/cli/category/list.ts
|
|
33788
|
-
const list$
|
|
33800
|
+
const list$11 = make$14("list", {}, () => gen(function* () {
|
|
33789
33801
|
const api = yield* Api;
|
|
33790
33802
|
const renderer = yield* Renderer;
|
|
33791
33803
|
const res = yield* api.request("/categories");
|
|
33792
33804
|
yield* renderer.emitSuccess(res);
|
|
33793
33805
|
}));
|
|
33794
|
-
const update$
|
|
33806
|
+
const update$7 = make$14("update", {
|
|
33795
33807
|
slugOrId: text$6({ name: "slugOrId" }),
|
|
33796
33808
|
name: text$4("name").pipe(optional$4),
|
|
33797
33809
|
slug: text$4("slug").pipe(optional$4),
|
|
@@ -33818,7 +33830,7 @@ const update$6 = make$14("update", {
|
|
|
33818
33830
|
}));
|
|
33819
33831
|
//#endregion
|
|
33820
33832
|
//#region src/cli/category/index.ts
|
|
33821
|
-
const help$
|
|
33833
|
+
const help$12 = registerCommandHelp({
|
|
33822
33834
|
name: "category",
|
|
33823
33835
|
description: "manage categories / tags",
|
|
33824
33836
|
skillChapter: "commands-category",
|
|
@@ -33859,12 +33871,12 @@ const help$11 = registerCommandHelp({
|
|
|
33859
33871
|
}
|
|
33860
33872
|
]
|
|
33861
33873
|
});
|
|
33862
|
-
const categoryCmd = make$14("category").pipe(withDescription(help$
|
|
33863
|
-
list$
|
|
33864
|
-
get$
|
|
33865
|
-
create$
|
|
33866
|
-
update$
|
|
33867
|
-
del$
|
|
33874
|
+
const categoryCmd = make$14("category").pipe(withDescription(help$12.description), withSubcommands([
|
|
33875
|
+
list$11,
|
|
33876
|
+
get$10,
|
|
33877
|
+
create$7,
|
|
33878
|
+
update$7,
|
|
33879
|
+
del$9
|
|
33868
33880
|
]));
|
|
33869
33881
|
//#endregion
|
|
33870
33882
|
//#region src/services/Comment.ts
|
|
@@ -33967,7 +33979,7 @@ var Comment = class Comment extends Tag$2("Comment")() {
|
|
|
33967
33979
|
//#region src/cli/comment/_flags.ts
|
|
33968
33980
|
const ids = text$6({ name: "id" }).pipe(repeated$2);
|
|
33969
33981
|
const all$1 = boolean("all").pipe(withDescription$3("apply to every comment (optionally filtered by --state)"));
|
|
33970
|
-
const force$
|
|
33982
|
+
const force$10 = boolean("force").pipe(withDescription$3("skip TTY confirmation guard"));
|
|
33971
33983
|
const stateFilter = choice("state", [
|
|
33972
33984
|
"unread",
|
|
33973
33985
|
"read",
|
|
@@ -33998,7 +34010,7 @@ const requireForceForSingleDelete = (params) => suspend(() => {
|
|
|
33998
34010
|
const approve = make$14("approve", {
|
|
33999
34011
|
ids,
|
|
34000
34012
|
all: all$1,
|
|
34001
|
-
force: force$
|
|
34013
|
+
force: force$10,
|
|
34002
34014
|
state: stateFilter
|
|
34003
34015
|
}, ({ ids, all, force, state }) => gen(function* () {
|
|
34004
34016
|
yield* validateBatchSelection({
|
|
@@ -34022,10 +34034,10 @@ const approve = make$14("approve", {
|
|
|
34022
34034
|
})).pipe(withDescription("mark comments as read; pass ids or --all [--state <s>]"));
|
|
34023
34035
|
//#endregion
|
|
34024
34036
|
//#region src/cli/comment/delete.ts
|
|
34025
|
-
const del$
|
|
34037
|
+
const del$8 = make$14("delete", {
|
|
34026
34038
|
ids,
|
|
34027
34039
|
all: all$1,
|
|
34028
|
-
force: force$
|
|
34040
|
+
force: force$10,
|
|
34029
34041
|
state: stateFilter
|
|
34030
34042
|
}, ({ ids, all, force, state }) => gen(function* () {
|
|
34031
34043
|
yield* validateBatchSelection({
|
|
@@ -34189,13 +34201,13 @@ const commentListView = {
|
|
|
34189
34201
|
readable: (data, ctx) => renderCommentListReadable(data, ctx.color),
|
|
34190
34202
|
llm: (data) => renderCommentListLlm(data)
|
|
34191
34203
|
};
|
|
34192
|
-
const get$
|
|
34204
|
+
const get$9 = make$14("get", { id: text$6({ name: "id" }) }, ({ id }) => gen(function* () {
|
|
34193
34205
|
const comment = yield* Comment;
|
|
34194
34206
|
const renderer = yield* Renderer;
|
|
34195
34207
|
const res = yield* comment.get(id);
|
|
34196
34208
|
yield* renderer.emit(commentView, res);
|
|
34197
34209
|
})).pipe(withDescription("show a single comment by id"));
|
|
34198
|
-
const list$
|
|
34210
|
+
const list$10 = make$14("list", {
|
|
34199
34211
|
page: integer("page").pipe(optional$4),
|
|
34200
34212
|
size: integer("size").pipe(optional$4),
|
|
34201
34213
|
state: stateFilter,
|
|
@@ -34216,7 +34228,7 @@ const list$9 = make$14("list", {
|
|
|
34216
34228
|
const reject = make$14("reject", {
|
|
34217
34229
|
ids,
|
|
34218
34230
|
all: all$1,
|
|
34219
|
-
force: force$
|
|
34231
|
+
force: force$10,
|
|
34220
34232
|
state: stateFilter
|
|
34221
34233
|
}, ({ ids, all, force, state }) => gen(function* () {
|
|
34222
34234
|
yield* validateBatchSelection({
|
|
@@ -34334,7 +34346,7 @@ const unread = make$14("unread", {
|
|
|
34334
34346
|
})).pipe(withDescription("list unread comments (alias for `comment list --state unread`)"));
|
|
34335
34347
|
//#endregion
|
|
34336
34348
|
//#region src/cli/comment/index.ts
|
|
34337
|
-
const help$
|
|
34349
|
+
const help$11 = registerCommandHelp({
|
|
34338
34350
|
name: "comment",
|
|
34339
34351
|
description: "list and moderate comments",
|
|
34340
34352
|
skillChapter: "commands-comment",
|
|
@@ -34402,14 +34414,14 @@ const help$10 = registerCommandHelp({
|
|
|
34402
34414
|
}
|
|
34403
34415
|
]
|
|
34404
34416
|
});
|
|
34405
|
-
const commentCmd = make$14("comment").pipe(withDescription(help$
|
|
34406
|
-
list$
|
|
34417
|
+
const commentCmd = make$14("comment").pipe(withDescription(help$11.description), withSubcommands([
|
|
34418
|
+
list$10,
|
|
34407
34419
|
unread,
|
|
34408
|
-
get$
|
|
34420
|
+
get$9,
|
|
34409
34421
|
reply,
|
|
34410
34422
|
approve,
|
|
34411
34423
|
reject,
|
|
34412
|
-
del$
|
|
34424
|
+
del$8
|
|
34413
34425
|
]));
|
|
34414
34426
|
//#endregion
|
|
34415
34427
|
//#region src/cli/config/edit.ts
|
|
@@ -34438,7 +34450,7 @@ const edit$5 = make$14("edit", {}, () => gen(function* () {
|
|
|
34438
34450
|
});
|
|
34439
34451
|
yield* renderer.emitSuccess(results);
|
|
34440
34452
|
}));
|
|
34441
|
-
const get$
|
|
34453
|
+
const get$8 = make$14("get", { key: text$6({ name: "key" }) }, ({ key }) => gen(function* () {
|
|
34442
34454
|
const api = yield* Api;
|
|
34443
34455
|
const renderer = yield* Renderer;
|
|
34444
34456
|
const res = yield* api.request(`/options/${encodeURIComponent(key)}`);
|
|
@@ -34446,7 +34458,7 @@ const get$7 = make$14("get", { key: text$6({ name: "key" }) }, ({ key }) => gen(
|
|
|
34446
34458
|
}));
|
|
34447
34459
|
//#endregion
|
|
34448
34460
|
//#region src/cli/config/list.ts
|
|
34449
|
-
const list$
|
|
34461
|
+
const list$9 = make$14("list", {}, () => gen(function* () {
|
|
34450
34462
|
const api = yield* Api;
|
|
34451
34463
|
const renderer = yield* Renderer;
|
|
34452
34464
|
const res = yield* api.request("/options");
|
|
@@ -34493,7 +34505,7 @@ const set = make$14("set", {
|
|
|
34493
34505
|
}));
|
|
34494
34506
|
//#endregion
|
|
34495
34507
|
//#region src/cli/config/index.ts
|
|
34496
|
-
const help$
|
|
34508
|
+
const help$10 = registerCommandHelp({
|
|
34497
34509
|
name: "config",
|
|
34498
34510
|
description: "manage server options",
|
|
34499
34511
|
skillChapter: "commands-config",
|
|
@@ -34522,143 +34534,27 @@ const help$9 = registerCommandHelp({
|
|
|
34522
34534
|
}
|
|
34523
34535
|
]
|
|
34524
34536
|
});
|
|
34525
|
-
const configCmd = make$14("config").pipe(withDescription(help$
|
|
34526
|
-
list$
|
|
34527
|
-
get$
|
|
34537
|
+
const configCmd = make$14("config").pipe(withDescription(help$10.description), withSubcommands([
|
|
34538
|
+
list$9,
|
|
34539
|
+
get$8,
|
|
34528
34540
|
set,
|
|
34529
34541
|
edit$5
|
|
34530
34542
|
]));
|
|
34531
34543
|
//#endregion
|
|
34532
|
-
//#region src/cli/file/_shared.ts
|
|
34533
|
-
/** Mirrors the server's `FileTypeEnum` (apps/core modules/file/file.type.ts). */
|
|
34534
|
-
const FILE_TYPES = [
|
|
34535
|
-
"file",
|
|
34536
|
-
"image",
|
|
34537
|
-
"icon",
|
|
34538
|
-
"avatar"
|
|
34539
|
-
];
|
|
34540
|
-
const typeOption = choice("type", FILE_TYPES).pipe(withDescription$3("server-side storage bucket for the file"), withDefault("file"));
|
|
34541
|
-
const silentFlag$5 = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response."));
|
|
34542
|
-
const del$6 = make$14("delete", {
|
|
34543
|
-
name: text$6({ name: "name" }),
|
|
34544
|
-
type: typeOption,
|
|
34545
|
-
force: boolean("force").pipe(withDescription$3("skip confirmation"))
|
|
34546
|
-
}, ({ name, type, force }) => gen(function* () {
|
|
34547
|
-
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
34548
|
-
const api = yield* Api;
|
|
34549
|
-
const renderer = yield* Renderer;
|
|
34550
|
-
yield* api.request(`/objects/${type}/${encodeURIComponent(name)}`, { method: "DELETE" });
|
|
34551
|
-
yield* renderer.emitSuccess({ deleted: `${type}/${name}` });
|
|
34552
|
-
})).pipe(withDescription("delete an uploaded file"));
|
|
34553
|
-
//#endregion
|
|
34554
|
-
//#region src/cli/file/list.ts
|
|
34555
|
-
const list$7 = make$14("list", { type: typeOption }, ({ type }) => gen(function* () {
|
|
34556
|
-
const api = yield* Api;
|
|
34557
|
-
const renderer = yield* Renderer;
|
|
34558
|
-
const res = yield* api.request(`/objects/${type}`);
|
|
34559
|
-
yield* renderer.emitSuccess(res);
|
|
34560
|
-
})).pipe(withDescription("list uploaded files of a type (name, url, created)"));
|
|
34561
|
-
const rename = make$14("rename", {
|
|
34562
|
-
name: text$6({ name: "name" }),
|
|
34563
|
-
newName: text$6({ name: "newName" }),
|
|
34564
|
-
type: typeOption
|
|
34565
|
-
}, ({ name, newName, type }) => gen(function* () {
|
|
34566
|
-
const api = yield* Api;
|
|
34567
|
-
const renderer = yield* Renderer;
|
|
34568
|
-
yield* api.request(`/objects/${type}/${encodeURIComponent(name)}/rename`, {
|
|
34569
|
-
method: "PATCH",
|
|
34570
|
-
query: { newName }
|
|
34571
|
-
});
|
|
34572
|
-
yield* renderer.emitSuccess({
|
|
34573
|
-
renamed: `${type}/${name}`,
|
|
34574
|
-
to: newName
|
|
34575
|
-
});
|
|
34576
|
-
})).pipe(withDescription("rename an uploaded file"));
|
|
34577
|
-
const upload = make$14("upload", {
|
|
34578
|
-
path: text$6({ name: "path" }),
|
|
34579
|
-
type: typeOption,
|
|
34580
|
-
name: text$4("name").pipe(withDescription$3("override the uploaded filename (defaults to the local basename)"), optional$4),
|
|
34581
|
-
silent: silentFlag$5
|
|
34582
|
-
}, ({ path, type, name, silent }) => gen(function* () {
|
|
34583
|
-
const buffer = yield* tryPromise({
|
|
34584
|
-
try: () => readFile(path),
|
|
34585
|
-
catch: (err) => new Generic({
|
|
34586
|
-
message: `cannot read file: ${path}`,
|
|
34587
|
-
cause: err
|
|
34588
|
-
})
|
|
34589
|
-
});
|
|
34590
|
-
const filename = name._tag === "Some" ? name.value : basename(path);
|
|
34591
|
-
const form = new FormData();
|
|
34592
|
-
form.append("file", new File([new Uint8Array(buffer)], filename));
|
|
34593
|
-
const api = yield* Api;
|
|
34594
|
-
const renderer = yield* Renderer;
|
|
34595
|
-
const res = yield* api.request(`/objects/upload`, {
|
|
34596
|
-
method: "POST",
|
|
34597
|
-
query: { type },
|
|
34598
|
-
body: form
|
|
34599
|
-
});
|
|
34600
|
-
yield* renderer.emitSuccess(silent ? { ok: true } : res);
|
|
34601
|
-
})).pipe(withDescription(`upload a local file (--type ${FILE_TYPES.join("|")}); returns { url, name }`));
|
|
34602
|
-
//#endregion
|
|
34603
|
-
//#region src/cli/file/index.ts
|
|
34604
|
-
const help$8 = registerCommandHelp({
|
|
34605
|
-
name: "file",
|
|
34606
|
-
description: "upload and manage static files (images, icons, avatars)",
|
|
34607
|
-
verbs: [
|
|
34608
|
-
{
|
|
34609
|
-
name: "upload",
|
|
34610
|
-
args: [
|
|
34611
|
-
"<path>",
|
|
34612
|
-
"[--type file|image|icon|avatar]",
|
|
34613
|
-
"[--name <n>]"
|
|
34614
|
-
],
|
|
34615
|
-
description: "upload a local file; returns { url, name }"
|
|
34616
|
-
},
|
|
34617
|
-
{
|
|
34618
|
-
name: "list",
|
|
34619
|
-
args: ["[--type <t>]"],
|
|
34620
|
-
description: "list uploaded files of a type"
|
|
34621
|
-
},
|
|
34622
|
-
{
|
|
34623
|
-
name: "delete",
|
|
34624
|
-
args: [
|
|
34625
|
-
"<name>",
|
|
34626
|
-
"[--type <t>]",
|
|
34627
|
-
"[--force]"
|
|
34628
|
-
],
|
|
34629
|
-
description: "delete an uploaded file"
|
|
34630
|
-
},
|
|
34631
|
-
{
|
|
34632
|
-
name: "rename",
|
|
34633
|
-
args: [
|
|
34634
|
-
"<name>",
|
|
34635
|
-
"<newName>",
|
|
34636
|
-
"[--type <t>]"
|
|
34637
|
-
],
|
|
34638
|
-
description: "rename an uploaded file"
|
|
34639
|
-
}
|
|
34640
|
-
]
|
|
34641
|
-
});
|
|
34642
|
-
const fileCmd = make$14("file").pipe(withDescription(help$8.description), withSubcommands([
|
|
34643
|
-
upload,
|
|
34644
|
-
list$7,
|
|
34645
|
-
del$6,
|
|
34646
|
-
rename
|
|
34647
|
-
]));
|
|
34648
|
-
//#endregion
|
|
34649
34544
|
//#region src/domain/admin-link.ts
|
|
34650
34545
|
const buildEditUrl = (adminUrl, kind, id) => {
|
|
34651
34546
|
const base = adminUrl.replace(/\/+$/, "");
|
|
34652
34547
|
if (kind === "projects") return `${base}#/projects/${encodeURIComponent(id)}`;
|
|
34653
34548
|
return `${base}#/${kind}/edit?id=${encodeURIComponent(id)}`;
|
|
34654
34549
|
};
|
|
34655
|
-
|
|
34656
|
-
|
|
34657
|
-
|
|
34658
|
-
|
|
34659
|
-
|
|
34660
|
-
|
|
34661
|
-
|
|
34550
|
+
const buildDraftEditUrl = (adminUrl, kind, draftId, refId) => {
|
|
34551
|
+
const base = adminUrl.replace(/\/+$/, "");
|
|
34552
|
+
const params = new URLSearchParams();
|
|
34553
|
+
params.set("draftId", draftId);
|
|
34554
|
+
if (refId) params.set("id", refId);
|
|
34555
|
+
return `${base}#/${kind}/edit?${params.toString()}`;
|
|
34556
|
+
};
|
|
34557
|
+
const openAdminUrl = (buildUrl) => gen(function* () {
|
|
34662
34558
|
const renderer = yield* Renderer;
|
|
34663
34559
|
const opts = yield* (yield* Api).request("/options/url");
|
|
34664
34560
|
const adminUrl = opts.data?.admin_url ?? opts.admin_url;
|
|
@@ -34666,13 +34562,21 @@ const openAdminEdit = (kind, id) => gen(function* () {
|
|
|
34666
34562
|
yield* renderer.emitWarn("admin_url is not configured on the server; skipping --open");
|
|
34667
34563
|
return;
|
|
34668
34564
|
}
|
|
34669
|
-
const url =
|
|
34565
|
+
const url = buildUrl(adminUrl);
|
|
34670
34566
|
yield* renderer.emitInfo(`opening admin: ${url}`);
|
|
34671
34567
|
yield* tryPromise({
|
|
34672
34568
|
try: () => open(url),
|
|
34673
34569
|
catch: () => /* @__PURE__ */ new Error("failed to launch browser")
|
|
34674
34570
|
}).pipe(catchAll((e) => renderer.emitWarn(`could not launch browser: ${e instanceof Error ? e.message : String(e)}`)));
|
|
34675
34571
|
});
|
|
34572
|
+
/**
|
|
34573
|
+
* Resolve the server's admin URL from `/options/url`, build the admin
|
|
34574
|
+
* edit-page URL for the given resource, and open it in the user's browser.
|
|
34575
|
+
* Non-fatal: missing admin_url or browser-launch failures emit a warning
|
|
34576
|
+
* and the parent effect continues.
|
|
34577
|
+
*/
|
|
34578
|
+
const openAdminEdit = (kind, id) => openAdminUrl((adminUrl) => buildEditUrl(adminUrl, kind, id));
|
|
34579
|
+
const openAdminDraftEdit = (kind, draftId, refId) => openAdminUrl((adminUrl) => buildDraftEditUrl(adminUrl, kind, draftId, refId));
|
|
34676
34580
|
//#endregion
|
|
34677
34581
|
//#region src/services/Lexical.ts
|
|
34678
34582
|
const messageOf$1 = (err) => {
|
|
@@ -35186,7 +35090,7 @@ const resolveContent = (flagSpec, envelope, format) => gen(function* () {
|
|
|
35186
35090
|
//#endregion
|
|
35187
35091
|
//#region src/cli/post/_flags.ts
|
|
35188
35092
|
const optional$3 = (self) => optional$4(self);
|
|
35189
|
-
const unwrap$
|
|
35093
|
+
const unwrap$9 = (value) => getOrUndefined(value);
|
|
35190
35094
|
const title$2 = optional$3(text$4("title"));
|
|
35191
35095
|
const slug$4 = optional$3(text$4("slug"));
|
|
35192
35096
|
const category = optional$3(text$4("category"));
|
|
@@ -35202,7 +35106,7 @@ const related = optional$3(text$4("related"));
|
|
|
35202
35106
|
const pinOrder = optional$3(integer("pin-order"));
|
|
35203
35107
|
const copyright = optional$3(text$4("copyright"));
|
|
35204
35108
|
const openFlag$4 = boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser."));
|
|
35205
|
-
const silentFlag$
|
|
35109
|
+
const silentFlag$5 = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response (saves output tokens). Errors still print normally."));
|
|
35206
35110
|
const parseCsv$1 = (v) => {
|
|
35207
35111
|
if (v === void 0) return void 0;
|
|
35208
35112
|
return v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
@@ -35224,7 +35128,7 @@ const postWriteOptions = {
|
|
|
35224
35128
|
meta: meta$2,
|
|
35225
35129
|
file: file$4,
|
|
35226
35130
|
open: openFlag$4,
|
|
35227
|
-
silent: silentFlag$
|
|
35131
|
+
silent: silentFlag$5
|
|
35228
35132
|
};
|
|
35229
35133
|
/** Resolve `__categoryName` placeholder (set by `buildPostPayload`) → `categoryId`. */
|
|
35230
35134
|
const resolveCategoryRefs = (payload) => gen(function* () {
|
|
@@ -35235,20 +35139,20 @@ const resolveCategoryRefs = (payload) => gen(function* () {
|
|
|
35235
35139
|
return next;
|
|
35236
35140
|
});
|
|
35237
35141
|
const toPostFlagInputs = (opts) => ({
|
|
35238
|
-
title: unwrap$
|
|
35239
|
-
slug: unwrap$
|
|
35240
|
-
category: unwrap$
|
|
35241
|
-
content: unwrap$
|
|
35242
|
-
format: unwrap$
|
|
35243
|
-
summary: unwrap$
|
|
35244
|
-
state: unwrap$
|
|
35245
|
-
tags: parseCsv$1(unwrap$
|
|
35246
|
-
copyright: parseCopyright(unwrap$
|
|
35247
|
-
pin: unwrap$
|
|
35248
|
-
pinOrder: unwrap$
|
|
35249
|
-
related: parseCsv$1(unwrap$
|
|
35250
|
-
meta: unwrap$
|
|
35251
|
-
file: unwrap$
|
|
35142
|
+
title: unwrap$9(opts.title),
|
|
35143
|
+
slug: unwrap$9(opts.slug),
|
|
35144
|
+
category: unwrap$9(opts.category),
|
|
35145
|
+
content: unwrap$9(opts.content),
|
|
35146
|
+
format: unwrap$9(opts.format),
|
|
35147
|
+
summary: unwrap$9(opts.summary),
|
|
35148
|
+
state: unwrap$9(opts.state),
|
|
35149
|
+
tags: parseCsv$1(unwrap$9(opts.tags)),
|
|
35150
|
+
copyright: parseCopyright(unwrap$9(opts.copyright)),
|
|
35151
|
+
pin: unwrap$9(opts.pin),
|
|
35152
|
+
pinOrder: unwrap$9(opts.pinOrder),
|
|
35153
|
+
related: parseCsv$1(unwrap$9(opts.related)),
|
|
35154
|
+
meta: unwrap$9(opts.meta),
|
|
35155
|
+
file: unwrap$9(opts.file)
|
|
35252
35156
|
});
|
|
35253
35157
|
/**
|
|
35254
35158
|
* Extract the id from a server response — handles both `id` and `_id`,
|
|
@@ -35263,6 +35167,382 @@ const extractId$1 = (res) => {
|
|
|
35263
35167
|
if (r.data && typeof r.data === "object") return extractId$1(r.data);
|
|
35264
35168
|
};
|
|
35265
35169
|
//#endregion
|
|
35170
|
+
//#region src/cli/draft/_shared.ts
|
|
35171
|
+
/** Draft-native fields; everything else rides along in `typeSpecificData`. */
|
|
35172
|
+
const DRAFT_CORE_KEYS$1 = /* @__PURE__ */ new Set([
|
|
35173
|
+
"title",
|
|
35174
|
+
"text",
|
|
35175
|
+
"content",
|
|
35176
|
+
"contentFormat",
|
|
35177
|
+
"meta"
|
|
35178
|
+
]);
|
|
35179
|
+
const REF_TYPE_TO_RESOURCE = {
|
|
35180
|
+
post: "posts",
|
|
35181
|
+
note: "notes",
|
|
35182
|
+
page: "pages"
|
|
35183
|
+
};
|
|
35184
|
+
const splitDraftBody = (payload) => {
|
|
35185
|
+
const draftBody = {};
|
|
35186
|
+
const typeSpecificData = {};
|
|
35187
|
+
for (const [key, value] of Object.entries(payload)) if (DRAFT_CORE_KEYS$1.has(key)) draftBody[key] = value;
|
|
35188
|
+
else typeSpecificData[key] = value;
|
|
35189
|
+
if (Object.keys(typeSpecificData).length > 0) draftBody.typeSpecificData = typeSpecificData;
|
|
35190
|
+
return draftBody;
|
|
35191
|
+
};
|
|
35192
|
+
const parseTypeSpecificData$1 = (raw) => {
|
|
35193
|
+
if (!raw) return {};
|
|
35194
|
+
if (typeof raw === "object") return raw;
|
|
35195
|
+
try {
|
|
35196
|
+
const parsed = JSON.parse(raw);
|
|
35197
|
+
return typeof parsed === "object" && parsed !== null ? parsed : {};
|
|
35198
|
+
} catch {
|
|
35199
|
+
return {};
|
|
35200
|
+
}
|
|
35201
|
+
};
|
|
35202
|
+
/**
|
|
35203
|
+
* The response interceptor snake_cases keys at every depth, but the request
|
|
35204
|
+
* pipe only camelizes the body's top level — nested subtrees (like `meta`)
|
|
35205
|
+
* must be restored before being sent back, or `skillIds` round-trips into a
|
|
35206
|
+
* stored `skill_ids`. Best-effort inverse: keys that legitimately contained
|
|
35207
|
+
* underscores were already mangled by the response side.
|
|
35208
|
+
*/
|
|
35209
|
+
const camelizeDeep = (value) => {
|
|
35210
|
+
if (Array.isArray(value)) return value.map(camelizeDeep);
|
|
35211
|
+
if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([k, v]) => [k.replaceAll(/_([a-z0-9])/g, (_, c) => c.toUpperCase()), camelizeDeep(v)]));
|
|
35212
|
+
return value;
|
|
35213
|
+
};
|
|
35214
|
+
/** The server serializes response keys to snake_case; normalize back. */
|
|
35215
|
+
const normalizeDraftRow = (row) => {
|
|
35216
|
+
if (!row || typeof row !== "object") return {};
|
|
35217
|
+
const r = row;
|
|
35218
|
+
const pick = (camel, snake) => r[camel] ?? r[snake];
|
|
35219
|
+
return {
|
|
35220
|
+
id: pick("id", "id"),
|
|
35221
|
+
refType: pick("refType", "ref_type"),
|
|
35222
|
+
refId: pick("refId", "ref_id"),
|
|
35223
|
+
title: pick("title", "title"),
|
|
35224
|
+
text: pick("text", "text"),
|
|
35225
|
+
content: pick("content", "content"),
|
|
35226
|
+
contentFormat: pick("contentFormat", "content_format"),
|
|
35227
|
+
meta: pick("meta", "meta"),
|
|
35228
|
+
typeSpecificData: pick("typeSpecificData", "type_specific_data")
|
|
35229
|
+
};
|
|
35230
|
+
};
|
|
35231
|
+
/** Single-object responses may arrive wrapped in an outer `data` envelope. */
|
|
35232
|
+
const unwrapData = (res) => {
|
|
35233
|
+
if (res && typeof res === "object" && "data" in res) {
|
|
35234
|
+
const inner = res.data;
|
|
35235
|
+
if (inner && typeof inner === "object") return inner;
|
|
35236
|
+
}
|
|
35237
|
+
return res;
|
|
35238
|
+
};
|
|
35239
|
+
//#endregion
|
|
35240
|
+
//#region src/cli/draft/create.ts
|
|
35241
|
+
const create$6 = make$14("create", postWriteOptions, (opts) => gen(function* () {
|
|
35242
|
+
const payload = yield* resolveCategoryRefs({ ...(yield* buildPostPayload(toPostFlagInputs(opts))).payload });
|
|
35243
|
+
delete payload.isPublished;
|
|
35244
|
+
if (Object.keys(payload).filter((k) => k !== "contentFormat").length === 0) return yield* fail$2(new ValidationFailed({ message: "nothing to save: provide --file or content/meta flags" }));
|
|
35245
|
+
const body = splitDraftBody(payload);
|
|
35246
|
+
const api = yield* Api;
|
|
35247
|
+
const renderer = yield* Renderer;
|
|
35248
|
+
const res = yield* api.request("/drafts", {
|
|
35249
|
+
method: "POST",
|
|
35250
|
+
body: {
|
|
35251
|
+
refType: "post",
|
|
35252
|
+
...body
|
|
35253
|
+
}
|
|
35254
|
+
});
|
|
35255
|
+
const id = extractId$1(res);
|
|
35256
|
+
yield* renderer.emitSuccess(opts.silent ? {
|
|
35257
|
+
ok: true,
|
|
35258
|
+
id
|
|
35259
|
+
} : res);
|
|
35260
|
+
if (opts.open && id) yield* openAdminDraftEdit("posts", id);
|
|
35261
|
+
})).pipe(withDescription("create a standalone post draft (not linked to any published post; publish later with `draft publish`)"));
|
|
35262
|
+
const del$7 = make$14("delete", {
|
|
35263
|
+
id: text$6({ name: "id" }),
|
|
35264
|
+
force: boolean("force")
|
|
35265
|
+
}, ({ id, force }) => gen(function* () {
|
|
35266
|
+
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
35267
|
+
const api = yield* Api;
|
|
35268
|
+
const renderer = yield* Renderer;
|
|
35269
|
+
yield* api.request(`/drafts/${encodeURIComponent(id)}`, { method: "DELETE" });
|
|
35270
|
+
yield* renderer.emitSuccess({ deleted: id });
|
|
35271
|
+
})).pipe(withDescription("delete a draft"));
|
|
35272
|
+
const get$7 = make$14("get", { id: text$6({ name: "id" }) }, ({ id }) => gen(function* () {
|
|
35273
|
+
const api = yield* Api;
|
|
35274
|
+
const renderer = yield* Renderer;
|
|
35275
|
+
const res = yield* api.request(`/drafts/${encodeURIComponent(id)}`);
|
|
35276
|
+
yield* renderer.emitSuccess(res);
|
|
35277
|
+
})).pipe(withDescription("show a single draft by id"));
|
|
35278
|
+
//#endregion
|
|
35279
|
+
//#region src/cli/draft/list.ts
|
|
35280
|
+
const page$3 = integer("page").pipe(optional$4);
|
|
35281
|
+
const size$3 = integer("size").pipe(optional$4);
|
|
35282
|
+
const type$1 = choice("type", [
|
|
35283
|
+
"post",
|
|
35284
|
+
"note",
|
|
35285
|
+
"page"
|
|
35286
|
+
]).pipe(optional$4);
|
|
35287
|
+
const newOnly = boolean("new").pipe(withDescription$3("only drafts not linked to a published resource"));
|
|
35288
|
+
const linkedOnly = boolean("linked").pipe(withDescription$3("only drafts linked to a published resource"));
|
|
35289
|
+
const unwrap$8 = (value) => getOrUndefined(value);
|
|
35290
|
+
const list$8 = make$14("list", {
|
|
35291
|
+
page: page$3,
|
|
35292
|
+
size: size$3,
|
|
35293
|
+
type: type$1,
|
|
35294
|
+
new: newOnly,
|
|
35295
|
+
linked: linkedOnly
|
|
35296
|
+
}, ({ page, size, type, new: newOnly, linked: linkedOnly }) => gen(function* () {
|
|
35297
|
+
const api = yield* Api;
|
|
35298
|
+
const renderer = yield* Renderer;
|
|
35299
|
+
const res = yield* api.request("/drafts", { query: {
|
|
35300
|
+
page: unwrap$8(page),
|
|
35301
|
+
size: unwrap$8(size),
|
|
35302
|
+
refType: unwrap$8(type),
|
|
35303
|
+
hasRef: newOnly ? false : linkedOnly ? true : void 0
|
|
35304
|
+
} });
|
|
35305
|
+
yield* renderer.emitSuccess(res);
|
|
35306
|
+
})).pipe(withDescription("list drafts"));
|
|
35307
|
+
const publish$2 = make$14("publish", {
|
|
35308
|
+
id: text$6({ name: "id" }),
|
|
35309
|
+
open: openFlag$4,
|
|
35310
|
+
silent: silentFlag$5
|
|
35311
|
+
}, ({ id, open, silent }) => gen(function* () {
|
|
35312
|
+
const api = yield* Api;
|
|
35313
|
+
const renderer = yield* Renderer;
|
|
35314
|
+
const draft = normalizeDraftRow(unwrapData(yield* api.request(`/drafts/${encodeURIComponent(id)}`)));
|
|
35315
|
+
if (!draft?.id || !draft.refType) return yield* fail$2(new Generic({ message: `draft not found: ${id}` }));
|
|
35316
|
+
const resource = REF_TYPE_TO_RESOURCE[draft.refType];
|
|
35317
|
+
if (!resource) return yield* fail$2(new Generic({ message: `unsupported draft refType: ${draft.refType}` }));
|
|
35318
|
+
const body = { ...parseTypeSpecificData$1(draft.typeSpecificData) };
|
|
35319
|
+
if (draft.title !== void 0) body.title = draft.title;
|
|
35320
|
+
if (draft.text !== void 0) body.text = draft.text;
|
|
35321
|
+
if (draft.content !== void 0 && draft.content !== null) body.content = draft.content;
|
|
35322
|
+
if (draft.contentFormat !== void 0) body.contentFormat = draft.contentFormat;
|
|
35323
|
+
if (draft.meta !== void 0 && draft.meta !== null) body.meta = camelizeDeep(draft.meta);
|
|
35324
|
+
body.draftId = draft.id;
|
|
35325
|
+
let res;
|
|
35326
|
+
if (draft.refId) {
|
|
35327
|
+
if (draft.refType !== "page") body.isPublished = true;
|
|
35328
|
+
res = yield* api.request(`/${resource}/${draft.refId}`, {
|
|
35329
|
+
method: "PATCH",
|
|
35330
|
+
body
|
|
35331
|
+
});
|
|
35332
|
+
} else {
|
|
35333
|
+
if (draft.refType !== "page") body.isPublished = true;
|
|
35334
|
+
res = yield* api.request(`/${resource}`, {
|
|
35335
|
+
method: "POST",
|
|
35336
|
+
body
|
|
35337
|
+
});
|
|
35338
|
+
}
|
|
35339
|
+
const publishedId = extractId$1(res) ?? draft.refId;
|
|
35340
|
+
yield* renderer.emitSuccess(silent ? {
|
|
35341
|
+
ok: true,
|
|
35342
|
+
id: publishedId
|
|
35343
|
+
} : res);
|
|
35344
|
+
if (open && publishedId && draft.refType !== "page") yield* openAdminEdit(resource, publishedId);
|
|
35345
|
+
})).pipe(withDescription("publish a draft: creates the post/note/page (or applies to the linked one) and marks it live"));
|
|
35346
|
+
const update$6 = make$14("update", {
|
|
35347
|
+
id: text$6({ name: "id" }),
|
|
35348
|
+
...postWriteOptions
|
|
35349
|
+
}, ({ id, ...rest }) => gen(function* () {
|
|
35350
|
+
const payload = yield* resolveCategoryRefs({ ...(yield* buildPostPayload(toPostFlagInputs(rest))).payload });
|
|
35351
|
+
delete payload.isPublished;
|
|
35352
|
+
if (Object.keys(payload).filter((k) => k !== "contentFormat").length === 0) return yield* fail$2(new ValidationFailed({ message: "nothing to update: provide --file or content/meta flags" }));
|
|
35353
|
+
const body = splitDraftBody(payload);
|
|
35354
|
+
const api = yield* Api;
|
|
35355
|
+
const renderer = yield* Renderer;
|
|
35356
|
+
const res = yield* api.request(`/drafts/${encodeURIComponent(id)}`, {
|
|
35357
|
+
method: "PUT",
|
|
35358
|
+
body
|
|
35359
|
+
});
|
|
35360
|
+
yield* renderer.emitSuccess(rest.silent ? {
|
|
35361
|
+
ok: true,
|
|
35362
|
+
id
|
|
35363
|
+
} : res);
|
|
35364
|
+
})).pipe(withDescription("update a draft (bumps its version and records history on content change)"));
|
|
35365
|
+
//#endregion
|
|
35366
|
+
//#region src/cli/draft/index.ts
|
|
35367
|
+
const help$9 = registerCommandHelp({
|
|
35368
|
+
name: "draft",
|
|
35369
|
+
description: "manage standalone drafts (server-side draft entities)",
|
|
35370
|
+
skillChapter: "commands-draft",
|
|
35371
|
+
verbs: [
|
|
35372
|
+
{
|
|
35373
|
+
name: "list",
|
|
35374
|
+
args: [
|
|
35375
|
+
"[--type <t>]",
|
|
35376
|
+
"[--new]",
|
|
35377
|
+
"[--linked]"
|
|
35378
|
+
],
|
|
35379
|
+
description: "list drafts"
|
|
35380
|
+
},
|
|
35381
|
+
{
|
|
35382
|
+
name: "get",
|
|
35383
|
+
args: ["<id>"],
|
|
35384
|
+
description: "show a single draft"
|
|
35385
|
+
},
|
|
35386
|
+
{
|
|
35387
|
+
name: "create",
|
|
35388
|
+
args: [
|
|
35389
|
+
"--file <envelope.xml>",
|
|
35390
|
+
"[--title ...]",
|
|
35391
|
+
"..."
|
|
35392
|
+
],
|
|
35393
|
+
description: "create a standalone post draft"
|
|
35394
|
+
},
|
|
35395
|
+
{
|
|
35396
|
+
name: "update",
|
|
35397
|
+
args: [
|
|
35398
|
+
"<id>",
|
|
35399
|
+
"--file <envelope.xml>",
|
|
35400
|
+
"..."
|
|
35401
|
+
],
|
|
35402
|
+
description: "update a draft (versioned)"
|
|
35403
|
+
},
|
|
35404
|
+
{
|
|
35405
|
+
name: "publish",
|
|
35406
|
+
args: [
|
|
35407
|
+
"<id>",
|
|
35408
|
+
"[--silent]",
|
|
35409
|
+
"[--open]"
|
|
35410
|
+
],
|
|
35411
|
+
description: "publish a draft as a live post/note/page"
|
|
35412
|
+
},
|
|
35413
|
+
{
|
|
35414
|
+
name: "delete",
|
|
35415
|
+
args: ["<id>", "[--force]"],
|
|
35416
|
+
description: "delete a draft"
|
|
35417
|
+
}
|
|
35418
|
+
]
|
|
35419
|
+
});
|
|
35420
|
+
const draftCmd = make$14("draft").pipe(withDescription(help$9.description), withSubcommands([
|
|
35421
|
+
list$8,
|
|
35422
|
+
get$7,
|
|
35423
|
+
create$6,
|
|
35424
|
+
update$6,
|
|
35425
|
+
publish$2,
|
|
35426
|
+
del$7
|
|
35427
|
+
]));
|
|
35428
|
+
//#endregion
|
|
35429
|
+
//#region src/cli/file/_shared.ts
|
|
35430
|
+
/** Mirrors the server's `FileTypeEnum` (apps/core modules/file/file.type.ts). */
|
|
35431
|
+
const FILE_TYPES = [
|
|
35432
|
+
"file",
|
|
35433
|
+
"image",
|
|
35434
|
+
"icon",
|
|
35435
|
+
"avatar"
|
|
35436
|
+
];
|
|
35437
|
+
const typeOption = choice("type", FILE_TYPES).pipe(withDescription$3("server-side storage bucket for the file"), withDefault("file"));
|
|
35438
|
+
const silentFlag$4 = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response."));
|
|
35439
|
+
const del$6 = make$14("delete", {
|
|
35440
|
+
name: text$6({ name: "name" }),
|
|
35441
|
+
type: typeOption,
|
|
35442
|
+
force: boolean("force").pipe(withDescription$3("skip confirmation"))
|
|
35443
|
+
}, ({ name, type, force }) => gen(function* () {
|
|
35444
|
+
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
35445
|
+
const api = yield* Api;
|
|
35446
|
+
const renderer = yield* Renderer;
|
|
35447
|
+
yield* api.request(`/objects/${type}/${encodeURIComponent(name)}`, { method: "DELETE" });
|
|
35448
|
+
yield* renderer.emitSuccess({ deleted: `${type}/${name}` });
|
|
35449
|
+
})).pipe(withDescription("delete an uploaded file"));
|
|
35450
|
+
//#endregion
|
|
35451
|
+
//#region src/cli/file/list.ts
|
|
35452
|
+
const list$7 = make$14("list", { type: typeOption }, ({ type }) => gen(function* () {
|
|
35453
|
+
const api = yield* Api;
|
|
35454
|
+
const renderer = yield* Renderer;
|
|
35455
|
+
const res = yield* api.request(`/objects/${type}`);
|
|
35456
|
+
yield* renderer.emitSuccess(res);
|
|
35457
|
+
})).pipe(withDescription("list uploaded files of a type (name, url, created)"));
|
|
35458
|
+
const rename = make$14("rename", {
|
|
35459
|
+
name: text$6({ name: "name" }),
|
|
35460
|
+
newName: text$6({ name: "newName" }),
|
|
35461
|
+
type: typeOption
|
|
35462
|
+
}, ({ name, newName, type }) => gen(function* () {
|
|
35463
|
+
const api = yield* Api;
|
|
35464
|
+
const renderer = yield* Renderer;
|
|
35465
|
+
yield* api.request(`/objects/${type}/${encodeURIComponent(name)}/rename`, {
|
|
35466
|
+
method: "PATCH",
|
|
35467
|
+
query: { newName }
|
|
35468
|
+
});
|
|
35469
|
+
yield* renderer.emitSuccess({
|
|
35470
|
+
renamed: `${type}/${name}`,
|
|
35471
|
+
to: newName
|
|
35472
|
+
});
|
|
35473
|
+
})).pipe(withDescription("rename an uploaded file"));
|
|
35474
|
+
const upload = make$14("upload", {
|
|
35475
|
+
path: text$6({ name: "path" }),
|
|
35476
|
+
type: typeOption,
|
|
35477
|
+
name: text$4("name").pipe(withDescription$3("override the uploaded filename (defaults to the local basename)"), optional$4),
|
|
35478
|
+
silent: silentFlag$4
|
|
35479
|
+
}, ({ path, type, name, silent }) => gen(function* () {
|
|
35480
|
+
const buffer = yield* tryPromise({
|
|
35481
|
+
try: () => readFile(path),
|
|
35482
|
+
catch: (err) => new Generic({
|
|
35483
|
+
message: `cannot read file: ${path}`,
|
|
35484
|
+
cause: err
|
|
35485
|
+
})
|
|
35486
|
+
});
|
|
35487
|
+
const filename = name._tag === "Some" ? name.value : basename(path);
|
|
35488
|
+
const form = new FormData();
|
|
35489
|
+
form.append("file", new File([new Uint8Array(buffer)], filename));
|
|
35490
|
+
const api = yield* Api;
|
|
35491
|
+
const renderer = yield* Renderer;
|
|
35492
|
+
const res = yield* api.request(`/objects/upload`, {
|
|
35493
|
+
method: "POST",
|
|
35494
|
+
query: { type },
|
|
35495
|
+
body: form
|
|
35496
|
+
});
|
|
35497
|
+
yield* renderer.emitSuccess(silent ? { ok: true } : res);
|
|
35498
|
+
})).pipe(withDescription(`upload a local file (--type ${FILE_TYPES.join("|")}); returns { url, name }`));
|
|
35499
|
+
//#endregion
|
|
35500
|
+
//#region src/cli/file/index.ts
|
|
35501
|
+
const help$8 = registerCommandHelp({
|
|
35502
|
+
name: "file",
|
|
35503
|
+
description: "upload and manage static files (images, icons, avatars)",
|
|
35504
|
+
verbs: [
|
|
35505
|
+
{
|
|
35506
|
+
name: "upload",
|
|
35507
|
+
args: [
|
|
35508
|
+
"<path>",
|
|
35509
|
+
"[--type file|image|icon|avatar]",
|
|
35510
|
+
"[--name <n>]"
|
|
35511
|
+
],
|
|
35512
|
+
description: "upload a local file; returns { url, name }"
|
|
35513
|
+
},
|
|
35514
|
+
{
|
|
35515
|
+
name: "list",
|
|
35516
|
+
args: ["[--type <t>]"],
|
|
35517
|
+
description: "list uploaded files of a type"
|
|
35518
|
+
},
|
|
35519
|
+
{
|
|
35520
|
+
name: "delete",
|
|
35521
|
+
args: [
|
|
35522
|
+
"<name>",
|
|
35523
|
+
"[--type <t>]",
|
|
35524
|
+
"[--force]"
|
|
35525
|
+
],
|
|
35526
|
+
description: "delete an uploaded file"
|
|
35527
|
+
},
|
|
35528
|
+
{
|
|
35529
|
+
name: "rename",
|
|
35530
|
+
args: [
|
|
35531
|
+
"<name>",
|
|
35532
|
+
"<newName>",
|
|
35533
|
+
"[--type <t>]"
|
|
35534
|
+
],
|
|
35535
|
+
description: "rename an uploaded file"
|
|
35536
|
+
}
|
|
35537
|
+
]
|
|
35538
|
+
});
|
|
35539
|
+
const fileCmd = make$14("file").pipe(withDescription(help$8.description), withSubcommands([
|
|
35540
|
+
upload,
|
|
35541
|
+
list$7,
|
|
35542
|
+
del$6,
|
|
35543
|
+
rename
|
|
35544
|
+
]));
|
|
35545
|
+
//#endregion
|
|
35266
35546
|
//#region src/cli/note/_flags.ts
|
|
35267
35547
|
const optional$2 = (self) => optional$4(self);
|
|
35268
35548
|
const unwrap$7 = (value) => getOrUndefined(value);
|
|
@@ -39316,14 +39596,14 @@ const make$2 = gen(function* () {
|
|
|
39316
39596
|
const cache = yield* make$24(null);
|
|
39317
39597
|
const indexCache = yield* make$24(null);
|
|
39318
39598
|
const load = gen(function* () {
|
|
39319
|
-
const cached = yield* get$
|
|
39599
|
+
const cached = yield* get$16(cache);
|
|
39320
39600
|
if (cached) return cached;
|
|
39321
39601
|
const chapters = yield* buildRegistry(fs, path, cliDir, haklexDir);
|
|
39322
39602
|
yield* set$3(cache, chapters);
|
|
39323
39603
|
return chapters;
|
|
39324
39604
|
});
|
|
39325
39605
|
const loadIndex = gen(function* () {
|
|
39326
|
-
const cached = yield* get$
|
|
39606
|
+
const cached = yield* get$16(indexCache);
|
|
39327
39607
|
if (cached) return cached;
|
|
39328
39608
|
const mini = buildIndex(yield* load);
|
|
39329
39609
|
yield* set$3(indexCache, mini);
|
|
@@ -42125,6 +42405,7 @@ const GROUP_NAMES = [
|
|
|
42125
42405
|
"post",
|
|
42126
42406
|
"note",
|
|
42127
42407
|
"page",
|
|
42408
|
+
"draft",
|
|
42128
42409
|
"project",
|
|
42129
42410
|
"category",
|
|
42130
42411
|
"topic",
|
|
@@ -42627,6 +42908,7 @@ const rootCmd = make$14("mxs", {}, () => flatMap$1(Renderer, (r) => r.emitInfo("
|
|
|
42627
42908
|
postCmd,
|
|
42628
42909
|
noteCmd,
|
|
42629
42910
|
pageCmd,
|
|
42911
|
+
draftCmd,
|
|
42630
42912
|
projectCmd,
|
|
42631
42913
|
categoryCmd,
|
|
42632
42914
|
topicCmd,
|