@base44-preview/cli 0.0.30-pr.189.ae9567a → 0.0.30-pr.217.2ff8369
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 +84 -45
- package/dist/cli/index.js.map +9 -9
- package/package.json +1 -1
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
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -154685,23 +154701,48 @@ class TimeoutError2 extends Error {
|
|
|
154685
154701
|
// src/core/resources/connector/oauth.ts
|
|
154686
154702
|
var POLL_INTERVAL_MS = 2000;
|
|
154687
154703
|
var POLL_TIMEOUT_MS = 2 * 60 * 1000;
|
|
154688
|
-
async function
|
|
154704
|
+
async function runOAuthFlowWithSkip(params) {
|
|
154689
154705
|
await open_default(params.redirectUrl);
|
|
154690
154706
|
let finalStatus = "PENDING";
|
|
154691
|
-
|
|
154692
|
-
|
|
154693
|
-
|
|
154694
|
-
|
|
154695
|
-
|
|
154696
|
-
|
|
154697
|
-
|
|
154698
|
-
|
|
154699
|
-
|
|
154700
|
-
|
|
154701
|
-
|
|
154702
|
-
|
|
154707
|
+
let skipped = false;
|
|
154708
|
+
const s = Y2();
|
|
154709
|
+
const originalExit = process.exit;
|
|
154710
|
+
process.exit = () => {
|
|
154711
|
+
skipped = true;
|
|
154712
|
+
s.stop(`${params.type} skipped`);
|
|
154713
|
+
};
|
|
154714
|
+
s.start(`Waiting for ${params.type} authorization... (Esc to skip)`);
|
|
154715
|
+
try {
|
|
154716
|
+
await pWaitFor(async () => {
|
|
154717
|
+
if (skipped) {
|
|
154718
|
+
finalStatus = "SKIPPED";
|
|
154719
|
+
return true;
|
|
154720
|
+
}
|
|
154721
|
+
const response = await getOAuthStatus(params.type, params.connectionId);
|
|
154722
|
+
finalStatus = response.status;
|
|
154723
|
+
return response.status !== "PENDING";
|
|
154724
|
+
}, {
|
|
154725
|
+
interval: POLL_INTERVAL_MS,
|
|
154726
|
+
timeout: POLL_TIMEOUT_MS
|
|
154727
|
+
}).catch((err) => {
|
|
154728
|
+
if (err instanceof TimeoutError2) {
|
|
154729
|
+
finalStatus = "PENDING";
|
|
154730
|
+
} else {
|
|
154731
|
+
throw err;
|
|
154732
|
+
}
|
|
154733
|
+
});
|
|
154734
|
+
} finally {
|
|
154735
|
+
process.exit = originalExit;
|
|
154736
|
+
if (!skipped) {
|
|
154737
|
+
if (finalStatus === "ACTIVE") {
|
|
154738
|
+
s.stop(`${params.type} authorization complete`);
|
|
154739
|
+
} else if (finalStatus === "FAILED") {
|
|
154740
|
+
s.stop(`${params.type} authorization failed`);
|
|
154741
|
+
} else {
|
|
154742
|
+
s.stop(`${params.type} authorization timed out`);
|
|
154743
|
+
}
|
|
154703
154744
|
}
|
|
154704
|
-
}
|
|
154745
|
+
}
|
|
154705
154746
|
return { type: params.type, status: finalStatus };
|
|
154706
154747
|
}
|
|
154707
154748
|
// src/core/resources/connector/push.ts
|
|
@@ -154711,7 +154752,7 @@ async function pushConnectors(connectors) {
|
|
|
154711
154752
|
const localTypes = new Set(connectors.map((c) => c.type));
|
|
154712
154753
|
for (const connector of connectors) {
|
|
154713
154754
|
try {
|
|
154714
|
-
const response = await setConnector(connector.type, connector.scopes);
|
|
154755
|
+
const response = await setConnector(connector.type, connector.scopes ?? []);
|
|
154715
154756
|
results.push(setResponseToResult(connector.type, response));
|
|
154716
154757
|
} catch (err) {
|
|
154717
154758
|
results.push({
|
|
@@ -154745,7 +154786,7 @@ function setResponseToResult(type, response) {
|
|
|
154745
154786
|
return {
|
|
154746
154787
|
type,
|
|
154747
154788
|
action: "error",
|
|
154748
|
-
error: response.error_message || `Already connected by ${response.other_user_email}`
|
|
154789
|
+
error: response.error_message || `Already connected by ${response.other_user_email ?? "another user"}`
|
|
154749
154790
|
};
|
|
154750
154791
|
}
|
|
154751
154792
|
if (response.already_authorized) {
|
|
@@ -169697,7 +169738,7 @@ async function checkForUpgrade() {
|
|
|
169697
169738
|
function formatUpgradeMessage(info) {
|
|
169698
169739
|
const { shinyOrange } = theme.colors;
|
|
169699
169740
|
const { bold: bold2 } = theme.styles;
|
|
169700
|
-
return `${shinyOrange("Update available!")} ${shinyOrange(`${info.currentVersion} → ${info.latestVersion}`)} ${shinyOrange("Run:")} ${bold2(shinyOrange("npm
|
|
169741
|
+
return `${shinyOrange("Update available!")} ${shinyOrange(`${info.currentVersion} → ${info.latestVersion}`)} ${shinyOrange("Run:")} ${bold2(shinyOrange("npm install -g base44@latest"))}`;
|
|
169701
169742
|
}
|
|
169702
169743
|
async function printUpgradeNotificationIfAvailable() {
|
|
169703
169744
|
try {
|
|
@@ -169879,6 +169920,7 @@ function printSummary(results, oauthOutcomes) {
|
|
|
169879
169920
|
const synced = [];
|
|
169880
169921
|
const added = [];
|
|
169881
169922
|
const removed = [];
|
|
169923
|
+
const skipped = [];
|
|
169882
169924
|
const failed = [];
|
|
169883
169925
|
for (const r2 of results) {
|
|
169884
169926
|
const oauthStatus = oauthOutcomes.get(r2.type);
|
|
@@ -169891,6 +169933,8 @@ function printSummary(results, oauthOutcomes) {
|
|
|
169891
169933
|
} else if (r2.action === "needs_oauth") {
|
|
169892
169934
|
if (oauthStatus === "ACTIVE") {
|
|
169893
169935
|
added.push(r2.type);
|
|
169936
|
+
} else if (oauthStatus === "SKIPPED") {
|
|
169937
|
+
skipped.push(r2.type);
|
|
169894
169938
|
} else if (oauthStatus === "PENDING") {
|
|
169895
169939
|
failed.push({ type: r2.type, error: "authorization timed out" });
|
|
169896
169940
|
} else if (oauthStatus === "FAILED") {
|
|
@@ -169901,18 +169945,21 @@ function printSummary(results, oauthOutcomes) {
|
|
|
169901
169945
|
}
|
|
169902
169946
|
}
|
|
169903
169947
|
M2.info("");
|
|
169904
|
-
M2.info(
|
|
169948
|
+
M2.info(theme.styles.bold("Summary:"));
|
|
169905
169949
|
if (synced.length > 0) {
|
|
169906
|
-
M2.
|
|
169950
|
+
M2.success(`Synced: ${synced.join(", ")}`);
|
|
169907
169951
|
}
|
|
169908
169952
|
if (added.length > 0) {
|
|
169909
|
-
M2.
|
|
169953
|
+
M2.success(`Added: ${added.join(", ")}`);
|
|
169910
169954
|
}
|
|
169911
169955
|
if (removed.length > 0) {
|
|
169912
|
-
M2.info(
|
|
169956
|
+
M2.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
|
|
169957
|
+
}
|
|
169958
|
+
if (skipped.length > 0) {
|
|
169959
|
+
M2.warn(`Skipped: ${skipped.join(", ")}`);
|
|
169913
169960
|
}
|
|
169914
169961
|
for (const r2 of failed) {
|
|
169915
|
-
M2.
|
|
169962
|
+
M2.error(`Failed: ${r2.type}${r2.error ? ` - ${r2.error}` : ""}`);
|
|
169916
169963
|
}
|
|
169917
169964
|
}
|
|
169918
169965
|
async function pushConnectorsAction() {
|
|
@@ -169925,18 +169972,15 @@ async function pushConnectorsAction() {
|
|
|
169925
169972
|
}
|
|
169926
169973
|
const { results } = await runTask("Pushing connectors to Base44", async () => {
|
|
169927
169974
|
return await pushConnectors(connectors);
|
|
169928
|
-
}, {
|
|
169929
|
-
successMessage: "Connectors pushed",
|
|
169930
|
-
errorMessage: "Failed to push connectors"
|
|
169931
169975
|
});
|
|
169932
169976
|
const oauthOutcomes = new Map;
|
|
169933
169977
|
const needsOAuth = results.filter(isPendingOAuth);
|
|
169934
169978
|
let outroMessage = "Connectors pushed to Base44";
|
|
169935
169979
|
if (needsOAuth.length > 0) {
|
|
169936
169980
|
M2.info("");
|
|
169937
|
-
M2.
|
|
169981
|
+
M2.warn(`${needsOAuth.length} connector(s) require authorization in your browser:`);
|
|
169938
169982
|
for (const connector2 of needsOAuth) {
|
|
169939
|
-
M2.info(` ${connector2.type}: ${
|
|
169983
|
+
M2.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
|
|
169940
169984
|
}
|
|
169941
169985
|
const pending = needsOAuth.map((c3) => c3.type).join(", ");
|
|
169942
169986
|
if (process.env.CI) {
|
|
@@ -169951,15 +169995,10 @@ async function pushConnectorsAction() {
|
|
|
169951
169995
|
for (const connector2 of needsOAuth) {
|
|
169952
169996
|
M2.info(`
|
|
169953
169997
|
Opening browser for ${connector2.type}...`);
|
|
169954
|
-
const oauthResult = await
|
|
169955
|
-
|
|
169956
|
-
|
|
169957
|
-
|
|
169958
|
-
connectionId: connector2.connectionId
|
|
169959
|
-
});
|
|
169960
|
-
}, {
|
|
169961
|
-
successMessage: `${connector2.type} authorization complete`,
|
|
169962
|
-
errorMessage: `${connector2.type} authorization failed`
|
|
169998
|
+
const oauthResult = await runOAuthFlowWithSkip({
|
|
169999
|
+
type: connector2.type,
|
|
170000
|
+
redirectUrl: connector2.redirectUrl,
|
|
170001
|
+
connectionId: connector2.connectionId
|
|
169963
170002
|
});
|
|
169964
170003
|
oauthOutcomes.set(connector2.type, oauthResult.status);
|
|
169965
170004
|
}
|
|
@@ -170536,10 +170575,10 @@ async function generateContent(input) {
|
|
|
170536
170575
|
const registryEntries = [
|
|
170537
170576
|
[
|
|
170538
170577
|
"EntityTypeRegistry",
|
|
170539
|
-
entities.map((e8) =>
|
|
170578
|
+
entities.map((e8) => `"${e8.name}": ${toPascalCase(e8.name)};`)
|
|
170540
170579
|
],
|
|
170541
|
-
["FunctionNameRegistry", functions.map((f7) =>
|
|
170542
|
-
["AgentNameRegistry", agents.map((a5) =>
|
|
170580
|
+
["FunctionNameRegistry", functions.map((f7) => `"${f7.name}": true;`)],
|
|
170581
|
+
["AgentNameRegistry", agents.map((a5) => `"${a5.name}": true;`)]
|
|
170543
170582
|
];
|
|
170544
170583
|
const registries2 = registryEntries.filter(([, entries]) => entries.length > 0).map(([name2, entries]) => registry2(name2, entries));
|
|
170545
170584
|
return [
|
|
@@ -174919,4 +174958,4 @@ export {
|
|
|
174919
174958
|
CLIExitError
|
|
174920
174959
|
};
|
|
174921
174960
|
|
|
174922
|
-
//# debugId=
|
|
174961
|
+
//# debugId=E37980718A5E4C3064756E2164756E21
|