@base44-preview/cli 0.0.30-pr.211.eb36cd7 → 0.0.30-pr.214.355c0d7
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 +172 -107
- package/dist/cli/index.js.map +10 -10
- 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,
|
|
@@ -137148,7 +137148,7 @@ var {
|
|
|
137148
137148
|
} = import__.default;
|
|
137149
137149
|
|
|
137150
137150
|
// src/cli/commands/agents/pull.ts
|
|
137151
|
-
import { dirname as dirname7, join as
|
|
137151
|
+
import { dirname as dirname7, join as join9 } from "node:path";
|
|
137152
137152
|
|
|
137153
137153
|
// node_modules/@clack/core/dist/index.mjs
|
|
137154
137154
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
@@ -153650,7 +153650,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
153650
153650
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
153651
153651
|
|
|
153652
153652
|
// src/core/project/config.ts
|
|
153653
|
-
import { dirname as dirname4, join as
|
|
153653
|
+
import { dirname as dirname4, join as join5 } from "node:path";
|
|
153654
153654
|
|
|
153655
153655
|
// src/core/resources/agent/schema.ts
|
|
153656
153656
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -153911,6 +153911,9 @@ async function listConnectors() {
|
|
|
153911
153911
|
}
|
|
153912
153912
|
return result.data;
|
|
153913
153913
|
}
|
|
153914
|
+
async function fetchConnectors() {
|
|
153915
|
+
return await listConnectors();
|
|
153916
|
+
}
|
|
153914
153917
|
async function setConnector(integrationType, scopes) {
|
|
153915
153918
|
const appClient = getAppClient();
|
|
153916
153919
|
let response;
|
|
@@ -153963,6 +153966,8 @@ async function removeConnector(integrationType) {
|
|
|
153963
153966
|
return result.data;
|
|
153964
153967
|
}
|
|
153965
153968
|
// src/core/resources/connector/config.ts
|
|
153969
|
+
import { join as join3 } from "node:path";
|
|
153970
|
+
import { isDeepStrictEqual } from "node:util";
|
|
153966
153971
|
async function readConnectorFile(connectorPath) {
|
|
153967
153972
|
const parsed = await readJsonFile(connectorPath);
|
|
153968
153973
|
const result = ConnectorResourceSchema.safeParse(parsed);
|
|
@@ -153971,7 +153976,7 @@ async function readConnectorFile(connectorPath) {
|
|
|
153971
153976
|
}
|
|
153972
153977
|
return result.data;
|
|
153973
153978
|
}
|
|
153974
|
-
async function
|
|
153979
|
+
async function readConnectorFiles(connectorsDir) {
|
|
153975
153980
|
if (!await pathExists(connectorsDir)) {
|
|
153976
153981
|
return [];
|
|
153977
153982
|
}
|
|
@@ -153979,21 +153984,66 @@ async function readAllConnectors(connectorsDir) {
|
|
|
153979
153984
|
cwd: connectorsDir,
|
|
153980
153985
|
absolute: true
|
|
153981
153986
|
});
|
|
153982
|
-
|
|
153987
|
+
return await Promise.all(files.map(async (filePath) => ({
|
|
153988
|
+
data: await readConnectorFile(filePath),
|
|
153989
|
+
filePath
|
|
153990
|
+
})));
|
|
153991
|
+
}
|
|
153992
|
+
async function readAllConnectors(connectorsDir) {
|
|
153993
|
+
const entries = await readConnectorFiles(connectorsDir);
|
|
153983
153994
|
const types = new Set;
|
|
153984
|
-
for (const
|
|
153985
|
-
if (types.has(
|
|
153986
|
-
throw new InvalidInputError(`Duplicate connector type "${
|
|
153995
|
+
for (const { data } of entries) {
|
|
153996
|
+
if (types.has(data.type)) {
|
|
153997
|
+
throw new InvalidInputError(`Duplicate connector type "${data.type}"`, {
|
|
153998
|
+
hints: [
|
|
153999
|
+
{
|
|
154000
|
+
message: `Remove duplicate connectors with type "${data.type}" - only one connector per type is allowed`
|
|
154001
|
+
}
|
|
154002
|
+
]
|
|
154003
|
+
});
|
|
154004
|
+
}
|
|
154005
|
+
types.add(data.type);
|
|
154006
|
+
}
|
|
154007
|
+
return entries.map((e2) => e2.data);
|
|
154008
|
+
}
|
|
154009
|
+
async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
154010
|
+
const entries = await readConnectorFiles(connectorsDir);
|
|
154011
|
+
const typeToEntry = new Map;
|
|
154012
|
+
for (const entry of entries) {
|
|
154013
|
+
if (typeToEntry.has(entry.data.type)) {
|
|
154014
|
+
throw new InvalidInputError(`Duplicate connector type "${entry.data.type}"`, {
|
|
153987
154015
|
hints: [
|
|
153988
154016
|
{
|
|
153989
|
-
message: `Remove duplicate connectors with type "${
|
|
154017
|
+
message: `Remove duplicate connectors with type "${entry.data.type}" - only one connector per type is allowed`
|
|
153990
154018
|
}
|
|
153991
154019
|
]
|
|
153992
154020
|
});
|
|
153993
154021
|
}
|
|
153994
|
-
|
|
154022
|
+
typeToEntry.set(entry.data.type, entry);
|
|
154023
|
+
}
|
|
154024
|
+
const newTypes = new Set(remoteConnectors.map((c) => c.integration_type));
|
|
154025
|
+
const deleted = [];
|
|
154026
|
+
for (const [type, entry] of typeToEntry) {
|
|
154027
|
+
if (!newTypes.has(type)) {
|
|
154028
|
+
await deleteFile(entry.filePath);
|
|
154029
|
+
deleted.push(type);
|
|
154030
|
+
}
|
|
153995
154031
|
}
|
|
153996
|
-
|
|
154032
|
+
const written = [];
|
|
154033
|
+
for (const connector of remoteConnectors) {
|
|
154034
|
+
const existing = typeToEntry.get(connector.integration_type);
|
|
154035
|
+
const localConnector = {
|
|
154036
|
+
type: connector.integration_type,
|
|
154037
|
+
scopes: connector.scopes
|
|
154038
|
+
};
|
|
154039
|
+
if (existing && isDeepStrictEqual(existing.data, localConnector)) {
|
|
154040
|
+
continue;
|
|
154041
|
+
}
|
|
154042
|
+
const filePath = existing?.filePath ?? join3(connectorsDir, `${connector.integration_type}.${CONFIG_FILE_EXTENSION}`);
|
|
154043
|
+
await writeJsonFile(filePath, localConnector);
|
|
154044
|
+
written.push(connector.integration_type);
|
|
154045
|
+
}
|
|
154046
|
+
return { written, deleted };
|
|
153997
154047
|
}
|
|
153998
154048
|
// node_modules/open/index.js
|
|
153999
154049
|
import process11 from "node:process";
|
|
@@ -155059,7 +155109,7 @@ async function deployFunctions(functions) {
|
|
|
155059
155109
|
return result.data;
|
|
155060
155110
|
}
|
|
155061
155111
|
// src/core/resources/function/config.ts
|
|
155062
|
-
import { dirname as dirname3, join as
|
|
155112
|
+
import { dirname as dirname3, join as join4 } from "node:path";
|
|
155063
155113
|
async function readFunctionConfig(configPath) {
|
|
155064
155114
|
const parsed = await readJsonFile(configPath);
|
|
155065
155115
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -155071,7 +155121,7 @@ async function readFunctionConfig(configPath) {
|
|
|
155071
155121
|
async function readFunction(configPath) {
|
|
155072
155122
|
const config5 = await readFunctionConfig(configPath);
|
|
155073
155123
|
const functionDir = dirname3(configPath);
|
|
155074
|
-
const entryPath =
|
|
155124
|
+
const entryPath = join4(functionDir, config5.entry);
|
|
155075
155125
|
if (!await pathExists(entryPath)) {
|
|
155076
155126
|
throw new FileNotFoundError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`);
|
|
155077
155127
|
}
|
|
@@ -155160,10 +155210,10 @@ async function readProjectConfig(projectRoot) {
|
|
|
155160
155210
|
const project = result.data;
|
|
155161
155211
|
const configDir = dirname4(configPath);
|
|
155162
155212
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
155163
|
-
entityResource.readAll(
|
|
155164
|
-
functionResource.readAll(
|
|
155165
|
-
agentResource.readAll(
|
|
155166
|
-
connectorResource.readAll(
|
|
155213
|
+
entityResource.readAll(join5(configDir, project.entitiesDir)),
|
|
155214
|
+
functionResource.readAll(join5(configDir, project.functionsDir)),
|
|
155215
|
+
agentResource.readAll(join5(configDir, project.agentsDir)),
|
|
155216
|
+
connectorResource.readAll(join5(configDir, project.connectorsDir))
|
|
155167
155217
|
]);
|
|
155168
155218
|
return {
|
|
155169
155219
|
project: { ...project, root, configPath },
|
|
@@ -155260,7 +155310,7 @@ async function readAppConfig(projectRoot) {
|
|
|
155260
155310
|
// src/core/project/template.ts
|
|
155261
155311
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
155262
155312
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
155263
|
-
import { dirname as dirname5, join as
|
|
155313
|
+
import { dirname as dirname5, join as join6 } from "node:path";
|
|
155264
155314
|
async function listTemplates() {
|
|
155265
155315
|
const parsed = await readJsonFile(getTemplatesIndexPath());
|
|
155266
155316
|
const result = TemplatesConfigSchema.safeParse(parsed);
|
|
@@ -155270,23 +155320,23 @@ async function listTemplates() {
|
|
|
155270
155320
|
return result.data.templates;
|
|
155271
155321
|
}
|
|
155272
155322
|
async function renderTemplate(template, destPath, data) {
|
|
155273
|
-
const templateDir =
|
|
155323
|
+
const templateDir = join6(getTemplatesDir(), template.path);
|
|
155274
155324
|
const files = await globby("**/*", {
|
|
155275
155325
|
cwd: templateDir,
|
|
155276
155326
|
dot: true,
|
|
155277
155327
|
onlyFiles: true
|
|
155278
155328
|
});
|
|
155279
155329
|
for (const file2 of files) {
|
|
155280
|
-
const srcPath =
|
|
155330
|
+
const srcPath = join6(templateDir, file2);
|
|
155281
155331
|
try {
|
|
155282
155332
|
if (file2.endsWith(".ejs")) {
|
|
155283
155333
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
155284
155334
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
155285
|
-
const destFile = attributes.outputFileName ?
|
|
155286
|
-
const destFilePath =
|
|
155335
|
+
const destFile = attributes.outputFileName ? join6(dirname5(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
155336
|
+
const destFilePath = join6(destPath, destFile);
|
|
155287
155337
|
await writeFile(destFilePath, body);
|
|
155288
155338
|
} else {
|
|
155289
|
-
const destFilePath =
|
|
155339
|
+
const destFilePath = join6(destPath, file2);
|
|
155290
155340
|
await copyFile(srcPath, destFilePath);
|
|
155291
155341
|
}
|
|
155292
155342
|
} catch (error48) {
|
|
@@ -155376,7 +155426,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
155376
155426
|
// src/core/site/deploy.ts
|
|
155377
155427
|
import { randomUUID } from "node:crypto";
|
|
155378
155428
|
import { tmpdir } from "node:os";
|
|
155379
|
-
import { join as
|
|
155429
|
+
import { join as join8 } from "node:path";
|
|
155380
155430
|
|
|
155381
155431
|
// node_modules/@isaacs/fs-minipass/dist/esm/index.js
|
|
155382
155432
|
import EE from "events";
|
|
@@ -161141,7 +161191,7 @@ var mkdirSync = (dir, opt) => {
|
|
|
161141
161191
|
};
|
|
161142
161192
|
|
|
161143
161193
|
// node_modules/tar/dist/esm/path-reservations.js
|
|
161144
|
-
import { join as
|
|
161194
|
+
import { join as join7 } from "node:path";
|
|
161145
161195
|
|
|
161146
161196
|
// node_modules/tar/dist/esm/normalize-unicode.js
|
|
161147
161197
|
var normalizeCache = Object.create(null);
|
|
@@ -161174,7 +161224,7 @@ var getDirs = (path10) => {
|
|
|
161174
161224
|
const dirs = path10.split("/").slice(0, -1).reduce((set2, path11) => {
|
|
161175
161225
|
const s = set2[set2.length - 1];
|
|
161176
161226
|
if (s !== undefined) {
|
|
161177
|
-
path11 =
|
|
161227
|
+
path11 = join7(s, path11);
|
|
161178
161228
|
}
|
|
161179
161229
|
set2.push(path11 || "/");
|
|
161180
161230
|
return set2;
|
|
@@ -161188,7 +161238,7 @@ class PathReservations {
|
|
|
161188
161238
|
#running = new Set;
|
|
161189
161239
|
reserve(paths, fn) {
|
|
161190
161240
|
paths = isWindows2 ? ["win32 parallelization disabled"] : paths.map((p2) => {
|
|
161191
|
-
return stripTrailingSlashes(
|
|
161241
|
+
return stripTrailingSlashes(join7(normalizeUnicode(p2)));
|
|
161192
161242
|
});
|
|
161193
161243
|
const dirs = new Set(paths.map((path10) => getDirs(path10)).reduce((a, b3) => a.concat(b3)));
|
|
161194
161244
|
this.#reservations.set(fn, { dirs, paths });
|
|
@@ -162223,7 +162273,7 @@ async function deploySite(siteOutputDir) {
|
|
|
162223
162273
|
]
|
|
162224
162274
|
});
|
|
162225
162275
|
}
|
|
162226
|
-
const archivePath =
|
|
162276
|
+
const archivePath = join8(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
162227
162277
|
try {
|
|
162228
162278
|
await createArchive(siteOutputDir, archivePath);
|
|
162229
162279
|
return await uploadSite(archivePath);
|
|
@@ -162240,26 +162290,24 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
162240
162290
|
}
|
|
162241
162291
|
// src/core/project/deploy.ts
|
|
162242
162292
|
function hasResourcesToDeploy(projectData) {
|
|
162243
|
-
const { project, entities, functions, agents
|
|
162293
|
+
const { project, entities, functions, agents } = projectData;
|
|
162244
162294
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
162245
162295
|
const hasEntities = entities.length > 0;
|
|
162246
162296
|
const hasFunctions = functions.length > 0;
|
|
162247
162297
|
const hasAgents = agents.length > 0;
|
|
162248
|
-
|
|
162249
|
-
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasSite;
|
|
162298
|
+
return hasEntities || hasFunctions || hasAgents || hasSite;
|
|
162250
162299
|
}
|
|
162251
162300
|
async function deployAll(projectData) {
|
|
162252
|
-
const { project, entities, functions, agents
|
|
162301
|
+
const { project, entities, functions, agents } = projectData;
|
|
162253
162302
|
await entityResource.push(entities);
|
|
162254
162303
|
await functionResource.push(functions);
|
|
162255
162304
|
await agentResource.push(agents);
|
|
162256
|
-
const { results: connectorResults } = await pushConnectors(connectors);
|
|
162257
162305
|
if (project.site?.outputDirectory) {
|
|
162258
162306
|
const outputDir = resolve(project.root, project.site.outputDirectory);
|
|
162259
162307
|
const { appUrl } = await deploySite(outputDir);
|
|
162260
|
-
return { appUrl
|
|
162308
|
+
return { appUrl };
|
|
162261
162309
|
}
|
|
162262
|
-
return {
|
|
162310
|
+
return {};
|
|
162263
162311
|
}
|
|
162264
162312
|
// src/core/clients/base44-client.ts
|
|
162265
162313
|
var retriedRequests = new WeakSet;
|
|
@@ -169796,7 +169844,7 @@ function getDashboardUrl(projectId) {
|
|
|
169796
169844
|
async function pullAgentsAction() {
|
|
169797
169845
|
const { project: project2 } = await readProjectConfig();
|
|
169798
169846
|
const configDir = dirname7(project2.configPath);
|
|
169799
|
-
const agentsDir =
|
|
169847
|
+
const agentsDir = join9(configDir, project2.agentsDir);
|
|
169800
169848
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
169801
169849
|
return await fetchAgents();
|
|
169802
169850
|
}, {
|
|
@@ -169889,48 +169937,50 @@ function getWhoamiCommand(context) {
|
|
|
169889
169937
|
});
|
|
169890
169938
|
}
|
|
169891
169939
|
|
|
169892
|
-
// src/cli/commands/connectors/
|
|
169893
|
-
|
|
169894
|
-
|
|
169895
|
-
}
|
|
169896
|
-
|
|
169897
|
-
const
|
|
169898
|
-
|
|
169899
|
-
return
|
|
169900
|
-
}
|
|
169901
|
-
|
|
169902
|
-
|
|
169903
|
-
|
|
169904
|
-
|
|
169905
|
-
|
|
169906
|
-
if (options?.skipPrompt) {
|
|
169907
|
-
return outcomes;
|
|
169940
|
+
// src/cli/commands/connectors/pull.ts
|
|
169941
|
+
import { dirname as dirname8, join as join10 } from "node:path";
|
|
169942
|
+
async function pullConnectorsAction() {
|
|
169943
|
+
const { project: project2 } = await readProjectConfig();
|
|
169944
|
+
const configDir = dirname8(project2.configPath);
|
|
169945
|
+
const connectorsDir = join10(configDir, project2.connectorsDir);
|
|
169946
|
+
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
169947
|
+
return await fetchConnectors();
|
|
169948
|
+
}, {
|
|
169949
|
+
successMessage: "Connectors fetched successfully",
|
|
169950
|
+
errorMessage: "Failed to fetch connectors"
|
|
169951
|
+
});
|
|
169952
|
+
if (remoteConnectors.integrations.length === 0) {
|
|
169953
|
+
return { outroMessage: "No connectors found on Base44" };
|
|
169908
169954
|
}
|
|
169909
|
-
const
|
|
169910
|
-
|
|
169955
|
+
const { written, deleted } = await runTask("Writing connector files", async () => {
|
|
169956
|
+
return await writeConnectors(connectorsDir, remoteConnectors.integrations);
|
|
169957
|
+
}, {
|
|
169958
|
+
successMessage: "Connector files written successfully",
|
|
169959
|
+
errorMessage: "Failed to write connector files"
|
|
169911
169960
|
});
|
|
169912
|
-
if (
|
|
169913
|
-
|
|
169961
|
+
if (written.length > 0) {
|
|
169962
|
+
M2.success(`Written: ${written.join(", ")}`);
|
|
169914
169963
|
}
|
|
169915
|
-
|
|
169916
|
-
M2.
|
|
169917
|
-
Opening browser for ${connector2.type}...`);
|
|
169918
|
-
const oauthResult = await runTask(`Waiting for ${connector2.type} authorization...`, async () => {
|
|
169919
|
-
return await runOAuthFlow({
|
|
169920
|
-
type: connector2.type,
|
|
169921
|
-
redirectUrl: connector2.redirectUrl,
|
|
169922
|
-
connectionId: connector2.connectionId
|
|
169923
|
-
});
|
|
169924
|
-
}, {
|
|
169925
|
-
successMessage: `${connector2.type} authorization complete`,
|
|
169926
|
-
errorMessage: `${connector2.type} authorization failed`
|
|
169927
|
-
});
|
|
169928
|
-
outcomes.set(connector2.type, oauthResult.status);
|
|
169964
|
+
if (deleted.length > 0) {
|
|
169965
|
+
M2.warn(`Deleted: ${deleted.join(", ")}`);
|
|
169929
169966
|
}
|
|
169930
|
-
|
|
169967
|
+
if (written.length === 0 && deleted.length === 0) {
|
|
169968
|
+
M2.info("All connectors are already up to date");
|
|
169969
|
+
}
|
|
169970
|
+
return {
|
|
169971
|
+
outroMessage: `Pulled ${remoteConnectors.integrations.length} connectors to ${connectorsDir}`
|
|
169972
|
+
};
|
|
169973
|
+
}
|
|
169974
|
+
function getConnectorsPullCommand(context) {
|
|
169975
|
+
return new Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(async () => {
|
|
169976
|
+
await runCommand(pullConnectorsAction, { requireAuth: true }, context);
|
|
169977
|
+
});
|
|
169931
169978
|
}
|
|
169932
169979
|
|
|
169933
169980
|
// src/cli/commands/connectors/push.ts
|
|
169981
|
+
function isPendingOAuth(r2) {
|
|
169982
|
+
return r2.action === "needs_oauth" && !!r2.redirectUrl && !!r2.connectionId;
|
|
169983
|
+
}
|
|
169934
169984
|
function printSummary(results, oauthOutcomes) {
|
|
169935
169985
|
const synced = [];
|
|
169936
169986
|
const added = [];
|
|
@@ -169982,14 +170032,42 @@ async function pushConnectorsAction() {
|
|
|
169982
170032
|
const { results } = await runTask("Pushing connectors to Base44", async () => {
|
|
169983
170033
|
return await pushConnectors(connectors);
|
|
169984
170034
|
});
|
|
169985
|
-
const
|
|
170035
|
+
const oauthOutcomes = new Map;
|
|
170036
|
+
const needsOAuth = results.filter(isPendingOAuth);
|
|
169986
170037
|
let outroMessage = "Connectors pushed to Base44";
|
|
169987
|
-
|
|
169988
|
-
|
|
169989
|
-
|
|
169990
|
-
|
|
170038
|
+
if (needsOAuth.length > 0) {
|
|
170039
|
+
M2.info("");
|
|
170040
|
+
M2.warn(`${needsOAuth.length} connector(s) require authorization in your browser:`);
|
|
170041
|
+
for (const connector2 of needsOAuth) {
|
|
170042
|
+
M2.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
|
|
170043
|
+
}
|
|
169991
170044
|
const pending = needsOAuth.map((c3) => c3.type).join(", ");
|
|
169992
|
-
|
|
170045
|
+
if (process.env.CI) {
|
|
170046
|
+
outroMessage = `Skipped OAuth in CI. Pending: ${pending}. Run 'base44 connectors push' locally to authorize.`;
|
|
170047
|
+
} else {
|
|
170048
|
+
const shouldAuth = await ye({
|
|
170049
|
+
message: "Open browser to authorize now?"
|
|
170050
|
+
});
|
|
170051
|
+
if (pD(shouldAuth) || !shouldAuth) {
|
|
170052
|
+
outroMessage = `Authorization skipped. Pending: ${pending}. Run 'base44 connectors push' again to complete.`;
|
|
170053
|
+
} else {
|
|
170054
|
+
for (const connector2 of needsOAuth) {
|
|
170055
|
+
M2.info(`
|
|
170056
|
+
Opening browser for ${connector2.type}...`);
|
|
170057
|
+
const oauthResult = await runTask(`Waiting for ${connector2.type} authorization...`, async () => {
|
|
170058
|
+
return await runOAuthFlow({
|
|
170059
|
+
type: connector2.type,
|
|
170060
|
+
redirectUrl: connector2.redirectUrl,
|
|
170061
|
+
connectionId: connector2.connectionId
|
|
170062
|
+
});
|
|
170063
|
+
}, {
|
|
170064
|
+
successMessage: `${connector2.type} authorization complete`,
|
|
170065
|
+
errorMessage: `${connector2.type} authorization failed`
|
|
170066
|
+
});
|
|
170067
|
+
oauthOutcomes.set(connector2.type, oauthResult.status);
|
|
170068
|
+
}
|
|
170069
|
+
}
|
|
170070
|
+
}
|
|
169993
170071
|
}
|
|
169994
170072
|
printSummary(results, oauthOutcomes);
|
|
169995
170073
|
return { outroMessage };
|
|
@@ -170002,7 +170080,7 @@ function getConnectorsPushCommand(context) {
|
|
|
170002
170080
|
|
|
170003
170081
|
// src/cli/commands/connectors/index.ts
|
|
170004
170082
|
function getConnectorsCommand(context) {
|
|
170005
|
-
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsPushCommand(context));
|
|
170083
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
170006
170084
|
}
|
|
170007
170085
|
|
|
170008
170086
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -170096,7 +170174,7 @@ function getFunctionsDeployCommand(context) {
|
|
|
170096
170174
|
}
|
|
170097
170175
|
|
|
170098
170176
|
// src/cli/commands/project/create.ts
|
|
170099
|
-
import { basename as basename3, join as
|
|
170177
|
+
import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
|
|
170100
170178
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
170101
170179
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
170102
170180
|
async function getTemplateById(templateId) {
|
|
@@ -170232,7 +170310,7 @@ async function executeCreate({
|
|
|
170232
170310
|
updateMessage("Building project...");
|
|
170233
170311
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
170234
170312
|
updateMessage("Deploying site...");
|
|
170235
|
-
return await deploySite(
|
|
170313
|
+
return await deploySite(join11(resolvedPath, outputDirectory));
|
|
170236
170314
|
}, {
|
|
170237
170315
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
170238
170316
|
errorMessage: "Failed to deploy site"
|
|
@@ -170280,7 +170358,7 @@ async function deployAction(options) {
|
|
|
170280
170358
|
outroMessage: "No resources found to deploy"
|
|
170281
170359
|
};
|
|
170282
170360
|
}
|
|
170283
|
-
const { project: project2, entities, functions, agents
|
|
170361
|
+
const { project: project2, entities, functions, agents } = projectData;
|
|
170284
170362
|
const summaryLines = [];
|
|
170285
170363
|
if (entities.length > 0) {
|
|
170286
170364
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -170291,9 +170369,6 @@ async function deployAction(options) {
|
|
|
170291
170369
|
if (agents.length > 0) {
|
|
170292
170370
|
summaryLines.push(` - ${agents.length} ${agents.length === 1 ? "agent" : "agents"}`);
|
|
170293
170371
|
}
|
|
170294
|
-
if (connectors.length > 0) {
|
|
170295
|
-
summaryLines.push(` - ${connectors.length} ${connectors.length === 1 ? "connector" : "connectors"}`);
|
|
170296
|
-
}
|
|
170297
170372
|
if (project2.site?.outputDirectory) {
|
|
170298
170373
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
170299
170374
|
}
|
|
@@ -170318,16 +170393,6 @@ ${summaryLines.join(`
|
|
|
170318
170393
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
170319
170394
|
errorMessage: "Deployment failed"
|
|
170320
170395
|
});
|
|
170321
|
-
const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
|
|
170322
|
-
if (needsOAuth.length > 0) {
|
|
170323
|
-
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
170324
|
-
skipPrompt: options.yes || !!process.env.CI
|
|
170325
|
-
});
|
|
170326
|
-
if (oauthOutcomes.size === 0) {
|
|
170327
|
-
const pending = needsOAuth.map((c3) => c3.type).join(", ");
|
|
170328
|
-
M2.info(`To authorize, run 'base44 connectors push' or open the links above in your browser.`);
|
|
170329
|
-
}
|
|
170330
|
-
}
|
|
170331
170396
|
M2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
170332
170397
|
if (result.appUrl) {
|
|
170333
170398
|
M2.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
|
|
@@ -170335,7 +170400,7 @@ ${summaryLines.join(`
|
|
|
170335
170400
|
return { outroMessage: "App deployed successfully" };
|
|
170336
170401
|
}
|
|
170337
170402
|
function getDeployCommand(context) {
|
|
170338
|
-
return new Command("deploy").description("Deploy all project resources (entities, functions, agents,
|
|
170403
|
+
return new Command("deploy").description("Deploy all project resources (entities, functions, agents, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
170339
170404
|
await runCommand(() => deployAction(options), { requireAuth: true }, context);
|
|
170340
170405
|
});
|
|
170341
170406
|
}
|
|
@@ -170626,10 +170691,10 @@ function toPascalCase(name2) {
|
|
|
170626
170691
|
return name2.split(/[-_\s]+/).map((w9) => w9.charAt(0).toUpperCase() + w9.slice(1)).join("");
|
|
170627
170692
|
}
|
|
170628
170693
|
// src/core/types/update-project.ts
|
|
170629
|
-
import { join as
|
|
170694
|
+
import { join as join14 } from "node:path";
|
|
170630
170695
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
170631
170696
|
async function updateProjectConfig(projectRoot) {
|
|
170632
|
-
const tsconfigPath =
|
|
170697
|
+
const tsconfigPath = join14(projectRoot, "tsconfig.json");
|
|
170633
170698
|
if (!await pathExists(tsconfigPath)) {
|
|
170634
170699
|
return false;
|
|
170635
170700
|
}
|
|
@@ -170729,7 +170794,7 @@ function nanoid3(size = 21) {
|
|
|
170729
170794
|
}
|
|
170730
170795
|
|
|
170731
170796
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
170732
|
-
import { dirname as
|
|
170797
|
+
import { dirname as dirname11, posix, sep } from "path";
|
|
170733
170798
|
function createModulerModifier() {
|
|
170734
170799
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
170735
170800
|
return async (frames) => {
|
|
@@ -170738,7 +170803,7 @@ function createModulerModifier() {
|
|
|
170738
170803
|
return frames;
|
|
170739
170804
|
};
|
|
170740
170805
|
}
|
|
170741
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
170806
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname11(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
|
|
170742
170807
|
const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
|
|
170743
170808
|
return (filename) => {
|
|
170744
170809
|
if (!filename)
|
|
@@ -174957,4 +175022,4 @@ export {
|
|
|
174957
175022
|
CLIExitError
|
|
174958
175023
|
};
|
|
174959
175024
|
|
|
174960
|
-
//# debugId=
|
|
175025
|
+
//# debugId=1AA228373AD0C78A64756E2164756E21
|