@base44-preview/cli 0.0.30-pr.189.ae9567a → 0.0.30-pr.211.a31cce0

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 CHANGED
@@ -153805,7 +153805,7 @@ var SlackConnectorSchema = exports_external.object({
153805
153805
  });
153806
153806
  var NotionConnectorSchema = exports_external.object({
153807
153807
  type: exports_external.literal("notion"),
153808
- scopes: exports_external.array(exports_external.string()).default([])
153808
+ scopes: exports_external.array(exports_external.string()).default([]).optional()
153809
153809
  });
153810
153810
  var SalesforceConnectorSchema = exports_external.object({
153811
153811
  type: exports_external.literal("salesforce"),
@@ -153823,7 +153823,12 @@ var TikTokConnectorSchema = exports_external.object({
153823
153823
  type: exports_external.literal("tiktok"),
153824
153824
  scopes: exports_external.array(exports_external.string()).default([])
153825
153825
  });
153826
- var ConnectorResourceSchema = exports_external.discriminatedUnion("type", [
153826
+ var CustomTypeSchema = exports_external.string().min(1).regex(/^[a-z0-9_-]+$/i);
153827
+ var GenericConnectorSchema = exports_external.object({
153828
+ type: CustomTypeSchema,
153829
+ scopes: exports_external.array(exports_external.string()).default([])
153830
+ });
153831
+ var ConnectorResourceSchema = exports_external.union([
153827
153832
  GoogleCalendarConnectorSchema,
153828
153833
  GoogleDriveConnectorSchema,
153829
153834
  GmailConnectorSchema,
@@ -153835,9 +153840,10 @@ var ConnectorResourceSchema = exports_external.discriminatedUnion("type", [
153835
153840
  SalesforceConnectorSchema,
153836
153841
  HubspotConnectorSchema,
153837
153842
  LinkedInConnectorSchema,
153838
- TikTokConnectorSchema
153843
+ TikTokConnectorSchema,
153844
+ GenericConnectorSchema
153839
153845
  ]);
153840
- var IntegrationTypeSchema = exports_external.enum([
153846
+ var KnownIntegrationTypes = [
153841
153847
  "googlecalendar",
153842
153848
  "googledrive",
153843
153849
  "gmail",
@@ -153850,6 +153856,10 @@ var IntegrationTypeSchema = exports_external.enum([
153850
153856
  "hubspot",
153851
153857
  "linkedin",
153852
153858
  "tiktok"
153859
+ ];
153860
+ var IntegrationTypeSchema = exports_external.union([
153861
+ exports_external.enum(KnownIntegrationTypes),
153862
+ CustomTypeSchema
153853
153863
  ]);
153854
153864
  var ConnectorStatusSchema = exports_external.enum([
153855
153865
  "active",
@@ -153973,7 +153983,13 @@ async function readAllConnectors(connectorsDir) {
153973
153983
  const types = new Set;
153974
153984
  for (const connector of connectors) {
153975
153985
  if (types.has(connector.type)) {
153976
- throw new Error(`Duplicate connector type "${connector.type}"`);
153986
+ throw new InvalidInputError(`Duplicate connector type "${connector.type}"`, {
153987
+ hints: [
153988
+ {
153989
+ message: `Remove duplicate connectors with type "${connector.type}" - only one connector per type is allowed`
153990
+ }
153991
+ ]
153992
+ });
153977
153993
  }
153978
153994
  types.add(connector.type);
153979
153995
  }
@@ -154711,7 +154727,7 @@ async function pushConnectors(connectors) {
154711
154727
  const localTypes = new Set(connectors.map((c) => c.type));
154712
154728
  for (const connector of connectors) {
154713
154729
  try {
154714
- const response = await setConnector(connector.type, connector.scopes);
154730
+ const response = await setConnector(connector.type, connector.scopes ?? []);
154715
154731
  results.push(setResponseToResult(connector.type, response));
154716
154732
  } catch (err) {
154717
154733
  results.push({
@@ -154745,7 +154761,7 @@ function setResponseToResult(type, response) {
154745
154761
  return {
154746
154762
  type,
154747
154763
  action: "error",
154748
- error: response.error_message || `Already connected by ${response.other_user_email}`
154764
+ error: response.error_message || `Already connected by ${response.other_user_email ?? "another user"}`
154749
154765
  };
154750
154766
  }
154751
154767
  if (response.already_authorized) {
@@ -162224,18 +162240,20 @@ async function createArchive(pathToArchive, targetArchivePath) {
162224
162240
  }
162225
162241
  // src/core/project/deploy.ts
162226
162242
  function hasResourcesToDeploy(projectData) {
162227
- const { project, entities, functions, agents } = projectData;
162243
+ const { project, entities, functions, agents, connectors } = projectData;
162228
162244
  const hasSite = Boolean(project.site?.outputDirectory);
162229
162245
  const hasEntities = entities.length > 0;
162230
162246
  const hasFunctions = functions.length > 0;
162231
162247
  const hasAgents = agents.length > 0;
162232
- return hasEntities || hasFunctions || hasAgents || hasSite;
162248
+ const hasConnectors = connectors.length > 0;
162249
+ return hasEntities || hasFunctions || hasAgents || hasConnectors || hasSite;
162233
162250
  }
162234
162251
  async function deployAll(projectData) {
162235
- const { project, entities, functions, agents } = projectData;
162252
+ const { project, entities, functions, agents, connectors } = projectData;
162236
162253
  await entityResource.push(entities);
162237
162254
  await functionResource.push(functions);
162238
162255
  await agentResource.push(agents);
162256
+ await connectorResource.push(connectors);
162239
162257
  if (project.site?.outputDirectory) {
162240
162258
  const outputDir = resolve(project.root, project.site.outputDirectory);
162241
162259
  const { appUrl } = await deploySite(outputDir);
@@ -169697,7 +169715,7 @@ async function checkForUpgrade() {
169697
169715
  function formatUpgradeMessage(info) {
169698
169716
  const { shinyOrange } = theme.colors;
169699
169717
  const { bold: bold2 } = theme.styles;
169700
- return `${shinyOrange("Update available!")} ${shinyOrange(`${info.currentVersion} → ${info.latestVersion}`)} ${shinyOrange("Run:")} ${bold2(shinyOrange("npm update -g base44"))}`;
169718
+ return `${shinyOrange("Update available!")} ${shinyOrange(`${info.currentVersion} → ${info.latestVersion}`)} ${shinyOrange("Run:")} ${bold2(shinyOrange("npm install -g base44@latest"))}`;
169701
169719
  }
169702
169720
  async function printUpgradeNotificationIfAvailable() {
169703
169721
  try {
@@ -169901,18 +169919,18 @@ function printSummary(results, oauthOutcomes) {
169901
169919
  }
169902
169920
  }
169903
169921
  M2.info("");
169904
- M2.info(source_default.bold("Summary:"));
169922
+ M2.info(theme.styles.bold("Summary:"));
169905
169923
  if (synced.length > 0) {
169906
- M2.info(source_default.green(` Synced: ${synced.join(", ")}`));
169924
+ M2.success(`Synced: ${synced.join(", ")}`);
169907
169925
  }
169908
169926
  if (added.length > 0) {
169909
- M2.info(source_default.green(` Added: ${added.join(", ")}`));
169927
+ M2.success(`Added: ${added.join(", ")}`);
169910
169928
  }
169911
169929
  if (removed.length > 0) {
169912
- M2.info(source_default.dim(` Removed: ${removed.join(", ")}`));
169930
+ M2.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
169913
169931
  }
169914
169932
  for (const r2 of failed) {
169915
- M2.info(source_default.red(` Failed: ${r2.type}${r2.error ? ` - ${r2.error}` : ""}`));
169933
+ M2.error(`Failed: ${r2.type}${r2.error ? ` - ${r2.error}` : ""}`);
169916
169934
  }
169917
169935
  }
169918
169936
  async function pushConnectorsAction() {
@@ -169925,18 +169943,15 @@ async function pushConnectorsAction() {
169925
169943
  }
169926
169944
  const { results } = await runTask("Pushing connectors to Base44", async () => {
169927
169945
  return await pushConnectors(connectors);
169928
- }, {
169929
- successMessage: "Connectors pushed",
169930
- errorMessage: "Failed to push connectors"
169931
169946
  });
169932
169947
  const oauthOutcomes = new Map;
169933
169948
  const needsOAuth = results.filter(isPendingOAuth);
169934
169949
  let outroMessage = "Connectors pushed to Base44";
169935
169950
  if (needsOAuth.length > 0) {
169936
169951
  M2.info("");
169937
- M2.info(source_default.yellow(`${needsOAuth.length} connector(s) require authorization in your browser:`));
169952
+ M2.warn(`${needsOAuth.length} connector(s) require authorization in your browser:`);
169938
169953
  for (const connector2 of needsOAuth) {
169939
- M2.info(` ${connector2.type}: ${source_default.dim(connector2.redirectUrl)}`);
169954
+ M2.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
169940
169955
  }
169941
169956
  const pending = needsOAuth.map((c3) => c3.type).join(", ");
169942
169957
  if (process.env.CI) {
@@ -170255,7 +170270,7 @@ async function deployAction(options) {
170255
170270
  outroMessage: "No resources found to deploy"
170256
170271
  };
170257
170272
  }
170258
- const { project: project2, entities, functions, agents } = projectData;
170273
+ const { project: project2, entities, functions, agents, connectors } = projectData;
170259
170274
  const summaryLines = [];
170260
170275
  if (entities.length > 0) {
170261
170276
  summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
@@ -170266,6 +170281,9 @@ async function deployAction(options) {
170266
170281
  if (agents.length > 0) {
170267
170282
  summaryLines.push(` - ${agents.length} ${agents.length === 1 ? "agent" : "agents"}`);
170268
170283
  }
170284
+ if (connectors.length > 0) {
170285
+ summaryLines.push(` - ${connectors.length} ${connectors.length === 1 ? "connector" : "connectors"}`);
170286
+ }
170269
170287
  if (project2.site?.outputDirectory) {
170270
170288
  summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
170271
170289
  }
@@ -170297,7 +170315,7 @@ ${summaryLines.join(`
170297
170315
  return { outroMessage: "App deployed successfully" };
170298
170316
  }
170299
170317
  function getDeployCommand(context) {
170300
- return new Command("deploy").description("Deploy all project resources (entities, functions, agents, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
170318
+ return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
170301
170319
  await runCommand(() => deployAction(options), { requireAuth: true }, context);
170302
170320
  });
170303
170321
  }
@@ -170536,10 +170554,10 @@ async function generateContent(input) {
170536
170554
  const registryEntries = [
170537
170555
  [
170538
170556
  "EntityTypeRegistry",
170539
- entities.map((e8) => `${e8.name}: ${toPascalCase(e8.name)};`)
170557
+ entities.map((e8) => `"${e8.name}": ${toPascalCase(e8.name)};`)
170540
170558
  ],
170541
- ["FunctionNameRegistry", functions.map((f7) => `${f7.name}: true;`)],
170542
- ["AgentNameRegistry", agents.map((a5) => `${a5.name}: true;`)]
170559
+ ["FunctionNameRegistry", functions.map((f7) => `"${f7.name}": true;`)],
170560
+ ["AgentNameRegistry", agents.map((a5) => `"${a5.name}": true;`)]
170543
170561
  ];
170544
170562
  const registries2 = registryEntries.filter(([, entries]) => entries.length > 0).map(([name2, entries]) => registry2(name2, entries));
170545
170563
  return [
@@ -174919,4 +174937,4 @@ export {
174919
174937
  CLIExitError
174920
174938
  };
174921
174939
 
174922
- //# debugId=13AA5E3A43A368D664756E2164756E21
174940
+ //# debugId=B111445572F1B3F064756E2164756E21