@base44-preview/cli 0.0.36-pr.355.fd88cd2 → 0.0.36-pr.356.36d8c62
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/dist/cli/index.js +24 -38
- package/dist/cli/index.js.map +7 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -225896,47 +225896,34 @@ function getTestOverrides() {
|
|
|
225896
225896
|
}
|
|
225897
225897
|
|
|
225898
225898
|
// src/core/clients/schemas.ts
|
|
225899
|
-
var ApiErrorResponseSchema = exports_external.
|
|
225900
|
-
|
|
225901
|
-
|
|
225902
|
-
detail: exports_external.union([
|
|
225903
|
-
exports_external.string(),
|
|
225904
|
-
exports_external.record(exports_external.string(), exports_external.unknown()),
|
|
225905
|
-
exports_external.array(exports_external.unknown())
|
|
225906
|
-
]).nullable().optional(),
|
|
225907
|
-
traceback: exports_external.string().nullable().optional(),
|
|
225899
|
+
var ApiErrorResponseSchema = exports_external.looseObject({
|
|
225900
|
+
message: exports_external.unknown().optional(),
|
|
225901
|
+
detail: exports_external.unknown().optional(),
|
|
225908
225902
|
extra_data: exports_external.looseObject({
|
|
225909
|
-
reason: exports_external.string().optional(),
|
|
225910
|
-
errors: exports_external.array(exports_external.
|
|
225911
|
-
|
|
225912
|
-
exports_external.string()
|
|
225913
|
-
])).optional()
|
|
225914
|
-
}).optional().nullable()
|
|
225903
|
+
reason: exports_external.string().optional().catch(undefined),
|
|
225904
|
+
errors: exports_external.array(exports_external.looseObject({ name: exports_external.string(), message: exports_external.string() })).optional().catch(undefined)
|
|
225905
|
+
}).optional().nullable().catch(undefined)
|
|
225915
225906
|
});
|
|
225916
225907
|
|
|
225917
225908
|
// src/core/errors.ts
|
|
225918
|
-
function formatApiError(errorBody) {
|
|
225919
|
-
const
|
|
225920
|
-
if (
|
|
225921
|
-
const
|
|
225922
|
-
|
|
225923
|
-
if (typeof content === "string") {
|
|
225909
|
+
function formatApiError(errorBody, parsed) {
|
|
225910
|
+
const data = parsed ?? ApiErrorResponseSchema.safeParse(errorBody).data;
|
|
225911
|
+
if (data) {
|
|
225912
|
+
const content = data.message ?? data.detail;
|
|
225913
|
+
if (typeof content === "string")
|
|
225924
225914
|
return content;
|
|
225925
|
-
|
|
225926
|
-
if (content !== undefined) {
|
|
225915
|
+
if (content !== undefined)
|
|
225927
225916
|
return JSON.stringify(content, null, 2);
|
|
225928
|
-
}
|
|
225929
225917
|
}
|
|
225930
|
-
if (typeof errorBody === "string")
|
|
225918
|
+
if (typeof errorBody === "string")
|
|
225931
225919
|
return errorBody;
|
|
225932
|
-
}
|
|
225933
225920
|
return JSON.stringify(errorBody, null, 2);
|
|
225934
225921
|
}
|
|
225935
225922
|
function parseErrorDetails(extraData) {
|
|
225936
225923
|
const errors3 = extraData?.errors;
|
|
225937
225924
|
if (!errors3 || errors3.length === 0)
|
|
225938
225925
|
return;
|
|
225939
|
-
return errors3.map((
|
|
225926
|
+
return errors3.map((e2) => `${e2.name}: ${e2.message}`);
|
|
225940
225927
|
}
|
|
225941
225928
|
|
|
225942
225929
|
class CLIError extends Error {
|
|
@@ -226057,11 +226044,12 @@ class ApiError extends SystemError {
|
|
|
226057
226044
|
let details;
|
|
226058
226045
|
try {
|
|
226059
226046
|
responseBody = await error48.response.clone().json();
|
|
226060
|
-
message = formatApiError(responseBody);
|
|
226061
226047
|
const parsed = ApiErrorResponseSchema.safeParse(responseBody);
|
|
226062
|
-
|
|
226063
|
-
|
|
226064
|
-
|
|
226048
|
+
const parsedData = parsed.success ? parsed.data : undefined;
|
|
226049
|
+
message = formatApiError(responseBody, parsedData);
|
|
226050
|
+
if (parsedData) {
|
|
226051
|
+
hints = ApiError.getReasonHints(parsedData);
|
|
226052
|
+
details = parseErrorDetails(parsedData.extra_data);
|
|
226065
226053
|
}
|
|
226066
226054
|
} catch {
|
|
226067
226055
|
message = error48.message;
|
|
@@ -226132,7 +226120,7 @@ class ApiError extends SystemError {
|
|
|
226132
226120
|
}
|
|
226133
226121
|
]
|
|
226134
226122
|
};
|
|
226135
|
-
const reason = parsedResponse
|
|
226123
|
+
const reason = parsedResponse.extra_data?.reason;
|
|
226136
226124
|
if (typeof reason !== "string")
|
|
226137
226125
|
return;
|
|
226138
226126
|
return REASON_HINTS[reason];
|
|
@@ -233661,9 +233649,7 @@ async function readFunction(configPath) {
|
|
|
233661
233649
|
const entryPath = join5(functionDir, config5.entry);
|
|
233662
233650
|
if (!await pathExists(entryPath)) {
|
|
233663
233651
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
233664
|
-
hints: [
|
|
233665
|
-
{ message: "Check the 'entry' field in your function config" }
|
|
233666
|
-
]
|
|
233652
|
+
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
233667
233653
|
});
|
|
233668
233654
|
}
|
|
233669
233655
|
const filePaths = await globby("*.{js,ts,json}", {
|
|
@@ -241723,7 +241709,7 @@ function displayError(error48) {
|
|
|
241723
241709
|
R2.error(errorMessage);
|
|
241724
241710
|
if (isCLIError(error48)) {
|
|
241725
241711
|
if (error48.details.length > 0) {
|
|
241726
|
-
R2.
|
|
241712
|
+
R2.info(theme.format.details(error48.details));
|
|
241727
241713
|
}
|
|
241728
241714
|
const hints = theme.format.agentHints(error48.hints);
|
|
241729
241715
|
if (hints) {
|
|
@@ -244479,7 +244465,7 @@ function createProgram(context) {
|
|
|
244479
244465
|
program2.addCommand(getAgentsCommand(context));
|
|
244480
244466
|
program2.addCommand(getConnectorsCommand(context));
|
|
244481
244467
|
program2.addCommand(getFunctionsDeployCommand(context));
|
|
244482
|
-
program2.addCommand(getSecretsCommand(context)
|
|
244468
|
+
program2.addCommand(getSecretsCommand(context));
|
|
244483
244469
|
program2.addCommand(getSiteCommand(context));
|
|
244484
244470
|
program2.addCommand(getTypesCommand(context));
|
|
244485
244471
|
program2.addCommand(getDevCommand(context), { hidden: true });
|
|
@@ -248719,4 +248705,4 @@ export {
|
|
|
248719
248705
|
CLIExitError
|
|
248720
248706
|
};
|
|
248721
248707
|
|
|
248722
|
-
//# debugId=
|
|
248708
|
+
//# debugId=3A2721A692CF8F1564756E2164756E21
|