@freelog/cli 0.10.0 → 0.10.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.
- package/LICENSE +21 -21
- package/README.md +9 -9
- package/dist/bin/index.js +210 -201
- package/dist/bin/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/docs/00-/347/211/210/346/234/254/351/200/211/346/213/251/344/270/216AI/344/273/243/345/212/236.md +0 -84
- package/dist/docs/01-/345/277/253/351/200/237/344/270/212/346/211/213.md +0 -124
- package/dist/docs/02-/347/216/257/345/242/203/344/270/216/345/207/255/346/215/256.md +0 -109
- package/dist/docs/03-/346/214/211/345/234/272/346/231/257/346/223/215/344/275/234.md +0 -46
- package/dist/docs/04-/346/227/245/345/270/270/350/267/257/345/276/204.md +0 -126
- package/dist/docs/05-/344/270/273/351/242/230/344/270/216/346/217/222/344/273/266.md +0 -156
- package/dist/docs/06-/347/211/210/346/234/254/345/267/245/344/275/234/347/250/277.md +0 -310
- package/dist/docs/07-/345/215/225/350/265/204/346/272/220/346/216/210/346/235/203/347/255/226/347/225/245.md +0 -123
- package/dist/docs/08-/350/265/204/346/272/220/347/256/241/347/220/206.md +0 -148
- package/dist/docs/09-/345/270/270/350/247/201/346/203/205/345/206/265/344/270/216/346/212/245/351/224/231.md +0 -212
- package/dist/docs/10-/346/234/254/345/234/260/346/226/207/344/273/266/345/217/202/350/200/203.md +0 -95
- package/dist/docs/11-/345/221/275/344/273/244/345/217/202/350/200/203.md +0 -367
- package/dist/docs/12-/350/207/252/345/212/250/345/214/226/344/270/216/347/273/223/346/236/234/345/244/204/347/220/206.md +0 -62
- package/dist/docs/README.md +0 -64
- package/dist/docs//345/220/210/351/233/206/01-/351/246/226/346/254/241/345/217/221/350/241/214/344/270/216/345/217/221/345/270/203.md +0 -193
- package/dist/docs//345/220/210/351/233/206/02-/345/217/221/350/241/214/345/220/216/347/256/241/347/220/206/344/270/216/350/276/271/347/225/214.md +0 -461
- package/dist/docs//345/220/210/351/233/206/03-/345/220/210/351/233/206/346/216/210/346/235/203/347/255/226/347/225/245.md +0 -145
- package/dist/docs//345/220/210/351/233/206/README.md +0 -65
- package/dist/docs//345/255/230/345/202/250/347/251/272/351/227/264/README.md +0 -176
- package/dist/docs//346/216/210/346/235/203/344/270/216/346/224/257/344/273/230/README.md +0 -29
- package/dist/docs//346/216/210/346/235/203/344/270/216/346/224/257/344/273/230//344/276/235/350/265/226/346/216/210/346/235/203.md +0 -15
- package/dist/docs//346/216/210/346/235/203/344/270/216/346/224/257/344/273/230//345/261/225/345/223/201/350/265/204/346/272/220/346/216/210/346/235/203.md +0 -13
- package/dist/docs//346/216/210/346/235/203/344/270/216/346/224/257/344/273/230//346/224/257/344/273/230/344/270/216/346/201/242/345/244/215.md +0 -39
- package/dist/docs//346/216/210/346/235/203/344/270/216/346/224/257/344/273/230//347/255/276/345/210/260/350/212/202/347/202/271.md +0 -15
- package/dist/docs//350/212/202/347/202/271/344/270/216/345/261/225/345/223/201/README.md +0 -367
- package/dist/docs//350/212/202/347/202/271/344/270/216/345/261/225/345/223/201//345/261/225/345/223/201/345/220/210/351/233/206.md +0 -197
package/dist/bin/index.js
CHANGED
|
@@ -10287,11 +10287,11 @@ var require_mime_types = __commonJS({
|
|
|
10287
10287
|
}
|
|
10288
10288
|
return exts[0];
|
|
10289
10289
|
}
|
|
10290
|
-
function lookup3(
|
|
10291
|
-
if (!
|
|
10290
|
+
function lookup3(path33) {
|
|
10291
|
+
if (!path33 || typeof path33 !== "string") {
|
|
10292
10292
|
return false;
|
|
10293
10293
|
}
|
|
10294
|
-
var extension2 = extname("x." +
|
|
10294
|
+
var extension2 = extname("x." + path33).toLowerCase().substr(1);
|
|
10295
10295
|
if (!extension2) {
|
|
10296
10296
|
return false;
|
|
10297
10297
|
}
|
|
@@ -11406,7 +11406,7 @@ var require_form_data = __commonJS({
|
|
|
11406
11406
|
"use strict";
|
|
11407
11407
|
var CombinedStream = require_combined_stream();
|
|
11408
11408
|
var util4 = __require("util");
|
|
11409
|
-
var
|
|
11409
|
+
var path33 = __require("path");
|
|
11410
11410
|
var http3 = __require("http");
|
|
11411
11411
|
var https2 = __require("https");
|
|
11412
11412
|
var parseUrl2 = __require("url").parse;
|
|
@@ -11537,11 +11537,11 @@ var require_form_data = __commonJS({
|
|
|
11537
11537
|
FormData3.prototype._getContentDisposition = function(value, options2) {
|
|
11538
11538
|
var filename;
|
|
11539
11539
|
if (typeof options2.filepath === "string") {
|
|
11540
|
-
filename =
|
|
11540
|
+
filename = path33.normalize(options2.filepath).replace(/\\/g, "/");
|
|
11541
11541
|
} else if (options2.filename || value && (value.name || value.path)) {
|
|
11542
|
-
filename =
|
|
11542
|
+
filename = path33.basename(options2.filename || value && (value.name || value.path));
|
|
11543
11543
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
11544
|
-
filename =
|
|
11544
|
+
filename = path33.basename(value.client._httpMessage.path || "");
|
|
11545
11545
|
}
|
|
11546
11546
|
if (filename) {
|
|
11547
11547
|
return 'filename="' + escapeHeaderParam(filename) + '"';
|
|
@@ -11755,9 +11755,9 @@ function isVisitable(thing) {
|
|
|
11755
11755
|
function removeBrackets(key2) {
|
|
11756
11756
|
return utils_default.endsWith(key2, "[]") ? key2.slice(0, -2) : key2;
|
|
11757
11757
|
}
|
|
11758
|
-
function renderKey(
|
|
11759
|
-
if (!
|
|
11760
|
-
return
|
|
11758
|
+
function renderKey(path33, key2, dots) {
|
|
11759
|
+
if (!path33) return key2;
|
|
11760
|
+
return path33.concat(key2).map(function each(token2, i) {
|
|
11761
11761
|
token2 = removeBrackets(token2);
|
|
11762
11762
|
return !dots && i ? "[" + token2 + "]" : token2;
|
|
11763
11763
|
}).join(dots ? "." : "");
|
|
@@ -11840,13 +11840,13 @@ function toFormData(obj, formData, options2) {
|
|
|
11840
11840
|
return currentValue;
|
|
11841
11841
|
});
|
|
11842
11842
|
}
|
|
11843
|
-
function defaultVisitor(value, key2,
|
|
11843
|
+
function defaultVisitor(value, key2, path33) {
|
|
11844
11844
|
let arr = value;
|
|
11845
11845
|
if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
|
|
11846
|
-
formData.append(renderKey(
|
|
11846
|
+
formData.append(renderKey(path33, key2, dots), convertValue(value));
|
|
11847
11847
|
return false;
|
|
11848
11848
|
}
|
|
11849
|
-
if (value && !
|
|
11849
|
+
if (value && !path33 && typeof value === "object") {
|
|
11850
11850
|
if (utils_default.endsWith(key2, "{}")) {
|
|
11851
11851
|
key2 = metaTokens ? key2 : key2.slice(0, -2);
|
|
11852
11852
|
value = stringifyWithDepthLimit(value, 1);
|
|
@@ -11865,7 +11865,7 @@ function toFormData(obj, formData, options2) {
|
|
|
11865
11865
|
if (isVisitable(value)) {
|
|
11866
11866
|
return true;
|
|
11867
11867
|
}
|
|
11868
|
-
formData.append(renderKey(
|
|
11868
|
+
formData.append(renderKey(path33, key2, dots), convertValue(value));
|
|
11869
11869
|
return false;
|
|
11870
11870
|
}
|
|
11871
11871
|
const exposedHelpers = Object.assign(predicates, {
|
|
@@ -11873,17 +11873,17 @@ function toFormData(obj, formData, options2) {
|
|
|
11873
11873
|
convertValue,
|
|
11874
11874
|
isVisitable
|
|
11875
11875
|
});
|
|
11876
|
-
function build(value,
|
|
11876
|
+
function build(value, path33, depth = 0) {
|
|
11877
11877
|
if (utils_default.isUndefined(value)) return;
|
|
11878
11878
|
throwIfMaxDepthExceeded(depth);
|
|
11879
11879
|
if (stack.indexOf(value) !== -1) {
|
|
11880
|
-
throw new Error("Circular reference detected in " +
|
|
11880
|
+
throw new Error("Circular reference detected in " + path33.join("."));
|
|
11881
11881
|
}
|
|
11882
11882
|
stack.push(value);
|
|
11883
11883
|
utils_default.forEach(value, function each(el, key2) {
|
|
11884
|
-
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key2) ? key2.trim() : key2,
|
|
11884
|
+
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key2) ? key2.trim() : key2, path33, exposedHelpers);
|
|
11885
11885
|
if (result === true) {
|
|
11886
|
-
build(el,
|
|
11886
|
+
build(el, path33 ? path33.concat(key2) : [key2], depth + 1);
|
|
11887
11887
|
}
|
|
11888
11888
|
});
|
|
11889
11889
|
stack.pop();
|
|
@@ -12162,7 +12162,7 @@ var init_platform = __esm({
|
|
|
12162
12162
|
// ../../node_modules/.pnpm/axios@1.19.0/node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
12163
12163
|
function toURLEncodedForm(data3, options2) {
|
|
12164
12164
|
return toFormData_default(data3, new platform_default.classes.URLSearchParams(), {
|
|
12165
|
-
visitor: function(value, key2,
|
|
12165
|
+
visitor: function(value, key2, path33, helpers) {
|
|
12166
12166
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
12167
12167
|
this.append(key2, value.toString("base64"));
|
|
12168
12168
|
return false;
|
|
@@ -12191,14 +12191,14 @@ function throwIfDepthExceeded(index) {
|
|
|
12191
12191
|
}
|
|
12192
12192
|
}
|
|
12193
12193
|
function parsePropPath(name) {
|
|
12194
|
-
const
|
|
12194
|
+
const path33 = [];
|
|
12195
12195
|
const pattern = /[^.[\]]+|\[([^.[\]]*)]/g;
|
|
12196
12196
|
let match;
|
|
12197
12197
|
while ((match = pattern.exec(name)) !== null) {
|
|
12198
|
-
throwIfDepthExceeded(
|
|
12199
|
-
|
|
12198
|
+
throwIfDepthExceeded(path33.length);
|
|
12199
|
+
path33.push(match[0] === "[]" ? "" : match[1] || match[0]);
|
|
12200
12200
|
}
|
|
12201
|
-
return
|
|
12201
|
+
return path33;
|
|
12202
12202
|
}
|
|
12203
12203
|
function arrayToObject(arr) {
|
|
12204
12204
|
const obj = {};
|
|
@@ -12213,12 +12213,12 @@ function arrayToObject(arr) {
|
|
|
12213
12213
|
return obj;
|
|
12214
12214
|
}
|
|
12215
12215
|
function formDataToJSON(formData) {
|
|
12216
|
-
function buildPath(
|
|
12216
|
+
function buildPath(path33, value, target, index) {
|
|
12217
12217
|
throwIfDepthExceeded(index);
|
|
12218
|
-
let name =
|
|
12218
|
+
let name = path33[index++];
|
|
12219
12219
|
if (name === "__proto__") return true;
|
|
12220
12220
|
const isNumericKey = Number.isFinite(+name);
|
|
12221
|
-
const isLast = index >=
|
|
12221
|
+
const isLast = index >= path33.length;
|
|
12222
12222
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
12223
12223
|
if (isLast) {
|
|
12224
12224
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -12231,7 +12231,7 @@ function formDataToJSON(formData) {
|
|
|
12231
12231
|
if (!utils_default.hasOwnProp(target, name) || !utils_default.isObject(target[name])) {
|
|
12232
12232
|
target[name] = [];
|
|
12233
12233
|
}
|
|
12234
|
-
const result = buildPath(
|
|
12234
|
+
const result = buildPath(path33, value, target[name], index);
|
|
12235
12235
|
if (result && utils_default.isArray(target[name])) {
|
|
12236
12236
|
target[name] = arrayToObject(target[name]);
|
|
12237
12237
|
}
|
|
@@ -15778,9 +15778,9 @@ var init_http = __esm({
|
|
|
15778
15778
|
auth = urlUsername + ":" + urlPassword;
|
|
15779
15779
|
}
|
|
15780
15780
|
auth && headers.delete("authorization");
|
|
15781
|
-
let
|
|
15781
|
+
let path33;
|
|
15782
15782
|
try {
|
|
15783
|
-
|
|
15783
|
+
path33 = buildURL(
|
|
15784
15784
|
parsed.pathname + parsed.search,
|
|
15785
15785
|
own3("params"),
|
|
15786
15786
|
own3("paramsSerializer")
|
|
@@ -15799,7 +15799,7 @@ var init_http = __esm({
|
|
|
15799
15799
|
false
|
|
15800
15800
|
);
|
|
15801
15801
|
const options2 = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
15802
|
-
path:
|
|
15802
|
+
path: path33,
|
|
15803
15803
|
method,
|
|
15804
15804
|
headers: toByteStringHeaderObject(headers),
|
|
15805
15805
|
agents: { http: httpAgent, https: httpsAgent },
|
|
@@ -16216,14 +16216,14 @@ var init_cookies = __esm({
|
|
|
16216
16216
|
cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
16217
16217
|
// Standard browser envs support document.cookie
|
|
16218
16218
|
{
|
|
16219
|
-
write(name, value, expires,
|
|
16219
|
+
write(name, value, expires, path33, domain, secure, sameSite) {
|
|
16220
16220
|
if (typeof document === "undefined") return;
|
|
16221
16221
|
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
16222
16222
|
if (utils_default.isNumber(expires)) {
|
|
16223
16223
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
16224
16224
|
}
|
|
16225
|
-
if (utils_default.isString(
|
|
16226
|
-
cookie.push(`path=${
|
|
16225
|
+
if (utils_default.isString(path33)) {
|
|
16226
|
+
cookie.push(`path=${path33}`);
|
|
16227
16227
|
}
|
|
16228
16228
|
if (utils_default.isString(domain)) {
|
|
16229
16229
|
cookie.push(`domain=${domain}`);
|
|
@@ -18249,14 +18249,14 @@ function copy(a, s, t2) {
|
|
|
18249
18249
|
if (s[m]) t2[m] = s[m];
|
|
18250
18250
|
});
|
|
18251
18251
|
}
|
|
18252
|
-
function getLastOfPath(object4,
|
|
18252
|
+
function getLastOfPath(object4, path33, Empty) {
|
|
18253
18253
|
function cleanKey(key3) {
|
|
18254
18254
|
return key3 && key3.indexOf("###") > -1 ? key3.replace(/###/g, ".") : key3;
|
|
18255
18255
|
}
|
|
18256
18256
|
function canNotTraverseDeeper() {
|
|
18257
18257
|
return !object4 || typeof object4 === "string";
|
|
18258
18258
|
}
|
|
18259
|
-
var stack = typeof
|
|
18259
|
+
var stack = typeof path33 !== "string" ? [].concat(path33) : path33.split(".");
|
|
18260
18260
|
while (stack.length > 1) {
|
|
18261
18261
|
if (canNotTraverseDeeper()) return {};
|
|
18262
18262
|
var key2 = cleanKey(stack.shift());
|
|
@@ -18273,18 +18273,18 @@ function getLastOfPath(object4, path34, Empty) {
|
|
|
18273
18273
|
k: cleanKey(stack.shift())
|
|
18274
18274
|
};
|
|
18275
18275
|
}
|
|
18276
|
-
function setPath(object4,
|
|
18277
|
-
var _getLastOfPath = getLastOfPath(object4,
|
|
18276
|
+
function setPath(object4, path33, newValue) {
|
|
18277
|
+
var _getLastOfPath = getLastOfPath(object4, path33, Object), obj = _getLastOfPath.obj, k = _getLastOfPath.k;
|
|
18278
18278
|
obj[k] = newValue;
|
|
18279
18279
|
}
|
|
18280
|
-
function pushPath(object4,
|
|
18281
|
-
var _getLastOfPath2 = getLastOfPath(object4,
|
|
18280
|
+
function pushPath(object4, path33, newValue, concat) {
|
|
18281
|
+
var _getLastOfPath2 = getLastOfPath(object4, path33, Object), obj = _getLastOfPath2.obj, k = _getLastOfPath2.k;
|
|
18282
18282
|
obj[k] = obj[k] || [];
|
|
18283
18283
|
if (concat) obj[k] = obj[k].concat(newValue);
|
|
18284
18284
|
if (!concat) obj[k].push(newValue);
|
|
18285
18285
|
}
|
|
18286
|
-
function getPath(object4,
|
|
18287
|
-
var _getLastOfPath3 = getLastOfPath(object4,
|
|
18286
|
+
function getPath(object4, path33) {
|
|
18287
|
+
var _getLastOfPath3 = getLastOfPath(object4, path33), obj = _getLastOfPath3.obj, k = _getLastOfPath3.k;
|
|
18288
18288
|
if (!obj) return void 0;
|
|
18289
18289
|
return obj[k];
|
|
18290
18290
|
}
|
|
@@ -18396,11 +18396,11 @@ function _isNativeReflectConstruct() {
|
|
|
18396
18396
|
return false;
|
|
18397
18397
|
}
|
|
18398
18398
|
}
|
|
18399
|
-
function deepFind(obj,
|
|
18399
|
+
function deepFind(obj, path33) {
|
|
18400
18400
|
var keySeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
18401
18401
|
if (!obj) return void 0;
|
|
18402
|
-
if (obj[
|
|
18403
|
-
var paths =
|
|
18402
|
+
if (obj[path33]) return obj[path33];
|
|
18403
|
+
var paths = path33.split(keySeparator);
|
|
18404
18404
|
var current2 = obj;
|
|
18405
18405
|
for (var i = 0; i < paths.length; ++i) {
|
|
18406
18406
|
if (!current2) return void 0;
|
|
@@ -18418,7 +18418,7 @@ function deepFind(obj, path34) {
|
|
|
18418
18418
|
}
|
|
18419
18419
|
if (mix === void 0) return void 0;
|
|
18420
18420
|
if (mix === null) return null;
|
|
18421
|
-
if (
|
|
18421
|
+
if (path33.endsWith(p)) {
|
|
18422
18422
|
if (typeof mix === "string") return mix;
|
|
18423
18423
|
if (p && typeof mix[p] === "string") return mix[p];
|
|
18424
18424
|
}
|
|
@@ -19009,13 +19009,13 @@ var init_i18next = __esm({
|
|
|
19009
19009
|
var options2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
19010
19010
|
var keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator;
|
|
19011
19011
|
var ignoreJSONStructure = options2.ignoreJSONStructure !== void 0 ? options2.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
19012
|
-
var
|
|
19013
|
-
if (key2 && typeof key2 !== "string")
|
|
19014
|
-
if (key2 && typeof key2 === "string")
|
|
19012
|
+
var path33 = [lng, ns];
|
|
19013
|
+
if (key2 && typeof key2 !== "string") path33 = path33.concat(key2);
|
|
19014
|
+
if (key2 && typeof key2 === "string") path33 = path33.concat(keySeparator ? key2.split(keySeparator) : key2);
|
|
19015
19015
|
if (lng.indexOf(".") > -1) {
|
|
19016
|
-
|
|
19016
|
+
path33 = lng.split(".");
|
|
19017
19017
|
}
|
|
19018
|
-
var result = getPath(this.data,
|
|
19018
|
+
var result = getPath(this.data, path33);
|
|
19019
19019
|
if (result || !ignoreJSONStructure || typeof key2 !== "string") return result;
|
|
19020
19020
|
return deepFind(this.data && this.data[lng] && this.data[lng][ns], key2, keySeparator);
|
|
19021
19021
|
}
|
|
@@ -19027,15 +19027,15 @@ var init_i18next = __esm({
|
|
|
19027
19027
|
};
|
|
19028
19028
|
var keySeparator = this.options.keySeparator;
|
|
19029
19029
|
if (keySeparator === void 0) keySeparator = ".";
|
|
19030
|
-
var
|
|
19031
|
-
if (key2)
|
|
19030
|
+
var path33 = [lng, ns];
|
|
19031
|
+
if (key2) path33 = path33.concat(keySeparator ? key2.split(keySeparator) : key2);
|
|
19032
19032
|
if (lng.indexOf(".") > -1) {
|
|
19033
|
-
|
|
19033
|
+
path33 = lng.split(".");
|
|
19034
19034
|
value = ns;
|
|
19035
|
-
ns =
|
|
19035
|
+
ns = path33[1];
|
|
19036
19036
|
}
|
|
19037
19037
|
this.addNamespaces(ns);
|
|
19038
|
-
setPath(this.data,
|
|
19038
|
+
setPath(this.data, path33, value);
|
|
19039
19039
|
if (!options2.silent) this.emit("added", lng, ns, key2, value);
|
|
19040
19040
|
}
|
|
19041
19041
|
}, {
|
|
@@ -19057,21 +19057,21 @@ var init_i18next = __esm({
|
|
|
19057
19057
|
var options2 = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
|
|
19058
19058
|
silent: false
|
|
19059
19059
|
};
|
|
19060
|
-
var
|
|
19060
|
+
var path33 = [lng, ns];
|
|
19061
19061
|
if (lng.indexOf(".") > -1) {
|
|
19062
|
-
|
|
19062
|
+
path33 = lng.split(".");
|
|
19063
19063
|
deep = resources;
|
|
19064
19064
|
resources = ns;
|
|
19065
|
-
ns =
|
|
19065
|
+
ns = path33[1];
|
|
19066
19066
|
}
|
|
19067
19067
|
this.addNamespaces(ns);
|
|
19068
|
-
var pack = getPath(this.data,
|
|
19068
|
+
var pack = getPath(this.data, path33) || {};
|
|
19069
19069
|
if (deep) {
|
|
19070
19070
|
deepExtend(pack, resources, overwrite);
|
|
19071
19071
|
} else {
|
|
19072
19072
|
pack = _objectSpread$1(_objectSpread$1({}, pack), resources);
|
|
19073
19073
|
}
|
|
19074
|
-
setPath(this.data,
|
|
19074
|
+
setPath(this.data, path33, pack);
|
|
19075
19075
|
if (!options2.silent) this.emit("added", lng, ns, resources);
|
|
19076
19076
|
}
|
|
19077
19077
|
}, {
|
|
@@ -19965,10 +19965,10 @@ var init_i18next = __esm({
|
|
|
19965
19965
|
}
|
|
19966
19966
|
var handleFormat = function handleFormat2(key2) {
|
|
19967
19967
|
if (key2.indexOf(_this.formatSeparator) < 0) {
|
|
19968
|
-
var
|
|
19969
|
-
return _this.alwaysFormat ? _this.format(
|
|
19968
|
+
var path33 = getPathWithDefaults(data3, defaultData, key2);
|
|
19969
|
+
return _this.alwaysFormat ? _this.format(path33, void 0, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options2), data3), {}, {
|
|
19970
19970
|
interpolationkey: key2
|
|
19971
|
-
})) :
|
|
19971
|
+
})) : path33;
|
|
19972
19972
|
}
|
|
19973
19973
|
var p = key2.split(_this.formatSeparator);
|
|
19974
19974
|
var k = p.shift().trim();
|
|
@@ -22021,6 +22021,8 @@ function list(params) {
|
|
|
22021
22021
|
});
|
|
22022
22022
|
}
|
|
22023
22023
|
function info({ resourceIdOrName, ...params }, controls) {
|
|
22024
|
+
if (typeof resourceIdOrName !== "string" || !resourceIdOrName.trim() || ["undefined", "null"].includes(resourceIdOrName.trim()))
|
|
22025
|
+
throw new TypeError("Resource.info requires a valid resource ID or full name");
|
|
22024
22026
|
return utils_default2.Request({
|
|
22025
22027
|
method: "GET",
|
|
22026
22028
|
url: `/v2/resources/${encodeURIComponent(resourceIdOrName)}`,
|
|
@@ -36649,6 +36651,8 @@ function getNode({ nodeId: nodeId22 }, controls) {
|
|
|
36649
36651
|
return platformRequest({ method: "GET", url: `/v2/nodes/${nodeId22}`, ...controls });
|
|
36650
36652
|
}
|
|
36651
36653
|
function getResource({ resourceIdOrName, ...params }, controls) {
|
|
36654
|
+
if (typeof resourceIdOrName !== "string" || !resourceIdOrName.trim() || ["undefined", "null"].includes(resourceIdOrName.trim()))
|
|
36655
|
+
throw new AuthCliError("\u8BF7\u63D0\u4F9B\u6709\u6548\u7684\u8D44\u6E90ID\u6216\u5B8C\u6574\u540D\u79F0", "INVALID_SCENE_PARAMS");
|
|
36652
36656
|
return platformRequest({
|
|
36653
36657
|
method: "GET",
|
|
36654
36658
|
url: `/v2/resources/${encodeURIComponent(String(resourceIdOrName))}`,
|
|
@@ -36705,12 +36709,16 @@ async function loadNode(input22) {
|
|
|
36705
36709
|
};
|
|
36706
36710
|
}
|
|
36707
36711
|
async function showResource(input22) {
|
|
36708
|
-
const source = input22.source.replace(/^(id:|name:)/u, "");
|
|
36712
|
+
const source = typeof input22.source === "string" ? input22.source.replace(/^(id:|name:)/u, "") : "";
|
|
36713
|
+
if (!source.trim() || ["undefined", "null"].includes(source.trim()))
|
|
36714
|
+
throw new AuthCommandError("\u8BF7\u63D0\u4F9B\u6709\u6548\u7684\u8D44\u6E90ID\u6216\u5B8C\u6574\u540D\u79F0", "RESOURCE_ID_INVALID", { category: "input" });
|
|
36709
36715
|
const raw = await request2(
|
|
36710
36716
|
input22.apis?.resourceInfo ?? getResource,
|
|
36711
36717
|
{ resourceIdOrName: source, isLoadLatestVersionInfo: 1, isLoadPolicyInfo: 1 },
|
|
36712
36718
|
"MARKET_RESOURCE_INVALID"
|
|
36713
36719
|
);
|
|
36720
|
+
if (raw === null)
|
|
36721
|
+
throw new AuthCommandError("\u8D44\u6E90\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u8D44\u6E90ID\u6216\u540D\u79F0", "RESOURCE_NOT_FOUND", { category: "not_found" });
|
|
36714
36722
|
if (!object(raw) || typeof raw.resourceId !== "string" || !raw.resourceId || raw.subjectType !== 1 && raw.subjectType !== 4 || typeof raw.resourceTypeCode !== "string" || !raw.resourceTypeCode || !Array.isArray(raw.policies))
|
|
36715
36723
|
throw new AuthCommandError("\u8D44\u6E90\u4E0D\u5B58\u5728\u6216\u7F3A\u5C11\u521B\u5EFA\u6240\u9700\u4FE1\u606F", "MARKET_RESOURCE_INVALID", { category: "other" });
|
|
36716
36724
|
return {
|
|
@@ -36832,7 +36840,9 @@ async function collectNonInteractiveForm(input22) {
|
|
|
36832
36840
|
defaults3.exhibitTitle,
|
|
36833
36841
|
input22.presentableTitle ?? defaults3.exhibitTitle
|
|
36834
36842
|
);
|
|
36835
|
-
|
|
36843
|
+
if (input22.presentableName !== void 0 && !input22.presentableName.trim())
|
|
36844
|
+
throw new AuthCliError("\u5C55\u54C1\u6388\u6743\u6807\u8BC6\u987B 1 \u81F3 60 \u5B57", "EXHIBIT_NAME_INVALID");
|
|
36845
|
+
const nameRaw = input22.presentableName === void 0 ? defaults3.exhibitName : input22.presentableName;
|
|
36836
36846
|
const presentableName = validateExhibitFields("ok", nameRaw).presentableName;
|
|
36837
36847
|
await resolveAvailablePresentableName({
|
|
36838
36848
|
http: input22.http,
|
|
@@ -36870,6 +36880,8 @@ async function collectResourceToNodeForm(input22) {
|
|
|
36870
36880
|
}
|
|
36871
36881
|
const defaults3 = buildFormDefaults(input22.ctx.resource);
|
|
36872
36882
|
const presentableTitle = await promptTitle(input22.prompts, defaults3.exhibitTitle, input22.presentableTitle);
|
|
36883
|
+
if (input22.presentableName !== void 0 && !input22.presentableName.trim())
|
|
36884
|
+
throw new AuthCliError("\u5C55\u54C1\u6388\u6743\u6807\u8BC6\u987B 1 \u81F3 60 \u5B57", "EXHIBIT_NAME_INVALID");
|
|
36873
36885
|
const nameDefault = input22.presentableName ?? defaults3.exhibitName;
|
|
36874
36886
|
const initialName = input22.presentableName === void 0 ? await promptNameOnce(input22.prompts, nameDefault) : validateExhibitFields(presentableTitle, input22.presentableName).presentableName;
|
|
36875
36887
|
const presentableName = await resolveAvailablePresentableName({
|
|
@@ -37067,6 +37079,8 @@ async function submitSigning(input22, context5, form) {
|
|
|
37067
37079
|
}
|
|
37068
37080
|
async function runResourceToNode(input22) {
|
|
37069
37081
|
try {
|
|
37082
|
+
if (input22.name !== void 0 && !input22.name.trim())
|
|
37083
|
+
throw new AuthCliError("\u5C55\u54C1\u6388\u6743\u6807\u8BC6\u987B 1 \u81F3 60 \u5B57", "EXHIBIT_NAME_INVALID");
|
|
37070
37084
|
const node2 = await loadNode({ ...input22, node: await chooseNode(input22, input22.node) });
|
|
37071
37085
|
const loaded = await loadSigningContext(input22, node2);
|
|
37072
37086
|
if ("reused" in loaded) return loaded;
|
|
@@ -37265,6 +37279,7 @@ function platformFailureMessage(error3, fallback, options2) {
|
|
|
37265
37279
|
function platformRejectionDescription(error3) {
|
|
37266
37280
|
const failure = apiFailureDetails(error3);
|
|
37267
37281
|
if (failure?.kind !== "rejected") return void 0;
|
|
37282
|
+
if (failure.errCode === 30) return { code: "PLATFORM_UNAUTHORIZED", message: "\u767B\u5F55\u72B6\u6001\u65E0\u6548\u6216\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55" };
|
|
37268
37283
|
return {
|
|
37269
37284
|
code: "PLATFORM_REQUEST_REJECTED",
|
|
37270
37285
|
message: safePlatformMessage(failure.message) ?? "\u5E73\u53F0\u660E\u786E\u62D2\u7EDD\u672C\u6B21\u8BF7\u6C42\uFF0C\u8BF7\u68C0\u67E5\u64CD\u4F5C\u6761\u4EF6"
|
|
@@ -37544,6 +37559,42 @@ var init_errors = __esm({
|
|
|
37544
37559
|
}
|
|
37545
37560
|
});
|
|
37546
37561
|
|
|
37562
|
+
// src/platform/os/interactive-terminal.mjs
|
|
37563
|
+
import { PassThrough } from "stream";
|
|
37564
|
+
function prepareInteractiveTerminal({
|
|
37565
|
+
platform = process.platform,
|
|
37566
|
+
input: input3 = process.stdin,
|
|
37567
|
+
output: output5 = process.stdout,
|
|
37568
|
+
env = process.env
|
|
37569
|
+
} = {}) {
|
|
37570
|
+
if (platform === "win32" && input3.isTTY && output5.isTTY && env.TERM === "dumb") {
|
|
37571
|
+
delete env.TERM;
|
|
37572
|
+
}
|
|
37573
|
+
}
|
|
37574
|
+
async function withTerminalInput(question, { platform = process.platform, input: input3 = process.stdin } = {}) {
|
|
37575
|
+
if (platform !== "win32" || !input3.isTTY) return question(void 0);
|
|
37576
|
+
const bridge = new PassThrough();
|
|
37577
|
+
const raw = input3.isRaw;
|
|
37578
|
+
const flowing = input3.readableFlowing === true;
|
|
37579
|
+
try {
|
|
37580
|
+
input3.setRawMode(true);
|
|
37581
|
+
input3.pipe(bridge);
|
|
37582
|
+
return await question(bridge);
|
|
37583
|
+
} finally {
|
|
37584
|
+
input3.unpipe(bridge);
|
|
37585
|
+
if (flowing) input3.resume();
|
|
37586
|
+
else input3.pause();
|
|
37587
|
+
bridge.destroy();
|
|
37588
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
37589
|
+
input3.setRawMode(raw);
|
|
37590
|
+
}
|
|
37591
|
+
}
|
|
37592
|
+
var init_interactive_terminal = __esm({
|
|
37593
|
+
"src/platform/os/interactive-terminal.mjs"() {
|
|
37594
|
+
"use strict";
|
|
37595
|
+
}
|
|
37596
|
+
});
|
|
37597
|
+
|
|
37547
37598
|
// src/domain/env.ts
|
|
37548
37599
|
function normalizeEnvToken(raw) {
|
|
37549
37600
|
const value = raw.trim().toLowerCase();
|
|
@@ -38043,6 +38094,9 @@ import {
|
|
|
38043
38094
|
input as inquirerInput,
|
|
38044
38095
|
select as inquirerSelect
|
|
38045
38096
|
} from "@inquirer/prompts";
|
|
38097
|
+
function promptContext(input3, output5) {
|
|
38098
|
+
return input3 || output5 ? { ...input3 ? { input: input3 } : {}, ...output5 ? { output: output5 } : {} } : void 0;
|
|
38099
|
+
}
|
|
38046
38100
|
function isInteractive() {
|
|
38047
38101
|
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
38048
38102
|
}
|
|
@@ -38050,23 +38104,23 @@ async function confirmQuestion(message, defaultYes = true, output5) {
|
|
|
38050
38104
|
if (!isInteractive()) {
|
|
38051
38105
|
return defaultYes;
|
|
38052
38106
|
}
|
|
38053
|
-
return inquirerConfirm({ message, default: defaultYes },
|
|
38107
|
+
return withTerminalInput((input3) => inquirerConfirm({ message, default: defaultYes }, promptContext(input3, output5)));
|
|
38054
38108
|
}
|
|
38055
38109
|
async function askInput(message, output5) {
|
|
38056
38110
|
if (!isInteractive()) {
|
|
38057
38111
|
throw new CliError("\u975E\u4EA4\u4E92\u6A21\u5F0F\u8BF7\u663E\u5F0F\u63D0\u4F9B\u5FC5\u9700\u53C2\u6570", "TTY_REQUIRED");
|
|
38058
38112
|
}
|
|
38059
|
-
return inquirerInput({ message },
|
|
38113
|
+
return withTerminalInput((input3) => inquirerInput({ message }, promptContext(input3, output5)));
|
|
38060
38114
|
}
|
|
38061
38115
|
async function selectQuestion(message, choices, output5) {
|
|
38062
38116
|
if (!isInteractive()) {
|
|
38063
38117
|
throw new CliError("\u975E\u4EA4\u4E92\u6A21\u5F0F\u8BF7\u663E\u5F0F\u63D0\u4F9B\u9009\u62E9\u9879", "TTY_REQUIRED");
|
|
38064
38118
|
}
|
|
38065
|
-
return inquirerSelect({ message, choices },
|
|
38119
|
+
return withTerminalInput((input3) => inquirerSelect({ message, choices }, promptContext(input3, output5)));
|
|
38066
38120
|
}
|
|
38067
38121
|
async function selectMany(message, choices, output5) {
|
|
38068
38122
|
if (!isInteractive()) throw new CliError("\u975E\u4EA4\u4E92\u6A21\u5F0F\u9700\u663E\u5F0F\u63D0\u4F9B\u9009\u9879\u53C2\u6570", "TTY_REQUIRED");
|
|
38069
|
-
return inquirerCheckbox({ message, choices },
|
|
38123
|
+
return withTerminalInput((input3) => inquirerCheckbox({ message, choices }, promptContext(input3, output5)));
|
|
38070
38124
|
}
|
|
38071
38125
|
async function confirmWrite(preview2, yes, output5) {
|
|
38072
38126
|
if (yes) {
|
|
@@ -38096,6 +38150,7 @@ var init_tty = __esm({
|
|
|
38096
38150
|
"src/core/tty.ts"() {
|
|
38097
38151
|
"use strict";
|
|
38098
38152
|
init_errors();
|
|
38153
|
+
init_interactive_terminal();
|
|
38099
38154
|
}
|
|
38100
38155
|
});
|
|
38101
38156
|
|
|
@@ -38874,19 +38929,39 @@ var init_logout2 = __esm({
|
|
|
38874
38929
|
});
|
|
38875
38930
|
|
|
38876
38931
|
// src/adapters/terminalInteraction.ts
|
|
38932
|
+
async function terminalQuestion(question) {
|
|
38933
|
+
try {
|
|
38934
|
+
return await question();
|
|
38935
|
+
} catch (error3) {
|
|
38936
|
+
if (error3 instanceof Error && ["ExitPromptError", "AbortPromptError"].includes(error3.name))
|
|
38937
|
+
throw new CliError("\u5DF2\u53D6\u6D88\u64CD\u4F5C", "CANCELLED");
|
|
38938
|
+
throw error3;
|
|
38939
|
+
}
|
|
38940
|
+
}
|
|
38877
38941
|
var terminalPrompts, terminalReporter;
|
|
38878
38942
|
var init_terminalInteraction = __esm({
|
|
38879
38943
|
"src/adapters/terminalInteraction.ts"() {
|
|
38880
38944
|
"use strict";
|
|
38881
38945
|
init_tty();
|
|
38946
|
+
init_errors();
|
|
38882
38947
|
terminalPrompts = Object.freeze({
|
|
38883
38948
|
isInteractive: () => isInteractive(),
|
|
38884
|
-
askInput: (message, channel) =>
|
|
38885
|
-
|
|
38886
|
-
|
|
38887
|
-
|
|
38888
|
-
|
|
38889
|
-
|
|
38949
|
+
askInput: (message, channel) => terminalQuestion(
|
|
38950
|
+
() => channel ? askInput(message, channel === "stderr" ? process.stderr : process.stdout) : askInput(message)
|
|
38951
|
+
),
|
|
38952
|
+
selectQuestion: (message, choices, channel) => terminalQuestion(
|
|
38953
|
+
() => channel ? selectQuestion(message, [...choices], channel === "stderr" ? process.stderr : process.stdout) : selectQuestion(message, [...choices])
|
|
38954
|
+
),
|
|
38955
|
+
selectMany: (message, choices, channel) => terminalQuestion(
|
|
38956
|
+
() => channel ? selectMany(message, [...choices], channel === "stderr" ? process.stderr : process.stdout) : selectMany(message, [...choices])
|
|
38957
|
+
),
|
|
38958
|
+
confirmQuestion: (message, defaultYes, channel) => terminalQuestion(
|
|
38959
|
+
() => channel ? confirmQuestion(message, defaultYes, channel === "stderr" ? process.stderr : process.stdout) : confirmQuestion(message, defaultYes)
|
|
38960
|
+
),
|
|
38961
|
+
confirmWrite: (preview2, yes, channel) => terminalQuestion(
|
|
38962
|
+
() => channel ? confirmWrite(preview2, yes, channel === "stderr" ? process.stderr : process.stdout) : confirmWrite(preview2, yes)
|
|
38963
|
+
),
|
|
38964
|
+
confirmDestructive: (...args) => terminalQuestion(() => confirmDestructive(...args))
|
|
38890
38965
|
});
|
|
38891
38966
|
terminalReporter = Object.freeze({
|
|
38892
38967
|
log: (message) => console.log(message),
|
|
@@ -38981,12 +39056,12 @@ function hasChildren(node2) {
|
|
|
38981
39056
|
}
|
|
38982
39057
|
function flattenLeaves(nodes2, ancestors = [], acc = []) {
|
|
38983
39058
|
for (const node2 of nodes2) {
|
|
38984
|
-
const
|
|
39059
|
+
const path33 = [...ancestors, node2];
|
|
38985
39060
|
if (hasChildren(node2)) {
|
|
38986
|
-
flattenLeaves(node2.children,
|
|
39061
|
+
flattenLeaves(node2.children, path33, acc);
|
|
38987
39062
|
}
|
|
38988
39063
|
if (isEnabledResourceLeafCandidate(node2)) {
|
|
38989
|
-
const names2 =
|
|
39064
|
+
const names2 = path33.map((item) => item.name.trim());
|
|
38990
39065
|
if (names2.some((name) => !name)) {
|
|
38991
39066
|
throw new CliError("\u5E73\u53F0\u7C7B\u578B\u94FE\u5B58\u5728\u7F3A\u5931\u540D\u79F0\uFF0C\u65E0\u6CD5\u5C55\u793A\u5B8C\u6574\u5C42\u7EA7", "TYPE_HIERARCHY_INVALID");
|
|
38992
39067
|
}
|
|
@@ -39002,10 +39077,10 @@ async function resourceTypeTree(apis2) {
|
|
|
39002
39077
|
}
|
|
39003
39078
|
function findTypePath(nodes2, code2, ancestors = []) {
|
|
39004
39079
|
for (const node2 of nodes2) {
|
|
39005
|
-
const
|
|
39006
|
-
if (node2.code === code2) return
|
|
39080
|
+
const path33 = [...ancestors, node2];
|
|
39081
|
+
if (node2.code === code2) return path33;
|
|
39007
39082
|
if (hasChildren(node2)) {
|
|
39008
|
-
const found = findTypePath(node2.children, code2,
|
|
39083
|
+
const found = findTypePath(node2.children, code2, path33);
|
|
39009
39084
|
if (found) return found;
|
|
39010
39085
|
}
|
|
39011
39086
|
}
|
|
@@ -39014,9 +39089,9 @@ function findTypePath(nodes2, code2, ancestors = []) {
|
|
|
39014
39089
|
async function getTypeHierarchy(code2, apis2 = {}) {
|
|
39015
39090
|
const normalized = code2.trim();
|
|
39016
39091
|
if (!normalized) throw new CliError("\u8BF7\u63D0\u4F9B\u8D44\u6E90\u7C7B\u578B\u7F16\u53F7", "TYPE_CODE_REQUIRED");
|
|
39017
|
-
const
|
|
39018
|
-
if (!
|
|
39019
|
-
const names2 =
|
|
39092
|
+
const path33 = findTypePath(await resourceTypeTree(apis2), normalized);
|
|
39093
|
+
if (!path33) throw new CliError(`\u5E73\u53F0\u7C7B\u578B\u6811\u4E0D\u5305\u542B\u5F53\u524D\u7C7B\u578B ${normalized}`, "TYPE_HIERARCHY_NOT_FOUND");
|
|
39094
|
+
const names2 = path33.map((node2) => node2.name.trim());
|
|
39020
39095
|
if (names2.some((name) => !name)) {
|
|
39021
39096
|
throw new CliError("\u5E73\u53F0\u7C7B\u578B\u94FE\u5B58\u5728\u7F3A\u5931\u540D\u79F0\uFF0C\u65E0\u6CD5\u5C55\u793A\u5B8C\u6574\u5C42\u7EA7", "TYPE_HIERARCHY_INVALID");
|
|
39022
39097
|
}
|
|
@@ -39044,11 +39119,11 @@ async function searchLeafTypes(keyword, apis2 = {}) {
|
|
|
39044
39119
|
return unwrapList(response).flatMap((item) => {
|
|
39045
39120
|
if (!item.code || codes2.has(item.code)) return [];
|
|
39046
39121
|
codes2.add(item.code);
|
|
39047
|
-
const
|
|
39048
|
-
if (!
|
|
39049
|
-
const leaf =
|
|
39122
|
+
const path33 = findTypePath(tree, item.code);
|
|
39123
|
+
if (!path33) return [];
|
|
39124
|
+
const leaf = path33[path33.length - 1];
|
|
39050
39125
|
if (!isEnabledResourceLeafCandidate(leaf)) return [];
|
|
39051
|
-
const names2 =
|
|
39126
|
+
const names2 = path33.map((node2) => node2.name.trim());
|
|
39052
39127
|
if (names2.some((name) => !name)) {
|
|
39053
39128
|
throw new CliError("\u5E73\u53F0\u7C7B\u578B\u94FE\u5B58\u5728\u7F3A\u5931\u540D\u79F0\uFF0C\u65E0\u6CD5\u5C55\u793A\u5B8C\u6574\u5C42\u7EA7", "TYPE_HIERARCHY_INVALID");
|
|
39054
39129
|
}
|
|
@@ -40898,24 +40973,12 @@ function unwrapData2(result, code2, message, allowNull = false) {
|
|
|
40898
40973
|
if (data3 === null || typeof data3 !== "object" || Array.isArray(data3)) throw new CliError(message, code2);
|
|
40899
40974
|
return data3;
|
|
40900
40975
|
}
|
|
40901
|
-
function isNotFound(error3) {
|
|
40902
|
-
const response = error3?.response;
|
|
40903
|
-
if (Number(response?.status) === 404) return true;
|
|
40904
|
-
const message = error3?.message;
|
|
40905
|
-
if (typeof message !== "string") return false;
|
|
40906
|
-
try {
|
|
40907
|
-
return Number(JSON.parse(message).status) === 404;
|
|
40908
|
-
} catch {
|
|
40909
|
-
return false;
|
|
40910
|
-
}
|
|
40911
|
-
}
|
|
40912
40976
|
async function lookupResource(infoApi2, params) {
|
|
40913
40977
|
try {
|
|
40914
40978
|
const response = await infoApi2(params);
|
|
40915
40979
|
assertSuccessfulResponse(response, "CREATE_LOOKUP_FAILED", "\u67E5\u8BE2\u73B0\u6709\u8D44\u6E90\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u548C\u7F51\u7EDC\u540E\u91CD\u8BD5");
|
|
40916
40980
|
return unwrapData2(response, "CREATE_LOOKUP_FAILED", "\u67E5\u8BE2\u73B0\u6709\u8D44\u6E90\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u548C\u7F51\u7EDC\u540E\u91CD\u8BD5", true);
|
|
40917
40981
|
} catch (error3) {
|
|
40918
|
-
if (isNotFound(error3)) return {};
|
|
40919
40982
|
throwPlatformReadError(error3, {
|
|
40920
40983
|
code: "CREATE_LOOKUP_FAILED",
|
|
40921
40984
|
message: "\u67E5\u8BE2\u73B0\u6709\u8D44\u6E90\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u548C\u7F51\u7EDC\u540E\u91CD\u8BD5"
|
|
@@ -41317,14 +41380,14 @@ async function getCollectionTypeInfo(code2, apis2 = {}) {
|
|
|
41317
41380
|
if (!info2?.code || info2.code !== normalized) {
|
|
41318
41381
|
throw new CliError(`\u627E\u4E0D\u5230\u5408\u96C6\u7C7B\u578B ${normalized}`, "COLLECTION_TYPE_NOT_FOUND");
|
|
41319
41382
|
}
|
|
41320
|
-
const
|
|
41321
|
-
if (!isLeaf(info2) || !
|
|
41383
|
+
const path33 = findPath(nodes2, normalized);
|
|
41384
|
+
if (!isLeaf(info2) || !path33 || !isCollectionTypeCandidate(path33[path33.length - 1])) {
|
|
41322
41385
|
throw new CliError("\u5FC5\u987B\u662F\u542F\u7528\u4E2D\u7684\u5408\u96C6\u6700\u7EC8\u53F6\u5B50\u7C7B\u578B", "COLLECTION_TYPE_NOT_LEAF");
|
|
41323
41386
|
}
|
|
41324
|
-
return { ...info2, pathLabel: label(
|
|
41387
|
+
return { ...info2, pathLabel: label(path33) };
|
|
41325
41388
|
}
|
|
41326
|
-
function label(
|
|
41327
|
-
const names2 =
|
|
41389
|
+
function label(path33) {
|
|
41390
|
+
const names2 = path33.map((node2) => node2.name?.trim());
|
|
41328
41391
|
if (names2.some((name) => !name)) throw new CliError("\u5E73\u53F0\u5408\u96C6\u7C7B\u578B\u94FE\u7F3A\u5C11\u540D\u79F0", "COLLECTION_TYPE_HIERARCHY");
|
|
41329
41392
|
return names2.join(" / ");
|
|
41330
41393
|
}
|
|
@@ -41339,9 +41402,9 @@ async function searchCollectionTypeLeaves(keyword, apis2) {
|
|
|
41339
41402
|
return unwrapList2(response).flatMap((item) => {
|
|
41340
41403
|
if (!item.code || seen.has(item.code)) return [];
|
|
41341
41404
|
seen.add(item.code);
|
|
41342
|
-
const
|
|
41343
|
-
if (!
|
|
41344
|
-
return [{ code: item.code, label: label(
|
|
41405
|
+
const path33 = findPath(nodes2, item.code);
|
|
41406
|
+
if (!path33 || !isCollectionTypeCandidate(path33[path33.length - 1])) return [];
|
|
41407
|
+
return [{ code: item.code, label: label(path33) }];
|
|
41345
41408
|
});
|
|
41346
41409
|
}
|
|
41347
41410
|
var init_resourceTypes = __esm({
|
|
@@ -41415,9 +41478,6 @@ function record5(value) {
|
|
|
41415
41478
|
function validResourceId(value) {
|
|
41416
41479
|
return typeof value === "string" && value.trim() === value && /^[a-zA-Z0-9_.-]+$/u.test(value) && value !== "." && value !== "..";
|
|
41417
41480
|
}
|
|
41418
|
-
function isNotFound2(error3) {
|
|
41419
|
-
return record5(error3) && record5(error3.response) && error3.response.status === 404 || error3 instanceof Error && error3.message === '{"status":404}';
|
|
41420
|
-
}
|
|
41421
41481
|
function normalizeCollectionName(raw) {
|
|
41422
41482
|
return normalizePlatformName(raw);
|
|
41423
41483
|
}
|
|
@@ -41460,7 +41520,6 @@ async function assertNameAvailable(input3) {
|
|
|
41460
41520
|
isLoadLatestVersionInfo: 1
|
|
41461
41521
|
});
|
|
41462
41522
|
} catch (error3) {
|
|
41463
|
-
if (isNotFound2(error3)) return;
|
|
41464
41523
|
throwPlatformReadError(error3, {
|
|
41465
41524
|
code: "COLLECTION_LOOKUP_FAILED",
|
|
41466
41525
|
message: "\u67E5\u8BE2\u73B0\u6709\u5408\u96C6\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u548C\u7F51\u7EDC\u540E\u91CD\u8BD5"
|
|
@@ -44979,7 +45038,7 @@ async function prompt(ask) {
|
|
|
44979
45038
|
try {
|
|
44980
45039
|
return await ask();
|
|
44981
45040
|
} catch (error3) {
|
|
44982
|
-
const cancelled3 = error3 instanceof Error && ["ExitPromptError", "AbortPromptError"].includes(error3.name);
|
|
45041
|
+
const cancelled3 = error3 instanceof CliError && ["CANCELLED", "FORM_CANCELLED"].includes(error3.code ?? "") || error3 instanceof Error && ["ExitPromptError", "AbortPromptError"].includes(error3.name);
|
|
44983
45042
|
throw new CliError(
|
|
44984
45043
|
cancelled3 ? "\u5DF2\u53D6\u6D88\u6807\u7B7E\u7F16\u8F91\uFF0C\u672A\u63D0\u4EA4\u4FEE\u6539" : "\u6807\u7B7E\u7F16\u8F91\u672A\u80FD\u5B8C\u6210\uFF0C\u672A\u63D0\u4EA4\u4FEE\u6539",
|
|
44985
45044
|
cancelled3 ? "FORM_CANCELLED" : "COLLECTION_TAGS_PROMPT_FAILED"
|
|
@@ -51248,14 +51307,9 @@ function assertResourceInfoExists(response) {
|
|
|
51248
51307
|
throw new CliError("\u8D44\u6E90\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u8D44\u6E90ID", "RESOURCE_NOT_FOUND");
|
|
51249
51308
|
}
|
|
51250
51309
|
async function readResourceInfo(read2, resourceId, extra = {}) {
|
|
51251
|
-
|
|
51252
|
-
|
|
51253
|
-
|
|
51254
|
-
{
|
|
51255
|
-
code: "RESOURCE_NOT_FOUND",
|
|
51256
|
-
message: "\u8D44\u6E90\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u8D44\u6E90ID"
|
|
51257
|
-
}
|
|
51258
|
-
);
|
|
51310
|
+
if (typeof resourceId !== "string" || !resourceId.trim() || ["undefined", "null"].includes(resourceId.trim()))
|
|
51311
|
+
throw new CliError("\u8D44\u6E90ID\u4E0D\u80FD\u4E3A\u7A7A\u6216\u65E0\u6548", "CLI_ARGUMENT_INVALID");
|
|
51312
|
+
const response = await readPlatformResult(read2, { ...extra, resourceIdOrName: resourceId });
|
|
51259
51313
|
assertResourceInfoExists(response);
|
|
51260
51314
|
return unwrapData(response);
|
|
51261
51315
|
}
|
|
@@ -51468,22 +51522,10 @@ ${Object.entries(payload).filter(([key2]) => key2 !== "resourceId").map(([key2,
|
|
|
51468
51522
|
input3.yes,
|
|
51469
51523
|
promptOutput
|
|
51470
51524
|
);
|
|
51471
|
-
|
|
51472
|
-
assertContext2();
|
|
51473
|
-
const current2 = await readResourceInfo(info2, identity4.resourceId);
|
|
51474
|
-
assertContext2();
|
|
51475
|
-
assertRemoteResourceWritable({ info: current2, resourceId: identity4.resourceId, authUserId });
|
|
51476
|
-
if (["feedUrl", "rssGuid", "rssPubDate"].some(
|
|
51477
|
-
(key2) => typeof current2[key2] === "string" && current2[key2].trim()
|
|
51478
|
-
))
|
|
51479
|
-
throw new CliError("RSS \u76F8\u5173\u8D44\u6E90\u5F53\u524D\u4E0D\u652F\u6301\u4FEE\u6539\u5C55\u793A\u4FE1\u606F", "UPDATE_RSS_READONLY");
|
|
51480
|
-
if (!isDeepStrictEqual4(listingView(current2), before))
|
|
51481
|
-
throw new CliError("\u8D44\u6E90\u8D44\u6599\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u67E5\u8BE2\u540E\u4FEE\u6539", "UPDATE_CONFLICT");
|
|
51482
|
-
};
|
|
51483
|
-
await revalidate();
|
|
51525
|
+
assertContext2();
|
|
51484
51526
|
if (coverBytes) {
|
|
51485
51527
|
payload.coverImages = [await uploadCover2(coverBytes, input3.apis)];
|
|
51486
|
-
|
|
51528
|
+
assertContext2();
|
|
51487
51529
|
}
|
|
51488
51530
|
const update2 = input3.apis?.update ?? ((params) => service_API_default.Resource.update(params));
|
|
51489
51531
|
try {
|
|
@@ -51507,13 +51549,13 @@ ${Object.entries(payload).filter(([key2]) => key2 !== "resourceId").map(([key2,
|
|
|
51507
51549
|
assertRemoteResourceOwned({ info: afterInfo, resourceId: identity4.resourceId, authUserId });
|
|
51508
51550
|
after = listingView(afterInfo);
|
|
51509
51551
|
const expected = {
|
|
51510
|
-
...before,
|
|
51511
51552
|
...payload.resourceTitle !== void 0 ? { title: payload.resourceTitle } : {},
|
|
51512
51553
|
...payload.intro !== void 0 ? { intro: payload.intro } : {},
|
|
51513
51554
|
...payload.tags !== void 0 ? { tags: payload.tags } : {},
|
|
51514
51555
|
...payload.coverImages !== void 0 ? { coverImages: payload.coverImages } : {}
|
|
51515
51556
|
};
|
|
51516
|
-
if (afterInfo.isFrozen === true ||
|
|
51557
|
+
if (afterInfo.isFrozen === true || after.resourceName !== before.resourceName || Object.entries(expected).some(([key2, value]) => !isDeepStrictEqual4(after[key2], value)))
|
|
51558
|
+
throw new Error("Listing mismatch");
|
|
51517
51559
|
} catch {
|
|
51518
51560
|
throw new CliError("\u8D44\u6E90\u4FE1\u606F\u5199\u5165\u540E\u8BFB\u56DE\u4E0D\u4E00\u81F4\uFF1B\u8BF7\u5148\u6838\u5BF9\u7EBF\u4E0A\u8D44\u6599\uFF0C\u52FF\u91CD\u590D\u6267\u884C\u3002", "UPDATE_VERIFY_FAILED");
|
|
51519
51561
|
}
|
|
@@ -52640,11 +52682,7 @@ async function statusProject(input3) {
|
|
|
52640
52682
|
try {
|
|
52641
52683
|
result = await infoApi2({ resourceIdOrName: local.resourceId, isLoadLatestVersionInfo: 1 });
|
|
52642
52684
|
} catch (error3) {
|
|
52643
|
-
throwPlatformReadError(
|
|
52644
|
-
error3,
|
|
52645
|
-
{ code: "STATUS_REQUEST_FAILED", message: "\u8BF7\u6C42\u5931\u8D25\uFF0C\u65E0\u6CD5\u786E\u8BA4\u7EBF\u4E0A\u73B0\u72B6" },
|
|
52646
|
-
{ code: "RESOURCE_NOT_FOUND", message: "\u8D44\u6E90\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u8D44\u6E90ID" }
|
|
52647
|
-
);
|
|
52685
|
+
throwPlatformReadError(error3, { code: "STATUS_REQUEST_FAILED", message: "\u8BF7\u6C42\u5931\u8D25\uFF0C\u65E0\u6CD5\u786E\u8BA4\u7EBF\u4E0A\u73B0\u72B6" });
|
|
52648
52686
|
}
|
|
52649
52687
|
online = confirmedOnlineStatus(result, local.resourceId);
|
|
52650
52688
|
}
|
|
@@ -53307,11 +53345,10 @@ async function readResourceDetails(input3) {
|
|
|
53307
53345
|
response = await info2({ resourceIdOrName: target });
|
|
53308
53346
|
} catch (error3) {
|
|
53309
53347
|
assertContext2();
|
|
53310
|
-
throwPlatformReadError(
|
|
53311
|
-
|
|
53312
|
-
|
|
53313
|
-
|
|
53314
|
-
);
|
|
53348
|
+
throwPlatformReadError(error3, {
|
|
53349
|
+
code: "RESOURCE_INFO_REQUEST_FAILED",
|
|
53350
|
+
message: "\u8D44\u6E90\u8D44\u6599\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7\u786E\u8BA4\u7F51\u7EDC\u548C\u767B\u5F55\u540E\u91CD\u8BD5"
|
|
53351
|
+
});
|
|
53315
53352
|
}
|
|
53316
53353
|
assertContext2();
|
|
53317
53354
|
assertResourceInfoExists(response);
|
|
@@ -53450,7 +53487,6 @@ var init_resource = __esm({
|
|
|
53450
53487
|
});
|
|
53451
53488
|
|
|
53452
53489
|
// src/domain/resource/online.ts
|
|
53453
|
-
import { isDeepStrictEqual as isDeepStrictEqual5 } from "util";
|
|
53454
53490
|
async function loadInfo(resourceId, apis2) {
|
|
53455
53491
|
const infoApi2 = apis2?.info ?? ((params) => service_API_default.Resource.info(params));
|
|
53456
53492
|
return readResourceInfo(infoApi2, resourceId, {
|
|
@@ -53504,14 +53540,6 @@ async function changeShelfLocked(input3, authUserId, desired) {
|
|
|
53504
53540
|
input3.json ? "stderr" : void 0
|
|
53505
53541
|
);
|
|
53506
53542
|
assertContext2();
|
|
53507
|
-
const current2 = await loadInfo(identity4.resourceId, input3.apis);
|
|
53508
|
-
assertContext2();
|
|
53509
|
-
assertRemoteResourceWritable({ info: current2, resourceId: identity4.resourceId, authUserId });
|
|
53510
|
-
assertKnownShelfStatus(current2);
|
|
53511
|
-
if (listing) validateForOnline(current2);
|
|
53512
|
-
const policyState = (value) => Array.isArray(value.policies) ? value.policies.map((p) => [p.policyId, p.status]) : void 0;
|
|
53513
|
-
if (current2.status !== info2.status || listing && (current2.latestVersion !== info2.latestVersion || !isDeepStrictEqual5(policyState(current2), policyState(info2))))
|
|
53514
|
-
throw new CliError("\u8D44\u6E90\u72B6\u6001\u6216\u4E0A\u67B6\u6761\u4EF6\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u67E5\u8BE2\u540E\u64CD\u4F5C", "SHELF_CONFLICT");
|
|
53515
53543
|
const update2 = input3.apis?.update ?? ((params) => service_API_default.Resource.update(params));
|
|
53516
53544
|
const unknown2 = (cause) => {
|
|
53517
53545
|
const reason = cause instanceof CliError && cause.code !== "SHELF_RESULT_UNKNOWN" ? safePlatformMessage(cause.message) : platformFailureMessage(cause, "");
|
|
@@ -53709,7 +53737,7 @@ var init_validate2 = __esm({
|
|
|
53709
53737
|
});
|
|
53710
53738
|
|
|
53711
53739
|
// src/domain/resource/version/draftEdit.ts
|
|
53712
|
-
import { isDeepStrictEqual as
|
|
53740
|
+
import { isDeepStrictEqual as isDeepStrictEqual5 } from "util";
|
|
53713
53741
|
async function beginDraftEdit(cwd, input3 = {}) {
|
|
53714
53742
|
assertPlatformAllowed();
|
|
53715
53743
|
const auth = requireAuth({ cwd, homeDir: input3.homeDir });
|
|
@@ -53725,7 +53753,7 @@ async function beginDraftEdit(cwd, input3 = {}) {
|
|
|
53725
53753
|
throw new CliError("\u7F16\u8F91\u671F\u95F4\u5DE5\u4F5C\u7A3F\u5DF2\u53D8\u5316\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u7A3F", "DRAFT_CHANGED");
|
|
53726
53754
|
}
|
|
53727
53755
|
const current2 = resolveBoundIdentity(cwd, `file:${identity4.n}.json`);
|
|
53728
|
-
if (!
|
|
53756
|
+
if (!isDeepStrictEqual5(current2, identity4)) {
|
|
53729
53757
|
throw new CliError("\u7F16\u8F91\u671F\u95F4\u8D44\u6E90\u8EAB\u4EFD\u5DF2\u53D8\u5316\uFF0C\u672A\u8986\u76D6\u5DE5\u4F5C\u7A3F", "DRAFT_IDENTITY_CHANGED");
|
|
53730
53758
|
}
|
|
53731
53759
|
return currentAuth2;
|
|
@@ -55612,7 +55640,7 @@ var init_create_version = __esm({
|
|
|
55612
55640
|
|
|
55613
55641
|
// src/domain/resource/version/form/dep.ts
|
|
55614
55642
|
import semver9 from "semver";
|
|
55615
|
-
import { isDeepStrictEqual as
|
|
55643
|
+
import { isDeepStrictEqual as isDeepStrictEqual6 } from "util";
|
|
55616
55644
|
function dependencyIdentity(cwd, file3) {
|
|
55617
55645
|
const identity4 = resolveBoundIdentity(cwd, file3);
|
|
55618
55646
|
if (!identity4.resourceId) throw new CliError("\u8BF7\u5148 create \u6216 bind", "DEP_NEED_SHELL");
|
|
@@ -55936,7 +55964,7 @@ async function depSign(input3) {
|
|
|
55936
55964
|
});
|
|
55937
55965
|
if (published) {
|
|
55938
55966
|
const fresh = await readPublishedDependencies(input3, identity4.resourceId, published.version);
|
|
55939
|
-
if (!
|
|
55967
|
+
if (!isDeepStrictEqual6(fresh.dependencies, published.dependencies))
|
|
55940
55968
|
throw new CliError("\u8865\u7B7E\u671F\u95F4\u7EBF\u4E0A\u4F9D\u8D56\u5FEB\u7167\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u67E5\u770B", "DEP_PUBLISHED_CHANGED");
|
|
55941
55969
|
}
|
|
55942
55970
|
const { info: freshInfo } = await assertCurrentResourceWritable({ ...input3, identity: identity4 });
|
|
@@ -56189,7 +56217,7 @@ var init_publishedVersions = __esm({
|
|
|
56189
56217
|
});
|
|
56190
56218
|
|
|
56191
56219
|
// src/domain/resource/version/description.ts
|
|
56192
|
-
import { isDeepStrictEqual as
|
|
56220
|
+
import { isDeepStrictEqual as isDeepStrictEqual7 } from "util";
|
|
56193
56221
|
import semver11 from "semver";
|
|
56194
56222
|
function immutableFields(value) {
|
|
56195
56223
|
return [
|
|
@@ -56295,7 +56323,7 @@ ${description || "\uFF08\u65E0\u63CF\u8FF0\uFF09"}
|
|
|
56295
56323
|
await writableInfo();
|
|
56296
56324
|
const latest = await readVersion();
|
|
56297
56325
|
assertContext2();
|
|
56298
|
-
if (!
|
|
56326
|
+
if (!isDeepStrictEqual7(immutableFields(before), immutableFields(latest)) || latest.description !== current2) {
|
|
56299
56327
|
throw new CliError("\u7248\u672C\u4FE1\u606F\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u67E5\u8BE2\u540E\u4FEE\u6539", "DESCRIPTION_VERIFY_FAILED");
|
|
56300
56328
|
}
|
|
56301
56329
|
try {
|
|
@@ -56315,7 +56343,7 @@ ${description || "\uFF08\u65E0\u63CF\u8FF0\uFF09"}
|
|
|
56315
56343
|
} catch (error3) {
|
|
56316
56344
|
throw unknownResult2(error3);
|
|
56317
56345
|
}
|
|
56318
|
-
if (after.resourceId !== resourceId || after.version !== version2 || after.description !== description || !
|
|
56346
|
+
if (after.resourceId !== resourceId || after.version !== version2 || after.description !== description || !isDeepStrictEqual7(immutableFields(before), immutableFields(after))) {
|
|
56319
56347
|
throw new CliError("\u7248\u672C\u8BF4\u660E\u6216\u5176\u5B83\u5DF2\u53D1\u5B57\u6BB5\u8BFB\u56DE\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u5148\u6838\u5BF9\uFF0C\u4E0D\u8981\u91CD\u590D\u63D0\u4EA4", "DESCRIPTION_VERIFY_FAILED");
|
|
56320
56348
|
}
|
|
56321
56349
|
return { version: version2, description, changed: true };
|
|
@@ -56607,7 +56635,7 @@ var init_draftPull = __esm({
|
|
|
56607
56635
|
});
|
|
56608
56636
|
|
|
56609
56637
|
// src/domain/resource/version/storageMetadata.ts
|
|
56610
|
-
import { isDeepStrictEqual as
|
|
56638
|
+
import { isDeepStrictEqual as isDeepStrictEqual8 } from "util";
|
|
56611
56639
|
function record20(value) {
|
|
56612
56640
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
56613
56641
|
}
|
|
@@ -56839,7 +56867,7 @@ ${JSON.stringify({ before: edit.draft, after: candidate }, null, 2)}`;
|
|
|
56839
56867
|
return { imported: false, groups };
|
|
56840
56868
|
await checkDependencies();
|
|
56841
56869
|
const current2 = await readStorageObjectSnapshot(input3);
|
|
56842
|
-
if (!
|
|
56870
|
+
if (!isDeepStrictEqual8(current2, snapshot2))
|
|
56843
56871
|
throw new CliError("\u786E\u8BA4\u671F\u95F4\u5BF9\u8C61\u5185\u5BB9\u6216\u5143\u6570\u636E\u5DF2\u53D8\u5316\uFF0C\u672A\u8986\u76D6\u5DE5\u4F5C\u7A3F", "STORAGE_METADATA_CHANGED");
|
|
56844
56872
|
if (namespace) {
|
|
56845
56873
|
const fresh = await loadAttributeNamespace({
|
|
@@ -56847,7 +56875,7 @@ ${JSON.stringify({ before: edit.draft, after: candidate }, null, 2)}`;
|
|
|
56847
56875
|
metadataSource: "type",
|
|
56848
56876
|
apis: input3.apis
|
|
56849
56877
|
});
|
|
56850
|
-
if (!
|
|
56878
|
+
if (!isDeepStrictEqual8(fresh, namespace))
|
|
56851
56879
|
throw new CliError("\u786E\u8BA4\u671F\u95F4\u5F53\u524D\u7C7B\u578B\u6216\u5C5E\u6027\u5B9A\u4E49\u53D8\u5316\uFF0C\u672A\u66F4\u65B0\u5DE5\u4F5C\u7A3F", "STORAGE_METADATA_CHANGED");
|
|
56852
56880
|
await assertDraftOptionsAllowed({
|
|
56853
56881
|
cwd: input3.cwd,
|
|
@@ -56857,7 +56885,7 @@ ${JSON.stringify({ before: edit.draft, after: candidate }, null, 2)}`;
|
|
|
56857
56885
|
apis: input3.apis
|
|
56858
56886
|
});
|
|
56859
56887
|
for (const [key2, definition] of nameDefinitions)
|
|
56860
|
-
if (!
|
|
56888
|
+
if (!isDeepStrictEqual8(await readNameDefinition(key2), definition))
|
|
56861
56889
|
throw new CliError("\u786E\u8BA4\u671F\u95F4\u65E7\u5C5E\u6027\u540D\u79F0\u5B9A\u4E49\u53D8\u5316", "STORAGE_METADATA_CHANGED");
|
|
56862
56890
|
}
|
|
56863
56891
|
await edit.commitCheck();
|
|
@@ -58337,9 +58365,9 @@ async function updateNode(input3) {
|
|
|
58337
58365
|
}
|
|
58338
58366
|
});
|
|
58339
58367
|
}
|
|
58340
|
-
function imageSnapshot(cwd,
|
|
58368
|
+
function imageSnapshot(cwd, path33, formats) {
|
|
58341
58369
|
try {
|
|
58342
|
-
return readLocalImage({ cwd, path:
|
|
58370
|
+
return readLocalImage({ cwd, path: path33, maxBytes: 5 * 1024 * 1024, formats, staticGif: true });
|
|
58343
58371
|
} catch {
|
|
58344
58372
|
throw new CliError(
|
|
58345
58373
|
"\u8282\u70B9\u56FE\u7247\u5FC5\u987B\u662F\u5141\u8BB8\u683C\u5F0F\u7684\u672C\u5730\u56FE\u7247\u4E14\u4E0D\u8D85\u8FC75MiB\uFF1Bstage=image-validation\uFF0CnodeUpdateSent=false",
|
|
@@ -60728,12 +60756,12 @@ async function readExhibitCollectionTypes(input3) {
|
|
|
60728
60756
|
if (!object2(value) || typeof value.code !== "string" || !value.code.trim() || typeof value.name !== "string" || !value.name.trim() || codes2.has(value.code))
|
|
60729
60757
|
throw new CliError("\u7C7B\u578B\u6811\u5B58\u5728\u7F3A\u5931\u6216\u91CD\u590D\u8EAB\u4EFD", "EXHIBIT_COLLECTION_TYPE_INVALID");
|
|
60730
60758
|
codes2.add(value.code);
|
|
60731
|
-
const
|
|
60759
|
+
const path33 = [...parents, value.name];
|
|
60732
60760
|
return {
|
|
60733
60761
|
code: value.code,
|
|
60734
60762
|
name: value.name,
|
|
60735
|
-
path:
|
|
60736
|
-
children: value.children === void 0 || value.children === "" ? [] : decode(value.children,
|
|
60763
|
+
path: path33,
|
|
60764
|
+
children: value.children === void 0 || value.children === "" ? [] : decode(value.children, path33)
|
|
60737
60765
|
};
|
|
60738
60766
|
});
|
|
60739
60767
|
};
|
|
@@ -62937,8 +62965,8 @@ function createStorageCommand() {
|
|
|
62937
62965
|
options(root.command("show <objectId>")).action(async function(objectId) {
|
|
62938
62966
|
output3(await showStorageObject(context2(this), objectId));
|
|
62939
62967
|
});
|
|
62940
|
-
options(root.command("upload <path>")).requiredOption("--bucket <name>", "\u7A7A\u95F4\u540D\u79F0").option("--name <name>", "\u5B58\u50A8\u5BF9\u8C61\u6587\u4EF6\u540D\uFF0C\u9ED8\u8BA4\u672C\u5730\u6587\u4EF6\u540D").option("--replace", "\u663E\u5F0F\u5141\u8BB8\u540C\u540D\u66FF\u6362\uFF0C\u4ECD\u9700\u786E\u8BA4").action(async function(
|
|
62941
|
-
output3(await uploadStorageObject({ ...context2(this), path:
|
|
62968
|
+
options(root.command("upload <path>")).requiredOption("--bucket <name>", "\u7A7A\u95F4\u540D\u79F0").option("--name <name>", "\u5B58\u50A8\u5BF9\u8C61\u6587\u4EF6\u540D\uFF0C\u9ED8\u8BA4\u672C\u5730\u6587\u4EF6\u540D").option("--replace", "\u663E\u5F0F\u5141\u8BB8\u540C\u540D\u66FF\u6362\uFF0C\u4ECD\u9700\u786E\u8BA4").action(async function(path33, o) {
|
|
62969
|
+
output3(await uploadStorageObject({ ...context2(this), path: path33, ...o }));
|
|
62942
62970
|
});
|
|
62943
62971
|
options(root.command("remove <objectId>")).action(async function(objectId) {
|
|
62944
62972
|
output3(await removeStorageObject({ ...context2(this), objectId }));
|
|
@@ -63596,16 +63624,8 @@ var init_batchFailure = __esm({
|
|
|
63596
63624
|
});
|
|
63597
63625
|
|
|
63598
63626
|
// src/core/usageDocs.ts
|
|
63599
|
-
|
|
63600
|
-
|
|
63601
|
-
import { fileURLToPath } from "url";
|
|
63602
|
-
function usageDocsPath() {
|
|
63603
|
-
const moduleDir = path32.dirname(fileURLToPath(import.meta.url));
|
|
63604
|
-
const bundledPath = path32.resolve(moduleDir, "../docs/README.md");
|
|
63605
|
-
if (existsSync21(bundledPath)) {
|
|
63606
|
-
return bundledPath;
|
|
63607
|
-
}
|
|
63608
|
-
return path32.resolve(moduleDir, "../../../../docs/README.md");
|
|
63627
|
+
function usageDocsUrl() {
|
|
63628
|
+
return "https://widget-docs.freelog.cn/cli/";
|
|
63609
63629
|
}
|
|
63610
63630
|
var init_usageDocs = __esm({
|
|
63611
63631
|
"src/core/usageDocs.ts"() {
|
|
@@ -63615,11 +63635,11 @@ var init_usageDocs = __esm({
|
|
|
63615
63635
|
|
|
63616
63636
|
// src/core/packageVersion.ts
|
|
63617
63637
|
import { readFileSync as readFileSync17 } from "fs";
|
|
63618
|
-
import
|
|
63619
|
-
import { fileURLToPath
|
|
63638
|
+
import path32 from "path";
|
|
63639
|
+
import { fileURLToPath } from "url";
|
|
63620
63640
|
function packageVersion() {
|
|
63621
|
-
const moduleDir =
|
|
63622
|
-
const packageJson =
|
|
63641
|
+
const moduleDir = path32.dirname(fileURLToPath(import.meta.url));
|
|
63642
|
+
const packageJson = path32.resolve(moduleDir, "../..", "package.json");
|
|
63623
63643
|
const value = JSON.parse(readFileSync17(packageJson, "utf8"));
|
|
63624
63644
|
return typeof value.version === "string" ? value.version : "unknown";
|
|
63625
63645
|
}
|
|
@@ -63703,7 +63723,7 @@ function createProgram(options2 = {}) {
|
|
|
63703
63723
|
// i18n: cli.flag.cli_version
|
|
63704
63724
|
"\u6253\u5370 CLI \u7248\u672C"
|
|
63705
63725
|
).addHelpText("after", `
|
|
63706
|
-
\u4F7F\u7528\u6587\u6863\uFF1A${
|
|
63726
|
+
\u4F7F\u7528\u6587\u6863\uFF1A${usageDocsUrl()}
|
|
63707
63727
|
`);
|
|
63708
63728
|
addSharedOptions(program);
|
|
63709
63729
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -63896,19 +63916,8 @@ function isSupportedNodeVersion(value) {
|
|
|
63896
63916
|
return true;
|
|
63897
63917
|
}
|
|
63898
63918
|
|
|
63899
|
-
// src/platform/os/interactive-terminal.mjs
|
|
63900
|
-
function prepareInteractiveTerminal({
|
|
63901
|
-
platform = process.platform,
|
|
63902
|
-
input: input3 = process.stdin,
|
|
63903
|
-
output: output5 = process.stdout,
|
|
63904
|
-
env = process.env
|
|
63905
|
-
} = {}) {
|
|
63906
|
-
if (platform === "win32" && input3.isTTY && output5.isTTY && env.TERM === "dumb") {
|
|
63907
|
-
delete env.TERM;
|
|
63908
|
-
}
|
|
63909
|
-
}
|
|
63910
|
-
|
|
63911
63919
|
// src/bin/index.ts
|
|
63920
|
+
init_interactive_terminal();
|
|
63912
63921
|
try {
|
|
63913
63922
|
if (!isSupportedNodeVersion(process.versions.node)) {
|
|
63914
63923
|
throw new CliError(
|