@base44-preview/cli 0.1.14-pr.617.31be75e → 0.1.14-pr.619.5a268b0
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 +40 -58
- 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();
|
|
@@ -240000,10 +239945,46 @@ async function resolveWorkerBuild(projectRoot, progress) {
|
|
|
240000
239945
|
}
|
|
240001
239946
|
async function readIndexHtml(assetsDir, assets) {
|
|
240002
239947
|
if (!assetsDir || !assets.manifest["/index.html"]) {
|
|
240003
|
-
throw
|
|
239948
|
+
throw await missingIndexHtmlError(assetsDir, assets);
|
|
240004
239949
|
}
|
|
240005
239950
|
return new Uint8Array(await readFile3(join17(assetsDir, "index.html")));
|
|
240006
239951
|
}
|
|
239952
|
+
var BUILD_FIRST_HINT = {
|
|
239953
|
+
message: "Run 'base44 build' first (it injects your app id; a bare 'npm run build' does not)"
|
|
239954
|
+
};
|
|
239955
|
+
var REDIRECT_FILE_IN_COPY = ".wrangler/deploy/config.json";
|
|
239956
|
+
var NO_ARTIFACT_HINT = {
|
|
239957
|
+
message: `A build that emits ${REDIRECT_FILE_IN_COPY} deploys its server too; without one, only the files in the output directory are deployed.`
|
|
239958
|
+
};
|
|
239959
|
+
async function missingIndexHtmlError(assetsDir, assets) {
|
|
239960
|
+
if (!assetsDir) {
|
|
239961
|
+
return new InvalidInputError(`No site output to deploy: this build emitted no ${REDIRECT_FILE_IN_COPY}, and the project config sets no 'site.outputDirectory' to fall back to.`, {
|
|
239962
|
+
hints: [
|
|
239963
|
+
{
|
|
239964
|
+
message: `Add 'site.outputDirectory' to your config.jsonc (e.g., "site": { "outputDirectory": "dist" })`
|
|
239965
|
+
}
|
|
239966
|
+
]
|
|
239967
|
+
});
|
|
239968
|
+
}
|
|
239969
|
+
if (!await pathExists(assetsDir)) {
|
|
239970
|
+
return new InvalidInputError(`Output directory does not exist: ${assetsDir}. Make sure to build your project first.`, { hints: [BUILD_FIRST_HINT] });
|
|
239971
|
+
}
|
|
239972
|
+
const paths = Object.keys(assets.manifest);
|
|
239973
|
+
if (paths.length === 0) {
|
|
239974
|
+
return new InvalidInputError(`No files found in output directory: ${assetsDir}. Make sure to build your project first.`, { hints: [BUILD_FIRST_HINT] });
|
|
239975
|
+
}
|
|
239976
|
+
const nested = paths.filter((path) => path.endsWith("/index.html")).sort();
|
|
239977
|
+
return new InvalidInputError(`No index.html at the root of "${assetsDir}" — the build emitted ${paths.length} ${paths.length === 1 ? "file" : "files"} there, none of them an entry point.`, {
|
|
239978
|
+
hints: [
|
|
239979
|
+
...nested.length > 0 ? [
|
|
239980
|
+
{
|
|
239981
|
+
message: `Found an index.html deeper in the output: ${nested.join(", ")} — point 'site.outputDirectory' at that directory, or have the build emit an entry point at the root.`
|
|
239982
|
+
}
|
|
239983
|
+
] : [],
|
|
239984
|
+
NO_ARTIFACT_HINT
|
|
239985
|
+
]
|
|
239986
|
+
});
|
|
239987
|
+
}
|
|
240007
239988
|
function buildAssetsConfig(assetsConfig, progress) {
|
|
240008
239989
|
if (!assetsConfig)
|
|
240009
239990
|
return null;
|
|
@@ -246591,7 +246572,8 @@ async function deployAll(projectData, options) {
|
|
|
246591
246572
|
await agentSkillResource.push(agentSkills);
|
|
246592
246573
|
await agentResource.push(agents);
|
|
246593
246574
|
await authConfigResource.push(authConfig);
|
|
246594
|
-
const
|
|
246575
|
+
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
246576
|
+
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
246595
246577
|
if (project.site?.outputDirectory) {
|
|
246596
246578
|
const outputDir = resolve5(project.root, project.site.outputDirectory);
|
|
246597
246579
|
const { appUrl } = await deploySite(outputDir);
|
|
@@ -259543,4 +259525,4 @@ export {
|
|
|
259543
259525
|
runCLI
|
|
259544
259526
|
};
|
|
259545
259527
|
|
|
259546
|
-
//# debugId=
|
|
259528
|
+
//# debugId=EF071BA24F80624564756E2164756E21
|