@base44-preview/cli 0.0.31-pr.211.25a2296 → 0.0.31-pr.214.25a02b0
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 +187 -131
- package/dist/cli/index.js.map +9 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -17446,7 +17446,7 @@ var require_lodash2 = __commonJS((exports, module) => {
|
|
|
17446
17446
|
}
|
|
17447
17447
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
17448
17448
|
});
|
|
17449
|
-
function
|
|
17449
|
+
function join12(array2, separator) {
|
|
17450
17450
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
17451
17451
|
}
|
|
17452
17452
|
function last(array2) {
|
|
@@ -19378,7 +19378,7 @@ __p += '`;
|
|
|
19378
19378
|
lodash.isUndefined = isUndefined;
|
|
19379
19379
|
lodash.isWeakMap = isWeakMap;
|
|
19380
19380
|
lodash.isWeakSet = isWeakSet;
|
|
19381
|
-
lodash.join =
|
|
19381
|
+
lodash.join = join12;
|
|
19382
19382
|
lodash.kebabCase = kebabCase2;
|
|
19383
19383
|
lodash.last = last;
|
|
19384
19384
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -20007,7 +20007,7 @@ function cleanDoc(doc2) {
|
|
|
20007
20007
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
20008
20008
|
}
|
|
20009
20009
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
20010
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
20010
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join12(replacement, currentDoc.split(`
|
|
20011
20011
|
`)) : currentDoc);
|
|
20012
20012
|
}
|
|
20013
20013
|
function canBreakFn(doc2) {
|
|
@@ -20087,7 +20087,7 @@ function indentIfBreak(contents, options) {
|
|
|
20087
20087
|
negate: options.negate
|
|
20088
20088
|
};
|
|
20089
20089
|
}
|
|
20090
|
-
function
|
|
20090
|
+
function join12(separator, docs) {
|
|
20091
20091
|
assertDoc(separator);
|
|
20092
20092
|
assertDocArray(docs);
|
|
20093
20093
|
const parts = [];
|
|
@@ -20798,7 +20798,7 @@ var init_doc = __esm(() => {
|
|
|
20798
20798
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
20799
20799
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
20800
20800
|
builders = {
|
|
20801
|
-
join:
|
|
20801
|
+
join: join12,
|
|
20802
20802
|
line,
|
|
20803
20803
|
softline,
|
|
20804
20804
|
hardline,
|
|
@@ -125712,7 +125712,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
125712
125712
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
125713
125713
|
}
|
|
125714
125714
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
125715
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
125715
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join14(replacement, currentDoc.split(`
|
|
125716
125716
|
`)) : currentDoc);
|
|
125717
125717
|
}
|
|
125718
125718
|
function canBreakFn2(doc2) {
|
|
@@ -125798,7 +125798,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
125798
125798
|
negate: options8.negate
|
|
125799
125799
|
};
|
|
125800
125800
|
}
|
|
125801
|
-
function
|
|
125801
|
+
function join14(separator, docs) {
|
|
125802
125802
|
assertDoc2(separator);
|
|
125803
125803
|
assertDocArray2(docs);
|
|
125804
125804
|
const parts = [];
|
|
@@ -126463,7 +126463,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
126463
126463
|
}
|
|
126464
126464
|
}
|
|
126465
126465
|
var builders2 = {
|
|
126466
|
-
join:
|
|
126466
|
+
join: join14,
|
|
126467
126467
|
line: line3,
|
|
126468
126468
|
softline: softline2,
|
|
126469
126469
|
hardline: hardline4,
|
|
@@ -155678,10 +155678,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155678
155678
|
var debug = require_src4()("express:view");
|
|
155679
155679
|
var path18 = __require("node:path");
|
|
155680
155680
|
var fs28 = __require("node:fs");
|
|
155681
|
-
var
|
|
155681
|
+
var dirname11 = path18.dirname;
|
|
155682
155682
|
var basename4 = path18.basename;
|
|
155683
155683
|
var extname2 = path18.extname;
|
|
155684
|
-
var
|
|
155684
|
+
var join15 = path18.join;
|
|
155685
155685
|
var resolve5 = path18.resolve;
|
|
155686
155686
|
module.exports = View;
|
|
155687
155687
|
function View(name2, options8) {
|
|
@@ -155717,7 +155717,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155717
155717
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
155718
155718
|
var root2 = roots[i5];
|
|
155719
155719
|
var loc = resolve5(root2, name2);
|
|
155720
|
-
var dir =
|
|
155720
|
+
var dir = dirname11(loc);
|
|
155721
155721
|
var file2 = basename4(loc);
|
|
155722
155722
|
path19 = this.resolve(dir, file2);
|
|
155723
155723
|
}
|
|
@@ -155743,12 +155743,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155743
155743
|
};
|
|
155744
155744
|
View.prototype.resolve = function resolve6(dir, file2) {
|
|
155745
155745
|
var ext = this.ext;
|
|
155746
|
-
var path19 =
|
|
155746
|
+
var path19 = join15(dir, file2);
|
|
155747
155747
|
var stat2 = tryStat(path19);
|
|
155748
155748
|
if (stat2 && stat2.isFile()) {
|
|
155749
155749
|
return path19;
|
|
155750
155750
|
}
|
|
155751
|
-
path19 =
|
|
155751
|
+
path19 = join15(dir, basename4(file2, ext), "index" + ext);
|
|
155752
155752
|
stat2 = tryStat(path19);
|
|
155753
155753
|
if (stat2 && stat2.isFile()) {
|
|
155754
155754
|
return path19;
|
|
@@ -159443,7 +159443,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
159443
159443
|
var Stream2 = __require("stream");
|
|
159444
159444
|
var util2 = __require("util");
|
|
159445
159445
|
var extname2 = path18.extname;
|
|
159446
|
-
var
|
|
159446
|
+
var join15 = path18.join;
|
|
159447
159447
|
var normalize = path18.normalize;
|
|
159448
159448
|
var resolve5 = path18.resolve;
|
|
159449
159449
|
var sep = path18.sep;
|
|
@@ -159615,7 +159615,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
159615
159615
|
return res;
|
|
159616
159616
|
}
|
|
159617
159617
|
parts = path19.split(sep);
|
|
159618
|
-
path19 = normalize(
|
|
159618
|
+
path19 = normalize(join15(root2, path19));
|
|
159619
159619
|
} else {
|
|
159620
159620
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
159621
159621
|
debug('malicious path "%s"', path19);
|
|
@@ -159755,7 +159755,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
159755
159755
|
return self2.onStatError(err);
|
|
159756
159756
|
return self2.error(404);
|
|
159757
159757
|
}
|
|
159758
|
-
var p4 =
|
|
159758
|
+
var p4 = join15(path19, self2._index[i5]);
|
|
159759
159759
|
debug('stat "%s"', p4);
|
|
159760
159760
|
fs28.stat(p4, function(err2, stat2) {
|
|
159761
159761
|
if (err2)
|
|
@@ -162834,7 +162834,7 @@ var {
|
|
|
162834
162834
|
} = import__.default;
|
|
162835
162835
|
|
|
162836
162836
|
// src/cli/commands/agents/pull.ts
|
|
162837
|
-
import { dirname as dirname7, join as
|
|
162837
|
+
import { dirname as dirname7, join as join9 } from "node:path";
|
|
162838
162838
|
|
|
162839
162839
|
// node_modules/@clack/core/dist/index.mjs
|
|
162840
162840
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
@@ -184871,7 +184871,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
184871
184871
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
184872
184872
|
|
|
184873
184873
|
// src/core/project/config.ts
|
|
184874
|
-
import { dirname as dirname5, join as
|
|
184874
|
+
import { dirname as dirname5, join as join6 } from "node:path";
|
|
184875
184875
|
|
|
184876
184876
|
// src/core/resources/agent/schema.ts
|
|
184877
184877
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -185198,6 +185198,8 @@ async function removeConnector(integrationType) {
|
|
|
185198
185198
|
return result.data;
|
|
185199
185199
|
}
|
|
185200
185200
|
// src/core/resources/connector/config.ts
|
|
185201
|
+
import { join as join4 } from "node:path";
|
|
185202
|
+
import { isDeepStrictEqual } from "node:util";
|
|
185201
185203
|
async function readConnectorFile(connectorPath) {
|
|
185202
185204
|
const parsed = await readJsonFile(connectorPath);
|
|
185203
185205
|
const result = ConnectorResourceSchema.safeParse(parsed);
|
|
@@ -185206,7 +185208,7 @@ async function readConnectorFile(connectorPath) {
|
|
|
185206
185208
|
}
|
|
185207
185209
|
return result.data;
|
|
185208
185210
|
}
|
|
185209
|
-
async function
|
|
185211
|
+
async function readConnectorFiles(connectorsDir) {
|
|
185210
185212
|
if (!await pathExists(connectorsDir)) {
|
|
185211
185213
|
return [];
|
|
185212
185214
|
}
|
|
@@ -185214,24 +185216,58 @@ async function readAllConnectors(connectorsDir) {
|
|
|
185214
185216
|
cwd: connectorsDir,
|
|
185215
185217
|
absolute: true
|
|
185216
185218
|
});
|
|
185217
|
-
|
|
185218
|
-
|
|
185219
|
-
|
|
185219
|
+
return await Promise.all(files.map(async (filePath) => ({
|
|
185220
|
+
data: await readConnectorFile(filePath),
|
|
185221
|
+
filePath
|
|
185222
|
+
})));
|
|
185220
185223
|
}
|
|
185221
|
-
function
|
|
185222
|
-
const
|
|
185223
|
-
for (const
|
|
185224
|
-
if (
|
|
185225
|
-
throw new InvalidInputError(`Duplicate connector type "${
|
|
185224
|
+
function buildTypeToEntryMap(entries) {
|
|
185225
|
+
const typeToEntry = new Map;
|
|
185226
|
+
for (const entry of entries) {
|
|
185227
|
+
if (typeToEntry.has(entry.data.type)) {
|
|
185228
|
+
throw new InvalidInputError(`Duplicate connector type "${entry.data.type}"`, {
|
|
185226
185229
|
hints: [
|
|
185227
185230
|
{
|
|
185228
|
-
message: `Remove duplicate connectors with type "${
|
|
185231
|
+
message: `Remove duplicate connectors with type "${entry.data.type}" - only one connector per type is allowed`
|
|
185229
185232
|
}
|
|
185230
185233
|
]
|
|
185231
185234
|
});
|
|
185232
185235
|
}
|
|
185233
|
-
|
|
185236
|
+
typeToEntry.set(entry.data.type, entry);
|
|
185234
185237
|
}
|
|
185238
|
+
return typeToEntry;
|
|
185239
|
+
}
|
|
185240
|
+
async function readAllConnectors(connectorsDir) {
|
|
185241
|
+
const entries = await readConnectorFiles(connectorsDir);
|
|
185242
|
+
const typeToEntry = buildTypeToEntryMap(entries);
|
|
185243
|
+
return [...typeToEntry.values()].map((e2) => e2.data);
|
|
185244
|
+
}
|
|
185245
|
+
async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
185246
|
+
const entries = await readConnectorFiles(connectorsDir);
|
|
185247
|
+
const typeToEntry = buildTypeToEntryMap(entries);
|
|
185248
|
+
const newTypes = new Set(remoteConnectors.map((c) => c.integrationType));
|
|
185249
|
+
const deleted = [];
|
|
185250
|
+
for (const [type, entry] of typeToEntry) {
|
|
185251
|
+
if (!newTypes.has(type)) {
|
|
185252
|
+
await deleteFile(entry.filePath);
|
|
185253
|
+
deleted.push(type);
|
|
185254
|
+
}
|
|
185255
|
+
}
|
|
185256
|
+
const written = [];
|
|
185257
|
+
for (const connector of remoteConnectors) {
|
|
185258
|
+
const existing = typeToEntry.get(connector.integrationType);
|
|
185259
|
+
const localConnector = {
|
|
185260
|
+
type: connector.integrationType,
|
|
185261
|
+
scopes: connector.scopes
|
|
185262
|
+
};
|
|
185263
|
+
if (existing && isDeepStrictEqual(existing.data, localConnector)) {
|
|
185264
|
+
continue;
|
|
185265
|
+
}
|
|
185266
|
+
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.integrationType}.${CONFIG_FILE_EXTENSION}`);
|
|
185267
|
+
await writeJsonFile(filePath, localConnector);
|
|
185268
|
+
written.push(connector.integrationType);
|
|
185269
|
+
}
|
|
185270
|
+
return { written, deleted };
|
|
185235
185271
|
}
|
|
185236
185272
|
// src/core/resources/connector/push.ts
|
|
185237
185273
|
async function pushConnectors(connectors) {
|
|
@@ -185573,7 +185609,7 @@ async function deployFunctions(functions) {
|
|
|
185573
185609
|
return result.data;
|
|
185574
185610
|
}
|
|
185575
185611
|
// src/core/resources/function/config.ts
|
|
185576
|
-
import { dirname as dirname4, join as
|
|
185612
|
+
import { dirname as dirname4, join as join5 } from "node:path";
|
|
185577
185613
|
async function readFunctionConfig(configPath) {
|
|
185578
185614
|
const parsed = await readJsonFile(configPath);
|
|
185579
185615
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -185585,7 +185621,7 @@ async function readFunctionConfig(configPath) {
|
|
|
185585
185621
|
async function readFunction(configPath) {
|
|
185586
185622
|
const config5 = await readFunctionConfig(configPath);
|
|
185587
185623
|
const functionDir = dirname4(configPath);
|
|
185588
|
-
const entryPath =
|
|
185624
|
+
const entryPath = join5(functionDir, config5.entry);
|
|
185589
185625
|
if (!await pathExists(entryPath)) {
|
|
185590
185626
|
throw new FileNotFoundError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`);
|
|
185591
185627
|
}
|
|
@@ -185674,10 +185710,10 @@ async function readProjectConfig(projectRoot) {
|
|
|
185674
185710
|
const project = result.data;
|
|
185675
185711
|
const configDir = dirname5(configPath);
|
|
185676
185712
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
185677
|
-
entityResource.readAll(
|
|
185678
|
-
functionResource.readAll(
|
|
185679
|
-
agentResource.readAll(
|
|
185680
|
-
connectorResource.readAll(
|
|
185713
|
+
entityResource.readAll(join6(configDir, project.entitiesDir)),
|
|
185714
|
+
functionResource.readAll(join6(configDir, project.functionsDir)),
|
|
185715
|
+
agentResource.readAll(join6(configDir, project.agentsDir)),
|
|
185716
|
+
connectorResource.readAll(join6(configDir, project.connectorsDir))
|
|
185681
185717
|
]);
|
|
185682
185718
|
return {
|
|
185683
185719
|
project: { ...project, root, configPath },
|
|
@@ -185774,7 +185810,7 @@ async function readAppConfig(projectRoot) {
|
|
|
185774
185810
|
// src/core/project/template.ts
|
|
185775
185811
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
185776
185812
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
185777
|
-
import { dirname as dirname6, join as
|
|
185813
|
+
import { dirname as dirname6, join as join7 } from "node:path";
|
|
185778
185814
|
async function listTemplates() {
|
|
185779
185815
|
const parsed = await readJsonFile(getTemplatesIndexPath());
|
|
185780
185816
|
const result = TemplatesConfigSchema.safeParse(parsed);
|
|
@@ -185784,23 +185820,23 @@ async function listTemplates() {
|
|
|
185784
185820
|
return result.data.templates;
|
|
185785
185821
|
}
|
|
185786
185822
|
async function renderTemplate(template, destPath, data) {
|
|
185787
|
-
const templateDir =
|
|
185823
|
+
const templateDir = join7(getTemplatesDir(), template.path);
|
|
185788
185824
|
const files = await globby("**/*", {
|
|
185789
185825
|
cwd: templateDir,
|
|
185790
185826
|
dot: true,
|
|
185791
185827
|
onlyFiles: true
|
|
185792
185828
|
});
|
|
185793
185829
|
for (const file2 of files) {
|
|
185794
|
-
const srcPath =
|
|
185830
|
+
const srcPath = join7(templateDir, file2);
|
|
185795
185831
|
try {
|
|
185796
185832
|
if (file2.endsWith(".ejs")) {
|
|
185797
185833
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
185798
185834
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
185799
|
-
const destFile = attributes.outputFileName ?
|
|
185800
|
-
const destFilePath =
|
|
185835
|
+
const destFile = attributes.outputFileName ? join7(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
185836
|
+
const destFilePath = join7(destPath, destFile);
|
|
185801
185837
|
await writeFile(destFilePath, body);
|
|
185802
185838
|
} else {
|
|
185803
|
-
const destFilePath =
|
|
185839
|
+
const destFilePath = join7(destPath, file2);
|
|
185804
185840
|
await copyFile(srcPath, destFilePath);
|
|
185805
185841
|
}
|
|
185806
185842
|
} catch (error48) {
|
|
@@ -185903,7 +185939,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
185903
185939
|
// src/core/site/deploy.ts
|
|
185904
185940
|
import { randomUUID } from "node:crypto";
|
|
185905
185941
|
import { tmpdir } from "node:os";
|
|
185906
|
-
import { join as
|
|
185942
|
+
import { join as join8 } from "node:path";
|
|
185907
185943
|
async function deploySite(siteOutputDir) {
|
|
185908
185944
|
if (!await pathExists(siteOutputDir)) {
|
|
185909
185945
|
throw new FileNotFoundError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -185920,7 +185956,7 @@ async function deploySite(siteOutputDir) {
|
|
|
185920
185956
|
]
|
|
185921
185957
|
});
|
|
185922
185958
|
}
|
|
185923
|
-
const archivePath =
|
|
185959
|
+
const archivePath = join8(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
185924
185960
|
try {
|
|
185925
185961
|
await createArchive(siteOutputDir, archivePath);
|
|
185926
185962
|
return await uploadSite(archivePath);
|
|
@@ -185937,26 +185973,24 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
185937
185973
|
}
|
|
185938
185974
|
// src/core/project/deploy.ts
|
|
185939
185975
|
function hasResourcesToDeploy(projectData) {
|
|
185940
|
-
const { project, entities, functions, agents
|
|
185976
|
+
const { project, entities, functions, agents } = projectData;
|
|
185941
185977
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
185942
185978
|
const hasEntities = entities.length > 0;
|
|
185943
185979
|
const hasFunctions = functions.length > 0;
|
|
185944
185980
|
const hasAgents = agents.length > 0;
|
|
185945
|
-
|
|
185946
|
-
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasSite;
|
|
185981
|
+
return hasEntities || hasFunctions || hasAgents || hasSite;
|
|
185947
185982
|
}
|
|
185948
185983
|
async function deployAll(projectData) {
|
|
185949
|
-
const { project, entities, functions, agents
|
|
185984
|
+
const { project, entities, functions, agents } = projectData;
|
|
185950
185985
|
await entityResource.push(entities);
|
|
185951
185986
|
await functionResource.push(functions);
|
|
185952
185987
|
await agentResource.push(agents);
|
|
185953
|
-
const { results: connectorResults } = await pushConnectors(connectors);
|
|
185954
185988
|
if (project.site?.outputDirectory) {
|
|
185955
185989
|
const outputDir = resolve(project.root, project.site.outputDirectory);
|
|
185956
185990
|
const { appUrl } = await deploySite(outputDir);
|
|
185957
|
-
return { appUrl
|
|
185991
|
+
return { appUrl };
|
|
185958
185992
|
}
|
|
185959
|
-
return {
|
|
185993
|
+
return {};
|
|
185960
185994
|
}
|
|
185961
185995
|
// src/core/clients/base44-client.ts
|
|
185962
185996
|
var retriedRequests = new WeakSet;
|
|
@@ -193598,7 +193632,7 @@ function getDashboardUrl(projectId) {
|
|
|
193598
193632
|
async function pullAgentsAction() {
|
|
193599
193633
|
const { project: project2 } = await readProjectConfig();
|
|
193600
193634
|
const configDir = dirname7(project2.configPath);
|
|
193601
|
-
const agentsDir =
|
|
193635
|
+
const agentsDir = join9(configDir, project2.agentsDir);
|
|
193602
193636
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
193603
193637
|
return await fetchAgents();
|
|
193604
193638
|
}, {
|
|
@@ -193691,6 +193725,43 @@ function getWhoamiCommand(context) {
|
|
|
193691
193725
|
});
|
|
193692
193726
|
}
|
|
193693
193727
|
|
|
193728
|
+
// src/cli/commands/connectors/pull.ts
|
|
193729
|
+
import { dirname as dirname8, join as join10 } from "node:path";
|
|
193730
|
+
async function pullConnectorsAction() {
|
|
193731
|
+
const { project: project2 } = await readProjectConfig();
|
|
193732
|
+
const configDir = dirname8(project2.configPath);
|
|
193733
|
+
const connectorsDir = join10(configDir, project2.connectorsDir);
|
|
193734
|
+
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
193735
|
+
return await listConnectors();
|
|
193736
|
+
}, {
|
|
193737
|
+
successMessage: "Connectors fetched successfully",
|
|
193738
|
+
errorMessage: "Failed to fetch connectors"
|
|
193739
|
+
});
|
|
193740
|
+
const { written, deleted } = await runTask("Syncing connector files", async () => {
|
|
193741
|
+
return await writeConnectors(connectorsDir, remoteConnectors.integrations);
|
|
193742
|
+
}, {
|
|
193743
|
+
successMessage: "Connector files synced successfully",
|
|
193744
|
+
errorMessage: "Failed to sync connector files"
|
|
193745
|
+
});
|
|
193746
|
+
if (written.length > 0) {
|
|
193747
|
+
M2.success(`Written: ${written.join(", ")}`);
|
|
193748
|
+
}
|
|
193749
|
+
if (deleted.length > 0) {
|
|
193750
|
+
M2.warn(`Deleted: ${deleted.join(", ")}`);
|
|
193751
|
+
}
|
|
193752
|
+
if (written.length === 0 && deleted.length === 0) {
|
|
193753
|
+
M2.info("All connectors are already up to date");
|
|
193754
|
+
}
|
|
193755
|
+
return {
|
|
193756
|
+
outroMessage: `Pulled ${remoteConnectors.integrations.length} connectors to ${connectorsDir}`
|
|
193757
|
+
};
|
|
193758
|
+
}
|
|
193759
|
+
function getConnectorsPullCommand(context) {
|
|
193760
|
+
return new Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(async () => {
|
|
193761
|
+
await runCommand(pullConnectorsAction, { requireAuth: true }, context);
|
|
193762
|
+
});
|
|
193763
|
+
}
|
|
193764
|
+
|
|
193694
193765
|
// node_modules/open/index.js
|
|
193695
193766
|
import process20 from "node:process";
|
|
193696
193767
|
import path16 from "node:path";
|
|
@@ -194297,59 +194368,10 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
|
194297
194368
|
}));
|
|
194298
194369
|
var open_default = open;
|
|
194299
194370
|
|
|
194300
|
-
// src/cli/commands/connectors/oauth-prompt.ts
|
|
194301
|
-
function filterPendingOAuth(results) {
|
|
194302
|
-
return results.filter((r2) => r2.action === "needs_oauth" && !!r2.redirectUrl && !!r2.connectionId);
|
|
194303
|
-
}
|
|
194304
|
-
async function promptOAuthFlows(pending, options) {
|
|
194305
|
-
const outcomes = new Map;
|
|
194306
|
-
if (pending.length === 0) {
|
|
194307
|
-
return outcomes;
|
|
194308
|
-
}
|
|
194309
|
-
M2.info("");
|
|
194310
|
-
M2.warn(`${pending.length} connector(s) require authorization in your browser:`);
|
|
194311
|
-
for (const connector2 of pending) {
|
|
194312
|
-
M2.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
|
|
194313
|
-
}
|
|
194314
|
-
if (options?.skipPrompt) {
|
|
194315
|
-
return outcomes;
|
|
194316
|
-
}
|
|
194317
|
-
const shouldAuth = await ye({
|
|
194318
|
-
message: "Open browser to authorize now?"
|
|
194319
|
-
});
|
|
194320
|
-
if (pD(shouldAuth) || !shouldAuth) {
|
|
194321
|
-
return outcomes;
|
|
194322
|
-
}
|
|
194323
|
-
for (const connector2 of pending) {
|
|
194324
|
-
M2.info(`
|
|
194325
|
-
Opening browser for ${connector2.type}...`);
|
|
194326
|
-
await open_default(connector2.redirectUrl);
|
|
194327
|
-
let finalStatus = "PENDING";
|
|
194328
|
-
await runTask(`Waiting for ${connector2.type} authorization...`, async () => {
|
|
194329
|
-
await pWaitFor(async () => {
|
|
194330
|
-
const response = await getOAuthStatus(connector2.type, connector2.connectionId);
|
|
194331
|
-
finalStatus = response.status;
|
|
194332
|
-
return response.status !== "PENDING";
|
|
194333
|
-
}, {
|
|
194334
|
-
interval: 2000,
|
|
194335
|
-
timeout: 2 * 60 * 1000
|
|
194336
|
-
});
|
|
194337
|
-
}, {
|
|
194338
|
-
successMessage: `${connector2.type} authorization complete`,
|
|
194339
|
-
errorMessage: `${connector2.type} authorization failed`
|
|
194340
|
-
}).catch((err) => {
|
|
194341
|
-
if (err instanceof TimeoutError2) {
|
|
194342
|
-
finalStatus = "PENDING";
|
|
194343
|
-
} else {
|
|
194344
|
-
throw err;
|
|
194345
|
-
}
|
|
194346
|
-
});
|
|
194347
|
-
outcomes.set(connector2.type, finalStatus);
|
|
194348
|
-
}
|
|
194349
|
-
return outcomes;
|
|
194350
|
-
}
|
|
194351
|
-
|
|
194352
194371
|
// src/cli/commands/connectors/push.ts
|
|
194372
|
+
function isPendingOAuth(r2) {
|
|
194373
|
+
return r2.action === "needs_oauth" && !!r2.redirectUrl && !!r2.connectionId;
|
|
194374
|
+
}
|
|
194353
194375
|
function printSummary(results, oauthOutcomes) {
|
|
194354
194376
|
const synced = [];
|
|
194355
194377
|
const added = [];
|
|
@@ -194401,13 +194423,59 @@ async function pushConnectorsAction() {
|
|
|
194401
194423
|
const { results } = await runTask("Pushing connectors to Base44", async () => {
|
|
194402
194424
|
return await pushConnectors(connectors);
|
|
194403
194425
|
});
|
|
194404
|
-
const
|
|
194426
|
+
const oauthOutcomes = new Map;
|
|
194427
|
+
const needsOAuth = results.filter(isPendingOAuth);
|
|
194405
194428
|
let outroMessage = "Connectors pushed to Base44";
|
|
194406
|
-
|
|
194407
|
-
|
|
194408
|
-
|
|
194409
|
-
|
|
194410
|
-
|
|
194429
|
+
if (needsOAuth.length === 0) {
|
|
194430
|
+
printSummary(results, oauthOutcomes);
|
|
194431
|
+
return { outroMessage };
|
|
194432
|
+
}
|
|
194433
|
+
M2.warn(`${needsOAuth.length} connector(s) require authorization in your browser:`);
|
|
194434
|
+
for (const connector2 of needsOAuth) {
|
|
194435
|
+
M2.info(` '${connector2.type}': ${theme.styles.dim(connector2.redirectUrl)}`);
|
|
194436
|
+
}
|
|
194437
|
+
const pending = needsOAuth.map((c3) => c3.type).join(", ");
|
|
194438
|
+
if (process.env.CI) {
|
|
194439
|
+
outroMessage = `Skipped OAuth in CI. Pending: ${pending}. Run 'base44 connectors push' locally to authorize.`;
|
|
194440
|
+
} else {
|
|
194441
|
+
const shouldAuth = await ye({
|
|
194442
|
+
message: "Open browser to authorize now?"
|
|
194443
|
+
});
|
|
194444
|
+
if (pD(shouldAuth) || !shouldAuth) {
|
|
194445
|
+
outroMessage = `Authorization skipped. Pending: ${pending}. Run 'base44 connectors push' again to complete.`;
|
|
194446
|
+
} else {
|
|
194447
|
+
for (const connector2 of needsOAuth) {
|
|
194448
|
+
try {
|
|
194449
|
+
M2.info(`
|
|
194450
|
+
Opening browser for '${connector2.type}'...`);
|
|
194451
|
+
await open_default(connector2.redirectUrl);
|
|
194452
|
+
let finalStatus = "PENDING";
|
|
194453
|
+
await runTask(`Waiting for '${connector2.type}' authorization...`, async () => {
|
|
194454
|
+
await pWaitFor(async () => {
|
|
194455
|
+
const response = await getOAuthStatus(connector2.type, connector2.connectionId);
|
|
194456
|
+
finalStatus = response.status;
|
|
194457
|
+
return response.status !== "PENDING";
|
|
194458
|
+
}, {
|
|
194459
|
+
interval: 2000,
|
|
194460
|
+
timeout: 2 * 60 * 1000
|
|
194461
|
+
});
|
|
194462
|
+
}, {
|
|
194463
|
+
successMessage: `'${connector2.type}' authorization complete`,
|
|
194464
|
+
errorMessage: `'${connector2.type}' authorization failed`
|
|
194465
|
+
}).catch((err) => {
|
|
194466
|
+
if (err instanceof TimeoutError2) {
|
|
194467
|
+
finalStatus = "PENDING";
|
|
194468
|
+
} else {
|
|
194469
|
+
throw err;
|
|
194470
|
+
}
|
|
194471
|
+
});
|
|
194472
|
+
oauthOutcomes.set(connector2.type, finalStatus);
|
|
194473
|
+
} catch (err) {
|
|
194474
|
+
M2.error(`Failed to authorize '${connector2.type}': ${err instanceof Error ? err.message : String(err)}`);
|
|
194475
|
+
oauthOutcomes.set(connector2.type, "FAILED");
|
|
194476
|
+
}
|
|
194477
|
+
}
|
|
194478
|
+
}
|
|
194411
194479
|
}
|
|
194412
194480
|
printSummary(results, oauthOutcomes);
|
|
194413
194481
|
return { outroMessage };
|
|
@@ -194420,7 +194488,7 @@ function getConnectorsPushCommand(context) {
|
|
|
194420
194488
|
|
|
194421
194489
|
// src/cli/commands/connectors/index.ts
|
|
194422
194490
|
function getConnectorsCommand(context) {
|
|
194423
|
-
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsPushCommand(context));
|
|
194491
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
194424
194492
|
}
|
|
194425
194493
|
|
|
194426
194494
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -194514,7 +194582,7 @@ function getFunctionsDeployCommand(context) {
|
|
|
194514
194582
|
}
|
|
194515
194583
|
|
|
194516
194584
|
// src/cli/commands/project/create.ts
|
|
194517
|
-
import { basename as basename3, join as
|
|
194585
|
+
import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
|
|
194518
194586
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
194519
194587
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
194520
194588
|
async function getTemplateById(templateId) {
|
|
@@ -194650,7 +194718,7 @@ async function executeCreate({
|
|
|
194650
194718
|
updateMessage("Building project...");
|
|
194651
194719
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
194652
194720
|
updateMessage("Deploying site...");
|
|
194653
|
-
return await deploySite(
|
|
194721
|
+
return await deploySite(join11(resolvedPath, outputDirectory));
|
|
194654
194722
|
}, {
|
|
194655
194723
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
194656
194724
|
errorMessage: "Failed to deploy site"
|
|
@@ -194698,7 +194766,7 @@ async function deployAction(options) {
|
|
|
194698
194766
|
outroMessage: "No resources found to deploy"
|
|
194699
194767
|
};
|
|
194700
194768
|
}
|
|
194701
|
-
const { project: project2, entities, functions, agents
|
|
194769
|
+
const { project: project2, entities, functions, agents } = projectData;
|
|
194702
194770
|
const summaryLines = [];
|
|
194703
194771
|
if (entities.length > 0) {
|
|
194704
194772
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -194709,9 +194777,6 @@ async function deployAction(options) {
|
|
|
194709
194777
|
if (agents.length > 0) {
|
|
194710
194778
|
summaryLines.push(` - ${agents.length} ${agents.length === 1 ? "agent" : "agents"}`);
|
|
194711
194779
|
}
|
|
194712
|
-
if (connectors.length > 0) {
|
|
194713
|
-
summaryLines.push(` - ${connectors.length} ${connectors.length === 1 ? "connector" : "connectors"}`);
|
|
194714
|
-
}
|
|
194715
194780
|
if (project2.site?.outputDirectory) {
|
|
194716
194781
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
194717
194782
|
}
|
|
@@ -194736,15 +194801,6 @@ ${summaryLines.join(`
|
|
|
194736
194801
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
194737
194802
|
errorMessage: "Deployment failed"
|
|
194738
194803
|
});
|
|
194739
|
-
const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
|
|
194740
|
-
if (needsOAuth.length > 0) {
|
|
194741
|
-
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
194742
|
-
skipPrompt: options.yes || !!process.env.CI
|
|
194743
|
-
});
|
|
194744
|
-
if (oauthOutcomes.size === 0) {
|
|
194745
|
-
M2.info("To authorize, run 'base44 connectors push' or open the links above in your browser.");
|
|
194746
|
-
}
|
|
194747
|
-
}
|
|
194748
194804
|
M2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
194749
194805
|
if (result.appUrl) {
|
|
194750
194806
|
M2.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
|
|
@@ -194752,7 +194808,7 @@ ${summaryLines.join(`
|
|
|
194752
194808
|
return { outroMessage: "App deployed successfully" };
|
|
194753
194809
|
}
|
|
194754
194810
|
function getDeployCommand(context) {
|
|
194755
|
-
return new Command("deploy").description("Deploy all project resources (entities, functions, agents,
|
|
194811
|
+
return new Command("deploy").description("Deploy all project resources (entities, functions, agents, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
194756
194812
|
await runCommand(() => deployAction(options), { requireAuth: true }, context);
|
|
194757
194813
|
});
|
|
194758
194814
|
}
|
|
@@ -195043,10 +195099,10 @@ function toPascalCase(name2) {
|
|
|
195043
195099
|
return name2.split(/[-_\s]+/).map((w9) => w9.charAt(0).toUpperCase() + w9.slice(1)).join("");
|
|
195044
195100
|
}
|
|
195045
195101
|
// src/core/types/update-project.ts
|
|
195046
|
-
import { join as
|
|
195102
|
+
import { join as join14 } from "node:path";
|
|
195047
195103
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
195048
195104
|
async function updateProjectConfig(projectRoot) {
|
|
195049
|
-
const tsconfigPath =
|
|
195105
|
+
const tsconfigPath = join14(projectRoot, "tsconfig.json");
|
|
195050
195106
|
if (!await pathExists(tsconfigPath)) {
|
|
195051
195107
|
return false;
|
|
195052
195108
|
}
|
|
@@ -195415,7 +195471,7 @@ function nanoid3(size = 21) {
|
|
|
195415
195471
|
}
|
|
195416
195472
|
|
|
195417
195473
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
195418
|
-
import { dirname as
|
|
195474
|
+
import { dirname as dirname11, posix, sep } from "path";
|
|
195419
195475
|
function createModulerModifier() {
|
|
195420
195476
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
195421
195477
|
return async (frames) => {
|
|
@@ -195424,7 +195480,7 @@ function createModulerModifier() {
|
|
|
195424
195480
|
return frames;
|
|
195425
195481
|
};
|
|
195426
195482
|
}
|
|
195427
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
195483
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname11(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
|
|
195428
195484
|
const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
|
|
195429
195485
|
return (filename) => {
|
|
195430
195486
|
if (!filename)
|
|
@@ -199643,4 +199699,4 @@ export {
|
|
|
199643
199699
|
CLIExitError
|
|
199644
199700
|
};
|
|
199645
199701
|
|
|
199646
|
-
//# debugId=
|
|
199702
|
+
//# debugId=3B15B2EE2CDAA1C064756E2164756E21
|