@base44-preview/cli 0.0.38-pr.367.f37f692 → 0.0.38-pr.370.a181654
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 +26 -79
- package/dist/cli/index.js.map +9 -10
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -226169,11 +226169,15 @@ var SiteConfigSchema = exports_external.object({
|
|
|
226169
226169
|
outputDirectory: exports_external.string().optional(),
|
|
226170
226170
|
installCommand: exports_external.string().optional()
|
|
226171
226171
|
});
|
|
226172
|
+
var VisibilitySchema = exports_external.enum(["public", "private"], {
|
|
226173
|
+
error: 'Invalid visibility value. Allowed values: "public", "private"'
|
|
226174
|
+
});
|
|
226172
226175
|
var ProjectConfigSchema = exports_external.object({
|
|
226173
226176
|
name: exports_external.string({
|
|
226174
226177
|
error: "App name cannot be empty"
|
|
226175
226178
|
}).min(1, "App name cannot be empty"),
|
|
226176
226179
|
description: exports_external.string().optional(),
|
|
226180
|
+
visibility: VisibilitySchema.optional(),
|
|
226177
226181
|
site: SiteConfigSchema.optional(),
|
|
226178
226182
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
226179
226183
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
@@ -232220,7 +232224,7 @@ async function createProject(projectName, description) {
|
|
|
232220
232224
|
name: projectName,
|
|
232221
232225
|
user_description: description ?? `Backend for '${projectName}'`,
|
|
232222
232226
|
is_managed_source_code: false,
|
|
232223
|
-
public_settings: "
|
|
232227
|
+
public_settings: "private"
|
|
232224
232228
|
}
|
|
232225
232229
|
});
|
|
232226
232230
|
} catch (error48) {
|
|
@@ -232234,6 +232238,22 @@ async function createProject(projectName, description) {
|
|
|
232234
232238
|
projectId: result.data.id
|
|
232235
232239
|
};
|
|
232236
232240
|
}
|
|
232241
|
+
var VISIBILITY_TO_PUBLIC_SETTINGS = {
|
|
232242
|
+
public: "public_without_login",
|
|
232243
|
+
private: "private"
|
|
232244
|
+
};
|
|
232245
|
+
async function updateProjectVisibility(visibility) {
|
|
232246
|
+
const appClient = getAppClient();
|
|
232247
|
+
try {
|
|
232248
|
+
await appClient.patch("", {
|
|
232249
|
+
json: {
|
|
232250
|
+
public_settings: VISIBILITY_TO_PUBLIC_SETTINGS[visibility]
|
|
232251
|
+
}
|
|
232252
|
+
});
|
|
232253
|
+
} catch (error48) {
|
|
232254
|
+
throw await ApiError.fromHttpError(error48, "updating project visibility");
|
|
232255
|
+
}
|
|
232256
|
+
}
|
|
232237
232257
|
async function listProjects() {
|
|
232238
232258
|
let response;
|
|
232239
232259
|
try {
|
|
@@ -233475,43 +233495,6 @@ var RemoveConnectorResponseSchema = exports_external.object({
|
|
|
233475
233495
|
status: data.status,
|
|
233476
233496
|
integrationType: data.integration_type
|
|
233477
233497
|
}));
|
|
233478
|
-
var ConnectionConfigFieldSchema = exports_external.object({
|
|
233479
|
-
name: exports_external.string(),
|
|
233480
|
-
display_name: exports_external.string(),
|
|
233481
|
-
description: exports_external.string(),
|
|
233482
|
-
placeholder: exports_external.string(),
|
|
233483
|
-
required: exports_external.boolean(),
|
|
233484
|
-
validation_pattern: exports_external.string().nullable().optional(),
|
|
233485
|
-
validation_error: exports_external.string().nullable().optional()
|
|
233486
|
-
});
|
|
233487
|
-
var AvailableIntegrationSchema = exports_external.object({
|
|
233488
|
-
integration_type: exports_external.string(),
|
|
233489
|
-
display_name: exports_external.string(),
|
|
233490
|
-
description: exports_external.string(),
|
|
233491
|
-
notes: exports_external.string().nullable(),
|
|
233492
|
-
usage_guide: exports_external.string().nullable(),
|
|
233493
|
-
connection_config_fields: exports_external.array(ConnectionConfigFieldSchema)
|
|
233494
|
-
});
|
|
233495
|
-
var ListAvailableIntegrationsResponseSchema = exports_external.object({
|
|
233496
|
-
available_integrations: exports_external.array(AvailableIntegrationSchema)
|
|
233497
|
-
}).transform((data) => ({
|
|
233498
|
-
availableIntegrations: data.available_integrations.map((i) => ({
|
|
233499
|
-
integrationType: i.integration_type,
|
|
233500
|
-
displayName: i.display_name,
|
|
233501
|
-
description: i.description,
|
|
233502
|
-
notes: i.notes,
|
|
233503
|
-
usageGuide: i.usage_guide,
|
|
233504
|
-
connectionConfigFields: i.connection_config_fields.map((f) => ({
|
|
233505
|
-
name: f.name,
|
|
233506
|
-
displayName: f.display_name,
|
|
233507
|
-
description: f.description,
|
|
233508
|
-
placeholder: f.placeholder,
|
|
233509
|
-
required: f.required,
|
|
233510
|
-
validationPattern: f.validation_pattern,
|
|
233511
|
-
validationError: f.validation_error
|
|
233512
|
-
}))
|
|
233513
|
-
}))
|
|
233514
|
-
}));
|
|
233515
233498
|
|
|
233516
233499
|
// src/core/resources/connector/api.ts
|
|
233517
233500
|
async function listConnectors() {
|
|
@@ -233565,20 +233548,6 @@ async function getOAuthStatus(integrationType, connectionId) {
|
|
|
233565
233548
|
}
|
|
233566
233549
|
return result.data;
|
|
233567
233550
|
}
|
|
233568
|
-
async function listAvailableIntegrations() {
|
|
233569
|
-
const appClient = getAppClient();
|
|
233570
|
-
let response;
|
|
233571
|
-
try {
|
|
233572
|
-
response = await appClient.get("external-auth/available-integrations");
|
|
233573
|
-
} catch (error48) {
|
|
233574
|
-
throw await ApiError.fromHttpError(error48, "listing available integrations");
|
|
233575
|
-
}
|
|
233576
|
-
const result = ListAvailableIntegrationsResponseSchema.safeParse(await response.json());
|
|
233577
|
-
if (!result.success) {
|
|
233578
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
233579
|
-
}
|
|
233580
|
-
return result.data;
|
|
233581
|
-
}
|
|
233582
233551
|
async function removeConnector(integrationType) {
|
|
233583
233552
|
const appClient = getAppClient();
|
|
233584
233553
|
let response;
|
|
@@ -234448,6 +234417,9 @@ async function deployAll(projectData) {
|
|
|
234448
234417
|
await functionResource.push(functions);
|
|
234449
234418
|
await agentResource.push(agents);
|
|
234450
234419
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
234420
|
+
if (project.visibility) {
|
|
234421
|
+
await updateProjectVisibility(project.visibility);
|
|
234422
|
+
}
|
|
234451
234423
|
if (project.site?.outputDirectory) {
|
|
234452
234424
|
const outputDir = resolve(project.root, project.site.outputDirectory);
|
|
234453
234425
|
const { appUrl } = await deploySite(outputDir);
|
|
@@ -242272,31 +242244,6 @@ function getWhoamiCommand(context) {
|
|
|
242272
242244
|
});
|
|
242273
242245
|
}
|
|
242274
242246
|
|
|
242275
|
-
// src/cli/commands/connectors/list-available.ts
|
|
242276
|
-
async function listAvailableAction() {
|
|
242277
|
-
const { availableIntegrations } = await runTask("Fetching available integrations from Base44", async () => {
|
|
242278
|
-
return await listAvailableIntegrations();
|
|
242279
|
-
}, {
|
|
242280
|
-
successMessage: "Available integrations fetched successfully",
|
|
242281
|
-
errorMessage: "Failed to fetch available integrations"
|
|
242282
|
-
});
|
|
242283
|
-
if (availableIntegrations.length === 0) {
|
|
242284
|
-
return { outroMessage: "No available integrations found." };
|
|
242285
|
-
}
|
|
242286
|
-
for (const integration of availableIntegrations) {
|
|
242287
|
-
R2.info(`${theme.styles.bold(integration.displayName)} ${theme.styles.dim(`(${integration.integrationType})`)}${integration.description ? `
|
|
242288
|
-
${theme.styles.dim(integration.description)}` : ""}`);
|
|
242289
|
-
}
|
|
242290
|
-
return {
|
|
242291
|
-
outroMessage: `Found ${availableIntegrations.length} available integrations.`
|
|
242292
|
-
};
|
|
242293
|
-
}
|
|
242294
|
-
function getConnectorsListAvailableCommand(context) {
|
|
242295
|
-
return new Command("list-available").description("List all available integration types").action(async () => {
|
|
242296
|
-
await runCommand(listAvailableAction, { requireAuth: true }, context);
|
|
242297
|
-
});
|
|
242298
|
-
}
|
|
242299
|
-
|
|
242300
242247
|
// src/cli/commands/connectors/pull.ts
|
|
242301
242248
|
import { dirname as dirname9, join as join10 } from "node:path";
|
|
242302
242249
|
async function pullConnectorsAction() {
|
|
@@ -243097,7 +243044,7 @@ function getConnectorsPushCommand(context) {
|
|
|
243097
243044
|
|
|
243098
243045
|
// src/cli/commands/connectors/index.ts
|
|
243099
243046
|
function getConnectorsCommand(context) {
|
|
243100
|
-
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(
|
|
243047
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
243101
243048
|
}
|
|
243102
243049
|
|
|
243103
243050
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -250912,4 +250859,4 @@ export {
|
|
|
250912
250859
|
CLIExitError
|
|
250913
250860
|
};
|
|
250914
250861
|
|
|
250915
|
-
//# debugId=
|
|
250862
|
+
//# debugId=6DBF3468B0B3316264756E2164756E21
|