@base44-preview/cli 0.0.32-pr.241.887699f → 0.0.32-pr.246.eec21b0
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/README.md +8 -12
- package/dist/cli/index.js +68 -60
- package/dist/cli/index.js.map +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,23 +43,19 @@ The CLI will guide you through project setup. For step-by-step tutorials, see th
|
|
|
43
43
|
|
|
44
44
|
| Command | Description |
|
|
45
45
|
| ------- | ----------- |
|
|
46
|
-
| [`create`](https://docs.base44.com/developers/references/cli/commands/create) | Create a new Base44 project |
|
|
47
|
-
| [`deploy`](https://docs.base44.com/developers/references/cli/commands/deploy) | Deploy
|
|
48
|
-
| [`link`](https://docs.base44.com/developers/references/cli/commands/link) | Link a local project to a
|
|
49
|
-
| [`eject`](https://docs.base44.com/developers/references/cli/commands/eject) | Download the code for an existing Base44 project |
|
|
46
|
+
| [`create`](https://docs.base44.com/developers/references/cli/commands/create) | Create a new Base44 project from a template |
|
|
47
|
+
| [`deploy`](https://docs.base44.com/developers/references/cli/commands/deploy) | Deploy resources and site to Base44 |
|
|
48
|
+
| [`link`](https://docs.base44.com/developers/references/cli/commands/link) | Link a local project to a project on Base44 |
|
|
50
49
|
| [`dashboard open`](https://docs.base44.com/developers/references/cli/commands/dashboard) | Open the app dashboard in your browser |
|
|
51
50
|
| [`login`](https://docs.base44.com/developers/references/cli/commands/login) | Authenticate with Base44 |
|
|
52
|
-
| [`logout`](https://docs.base44.com/developers/references/cli/commands/logout) |
|
|
53
|
-
| [`whoami`](https://docs.base44.com/developers/references/cli/commands/whoami) | Display current authenticated user |
|
|
54
|
-
| [`agents pull`](https://docs.base44.com/developers/references/cli/commands/agents-pull) | Pull agents from Base44 to local files
|
|
55
|
-
| [`agents push`](https://docs.base44.com/developers/references/cli/commands/agents-push) | Push local agents to Base44
|
|
56
|
-
| [`
|
|
57
|
-
| [`connectors push`](https://docs.base44.com/developers/references/cli/commands/connectors-push) | Push local connectors to Base44 (overwrites connectors on Base44) |
|
|
58
|
-
| [`entities push`](https://docs.base44.com/developers/references/cli/commands/entities-push) | Push local entities to Base44 |
|
|
51
|
+
| [`logout`](https://docs.base44.com/developers/references/cli/commands/logout) | Sign out and clear stored credentials |
|
|
52
|
+
| [`whoami`](https://docs.base44.com/developers/references/cli/commands/whoami) | Display the current authenticated user |
|
|
53
|
+
| [`agents pull`](https://docs.base44.com/developers/references/cli/commands/agents-pull) | Pull agents from Base44 to local files |
|
|
54
|
+
| [`agents push`](https://docs.base44.com/developers/references/cli/commands/agents-push) | Push local agents to Base44 |
|
|
55
|
+
| [`entities push`](https://docs.base44.com/developers/references/cli/commands/entities-push) | Push local entity schemas to Base44 |
|
|
59
56
|
| [`functions deploy`](https://docs.base44.com/developers/references/cli/commands/functions-deploy) | Deploy local functions to Base44 |
|
|
60
57
|
| [`site deploy`](https://docs.base44.com/developers/references/cli/commands/site-deploy) | Deploy built site files to Base44 hosting |
|
|
61
58
|
| [`site open`](https://docs.base44.com/developers/references/cli/commands/site-open) | Open the published site in your browser |
|
|
62
|
-
| [`types generate`](https://docs.base44.com/developers/references/cli/commands/types-generate) | Generate TypeScript declaration file (types.d.ts) from project resources |
|
|
63
59
|
|
|
64
60
|
|
|
65
61
|
<!--| [`eject`](https://docs.base44.com/developers/references/cli/commands/eject) | Create a Base44 backend project from an existing Base44 app | -->
|
package/dist/cli/index.js
CHANGED
|
@@ -9296,10 +9296,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
9296
9296
|
};
|
|
9297
9297
|
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
9298
9298
|
var filename = opts.filename;
|
|
9299
|
-
var
|
|
9299
|
+
var basename4 = path11.basename(filename, path11.extname(filename));
|
|
9300
9300
|
try {
|
|
9301
9301
|
Object.defineProperty(returnedFn, "name", {
|
|
9302
|
-
value:
|
|
9302
|
+
value: basename4,
|
|
9303
9303
|
writable: false,
|
|
9304
9304
|
enumerable: false,
|
|
9305
9305
|
configurable: true
|
|
@@ -111567,12 +111567,12 @@ function getLanguageByFileName(languages2, file2) {
|
|
|
111567
111567
|
if (!file2) {
|
|
111568
111568
|
return;
|
|
111569
111569
|
}
|
|
111570
|
-
const
|
|
111570
|
+
const basename5 = getFileBasename(file2).toLowerCase();
|
|
111571
111571
|
return languages2.find(({
|
|
111572
111572
|
filenames
|
|
111573
|
-
}) => filenames?.some((name2) => name2.toLowerCase() ===
|
|
111573
|
+
}) => filenames?.some((name2) => name2.toLowerCase() === basename5)) ?? languages2.find(({
|
|
111574
111574
|
extensions
|
|
111575
|
-
}) => extensions?.some((extension) =>
|
|
111575
|
+
}) => extensions?.some((extension) => basename5.endsWith(extension)));
|
|
111576
111576
|
}
|
|
111577
111577
|
function getLanguageByLanguageName(languages2, languageName) {
|
|
111578
111578
|
if (!languageName) {
|
|
@@ -116794,8 +116794,8 @@ var init_prettier = __esm(() => {
|
|
|
116794
116794
|
}
|
|
116795
116795
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
116796
116796
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
116797
|
-
const
|
|
116798
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
116797
|
+
const basename5 = path152.basename(pattern);
|
|
116798
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename5);
|
|
116799
116799
|
}
|
|
116800
116800
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
116801
116801
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -155679,7 +155679,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155679
155679
|
var path18 = __require("node:path");
|
|
155680
155680
|
var fs28 = __require("node:fs");
|
|
155681
155681
|
var dirname11 = path18.dirname;
|
|
155682
|
-
var
|
|
155682
|
+
var basename5 = path18.basename;
|
|
155683
155683
|
var extname2 = path18.extname;
|
|
155684
155684
|
var join15 = path18.join;
|
|
155685
155685
|
var resolve5 = path18.resolve;
|
|
@@ -155718,7 +155718,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155718
155718
|
var root2 = roots[i5];
|
|
155719
155719
|
var loc = resolve5(root2, name2);
|
|
155720
155720
|
var dir = dirname11(loc);
|
|
155721
|
-
var file2 =
|
|
155721
|
+
var file2 = basename5(loc);
|
|
155722
155722
|
path19 = this.resolve(dir, file2);
|
|
155723
155723
|
}
|
|
155724
155724
|
return path19;
|
|
@@ -155748,7 +155748,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155748
155748
|
if (stat2 && stat2.isFile()) {
|
|
155749
155749
|
return path19;
|
|
155750
155750
|
}
|
|
155751
|
-
path19 = join15(dir,
|
|
155751
|
+
path19 = join15(dir, basename5(file2, ext), "index" + ext);
|
|
155752
155752
|
stat2 = tryStat(path19);
|
|
155753
155753
|
if (stat2 && stat2.isFile()) {
|
|
155754
155754
|
return path19;
|
|
@@ -159069,7 +159069,7 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159069
159069
|
*/
|
|
159070
159070
|
module.exports = contentDisposition;
|
|
159071
159071
|
module.exports.parse = parse10;
|
|
159072
|
-
var
|
|
159072
|
+
var basename5 = __require("path").basename;
|
|
159073
159073
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
159074
159074
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
159075
159075
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -159104,9 +159104,9 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159104
159104
|
if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
|
|
159105
159105
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
159106
159106
|
}
|
|
159107
|
-
var name2 =
|
|
159107
|
+
var name2 = basename5(filename);
|
|
159108
159108
|
var isQuotedString = TEXT_REGEXP.test(name2);
|
|
159109
|
-
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) :
|
|
159109
|
+
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) : basename5(fallback);
|
|
159110
159110
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
|
|
159111
159111
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
|
|
159112
159112
|
params["filename*"] = name2;
|
|
@@ -185051,6 +185051,10 @@ var TikTokConnectorSchema = exports_external.object({
|
|
|
185051
185051
|
type: exports_external.literal("tiktok"),
|
|
185052
185052
|
scopes: exports_external.array(exports_external.string()).default([])
|
|
185053
185053
|
});
|
|
185054
|
+
var GoogleBigQueryConnectorSchema = exports_external.object({
|
|
185055
|
+
type: exports_external.literal("googlebigquery"),
|
|
185056
|
+
scopes: exports_external.array(exports_external.string()).default([])
|
|
185057
|
+
});
|
|
185054
185058
|
var CustomTypeSchema = exports_external.string().min(1).regex(/^[a-z0-9_-]+$/i);
|
|
185055
185059
|
var GenericConnectorSchema = exports_external.object({
|
|
185056
185060
|
type: CustomTypeSchema,
|
|
@@ -185063,6 +185067,7 @@ var ConnectorResourceSchema = exports_external.union([
|
|
|
185063
185067
|
GoogleSheetsConnectorSchema,
|
|
185064
185068
|
GoogleDocsConnectorSchema,
|
|
185065
185069
|
GoogleSlidesConnectorSchema,
|
|
185070
|
+
GoogleBigQueryConnectorSchema,
|
|
185066
185071
|
SlackConnectorSchema,
|
|
185067
185072
|
NotionConnectorSchema,
|
|
185068
185073
|
SalesforceConnectorSchema,
|
|
@@ -185078,6 +185083,7 @@ var KnownIntegrationTypes = [
|
|
|
185078
185083
|
"googlesheets",
|
|
185079
185084
|
"googledocs",
|
|
185080
185085
|
"googleslides",
|
|
185086
|
+
"googlebigquery",
|
|
185081
185087
|
"slack",
|
|
185082
185088
|
"notion",
|
|
185083
185089
|
"salesforce",
|
|
@@ -185340,7 +185346,10 @@ var connectorResource = {
|
|
|
185340
185346
|
// src/core/resources/entity/schema.ts
|
|
185341
185347
|
var FieldConditionSchema = exports_external.union([
|
|
185342
185348
|
exports_external.string(),
|
|
185343
|
-
exports_external.
|
|
185349
|
+
exports_external.number(),
|
|
185350
|
+
exports_external.boolean(),
|
|
185351
|
+
exports_external.null(),
|
|
185352
|
+
exports_external.looseObject({
|
|
185344
185353
|
$in: exports_external.unknown().optional(),
|
|
185345
185354
|
$nin: exports_external.unknown().optional(),
|
|
185346
185355
|
$ne: exports_external.unknown().optional(),
|
|
@@ -185357,6 +185366,15 @@ var rlsConditionAllowedKeys = new Set([
|
|
|
185357
185366
|
"user_condition",
|
|
185358
185367
|
"created_by",
|
|
185359
185368
|
"created_by_id",
|
|
185369
|
+
"id",
|
|
185370
|
+
"_id",
|
|
185371
|
+
"created_date",
|
|
185372
|
+
"updated_date",
|
|
185373
|
+
"app_id",
|
|
185374
|
+
"entity_name",
|
|
185375
|
+
"is_deleted",
|
|
185376
|
+
"deleted_date",
|
|
185377
|
+
"environment",
|
|
185360
185378
|
"$or",
|
|
185361
185379
|
"$and",
|
|
185362
185380
|
"$nor"
|
|
@@ -185385,60 +185403,33 @@ var isValidFieldCondition = (value) => {
|
|
|
185385
185403
|
}
|
|
185386
185404
|
return false;
|
|
185387
185405
|
};
|
|
185388
|
-
var RefineRLSConditionSchema = RLSConditionSchema.refine((val) => Object.entries(val).every(([key, value]) =>
|
|
185389
|
-
if (rlsConditionAllowedKeys.has(key)) {
|
|
185390
|
-
return true;
|
|
185391
|
-
}
|
|
185392
|
-
if (!key.startsWith("data.")) {
|
|
185393
|
-
return false;
|
|
185394
|
-
}
|
|
185395
|
-
return isValidFieldCondition(value);
|
|
185396
|
-
}), "Keys must be known RLS keys or match data.* pattern with valid value");
|
|
185406
|
+
var RefineRLSConditionSchema = RLSConditionSchema.refine((val) => Object.entries(val).every(([key, value]) => rlsConditionAllowedKeys.has(key) || isValidFieldCondition(value)), "Field condition values must be a primitive or an operator object ($in, $nin, $ne, $all)");
|
|
185397
185407
|
var RLSRuleSchema = exports_external.union([exports_external.boolean(), RefineRLSConditionSchema]);
|
|
185398
|
-
var EntityRLSSchema = exports_external.
|
|
185408
|
+
var EntityRLSSchema = exports_external.looseObject({
|
|
185399
185409
|
create: RLSRuleSchema.optional(),
|
|
185400
185410
|
read: RLSRuleSchema.optional(),
|
|
185401
185411
|
update: RLSRuleSchema.optional(),
|
|
185402
185412
|
delete: RLSRuleSchema.optional(),
|
|
185403
185413
|
write: RLSRuleSchema.optional()
|
|
185404
185414
|
});
|
|
185405
|
-
var FieldRLSSchema = exports_external.
|
|
185415
|
+
var FieldRLSSchema = exports_external.looseObject({
|
|
185406
185416
|
read: RLSRuleSchema.optional(),
|
|
185407
185417
|
write: RLSRuleSchema.optional(),
|
|
185408
185418
|
create: RLSRuleSchema.optional(),
|
|
185409
185419
|
update: RLSRuleSchema.optional(),
|
|
185410
185420
|
delete: RLSRuleSchema.optional()
|
|
185411
185421
|
});
|
|
185412
|
-
var
|
|
185413
|
-
|
|
185414
|
-
"number",
|
|
185415
|
-
"integer",
|
|
185416
|
-
"boolean",
|
|
185417
|
-
"array",
|
|
185418
|
-
"object"
|
|
185419
|
-
]);
|
|
185420
|
-
var StringFormatSchema = exports_external.enum([
|
|
185421
|
-
"date",
|
|
185422
|
-
"date-time",
|
|
185423
|
-
"time",
|
|
185424
|
-
"email",
|
|
185425
|
-
"uri",
|
|
185426
|
-
"hostname",
|
|
185427
|
-
"ipv4",
|
|
185428
|
-
"ipv6",
|
|
185429
|
-
"uuid"
|
|
185430
|
-
]);
|
|
185431
|
-
var PropertyDefinitionSchema = exports_external.object({
|
|
185432
|
-
type: PropertyTypeSchema,
|
|
185422
|
+
var PropertyDefinitionSchema = exports_external.looseObject({
|
|
185423
|
+
type: exports_external.string().optional(),
|
|
185433
185424
|
title: exports_external.string().optional(),
|
|
185434
185425
|
description: exports_external.string().optional(),
|
|
185435
185426
|
minLength: exports_external.number().int().min(0).optional(),
|
|
185436
185427
|
maxLength: exports_external.number().int().min(0).optional(),
|
|
185437
185428
|
pattern: exports_external.string().optional(),
|
|
185438
|
-
format:
|
|
185429
|
+
format: exports_external.string().optional(),
|
|
185439
185430
|
minimum: exports_external.number().optional(),
|
|
185440
185431
|
maximum: exports_external.number().optional(),
|
|
185441
|
-
enum: exports_external.array(exports_external.
|
|
185432
|
+
enum: exports_external.array(exports_external.unknown()).optional(),
|
|
185442
185433
|
enumNames: exports_external.array(exports_external.string()).optional(),
|
|
185443
185434
|
default: exports_external.unknown().optional(),
|
|
185444
185435
|
$ref: exports_external.string().optional(),
|
|
@@ -185451,12 +185442,12 @@ var PropertyDefinitionSchema = exports_external.object({
|
|
|
185451
185442
|
return exports_external.record(exports_external.string(), PropertyDefinitionSchema).optional();
|
|
185452
185443
|
}
|
|
185453
185444
|
});
|
|
185454
|
-
var EntitySchema = exports_external.
|
|
185455
|
-
type: exports_external.literal("object"),
|
|
185456
|
-
name: exports_external.string().regex(/^[a-zA-Z0-9]+$/, "Entity name must be alphanumeric only"),
|
|
185445
|
+
var EntitySchema = exports_external.looseObject({
|
|
185446
|
+
type: exports_external.literal("object").default("object"),
|
|
185447
|
+
name: exports_external.string().min(1).regex(/^[a-zA-Z0-9]+$/, "Entity name must be alphanumeric only"),
|
|
185457
185448
|
title: exports_external.string().optional(),
|
|
185458
185449
|
description: exports_external.string().optional(),
|
|
185459
|
-
properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema),
|
|
185450
|
+
properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema).default({}),
|
|
185460
185451
|
required: exports_external.array(exports_external.string()).optional(),
|
|
185461
185452
|
rls: EntityRLSSchema.optional()
|
|
185462
185453
|
});
|
|
@@ -185615,7 +185606,7 @@ async function deployFunctions(functions) {
|
|
|
185615
185606
|
return result.data;
|
|
185616
185607
|
}
|
|
185617
185608
|
// src/core/resources/function/config.ts
|
|
185618
|
-
import { dirname as dirname4, join as join5 } from "node:path";
|
|
185609
|
+
import { basename as basename2, dirname as dirname4, join as join5 } from "node:path";
|
|
185619
185610
|
async function readFunctionConfig(configPath) {
|
|
185620
185611
|
const parsed = await readJsonFile(configPath);
|
|
185621
185612
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -185646,7 +185637,24 @@ async function readAllFunctions(functionsDir) {
|
|
|
185646
185637
|
cwd: functionsDir,
|
|
185647
185638
|
absolute: true
|
|
185648
185639
|
});
|
|
185649
|
-
const
|
|
185640
|
+
const indexFiles = await globby(`*/index.{js,ts}`, {
|
|
185641
|
+
cwd: functionsDir,
|
|
185642
|
+
absolute: true
|
|
185643
|
+
});
|
|
185644
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
185645
|
+
const indexFilesDirs = indexFiles.filter((indexFile) => !configFilesDirs.has(dirname4(indexFile)));
|
|
185646
|
+
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
185647
|
+
const functionsWithoutConfig = await Promise.all(indexFilesDirs.map(async (functionFile) => {
|
|
185648
|
+
const functionDir = dirname4(functionFile);
|
|
185649
|
+
const filePaths = await globby("*.{js,ts,json}", {
|
|
185650
|
+
cwd: functionDir,
|
|
185651
|
+
absolute: true
|
|
185652
|
+
});
|
|
185653
|
+
const name2 = basename2(functionDir);
|
|
185654
|
+
const entry = basename2(functionFile);
|
|
185655
|
+
return { name: name2, entry, entryPath: functionFile, filePaths };
|
|
185656
|
+
}));
|
|
185657
|
+
const functions = [...functionsFromConfig, ...functionsWithoutConfig];
|
|
185650
185658
|
const names = new Set;
|
|
185651
185659
|
for (const fn of functions) {
|
|
185652
185660
|
if (names.has(fn.name)) {
|
|
@@ -185657,11 +185665,11 @@ async function readAllFunctions(functionsDir) {
|
|
|
185657
185665
|
return functions;
|
|
185658
185666
|
}
|
|
185659
185667
|
// src/core/resources/function/deploy.ts
|
|
185660
|
-
import { basename as
|
|
185668
|
+
import { basename as basename3 } from "node:path";
|
|
185661
185669
|
async function loadFunctionCode(fn) {
|
|
185662
185670
|
const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
185663
185671
|
const content = await readTextFile(filePath);
|
|
185664
|
-
return { path:
|
|
185672
|
+
return { path: basename3(filePath), content };
|
|
185665
185673
|
}));
|
|
185666
185674
|
return { ...fn, files: loadedFiles };
|
|
185667
185675
|
}
|
|
@@ -194629,7 +194637,7 @@ function getFunctionsDeployCommand(context) {
|
|
|
194629
194637
|
}
|
|
194630
194638
|
|
|
194631
194639
|
// src/cli/commands/project/create.ts
|
|
194632
|
-
import { basename as
|
|
194640
|
+
import { basename as basename4, join as join11, resolve as resolve2 } from "node:path";
|
|
194633
194641
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
194634
194642
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
194635
194643
|
async function getTemplateById(templateId) {
|
|
@@ -194664,8 +194672,8 @@ async function createInteractive(options) {
|
|
|
194664
194672
|
name: () => {
|
|
194665
194673
|
return options.name ? Promise.resolve(options.name) : he({
|
|
194666
194674
|
message: "What is the name of your project?",
|
|
194667
|
-
placeholder:
|
|
194668
|
-
initialValue:
|
|
194675
|
+
placeholder: basename4(process.cwd()),
|
|
194676
|
+
initialValue: basename4(process.cwd()),
|
|
194669
194677
|
validate: (value) => {
|
|
194670
194678
|
if (!value || value.trim().length === 0) {
|
|
194671
194679
|
return "Every project deserves a name";
|
|
@@ -199760,4 +199768,4 @@ export {
|
|
|
199760
199768
|
CLIExitError
|
|
199761
199769
|
};
|
|
199762
199770
|
|
|
199763
|
-
//# debugId=
|
|
199771
|
+
//# debugId=96D36CCA48392A0764756E2164756E21
|