@base44-preview/cli 0.1.14-pr.617.31be75e → 0.1.14-pr.618.6b8b5cf
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 +11 -60
- package/dist/cli/index.js.map +7 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -237663,17 +237663,6 @@ var RemoveConnectorResponseSchema = object({
|
|
|
237663
237663
|
status: data.status,
|
|
237664
237664
|
integrationType: data.integration_type
|
|
237665
237665
|
}));
|
|
237666
|
-
var SyncDeploymentConnectorsResponseSchema = object({
|
|
237667
|
-
connectors: array(object({
|
|
237668
|
-
integration_type: IntegrationTypeSchema,
|
|
237669
|
-
scopes: array(string2())
|
|
237670
|
-
}))
|
|
237671
|
-
}).transform((data) => ({
|
|
237672
|
-
connectors: data.connectors.map((c) => ({
|
|
237673
|
-
integrationType: c.integration_type,
|
|
237674
|
-
scopes: c.scopes
|
|
237675
|
-
}))
|
|
237676
|
-
}));
|
|
237677
237666
|
var STRIPE_CONNECTOR_TYPE = "stripe";
|
|
237678
237667
|
var InstallStripeResponseSchema = object({
|
|
237679
237668
|
already_installed: boolean2(),
|
|
@@ -237741,27 +237730,6 @@ async function listConnectors() {
|
|
|
237741
237730
|
}
|
|
237742
237731
|
return result.data;
|
|
237743
237732
|
}
|
|
237744
|
-
async function syncDeploymentConnectors(connectors) {
|
|
237745
|
-
const appClient = getAppClient();
|
|
237746
|
-
let response;
|
|
237747
|
-
try {
|
|
237748
|
-
response = await appClient.put("deployment/connectors", {
|
|
237749
|
-
json: {
|
|
237750
|
-
connectors: connectors.map((c) => ({
|
|
237751
|
-
integration_type: c.integrationType,
|
|
237752
|
-
scopes: c.scopes
|
|
237753
|
-
}))
|
|
237754
|
-
}
|
|
237755
|
-
});
|
|
237756
|
-
} catch (error) {
|
|
237757
|
-
throw await ApiError.fromHttpError(error, "syncing connectors");
|
|
237758
|
-
}
|
|
237759
|
-
const result = SyncDeploymentConnectorsResponseSchema.safeParse(await response.json());
|
|
237760
|
-
if (!result.success) {
|
|
237761
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
237762
|
-
}
|
|
237763
|
-
return result.data;
|
|
237764
|
-
}
|
|
237765
237733
|
async function setConnector(integrationType, scopes) {
|
|
237766
237734
|
const appClient = getAppClient();
|
|
237767
237735
|
let response;
|
|
@@ -238023,11 +237991,6 @@ async function pullAllConnectors() {
|
|
|
238023
237991
|
async function pushConnectors(connectors) {
|
|
238024
237992
|
const stripeConnector = connectors.find((c) => c.type === STRIPE_CONNECTOR_TYPE);
|
|
238025
237993
|
const oauthConnectors = connectors.filter((c) => c.type !== STRIPE_CONNECTOR_TYPE);
|
|
238026
|
-
if (hasWorkspaceApiKeyAuth()) {
|
|
238027
|
-
return {
|
|
238028
|
-
results: await syncConnectorsWithWorkspaceApiKey(oauthConnectors, stripeConnector)
|
|
238029
|
-
};
|
|
238030
|
-
}
|
|
238031
237994
|
const oauthResults = await syncOAuthConnectors(oauthConnectors);
|
|
238032
237995
|
const stripeResult = await syncStripeConnector(stripeConnector);
|
|
238033
237996
|
const results = [...oauthResults];
|
|
@@ -238036,24 +237999,6 @@ async function pushConnectors(connectors) {
|
|
|
238036
237999
|
}
|
|
238037
238000
|
return { results };
|
|
238038
238001
|
}
|
|
238039
|
-
async function syncConnectorsWithWorkspaceApiKey(oauthConnectors, stripeConnector) {
|
|
238040
|
-
const { connectors } = await syncDeploymentConnectors(oauthConnectors.map((c) => ({
|
|
238041
|
-
integrationType: c.type,
|
|
238042
|
-
scopes: c.scopes ?? []
|
|
238043
|
-
})));
|
|
238044
|
-
const results = connectors.map((c) => ({
|
|
238045
|
-
type: c.integrationType,
|
|
238046
|
-
action: "synced"
|
|
238047
|
-
}));
|
|
238048
|
-
if (stripeConnector) {
|
|
238049
|
-
results.push({
|
|
238050
|
-
type: STRIPE_CONNECTOR_TYPE,
|
|
238051
|
-
action: "error",
|
|
238052
|
-
error: "Stripe connector sync is not supported with a workspace API key. Run 'base44 connectors push' as a logged-in user."
|
|
238053
|
-
});
|
|
238054
|
-
}
|
|
238055
|
-
return results;
|
|
238056
|
-
}
|
|
238057
238002
|
async function syncOAuthConnectors(connectors) {
|
|
238058
238003
|
const results = [];
|
|
238059
238004
|
const upstream = await listConnectors();
|
|
@@ -246584,20 +246529,21 @@ async function deployAll(projectData, options) {
|
|
|
246584
246529
|
options?.onVisibilitySet?.(project.visibility);
|
|
246585
246530
|
}
|
|
246586
246531
|
await entityResource.push(entities);
|
|
246587
|
-
await deployFunctionsSequentially(functions, {
|
|
246532
|
+
const functionResults = await deployFunctionsSequentially(functions, {
|
|
246588
246533
|
onStart: options?.onFunctionStart,
|
|
246589
246534
|
onResult: options?.onFunctionResult
|
|
246590
246535
|
});
|
|
246591
246536
|
await agentSkillResource.push(agentSkills);
|
|
246592
246537
|
await agentResource.push(agents);
|
|
246593
246538
|
await authConfigResource.push(authConfig);
|
|
246594
|
-
const
|
|
246539
|
+
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
246540
|
+
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
246595
246541
|
if (project.site?.outputDirectory) {
|
|
246596
246542
|
const outputDir = resolve5(project.root, project.site.outputDirectory);
|
|
246597
246543
|
const { appUrl } = await deploySite(outputDir);
|
|
246598
|
-
return { appUrl, connectorResults };
|
|
246544
|
+
return { appUrl, connectorResults, functionResults };
|
|
246599
246545
|
}
|
|
246600
|
-
return { connectorResults };
|
|
246546
|
+
return { connectorResults, functionResults };
|
|
246601
246547
|
}
|
|
246602
246548
|
// src/core/clients/base44-client.ts
|
|
246603
246549
|
var retriedRequests = new WeakSet;
|
|
@@ -249615,6 +249561,11 @@ ${summaryLines.join(`
|
|
|
249615
249561
|
if (result.appUrl) {
|
|
249616
249562
|
log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
|
|
249617
249563
|
}
|
|
249564
|
+
const failedFunctions = result.functionResults.filter((functionResult) => functionResult.status === "error").length;
|
|
249565
|
+
if (failedFunctions > 0) {
|
|
249566
|
+
log.warn(`${failedFunctions} ${failedFunctions === 1 ? "function" : "functions"} failed to deploy`);
|
|
249567
|
+
throw new CLIExitError(1);
|
|
249568
|
+
}
|
|
249618
249569
|
return { outroMessage: "App deployed successfully" };
|
|
249619
249570
|
}
|
|
249620
249571
|
function getDeployCommand2() {
|
|
@@ -259543,4 +259494,4 @@ export {
|
|
|
259543
259494
|
runCLI
|
|
259544
259495
|
};
|
|
259545
259496
|
|
|
259546
|
-
//# debugId=
|
|
259497
|
+
//# debugId=948085031B0FBD6764756E2164756E21
|