@base44-preview/cli 0.1.14-pr.614.e34e90d → 0.1.14-pr.617.31be75e
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 +111 -134
- package/dist/cli/index.js.map +9 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -31177,7 +31177,7 @@ function cleanDoc(doc) {
|
|
|
31177
31177
|
return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
|
|
31178
31178
|
}
|
|
31179
31179
|
function replaceEndOfLine(doc, replacement = literalline) {
|
|
31180
|
-
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ?
|
|
31180
|
+
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join27(replacement, currentDoc.split(`
|
|
31181
31181
|
`)) : currentDoc);
|
|
31182
31182
|
}
|
|
31183
31183
|
function canBreakFn(doc) {
|
|
@@ -31257,7 +31257,7 @@ function indentIfBreak(contents, options) {
|
|
|
31257
31257
|
negate: options.negate
|
|
31258
31258
|
};
|
|
31259
31259
|
}
|
|
31260
|
-
function
|
|
31260
|
+
function join27(separator, docs) {
|
|
31261
31261
|
assertDoc(separator);
|
|
31262
31262
|
assertDocArray(docs);
|
|
31263
31263
|
const parts = [];
|
|
@@ -31968,7 +31968,7 @@ var init_doc = __esm(() => {
|
|
|
31968
31968
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
31969
31969
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
31970
31970
|
builders = {
|
|
31971
|
-
join:
|
|
31971
|
+
join: join27,
|
|
31972
31972
|
line,
|
|
31973
31973
|
softline,
|
|
31974
31974
|
hardline,
|
|
@@ -120869,7 +120869,7 @@ async function filter({ name, path: file }) {
|
|
|
120869
120869
|
function getSearcher(stopDirectory) {
|
|
120870
120870
|
return new FileSearcher(CONFIG_FILE_NAMES, { filter, stopDirectory });
|
|
120871
120871
|
}
|
|
120872
|
-
function
|
|
120872
|
+
function formatList(array2, type = "and") {
|
|
120873
120873
|
return array2.length < 3 ? array2.join(` ${type} `) : `${array2.slice(0, -1).join(", ")}, ${type} ${array2[array2.length - 1]}`;
|
|
120874
120874
|
}
|
|
120875
120875
|
function createError(sym, value, constructor) {
|
|
@@ -134665,18 +134665,18 @@ ${codeblock}`, options8);
|
|
|
134665
134665
|
}
|
|
134666
134666
|
}
|
|
134667
134667
|
if (types.length > 0) {
|
|
134668
|
-
message += `${types.length > 1 ? "one of type" : "of type"} ${
|
|
134668
|
+
message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`;
|
|
134669
134669
|
if (instances.length > 0 || other.length > 0)
|
|
134670
134670
|
message += " or ";
|
|
134671
134671
|
}
|
|
134672
134672
|
if (instances.length > 0) {
|
|
134673
|
-
message += `an instance of ${
|
|
134673
|
+
message += `an instance of ${formatList(instances, "or")}`;
|
|
134674
134674
|
if (other.length > 0)
|
|
134675
134675
|
message += " or ";
|
|
134676
134676
|
}
|
|
134677
134677
|
if (other.length > 0) {
|
|
134678
134678
|
if (other.length > 1) {
|
|
134679
|
-
message += `one of ${
|
|
134679
|
+
message += `one of ${formatList(other, "or")}`;
|
|
134680
134680
|
} else {
|
|
134681
134681
|
if (other[0].toLowerCase() !== other[0])
|
|
134682
134682
|
message += "an ";
|
|
@@ -228779,7 +228779,7 @@ function normalizeBase44Env() {
|
|
|
228779
228779
|
loadProjectEnvFiles();
|
|
228780
228780
|
|
|
228781
228781
|
// src/cli/index.ts
|
|
228782
|
-
import { dirname as
|
|
228782
|
+
import { dirname as dirname26, join as join36 } from "node:path";
|
|
228783
228783
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
228784
228784
|
|
|
228785
228785
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -236754,6 +236754,9 @@ var ListAgentsResponseSchema = object({
|
|
|
236754
236754
|
|
|
236755
236755
|
// src/core/resources/agent/api.ts
|
|
236756
236756
|
async function pushAgents(agents) {
|
|
236757
|
+
if (agents.length === 0) {
|
|
236758
|
+
return { created: [], updated: [], deleted: [] };
|
|
236759
|
+
}
|
|
236757
236760
|
const appClient = getAppClient();
|
|
236758
236761
|
let response;
|
|
236759
236762
|
try {
|
|
@@ -237660,6 +237663,17 @@ var RemoveConnectorResponseSchema = object({
|
|
|
237660
237663
|
status: data.status,
|
|
237661
237664
|
integrationType: data.integration_type
|
|
237662
237665
|
}));
|
|
237666
|
+
var SyncDeploymentConnectorsResponseSchema = object({
|
|
237667
|
+
connectors: array(object({
|
|
237668
|
+
integration_type: IntegrationTypeSchema,
|
|
237669
|
+
scopes: array(string2())
|
|
237670
|
+
}))
|
|
237671
|
+
}).transform((data) => ({
|
|
237672
|
+
connectors: data.connectors.map((c) => ({
|
|
237673
|
+
integrationType: c.integration_type,
|
|
237674
|
+
scopes: c.scopes
|
|
237675
|
+
}))
|
|
237676
|
+
}));
|
|
237663
237677
|
var STRIPE_CONNECTOR_TYPE = "stripe";
|
|
237664
237678
|
var InstallStripeResponseSchema = object({
|
|
237665
237679
|
already_installed: boolean2(),
|
|
@@ -237727,6 +237741,27 @@ async function listConnectors() {
|
|
|
237727
237741
|
}
|
|
237728
237742
|
return result.data;
|
|
237729
237743
|
}
|
|
237744
|
+
async function syncDeploymentConnectors(connectors) {
|
|
237745
|
+
const appClient = getAppClient();
|
|
237746
|
+
let response;
|
|
237747
|
+
try {
|
|
237748
|
+
response = await appClient.put("deployment/connectors", {
|
|
237749
|
+
json: {
|
|
237750
|
+
connectors: connectors.map((c) => ({
|
|
237751
|
+
integration_type: c.integrationType,
|
|
237752
|
+
scopes: c.scopes
|
|
237753
|
+
}))
|
|
237754
|
+
}
|
|
237755
|
+
});
|
|
237756
|
+
} catch (error) {
|
|
237757
|
+
throw await ApiError.fromHttpError(error, "syncing connectors");
|
|
237758
|
+
}
|
|
237759
|
+
const result = SyncDeploymentConnectorsResponseSchema.safeParse(await response.json());
|
|
237760
|
+
if (!result.success) {
|
|
237761
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
237762
|
+
}
|
|
237763
|
+
return result.data;
|
|
237764
|
+
}
|
|
237730
237765
|
async function setConnector(integrationType, scopes) {
|
|
237731
237766
|
const appClient = getAppClient();
|
|
237732
237767
|
let response;
|
|
@@ -237988,6 +238023,11 @@ async function pullAllConnectors() {
|
|
|
237988
238023
|
async function pushConnectors(connectors) {
|
|
237989
238024
|
const stripeConnector = connectors.find((c) => c.type === STRIPE_CONNECTOR_TYPE);
|
|
237990
238025
|
const oauthConnectors = connectors.filter((c) => c.type !== STRIPE_CONNECTOR_TYPE);
|
|
238026
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
238027
|
+
return {
|
|
238028
|
+
results: await syncConnectorsWithWorkspaceApiKey(oauthConnectors, stripeConnector)
|
|
238029
|
+
};
|
|
238030
|
+
}
|
|
237991
238031
|
const oauthResults = await syncOAuthConnectors(oauthConnectors);
|
|
237992
238032
|
const stripeResult = await syncStripeConnector(stripeConnector);
|
|
237993
238033
|
const results = [...oauthResults];
|
|
@@ -237996,6 +238036,24 @@ async function pushConnectors(connectors) {
|
|
|
237996
238036
|
}
|
|
237997
238037
|
return { results };
|
|
237998
238038
|
}
|
|
238039
|
+
async function syncConnectorsWithWorkspaceApiKey(oauthConnectors, stripeConnector) {
|
|
238040
|
+
const { connectors } = await syncDeploymentConnectors(oauthConnectors.map((c) => ({
|
|
238041
|
+
integrationType: c.type,
|
|
238042
|
+
scopes: c.scopes ?? []
|
|
238043
|
+
})));
|
|
238044
|
+
const results = connectors.map((c) => ({
|
|
238045
|
+
type: c.integrationType,
|
|
238046
|
+
action: "synced"
|
|
238047
|
+
}));
|
|
238048
|
+
if (stripeConnector) {
|
|
238049
|
+
results.push({
|
|
238050
|
+
type: STRIPE_CONNECTOR_TYPE,
|
|
238051
|
+
action: "error",
|
|
238052
|
+
error: "Stripe connector sync is not supported with a workspace API key. Run 'base44 connectors push' as a logged-in user."
|
|
238053
|
+
});
|
|
238054
|
+
}
|
|
238055
|
+
return results;
|
|
238056
|
+
}
|
|
237999
238057
|
async function syncOAuthConnectors(connectors) {
|
|
238000
238058
|
const results = [];
|
|
238001
238059
|
const upstream = await listConnectors();
|
|
@@ -246525,25 +246583,21 @@ async function deployAll(projectData, options) {
|
|
|
246525
246583
|
if (project.visibility) {
|
|
246526
246584
|
options?.onVisibilitySet?.(project.visibility);
|
|
246527
246585
|
}
|
|
246528
|
-
|
|
246529
|
-
syncResults.entities = await pushEntities(entities);
|
|
246586
|
+
await entityResource.push(entities);
|
|
246530
246587
|
await deployFunctionsSequentially(functions, {
|
|
246531
246588
|
onStart: options?.onFunctionStart,
|
|
246532
246589
|
onResult: options?.onFunctionResult
|
|
246533
246590
|
});
|
|
246534
|
-
|
|
246535
|
-
|
|
246536
|
-
syncResults.agents = await pushAgents(agents);
|
|
246537
|
-
}
|
|
246591
|
+
await agentSkillResource.push(agentSkills);
|
|
246592
|
+
await agentResource.push(agents);
|
|
246538
246593
|
await authConfigResource.push(authConfig);
|
|
246539
|
-
const
|
|
246540
|
-
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
246594
|
+
const connectorResults = (await pushConnectors(connectors)).results;
|
|
246541
246595
|
if (project.site?.outputDirectory) {
|
|
246542
246596
|
const outputDir = resolve5(project.root, project.site.outputDirectory);
|
|
246543
246597
|
const { appUrl } = await deploySite(outputDir);
|
|
246544
|
-
return { appUrl, connectorResults
|
|
246598
|
+
return { appUrl, connectorResults };
|
|
246545
246599
|
}
|
|
246546
|
-
return { connectorResults
|
|
246600
|
+
return { connectorResults };
|
|
246547
246601
|
}
|
|
246548
246602
|
// src/core/clients/base44-client.ts
|
|
246549
246603
|
var retriedRequests = new WeakSet;
|
|
@@ -247407,21 +247461,8 @@ function getAgentsPullCommand() {
|
|
|
247407
247461
|
}
|
|
247408
247462
|
|
|
247409
247463
|
// src/cli/commands/agents/push.ts
|
|
247410
|
-
|
|
247411
|
-
|
|
247412
|
-
const { project, agents } = await readProjectConfig();
|
|
247413
|
-
if (agents.length === 0) {
|
|
247414
|
-
const agentsDir = join20(dirname13(project.configPath), project.agentsDir);
|
|
247415
|
-
if (!await pathExists(agentsDir)) {
|
|
247416
|
-
throw new InvalidInputError(`No agents directory found at "${project.agentsDir}"`, {
|
|
247417
|
-
hints: [
|
|
247418
|
-
{
|
|
247419
|
-
message: `Run 'base44 agents pull' to fetch the app's agents, or create an empty "${project.agentsDir}" directory to confirm you want every remote agent deleted`
|
|
247420
|
-
}
|
|
247421
|
-
]
|
|
247422
|
-
});
|
|
247423
|
-
}
|
|
247424
|
-
}
|
|
247464
|
+
async function pushAgentsAction({ isNonInteractive, log, runTask }, options) {
|
|
247465
|
+
const { agents } = await readProjectConfig();
|
|
247425
247466
|
log.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
247426
247467
|
const proceed = await confirmPush({
|
|
247427
247468
|
isNonInteractive,
|
|
@@ -247447,12 +247488,6 @@ async function pushAgentsAction({ isNonInteractive, jsonMode, log, runTask }, op
|
|
|
247447
247488
|
if (result.deleted.length > 0) {
|
|
247448
247489
|
log.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
247449
247490
|
}
|
|
247450
|
-
if (jsonMode) {
|
|
247451
|
-
return {
|
|
247452
|
-
outroMessage: "Agents pushed to Base44",
|
|
247453
|
-
stdout: toJsonStdout(result)
|
|
247454
|
-
};
|
|
247455
|
-
}
|
|
247456
247491
|
return { outroMessage: "Agents pushed to Base44" };
|
|
247457
247492
|
}
|
|
247458
247493
|
function getAgentsPushCommand() {
|
|
@@ -247465,12 +247500,12 @@ function getAgentsCommand() {
|
|
|
247465
247500
|
}
|
|
247466
247501
|
|
|
247467
247502
|
// src/cli/commands/auth/password-login.ts
|
|
247468
|
-
import { dirname as
|
|
247503
|
+
import { dirname as dirname13, join as join20 } from "node:path";
|
|
247469
247504
|
async function passwordLoginAction({ log, runTask }, action) {
|
|
247470
247505
|
const shouldEnable = action === "enable";
|
|
247471
247506
|
const { project } = await readProjectConfig();
|
|
247472
|
-
const configDir =
|
|
247473
|
-
const authDir =
|
|
247507
|
+
const configDir = dirname13(project.configPath);
|
|
247508
|
+
const authDir = join20(configDir, project.authDir);
|
|
247474
247509
|
const updated = await runTask("Updating local auth config", async () => {
|
|
247475
247510
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
247476
247511
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -247490,14 +247525,14 @@ function getPasswordLoginCommand() {
|
|
|
247490
247525
|
}
|
|
247491
247526
|
|
|
247492
247527
|
// src/cli/commands/auth/pull.ts
|
|
247493
|
-
import { dirname as
|
|
247528
|
+
import { dirname as dirname14, join as join21 } from "node:path";
|
|
247494
247529
|
async function pullAuthAction({
|
|
247495
247530
|
log,
|
|
247496
247531
|
runTask
|
|
247497
247532
|
}) {
|
|
247498
247533
|
const { project } = await readProjectConfig();
|
|
247499
|
-
const configDir =
|
|
247500
|
-
const authDir =
|
|
247534
|
+
const configDir = dirname14(project.configPath);
|
|
247535
|
+
const authDir = join21(configDir, project.authDir);
|
|
247501
247536
|
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
247502
247537
|
return await pullAuthConfig();
|
|
247503
247538
|
}, {
|
|
@@ -247561,7 +247596,7 @@ function getAuthPushCommand() {
|
|
|
247561
247596
|
}
|
|
247562
247597
|
|
|
247563
247598
|
// src/cli/commands/auth/social-login.ts
|
|
247564
|
-
import { dirname as
|
|
247599
|
+
import { dirname as dirname15, join as join22, resolve as resolve6 } from "node:path";
|
|
247565
247600
|
var PROVIDER_LABELS = {
|
|
247566
247601
|
google: "Google",
|
|
247567
247602
|
microsoft: "Microsoft",
|
|
@@ -247631,8 +247666,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
|
|
|
247631
247666
|
}
|
|
247632
247667
|
}
|
|
247633
247668
|
const { project } = await readProjectConfig();
|
|
247634
|
-
const configDir =
|
|
247635
|
-
const authDir =
|
|
247669
|
+
const configDir = dirname15(project.configPath);
|
|
247670
|
+
const authDir = join22(configDir, project.authDir);
|
|
247636
247671
|
const { config: updated } = await runTask("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
247637
247672
|
if (clientSecret) {
|
|
247638
247673
|
await runTask("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -247657,7 +247692,7 @@ function getSocialLoginCommand() {
|
|
|
247657
247692
|
}
|
|
247658
247693
|
|
|
247659
247694
|
// src/cli/commands/auth/sso.ts
|
|
247660
|
-
import { dirname as
|
|
247695
|
+
import { dirname as dirname16, join as join23, resolve as resolve7 } from "node:path";
|
|
247661
247696
|
var SSOConfigFileSchema = object({
|
|
247662
247697
|
provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
247663
247698
|
clientId: string2(),
|
|
@@ -247820,8 +247855,8 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
|
|
|
247820
247855
|
throw error;
|
|
247821
247856
|
}
|
|
247822
247857
|
const { project } = await readProjectConfig();
|
|
247823
|
-
const configDir =
|
|
247824
|
-
const authDir =
|
|
247858
|
+
const configDir = dirname16(project.configPath);
|
|
247859
|
+
const authDir = join23(configDir, project.authDir);
|
|
247825
247860
|
await runTask("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
247826
247861
|
await runTask("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
247827
247862
|
return {
|
|
@@ -247836,8 +247871,8 @@ async function ssoDisableAction({ log, runTask }, options) {
|
|
|
247836
247871
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
247837
247872
|
}
|
|
247838
247873
|
const { project } = await readProjectConfig();
|
|
247839
|
-
const configDir =
|
|
247840
|
-
const authDir =
|
|
247874
|
+
const configDir = dirname16(project.configPath);
|
|
247875
|
+
const authDir = join23(configDir, project.authDir);
|
|
247841
247876
|
const updated = await runTask("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
247842
247877
|
await runTask("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
247843
247878
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -248694,13 +248729,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
248694
248729
|
}
|
|
248695
248730
|
|
|
248696
248731
|
// src/cli/commands/connectors/pull.ts
|
|
248697
|
-
import { dirname as
|
|
248732
|
+
import { dirname as dirname17, join as join24, resolve as resolve8 } from "node:path";
|
|
248698
248733
|
async function resolveConnectorsDir(options) {
|
|
248699
248734
|
if (!getAppContext().projectRoot) {
|
|
248700
248735
|
return resolve8(options.dir ?? "connectors");
|
|
248701
248736
|
}
|
|
248702
248737
|
const { project } = await readProjectConfig();
|
|
248703
|
-
return
|
|
248738
|
+
return join24(dirname17(project.configPath), project.connectorsDir);
|
|
248704
248739
|
}
|
|
248705
248740
|
async function pullConnectorsAction({ log, runTask, jsonMode }, options) {
|
|
248706
248741
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -249108,11 +249143,11 @@ function getListCommand() {
|
|
|
249108
249143
|
}
|
|
249109
249144
|
|
|
249110
249145
|
// src/cli/commands/functions/pull.ts
|
|
249111
|
-
import { dirname as
|
|
249146
|
+
import { dirname as dirname18, join as join25 } from "node:path";
|
|
249112
249147
|
async function pullFunctionsAction({ log, runTask }, name) {
|
|
249113
249148
|
const { project, functions } = await readProjectConfig();
|
|
249114
|
-
const configDir =
|
|
249115
|
-
const functionsDir =
|
|
249149
|
+
const configDir = dirname18(project.configPath);
|
|
249150
|
+
const functionsDir = join25(configDir, project.functionsDir);
|
|
249116
249151
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
249117
249152
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
249118
249153
|
const { functions } = await listDeployedFunctions();
|
|
@@ -249238,7 +249273,7 @@ import { basename as basename5, resolve as resolve10 } from "node:path";
|
|
|
249238
249273
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
249239
249274
|
|
|
249240
249275
|
// src/cli/commands/project/scaffold-shared.ts
|
|
249241
|
-
import { join as
|
|
249276
|
+
import { join as join26 } from "node:path";
|
|
249242
249277
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
249243
249278
|
async function getTemplateById(templateId) {
|
|
249244
249279
|
const templates = await listTemplates();
|
|
@@ -249301,7 +249336,7 @@ async function completeProjectSetup({
|
|
|
249301
249336
|
env: { VITE_BASE44_APP_ID: projectId }
|
|
249302
249337
|
})`${buildCommand}`;
|
|
249303
249338
|
updateMessage("Deploying site...");
|
|
249304
|
-
return await deploySite(
|
|
249339
|
+
return await deploySite(join26(resolvedPath, outputDirectory));
|
|
249305
249340
|
}, {
|
|
249306
249341
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
249307
249342
|
errorMessage: "Failed to deploy site"
|
|
@@ -249516,15 +249551,7 @@ async function deployAction(ctx, options = {}) {
|
|
|
249516
249551
|
outroMessage: "No resources found to deploy"
|
|
249517
249552
|
};
|
|
249518
249553
|
}
|
|
249519
|
-
const {
|
|
249520
|
-
project,
|
|
249521
|
-
entities,
|
|
249522
|
-
functions,
|
|
249523
|
-
agents,
|
|
249524
|
-
agentSkills,
|
|
249525
|
-
connectors,
|
|
249526
|
-
authConfig
|
|
249527
|
-
} = projectData;
|
|
249554
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
249528
249555
|
const summaryLines = [];
|
|
249529
249556
|
if (entities.length > 0) {
|
|
249530
249557
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -249547,19 +249574,10 @@ async function deployAction(ctx, options = {}) {
|
|
|
249547
249574
|
if (project.site?.outputDirectory) {
|
|
249548
249575
|
summaryLines.push(` - Site from ${project.site.outputDirectory}`);
|
|
249549
249576
|
}
|
|
249550
|
-
const fullSyncLabels = [
|
|
249551
|
-
entities.length > 0 && "entities",
|
|
249552
|
-
agents.length > 0 && "agents",
|
|
249553
|
-
agentSkills.length > 0 && "agent skills"
|
|
249554
|
-
].filter((label) => typeof label === "string");
|
|
249555
|
-
const destructiveWarning = fullSyncLabels.length > 0 ? `This is a full sync: ${formatList(fullSyncLabels)} that exist in your app but not locally will be DELETED.` : undefined;
|
|
249556
249577
|
if (!options.yes) {
|
|
249557
249578
|
log.warn(`This will update your Base44 app with:
|
|
249558
249579
|
${summaryLines.join(`
|
|
249559
249580
|
`)}`);
|
|
249560
|
-
if (destructiveWarning) {
|
|
249561
|
-
log.warn(destructiveWarning);
|
|
249562
|
-
}
|
|
249563
249581
|
const shouldDeploy = await Re({
|
|
249564
249582
|
message: "Are you sure you want to continue?"
|
|
249565
249583
|
});
|
|
@@ -249570,9 +249588,6 @@ ${summaryLines.join(`
|
|
|
249570
249588
|
log.info(`Deploying:
|
|
249571
249589
|
${summaryLines.join(`
|
|
249572
249590
|
`)}`);
|
|
249573
|
-
if (destructiveWarning) {
|
|
249574
|
-
log.warn(destructiveWarning);
|
|
249575
|
-
}
|
|
249576
249591
|
}
|
|
249577
249592
|
await maybeBuildBeforeDeploy(ctx, project, options.build);
|
|
249578
249593
|
let functionCompleted = 0;
|
|
@@ -249590,7 +249605,6 @@ ${summaryLines.join(`
|
|
|
249590
249605
|
formatDeployResult(r, log);
|
|
249591
249606
|
}
|
|
249592
249607
|
});
|
|
249593
|
-
reportSyncResults(result.syncResults, log);
|
|
249594
249608
|
const connectorResults = result.connectorResults ?? [];
|
|
249595
249609
|
await handleOAuthConnectors(connectorResults, isNonInteractive, options, log);
|
|
249596
249610
|
const stripeResult = connectorResults.find((r) => r.type === "stripe");
|
|
@@ -249601,45 +249615,8 @@ ${summaryLines.join(`
|
|
|
249601
249615
|
if (result.appUrl) {
|
|
249602
249616
|
log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
|
|
249603
249617
|
}
|
|
249604
|
-
if (ctx.jsonMode) {
|
|
249605
|
-
return {
|
|
249606
|
-
outroMessage: "App deployed successfully",
|
|
249607
|
-
stdout: toJsonStdout({
|
|
249608
|
-
appUrl: result.appUrl,
|
|
249609
|
-
sync: result.syncResults
|
|
249610
|
-
})
|
|
249611
|
-
};
|
|
249612
|
-
}
|
|
249613
249618
|
return { outroMessage: "App deployed successfully" };
|
|
249614
249619
|
}
|
|
249615
|
-
function formatList(items) {
|
|
249616
|
-
if (items.length <= 1) {
|
|
249617
|
-
return items.join("");
|
|
249618
|
-
}
|
|
249619
|
-
return `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
249620
|
-
}
|
|
249621
|
-
var SYNC_RESULT_LABELS = {
|
|
249622
|
-
entities: "Entities",
|
|
249623
|
-
agentSkills: "Agent skills",
|
|
249624
|
-
agents: "Agents"
|
|
249625
|
-
};
|
|
249626
|
-
function reportSyncResults(syncResults, log) {
|
|
249627
|
-
for (const [key, label] of Object.entries(SYNC_RESULT_LABELS)) {
|
|
249628
|
-
const outcome = syncResults[key];
|
|
249629
|
-
if (!outcome) {
|
|
249630
|
-
continue;
|
|
249631
|
-
}
|
|
249632
|
-
if (outcome.created.length > 0) {
|
|
249633
|
-
log.success(`${label} created: ${outcome.created.join(", ")}`);
|
|
249634
|
-
}
|
|
249635
|
-
if (outcome.updated.length > 0) {
|
|
249636
|
-
log.success(`${label} updated: ${outcome.updated.join(", ")}`);
|
|
249637
|
-
}
|
|
249638
|
-
if (outcome.deleted.length > 0) {
|
|
249639
|
-
log.warn(`${label} deleted: ${outcome.deleted.join(", ")}`);
|
|
249640
|
-
}
|
|
249641
|
-
}
|
|
249642
|
-
}
|
|
249643
249620
|
function getDeployCommand2() {
|
|
249644
249621
|
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction);
|
|
249645
249622
|
}
|
|
@@ -250810,10 +250787,10 @@ function toPascalCase(name) {
|
|
|
250810
250787
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
250811
250788
|
}
|
|
250812
250789
|
// src/core/types/update-project.ts
|
|
250813
|
-
import { join as
|
|
250790
|
+
import { join as join29 } from "node:path";
|
|
250814
250791
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
250815
250792
|
async function updateProjectConfig(projectRoot) {
|
|
250816
|
-
const tsconfigPath =
|
|
250793
|
+
const tsconfigPath = join29(projectRoot, "tsconfig.json");
|
|
250817
250794
|
if (!await pathExists(tsconfigPath)) {
|
|
250818
250795
|
return false;
|
|
250819
250796
|
}
|
|
@@ -251277,7 +251254,7 @@ function createDevLogger(label, labelColor = theme.styles.dim) {
|
|
|
251277
251254
|
// src/cli/dev/dev-server/main.ts
|
|
251278
251255
|
var import_cors = __toESM(require_lib4(), 1);
|
|
251279
251256
|
var import_express6 = __toESM(require_express(), 1);
|
|
251280
|
-
import { dirname as
|
|
251257
|
+
import { dirname as dirname24, join as join35 } from "node:path";
|
|
251281
251258
|
|
|
251282
251259
|
// ../../node_modules/get-port/index.js
|
|
251283
251260
|
import net from "node:net";
|
|
@@ -251407,7 +251384,7 @@ var $tmpName = promisify11(tmp.tmpName);
|
|
|
251407
251384
|
|
|
251408
251385
|
// src/cli/dev/dev-server/function-manager.ts
|
|
251409
251386
|
import { spawn as spawn2 } from "node:child_process";
|
|
251410
|
-
import { dirname as
|
|
251387
|
+
import { dirname as dirname21, join as join30 } from "node:path";
|
|
251411
251388
|
import { pathToFileURL } from "node:url";
|
|
251412
251389
|
|
|
251413
251390
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -251512,7 +251489,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
251512
251489
|
}
|
|
251513
251490
|
spawnFunction(func, port) {
|
|
251514
251491
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
251515
|
-
const importMapPath =
|
|
251492
|
+
const importMapPath = join30(dirname21(this.wrapperPath), "import-map.json");
|
|
251516
251493
|
const process2 = spawn2("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
251517
251494
|
env: {
|
|
251518
251495
|
...globalThis.process.env,
|
|
@@ -251586,7 +251563,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
251586
251563
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
251587
251564
|
import { isBuiltin } from "node:module";
|
|
251588
251565
|
import { homedir as homedir3 } from "node:os";
|
|
251589
|
-
import { join as
|
|
251566
|
+
import { join as join31 } from "node:path";
|
|
251590
251567
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
251591
251568
|
var depsPromise;
|
|
251592
251569
|
function loadDeps() {
|
|
@@ -251707,9 +251684,9 @@ export default {
|
|
|
251707
251684
|
};
|
|
251708
251685
|
`;
|
|
251709
251686
|
function ensureBundlerConfig() {
|
|
251710
|
-
const dir =
|
|
251687
|
+
const dir = join31(homedir3(), ".base44", "function-bundler");
|
|
251711
251688
|
mkdirSync2(dir, { recursive: true });
|
|
251712
|
-
const configPath =
|
|
251689
|
+
const configPath = join31(dir, "deno.json");
|
|
251713
251690
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
251714
251691
|
`);
|
|
251715
251692
|
return configPath;
|
|
@@ -254971,8 +254948,8 @@ async function createDevServer(options) {
|
|
|
254971
254948
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
254972
254949
|
};
|
|
254973
254950
|
const base44ConfigWatcher = new WatchBase44({
|
|
254974
|
-
functions:
|
|
254975
|
-
entities:
|
|
254951
|
+
functions: join35(dirname24(project.configPath), project.functionsDir),
|
|
254952
|
+
entities: join35(dirname24(project.configPath), project.entitiesDir)
|
|
254976
254953
|
}, devLogger);
|
|
254977
254954
|
base44ConfigWatcher.on("change", async (name) => {
|
|
254978
254955
|
try {
|
|
@@ -255527,7 +255504,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
255527
255504
|
import { release, type } from "node:os";
|
|
255528
255505
|
|
|
255529
255506
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
255530
|
-
import { dirname as
|
|
255507
|
+
import { dirname as dirname25, posix, sep as sep2 } from "path";
|
|
255531
255508
|
function createModulerModifier() {
|
|
255532
255509
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
255533
255510
|
return async (frames) => {
|
|
@@ -255536,7 +255513,7 @@ function createModulerModifier() {
|
|
|
255536
255513
|
return frames;
|
|
255537
255514
|
};
|
|
255538
255515
|
}
|
|
255539
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
255516
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname25(process.argv[1]) : process.cwd(), isWindows = sep2 === "\\") {
|
|
255540
255517
|
const normalizedBase = isWindows ? normalizeWindowsPath2(basePath) : basePath;
|
|
255541
255518
|
return (filename) => {
|
|
255542
255519
|
if (!filename)
|
|
@@ -259525,9 +259502,9 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
259525
259502
|
});
|
|
259526
259503
|
}
|
|
259527
259504
|
// src/cli/index.ts
|
|
259528
|
-
var __dirname4 =
|
|
259505
|
+
var __dirname4 = dirname26(fileURLToPath6(import.meta.url));
|
|
259529
259506
|
async function runCLI(options) {
|
|
259530
|
-
ensureNpmAssets(
|
|
259507
|
+
ensureNpmAssets(join36(__dirname4, "../assets"));
|
|
259531
259508
|
const errorReporter = new ErrorReporter;
|
|
259532
259509
|
errorReporter.registerProcessErrorHandlers();
|
|
259533
259510
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -259566,4 +259543,4 @@ export {
|
|
|
259566
259543
|
runCLI
|
|
259567
259544
|
};
|
|
259568
259545
|
|
|
259569
|
-
//# debugId=
|
|
259546
|
+
//# debugId=9AED7D92AE6BAB4764756E2164756E21
|