@base44-preview/cli 0.0.51-pr.503.a910f3e → 0.0.51-pr.516.5cdf28c

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
@@ -8935,8 +8935,8 @@ var require_ejs = __commonJS((exports) => {
8935
8935
  exports.resolveInclude = function(name2, filename, isDir) {
8936
8936
  var dirname6 = path11.dirname;
8937
8937
  var extname = path11.extname;
8938
- var resolve2 = path11.resolve;
8939
- var includePath = resolve2(isDir ? filename : dirname6(filename), name2);
8938
+ var resolve = path11.resolve;
8939
+ var includePath = resolve(isDir ? filename : dirname6(filename), name2);
8940
8940
  var ext = extname(name2);
8941
8941
  if (!ext) {
8942
8942
  includePath += ".ejs";
@@ -9011,10 +9011,10 @@ var require_ejs = __commonJS((exports) => {
9011
9011
  var result;
9012
9012
  if (!cb) {
9013
9013
  if (typeof exports.promiseImpl == "function") {
9014
- return new exports.promiseImpl(function(resolve2, reject) {
9014
+ return new exports.promiseImpl(function(resolve, reject) {
9015
9015
  try {
9016
9016
  result = handleCache(options)(data);
9017
- resolve2(result);
9017
+ resolve(result);
9018
9018
  } catch (err) {
9019
9019
  reject(err);
9020
9020
  }
@@ -12452,12 +12452,12 @@ var require_isexe = __commonJS((exports, module) => {
12452
12452
  if (typeof Promise !== "function") {
12453
12453
  throw new TypeError("callback not provided");
12454
12454
  }
12455
- return new Promise(function(resolve3, reject) {
12455
+ return new Promise(function(resolve2, reject) {
12456
12456
  isexe(path11, options || {}, function(er, is) {
12457
12457
  if (er) {
12458
12458
  reject(er);
12459
12459
  } else {
12460
- resolve3(is);
12460
+ resolve2(is);
12461
12461
  }
12462
12462
  });
12463
12463
  });
@@ -12519,27 +12519,27 @@ var require_which = __commonJS((exports, module) => {
12519
12519
  opt = {};
12520
12520
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
12521
12521
  const found = [];
12522
- const step = (i) => new Promise((resolve3, reject) => {
12522
+ const step = (i) => new Promise((resolve2, reject) => {
12523
12523
  if (i === pathEnv.length)
12524
- return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
12524
+ return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
12525
12525
  const ppRaw = pathEnv[i];
12526
12526
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
12527
12527
  const pCmd = path11.join(pathPart, cmd);
12528
12528
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
12529
- resolve3(subStep(p, i, 0));
12529
+ resolve2(subStep(p, i, 0));
12530
12530
  });
12531
- const subStep = (p, i, ii) => new Promise((resolve3, reject) => {
12531
+ const subStep = (p, i, ii) => new Promise((resolve2, reject) => {
12532
12532
  if (ii === pathExt.length)
12533
- return resolve3(step(i + 1));
12533
+ return resolve2(step(i + 1));
12534
12534
  const ext = pathExt[ii];
12535
12535
  isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
12536
12536
  if (!er && is) {
12537
12537
  if (opt.all)
12538
12538
  found.push(p + ext);
12539
12539
  else
12540
- return resolve3(p + ext);
12540
+ return resolve2(p + ext);
12541
12541
  }
12542
- return resolve3(subStep(p, i, ii + 1));
12542
+ return resolve2(subStep(p, i, ii + 1));
12543
12543
  });
12544
12544
  });
12545
12545
  return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
@@ -27503,7 +27503,7 @@ function cleanDoc(doc2) {
27503
27503
  return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
27504
27504
  }
27505
27505
  function replaceEndOfLine(doc2, replacement = literalline) {
27506
- return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join19(replacement, currentDoc.split(`
27506
+ return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join20(replacement, currentDoc.split(`
27507
27507
  `)) : currentDoc);
27508
27508
  }
27509
27509
  function canBreakFn(doc2) {
@@ -27583,7 +27583,7 @@ function indentIfBreak(contents, options) {
27583
27583
  negate: options.negate
27584
27584
  };
27585
27585
  }
27586
- function join19(separator, docs) {
27586
+ function join20(separator, docs) {
27587
27587
  assertDoc(separator);
27588
27588
  assertDocArray(docs);
27589
27589
  const parts = [];
@@ -28294,7 +28294,7 @@ var init_doc = __esm(() => {
28294
28294
  MODE_FLAT = Symbol("MODE_FLAT");
28295
28295
  DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
28296
28296
  builders = {
28297
- join: join19,
28297
+ join: join20,
28298
28298
  line,
28299
28299
  softline,
28300
28300
  hardline,
@@ -115559,7 +115559,7 @@ import { fileURLToPath as fileURLToPath22 } from "url";
115559
115559
  import v8 from "v8";
115560
115560
  import assert22 from "assert";
115561
115561
  import { format as format2, inspect as inspect3 } from "util";
115562
- import { createRequire as createRequire3 } from "module";
115562
+ import { createRequire as createRequire2 } from "module";
115563
115563
  import { equal, ok, strictEqual } from "assert";
115564
115564
  import path112 from "path";
115565
115565
  import { fileURLToPath as fileURLToPath52 } from "url";
@@ -118133,7 +118133,7 @@ function importFromFile(specifier, parent) {
118133
118133
  return import(url3);
118134
118134
  }
118135
118135
  function requireFromFile(id2, parent) {
118136
- const require22 = createRequire3(parent);
118136
+ const require22 = createRequire2(parent);
118137
118137
  return require22(id2);
118138
118138
  }
118139
118139
  async function loadExternalConfig(externalConfig, configFile) {
@@ -124338,7 +124338,7 @@ var init_prettier = __esm(() => {
124338
124338
  const absolute = [];
124339
124339
  const relative22 = [];
124340
124340
  for (const pattern of patterns) {
124341
- if (isAbsolute3(pattern)) {
124341
+ if (isAbsolute2(pattern)) {
124342
124342
  absolute.push(pattern);
124343
124343
  } else {
124344
124344
  relative22.push(pattern);
@@ -124347,10 +124347,10 @@ var init_prettier = __esm(() => {
124347
124347
  return [absolute, relative22];
124348
124348
  }
124349
124349
  exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
124350
- function isAbsolute3(pattern) {
124350
+ function isAbsolute2(pattern) {
124351
124351
  return path152.isAbsolute(pattern);
124352
124352
  }
124353
- exports.isAbsolute = isAbsolute3;
124353
+ exports.isAbsolute = isAbsolute2;
124354
124354
  }
124355
124355
  });
124356
124356
  require_merge22 = __commonJS2({
@@ -133208,7 +133208,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133208
133208
  return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
133209
133209
  }
133210
133210
  function replaceEndOfLine2(doc2, replacement = literalline2) {
133211
- return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join21(replacement, currentDoc.split(`
133211
+ return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join22(replacement, currentDoc.split(`
133212
133212
  `)) : currentDoc);
133213
133213
  }
133214
133214
  function canBreakFn2(doc2) {
@@ -133294,7 +133294,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133294
133294
  negate: options8.negate
133295
133295
  };
133296
133296
  }
133297
- function join21(separator, docs) {
133297
+ function join22(separator, docs) {
133298
133298
  assertDoc2(separator);
133299
133299
  assertDocArray2(docs);
133300
133300
  const parts = [];
@@ -133959,7 +133959,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133959
133959
  }
133960
133960
  }
133961
133961
  var builders2 = {
133962
- join: join21,
133962
+ join: join22,
133963
133963
  line: line3,
133964
133964
  softline: softline2,
133965
133965
  hardline: hardline4,
@@ -160399,10 +160399,10 @@ var require_view = __commonJS((exports, module) => {
160399
160399
  var debug = require_src4()("express:view");
160400
160400
  var path18 = __require("node:path");
160401
160401
  var fs28 = __require("node:fs");
160402
- var dirname15 = path18.dirname;
160402
+ var dirname16 = path18.dirname;
160403
160403
  var basename4 = path18.basename;
160404
160404
  var extname2 = path18.extname;
160405
- var join22 = path18.join;
160405
+ var join23 = path18.join;
160406
160406
  var resolve8 = path18.resolve;
160407
160407
  module.exports = View;
160408
160408
  function View(name2, options8) {
@@ -160438,7 +160438,7 @@ var require_view = __commonJS((exports, module) => {
160438
160438
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
160439
160439
  var root2 = roots[i5];
160440
160440
  var loc = resolve8(root2, name2);
160441
- var dir = dirname15(loc);
160441
+ var dir = dirname16(loc);
160442
160442
  var file2 = basename4(loc);
160443
160443
  path19 = this.resolve(dir, file2);
160444
160444
  }
@@ -160464,12 +160464,12 @@ var require_view = __commonJS((exports, module) => {
160464
160464
  };
160465
160465
  View.prototype.resolve = function resolve9(dir, file2) {
160466
160466
  var ext = this.ext;
160467
- var path19 = join22(dir, file2);
160467
+ var path19 = join23(dir, file2);
160468
160468
  var stat2 = tryStat(path19);
160469
160469
  if (stat2 && stat2.isFile()) {
160470
160470
  return path19;
160471
160471
  }
160472
- path19 = join22(dir, basename4(file2, ext), "index" + ext);
160472
+ path19 = join23(dir, basename4(file2, ext), "index" + ext);
160473
160473
  stat2 = tryStat(path19);
160474
160474
  if (stat2 && stat2.isFile()) {
160475
160475
  return path19;
@@ -164164,7 +164164,7 @@ var require_send = __commonJS((exports, module) => {
164164
164164
  var Stream2 = __require("stream");
164165
164165
  var util2 = __require("util");
164166
164166
  var extname2 = path18.extname;
164167
- var join22 = path18.join;
164167
+ var join23 = path18.join;
164168
164168
  var normalize2 = path18.normalize;
164169
164169
  var resolve8 = path18.resolve;
164170
164170
  var sep = path18.sep;
@@ -164336,7 +164336,7 @@ var require_send = __commonJS((exports, module) => {
164336
164336
  return res;
164337
164337
  }
164338
164338
  parts = path19.split(sep);
164339
- path19 = normalize2(join22(root2, path19));
164339
+ path19 = normalize2(join23(root2, path19));
164340
164340
  } else {
164341
164341
  if (UP_PATH_REGEXP.test(path19)) {
164342
164342
  debug('malicious path "%s"', path19);
@@ -164476,7 +164476,7 @@ var require_send = __commonJS((exports, module) => {
164476
164476
  return self2.onStatError(err);
164477
164477
  return self2.error(404);
164478
164478
  }
164479
- var p4 = join22(path19, self2._index[i5]);
164479
+ var p4 = join23(path19, self2._index[i5]);
164480
164480
  debug('stat "%s"', p4);
164481
164481
  fs28.stat(p4, function(err2, stat2) {
164482
164482
  if (err2)
@@ -214616,7 +214616,7 @@ var require_buffer_list = __commonJS((exports, module) => {
214616
214616
  }
214617
214617
  }, {
214618
214618
  key: "join",
214619
- value: function join22(s5) {
214619
+ value: function join23(s5) {
214620
214620
  if (this.length === 0)
214621
214621
  return "";
214622
214622
  var p4 = this.head;
@@ -218270,7 +218270,7 @@ var require_dist5 = __commonJS((exports, module) => {
218270
218270
  });
218271
218271
 
218272
218272
  // src/cli/index.ts
218273
- import { dirname as dirname19, join as join25 } from "node:path";
218273
+ import { dirname as dirname20, join as join26 } from "node:path";
218274
218274
  import { fileURLToPath as fileURLToPath6 } from "node:url";
218275
218275
 
218276
218276
  // ../../node_modules/@clack/core/dist/index.mjs
@@ -234632,8 +234632,7 @@ var ProjectConfigSchema = exports_external.object({
234632
234632
  functionsDir: exports_external.string().optional().default("functions"),
234633
234633
  agentsDir: exports_external.string().optional().default("agents"),
234634
234634
  connectorsDir: exports_external.string().optional().default("connectors"),
234635
- authDir: exports_external.string().optional().default("auth"),
234636
- plugins: exports_external.array(exports_external.string()).optional().default([])
234635
+ authDir: exports_external.string().optional().default("auth")
234637
234636
  });
234638
234637
  var AppConfigSchema = exports_external.object({
234639
234638
  id: exports_external.string().min(1, "id cannot be empty")
@@ -241580,8 +241579,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
241580
241579
  var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
241581
241580
 
241582
241581
  // src/core/project/config.ts
241583
- import { createRequire as createRequire2 } from "node:module";
241584
- import { dirname as dirname5, isAbsolute as isAbsolute2, join as join8, resolve } from "node:path";
241582
+ import { dirname as dirname5, join as join8 } from "node:path";
241585
241583
 
241586
241584
  // src/core/resources/agent/schema.ts
241587
241585
  var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
@@ -241976,7 +241974,11 @@ async function updateSocialLoginConfig(authDir, provider, enable, customOAuth) {
241976
241974
  const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
241977
241975
  const merged = {
241978
241976
  ...current,
241979
- [providerInfo.field]: enable
241977
+ [providerInfo.field]: enable,
241978
+ ...enable && {
241979
+ enableSSOLogin: false,
241980
+ ssoProviderName: null
241981
+ }
241980
241982
  };
241981
241983
  if (providerInfo.customOAuth) {
241982
241984
  const oauth = providerInfo.customOAuth;
@@ -242000,6 +242002,192 @@ async function pushCustomOAuthSecret(provider, clientSecret) {
242000
242002
  [providerInfo.customOAuth.secretKey]: clientSecret
242001
242003
  });
242002
242004
  }
242005
+ // src/core/resources/auth-config/sso/secret-keys.ts
242006
+ var SSOSecretKey;
242007
+ ((SSOSecretKey2) => {
242008
+ SSOSecretKey2["Name"] = "sso_name";
242009
+ SSOSecretKey2["ClientId"] = "sso_client_id";
242010
+ SSOSecretKey2["ClientSecret"] = "sso_client_secret";
242011
+ SSOSecretKey2["Scope"] = "sso_scope";
242012
+ SSOSecretKey2["DiscoveryUrl"] = "sso_discovery_url";
242013
+ SSOSecretKey2["TenantId"] = "sso_tenant_id";
242014
+ SSOSecretKey2["AuthEndpoint"] = "sso_auth_endpoint";
242015
+ SSOSecretKey2["TokenEndpoint"] = "sso_token_endpoint";
242016
+ SSOSecretKey2["UserinfoEndpoint"] = "sso_userinfo_endpoint";
242017
+ SSOSecretKey2["OktaDomain"] = "sso_okta_domain";
242018
+ SSOSecretKey2["JwksUri"] = "sso_jwks_uri";
242019
+ })(SSOSecretKey ||= {});
242020
+ var ALL_SSO_SECRET_KEYS = Object.values(SSOSecretKey);
242021
+ var DEFAULT_OIDC_SCOPE = "openid email profile";
242022
+ var DEFAULT_GITHUB_SCOPE = "user:email";
242023
+
242024
+ // src/core/resources/auth-config/sso/providers/custom.ts
242025
+ var customProvider = {
242026
+ requiredKeys: [
242027
+ "sso_auth_endpoint" /* AuthEndpoint */,
242028
+ "sso_token_endpoint" /* TokenEndpoint */,
242029
+ "sso_userinfo_endpoint" /* UserinfoEndpoint */,
242030
+ "sso_jwks_uri" /* JwksUri */
242031
+ ],
242032
+ defaults: {
242033
+ ["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
242034
+ }
242035
+ };
242036
+
242037
+ // src/core/resources/auth-config/sso/providers/github.ts
242038
+ var githubProvider = {
242039
+ requiredKeys: [],
242040
+ defaults: {
242041
+ ["sso_scope" /* Scope */]: DEFAULT_GITHUB_SCOPE,
242042
+ ["sso_auth_endpoint" /* AuthEndpoint */]: "https://github.com/login/oauth/authorize",
242043
+ ["sso_token_endpoint" /* TokenEndpoint */]: "https://github.com/login/oauth/access_token",
242044
+ ["sso_userinfo_endpoint" /* UserinfoEndpoint */]: "https://api.github.com/user"
242045
+ }
242046
+ };
242047
+
242048
+ // src/core/resources/auth-config/sso/providers/google.ts
242049
+ var googleProvider = {
242050
+ requiredKeys: [],
242051
+ defaults: {
242052
+ ["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE,
242053
+ ["sso_discovery_url" /* DiscoveryUrl */]: "https://accounts.google.com/.well-known/openid-configuration"
242054
+ }
242055
+ };
242056
+
242057
+ // src/core/resources/auth-config/sso/providers/microsoft.ts
242058
+ var microsoftProvider = {
242059
+ requiredKeys: ["sso_tenant_id" /* TenantId */],
242060
+ defaults: {
242061
+ ["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
242062
+ },
242063
+ deriveDefaults: (secrets) => {
242064
+ const tenantId = secrets["sso_tenant_id" /* TenantId */];
242065
+ if (tenantId) {
242066
+ return {
242067
+ ["sso_discovery_url" /* DiscoveryUrl */]: `https://login.microsoftonline.com/${tenantId}/v2.0/.well-known/openid-configuration`
242068
+ };
242069
+ }
242070
+ return {};
242071
+ }
242072
+ };
242073
+
242074
+ // src/core/resources/auth-config/sso/providers/okta.ts
242075
+ var oktaProvider = {
242076
+ requiredKeys: ["sso_okta_domain" /* OktaDomain */],
242077
+ defaults: {
242078
+ ["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
242079
+ },
242080
+ deriveDefaults: (secrets) => {
242081
+ const domain2 = secrets["sso_okta_domain" /* OktaDomain */];
242082
+ if (domain2) {
242083
+ return {
242084
+ ["sso_discovery_url" /* DiscoveryUrl */]: `https://${domain2}/.well-known/openid-configuration`
242085
+ };
242086
+ }
242087
+ return {};
242088
+ }
242089
+ };
242090
+
242091
+ // src/core/resources/auth-config/sso/providers/index.ts
242092
+ var SSO_PROVIDER_SCHEMAS = {
242093
+ google: googleProvider,
242094
+ microsoft: microsoftProvider,
242095
+ github: githubProvider,
242096
+ okta: oktaProvider,
242097
+ custom: customProvider
242098
+ };
242099
+
242100
+ // src/core/resources/auth-config/sso/types.ts
242101
+ var KNOWN_SSO_PROVIDERS = {
242102
+ google: "google",
242103
+ microsoft: "microsoft",
242104
+ github: "github",
242105
+ okta: "okta",
242106
+ custom: "custom"
242107
+ };
242108
+
242109
+ // src/core/resources/auth-config/sso/operations.ts
242110
+ var OPTION_TO_SECRET_KEY = {
242111
+ scope: "sso_scope" /* Scope */,
242112
+ discoveryUrl: "sso_discovery_url" /* DiscoveryUrl */,
242113
+ tenantId: "sso_tenant_id" /* TenantId */,
242114
+ oktaDomain: "sso_okta_domain" /* OktaDomain */,
242115
+ authEndpoint: "sso_auth_endpoint" /* AuthEndpoint */,
242116
+ tokenEndpoint: "sso_token_endpoint" /* TokenEndpoint */,
242117
+ userinfoEndpoint: "sso_userinfo_endpoint" /* UserinfoEndpoint */,
242118
+ jwksUri: "sso_jwks_uri" /* JwksUri */
242119
+ };
242120
+ async function updateSSOConfig(authDir, provider, enable) {
242121
+ const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
242122
+ const merged = {
242123
+ ...current,
242124
+ enableSSOLogin: enable,
242125
+ ssoProviderName: enable && provider ? provider : null,
242126
+ ...enable && {
242127
+ enableGoogleLogin: false,
242128
+ enableMicrosoftLogin: false,
242129
+ enableFacebookLogin: false,
242130
+ enableAppleLogin: false
242131
+ }
242132
+ };
242133
+ await writeAuthConfig(authDir, merged);
242134
+ return merged;
242135
+ }
242136
+
242137
+ class MissingSSOFieldsError extends InvalidInputError {
242138
+ missingKeys;
242139
+ provider;
242140
+ constructor(provider, missingKeys) {
242141
+ super(`Missing required fields for ${provider}: ${missingKeys.join(", ")}`);
242142
+ this.provider = provider;
242143
+ this.missingKeys = missingKeys;
242144
+ }
242145
+ }
242146
+ function buildSSOSecrets(provider, options) {
242147
+ const schema3 = SSO_PROVIDER_SCHEMAS[provider];
242148
+ const secrets = {};
242149
+ secrets["sso_name" /* Name */] = options.ssoName ?? provider;
242150
+ secrets["sso_client_id" /* ClientId */] = options.clientId;
242151
+ secrets["sso_client_secret" /* ClientSecret */] = options.clientSecret;
242152
+ for (const [optionKey, secretKey] of Object.entries(OPTION_TO_SECRET_KEY)) {
242153
+ const value = options[optionKey];
242154
+ if (typeof value === "string" && value.length > 0) {
242155
+ secrets[secretKey] = value;
242156
+ }
242157
+ }
242158
+ if (schema3.deriveDefaults) {
242159
+ const derived = schema3.deriveDefaults(secrets);
242160
+ for (const [key, val] of Object.entries(derived)) {
242161
+ if (!secrets[key]) {
242162
+ secrets[key] = val;
242163
+ }
242164
+ }
242165
+ }
242166
+ for (const [key, val] of Object.entries(schema3.defaults)) {
242167
+ if (!secrets[key]) {
242168
+ secrets[key] = val;
242169
+ }
242170
+ }
242171
+ const missing = [];
242172
+ for (const key of schema3.requiredKeys) {
242173
+ if (!secrets[key]) {
242174
+ missing.push(key);
242175
+ }
242176
+ }
242177
+ if (provider === KNOWN_SSO_PROVIDERS.custom && !options.ssoName) {
242178
+ missing.push("sso_name" /* Name */);
242179
+ }
242180
+ if (missing.length > 0) {
242181
+ throw new MissingSSOFieldsError(provider, missing);
242182
+ }
242183
+ return Object.fromEntries(Object.entries(secrets).filter(([, v]) => v.length > 0));
242184
+ }
242185
+ async function pushSSOSecrets(secrets) {
242186
+ await setSecrets(secrets);
242187
+ }
242188
+ async function deleteSSOSecrets() {
242189
+ await Promise.allSettled(ALL_SSO_SECRET_KEYS.map((key) => deleteSecret(key)));
242190
+ }
242003
242191
  // src/core/resources/connector/schema.ts
242004
242192
  var GoogleCalendarConnectorSchema = exports_external.object({
242005
242193
  type: exports_external.literal("googlecalendar"),
@@ -242657,55 +242845,6 @@ var SyncEntitiesResponseSchema = exports_external.object({
242657
242845
  deleted: exports_external.array(exports_external.string())
242658
242846
  });
242659
242847
 
242660
- // src/core/resources/entity/config.ts
242661
- async function readEntityFile(entityPath) {
242662
- const parsed = await readJsonFile(entityPath);
242663
- const result = EntitySchema.safeParse(parsed);
242664
- if (!result.success) {
242665
- throw new SchemaValidationError("Invalid entity file", result.error, entityPath);
242666
- }
242667
- return result.data;
242668
- }
242669
- async function readAllEntities(entitiesDir) {
242670
- if (!await pathExists(entitiesDir)) {
242671
- return [];
242672
- }
242673
- const files = await globby(`*.${CONFIG_FILE_EXTENSION_GLOB}`, {
242674
- cwd: entitiesDir,
242675
- absolute: true
242676
- });
242677
- const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
242678
- return entities;
242679
- }
242680
- function mergeEntities(appEntities, pluginEntities) {
242681
- const appEntitiesByName = new Map(appEntities.map((entity) => [entity.name, entity]));
242682
- let mergedEntities = [];
242683
- pluginEntities.forEach((pluginEntity) => {
242684
- const appEntityToMerge = appEntitiesByName.get(pluginEntity.name);
242685
- if (appEntityToMerge) {
242686
- const appEntityProperties = Object.keys(appEntityToMerge.properties);
242687
- const pluginEntityProperties = Object.keys(pluginEntity.properties);
242688
- const collidingProperties = appEntityProperties.filter((prop) => pluginEntityProperties.includes(prop));
242689
- if (collidingProperties.length) {
242690
- const collidingPropertiesNames = collidingProperties.map((name2) => `"${name2}"`).join(", ");
242691
- throw new ConfigInvalidError(`Entity "${appEntityToMerge.name}" cannot override plugin-defined properties: ${collidingPropertiesNames}.
242692
- Plugin properties are protected — remove or rename them in your local entity.`);
242693
- }
242694
- mergedEntities.push({
242695
- ...pluginEntity,
242696
- properties: {
242697
- ...pluginEntity.properties,
242698
- ...appEntityToMerge.properties
242699
- }
242700
- });
242701
- appEntitiesByName.delete(appEntityToMerge.name);
242702
- } else {
242703
- mergedEntities.push(pluginEntity);
242704
- }
242705
- });
242706
- return [...mergedEntities, ...appEntitiesByName.values()];
242707
- }
242708
-
242709
242848
  // src/core/resources/entity/api.ts
242710
242849
  async function syncEntities(entities) {
242711
242850
  const appClient = getAppClient();
@@ -242727,6 +242866,26 @@ async function syncEntities(entities) {
242727
242866
  }
242728
242867
  return result.data;
242729
242868
  }
242869
+ // src/core/resources/entity/config.ts
242870
+ async function readEntityFile(entityPath) {
242871
+ const parsed = await readJsonFile(entityPath);
242872
+ const result = EntitySchema.safeParse(parsed);
242873
+ if (!result.success) {
242874
+ throw new SchemaValidationError("Invalid entity file", result.error, entityPath);
242875
+ }
242876
+ return result.data;
242877
+ }
242878
+ async function readAllEntities(entitiesDir) {
242879
+ if (!await pathExists(entitiesDir)) {
242880
+ return [];
242881
+ }
242882
+ const files = await globby(`*.${CONFIG_FILE_EXTENSION_GLOB}`, {
242883
+ cwd: entitiesDir,
242884
+ absolute: true
242885
+ });
242886
+ const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
242887
+ return entities;
242888
+ }
242730
242889
  // src/core/resources/entity/deploy.ts
242731
242890
  async function pushEntities(entities) {
242732
242891
  if (entities.length === 0) {
@@ -243152,13 +243311,6 @@ var functionResource = {
243152
243311
  push: (functions) => deployFunctionsSequentially(functions)
243153
243312
  };
243154
243313
  // src/core/project/config.ts
243155
- function resolvePluginRoot(pluginRef, fromRoot) {
243156
- if (pluginRef.startsWith(".") || isAbsolute2(pluginRef)) {
243157
- return resolve(fromRoot, pluginRef);
243158
- }
243159
- const req = createRequire2(join8(fromRoot, "package.json"));
243160
- return dirname5(req.resolve(`${pluginRef}/package.json`));
243161
- }
243162
243314
  async function findConfigInDir(dir) {
243163
243315
  const files = await globby(PROJECT_CONFIG_PATTERNS, {
243164
243316
  cwd: dir,
@@ -243196,20 +243348,13 @@ async function readProjectConfig(projectRoot) {
243196
243348
  }
243197
243349
  const project = result.data;
243198
243350
  const configDir = dirname5(configPath);
243199
- const [appEntities, functions, agents, connectors, authConfig] = await Promise.all([
243351
+ const [entities, functions, agents, connectors, authConfig] = await Promise.all([
243200
243352
  entityResource.readAll(join8(configDir, project.entitiesDir)),
243201
243353
  functionResource.readAll(join8(configDir, project.functionsDir)),
243202
243354
  agentResource.readAll(join8(configDir, project.agentsDir)),
243203
243355
  connectorResource.readAll(join8(configDir, project.connectorsDir)),
243204
243356
  authConfigResource.readAll(join8(configDir, project.authDir))
243205
243357
  ]);
243206
- let entities = appEntities;
243207
- for (const pluginRef of project.plugins) {
243208
- const plugin = await readProjectConfig(resolvePluginRoot(pluginRef, root));
243209
- entities = mergeEntities(appEntities, plugin.entities);
243210
- functions.push(...plugin.functions);
243211
- agents.push(...plugin.agents);
243212
- }
243213
243358
  return {
243214
243359
  project: { ...project, root, configPath },
243215
243360
  entities,
@@ -243586,7 +243731,7 @@ async function createProjectFilesForExistingProject(options) {
243586
243731
  };
243587
243732
  }
243588
243733
  // src/core/project/deploy.ts
243589
- import { resolve as resolve2 } from "node:path";
243734
+ import { resolve } from "node:path";
243590
243735
 
243591
243736
  // src/core/site/api.ts
243592
243737
  async function uploadSite(archivePath) {
@@ -243675,7 +243820,7 @@ async function deployAll(projectData, options) {
243675
243820
  await authConfigResource.push(authConfig);
243676
243821
  const { results: connectorResults } = await pushConnectors(connectors);
243677
243822
  if (project.site?.outputDirectory) {
243678
- const outputDir = resolve2(project.root, project.site.outputDirectory);
243823
+ const outputDir = resolve(project.root, project.site.outputDirectory);
243679
243824
  const { appUrl } = await deploySite(outputDir);
243680
243825
  return { appUrl, connectorResults };
243681
243826
  }
@@ -245490,8 +245635,8 @@ var disconnect = (anyProcess) => {
245490
245635
  // ../../node_modules/execa/lib/utils/deferred.js
245491
245636
  var createDeferred = () => {
245492
245637
  const methods = {};
245493
- const promise2 = new Promise((resolve3, reject) => {
245494
- Object.assign(methods, { resolve: resolve3, reject });
245638
+ const promise2 = new Promise((resolve2, reject) => {
245639
+ Object.assign(methods, { resolve: resolve2, reject });
245495
245640
  });
245496
245641
  return Object.assign(promise2, methods);
245497
245642
  };
@@ -249855,11 +250000,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
249855
250000
  const promises = weakMap.get(stream);
249856
250001
  const promise2 = createDeferred();
249857
250002
  promises.push(promise2);
249858
- const resolve3 = promise2.resolve.bind(promise2);
249859
- return { resolve: resolve3, promises };
250003
+ const resolve2 = promise2.resolve.bind(promise2);
250004
+ return { resolve: resolve2, promises };
249860
250005
  };
249861
- var waitForConcurrentStreams = async ({ resolve: resolve3, promises }, subprocess) => {
249862
- resolve3();
250006
+ var waitForConcurrentStreams = async ({ resolve: resolve2, promises }, subprocess) => {
250007
+ resolve2();
249863
250008
  const [isSubprocessExit] = await Promise.race([
249864
250009
  Promise.allSettled([true, subprocess]),
249865
250010
  Promise.all([false, ...promises])
@@ -250986,7 +251131,7 @@ function getAuthPushCommand() {
250986
251131
  }
250987
251132
 
250988
251133
  // src/cli/commands/auth/social-login.ts
250989
- import { dirname as dirname10, join as join15, resolve as resolve3 } from "node:path";
251134
+ import { dirname as dirname10, join as join15, resolve as resolve2 } from "node:path";
250990
251135
  var PROVIDER_LABELS = {
250991
251136
  google: "Google",
250992
251137
  microsoft: "Microsoft",
@@ -251026,7 +251171,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
251026
251171
  let clientSecret;
251027
251172
  if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
251028
251173
  if (options.envFile) {
251029
- const secrets = await parseEnvFile(resolve3(options.envFile));
251174
+ const secrets = await parseEnvFile(resolve2(options.envFile));
251030
251175
  const value = secrets[oauthCli.envVar];
251031
251176
  if (!value) {
251032
251177
  throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
@@ -251081,9 +251226,213 @@ function getSocialLoginCommand() {
251081
251226
  ])).option("--client-id <id>", "custom OAuth client ID (Google only)").option("--client-secret <secret>", "custom OAuth client secret (Google only)").option("--client-secret-stdin", "read client secret from stdin (Google only)").option("--env-file <path>", "read client secret from a .env file (Google only)").action(socialLoginAction);
251082
251227
  }
251083
251228
 
251229
+ // src/cli/commands/auth/sso.ts
251230
+ import { dirname as dirname11, join as join16, resolve as resolve3 } from "node:path";
251231
+ var SSOConfigFileSchema = exports_external.object({
251232
+ provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
251233
+ clientId: exports_external.string(),
251234
+ clientSecret: exports_external.string(),
251235
+ scope: exports_external.string().optional(),
251236
+ discoveryUrl: exports_external.string().optional(),
251237
+ tenantId: exports_external.string().optional(),
251238
+ oktaDomain: exports_external.string().optional(),
251239
+ authEndpoint: exports_external.string().optional(),
251240
+ tokenEndpoint: exports_external.string().optional(),
251241
+ userinfoEndpoint: exports_external.string().optional(),
251242
+ jwksUri: exports_external.string().optional(),
251243
+ ssoName: exports_external.string().optional()
251244
+ });
251245
+ async function loadSSOConfigFile(filePath) {
251246
+ const resolved = resolve3(filePath);
251247
+ const raw2 = await readJsonFile(resolved);
251248
+ const result = SSOConfigFileSchema.safeParse(raw2);
251249
+ if (!result.success) {
251250
+ throw new SchemaValidationError("Invalid SSO config file", result.error, filePath);
251251
+ }
251252
+ return result.data;
251253
+ }
251254
+ function mergeFileWithFlags(fileConfig, options) {
251255
+ return {
251256
+ provider: options.provider ?? fileConfig.provider,
251257
+ clientId: options.clientId ?? fileConfig.clientId,
251258
+ clientSecret: options.clientSecret ?? fileConfig.clientSecret,
251259
+ clientSecretStdin: options.clientSecretStdin,
251260
+ envFile: options.envFile,
251261
+ scope: options.scope ?? fileConfig.scope,
251262
+ discoveryUrl: options.discoveryUrl ?? fileConfig.discoveryUrl,
251263
+ tenantId: options.tenantId ?? fileConfig.tenantId,
251264
+ oktaDomain: options.oktaDomain ?? fileConfig.oktaDomain,
251265
+ authEndpoint: options.authEndpoint ?? fileConfig.authEndpoint,
251266
+ tokenEndpoint: options.tokenEndpoint ?? fileConfig.tokenEndpoint,
251267
+ userinfoEndpoint: options.userinfoEndpoint ?? fileConfig.userinfoEndpoint,
251268
+ jwksUri: options.jwksUri ?? fileConfig.jwksUri,
251269
+ ssoName: options.ssoName ?? fileConfig.ssoName
251270
+ };
251271
+ }
251272
+ var providerNames = Object.keys(KNOWN_SSO_PROVIDERS);
251273
+ var SECRET_KEY_TO_FLAG = {
251274
+ ["sso_name" /* Name */]: "--sso-name",
251275
+ ["sso_client_id" /* ClientId */]: "--client-id",
251276
+ ["sso_client_secret" /* ClientSecret */]: "--client-secret",
251277
+ ["sso_scope" /* Scope */]: "--scope",
251278
+ ["sso_discovery_url" /* DiscoveryUrl */]: "--discovery-url",
251279
+ ["sso_tenant_id" /* TenantId */]: "--tenant-id",
251280
+ ["sso_auth_endpoint" /* AuthEndpoint */]: "--auth-endpoint",
251281
+ ["sso_token_endpoint" /* TokenEndpoint */]: "--token-endpoint",
251282
+ ["sso_userinfo_endpoint" /* UserinfoEndpoint */]: "--userinfo-endpoint",
251283
+ ["sso_okta_domain" /* OktaDomain */]: "--okta-domain",
251284
+ ["sso_jwks_uri" /* JwksUri */]: "--jwks-uri"
251285
+ };
251286
+ function secretKeyToFlag(key) {
251287
+ return SECRET_KEY_TO_FLAG[key];
251288
+ }
251289
+ function exampleCommand(provider) {
251290
+ let cmd = `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`;
251291
+ if (provider === KNOWN_SSO_PROVIDERS.microsoft)
251292
+ cmd += " --tenant-id <id>";
251293
+ if (provider === KNOWN_SSO_PROVIDERS.okta)
251294
+ cmd += " --okta-domain <domain>";
251295
+ if (provider === KNOWN_SSO_PROVIDERS.custom)
251296
+ cmd += " --sso-name <name> --auth-endpoint <url> --token-endpoint <url> --userinfo-endpoint <url> --jwks-uri <url>";
251297
+ return cmd;
251298
+ }
251299
+ function validateProvider(provider) {
251300
+ if (!provider) {
251301
+ throw new InvalidInputError("Missing --provider.", {
251302
+ hints: [
251303
+ {
251304
+ message: `Valid providers: ${providerNames.join(", ")}`,
251305
+ command: "base44 auth sso enable --provider <provider> --client-id <id> --client-secret <secret>"
251306
+ }
251307
+ ]
251308
+ });
251309
+ }
251310
+ return provider;
251311
+ }
251312
+ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options) {
251313
+ if (options.file && options.envFile) {
251314
+ throw new InvalidInputError("--file and --env-file cannot be used together. Provide the client secret either inside --file or via --env-file.");
251315
+ }
251316
+ let merged = options;
251317
+ if (options.file) {
251318
+ const fileConfig = await loadSSOConfigFile(options.file);
251319
+ merged = mergeFileWithFlags(fileConfig, options);
251320
+ }
251321
+ const provider = validateProvider(merged.provider);
251322
+ if (!merged.clientId) {
251323
+ throw new InvalidInputError("Missing --client-id.", {
251324
+ hints: [
251325
+ {
251326
+ message: `Example: base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`,
251327
+ command: `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`
251328
+ }
251329
+ ]
251330
+ });
251331
+ }
251332
+ let clientSecret;
251333
+ if (merged.envFile && !merged.clientSecret) {
251334
+ const secrets2 = await parseEnvFile(resolve3(merged.envFile));
251335
+ const value = secrets2.sso_client_secret;
251336
+ if (!value) {
251337
+ throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
251338
+ }
251339
+ clientSecret = value;
251340
+ } else {
251341
+ clientSecret = await resolveSecret({
251342
+ flagValue: merged.clientSecret,
251343
+ fromStdin: merged.clientSecretStdin,
251344
+ envVar: "sso_client_secret",
251345
+ promptMessage: "Enter SSO client secret",
251346
+ isNonInteractive,
251347
+ name: "client secret",
251348
+ hints: [
251349
+ {
251350
+ message: `Provide via flag: base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`,
251351
+ command: `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`
251352
+ },
251353
+ {
251354
+ message: `Provide via stdin: echo <secret> | base44 auth sso enable --provider ${provider} --client-id <id> --client-secret-stdin`
251355
+ },
251356
+ {
251357
+ message: `Provide via env: sso_client_secret=<secret> base44 auth sso enable --provider ${provider} --client-id <id>`
251358
+ }
251359
+ ]
251360
+ });
251361
+ }
251362
+ const secretOptions = {
251363
+ clientId: merged.clientId,
251364
+ clientSecret,
251365
+ scope: merged.scope,
251366
+ discoveryUrl: merged.discoveryUrl,
251367
+ tenantId: merged.tenantId,
251368
+ oktaDomain: merged.oktaDomain,
251369
+ authEndpoint: merged.authEndpoint,
251370
+ tokenEndpoint: merged.tokenEndpoint,
251371
+ userinfoEndpoint: merged.userinfoEndpoint,
251372
+ jwksUri: merged.jwksUri,
251373
+ ssoName: merged.ssoName
251374
+ };
251375
+ let secrets;
251376
+ try {
251377
+ secrets = buildSSOSecrets(provider, secretOptions);
251378
+ } catch (error48) {
251379
+ if (error48 instanceof MissingSSOFieldsError) {
251380
+ const flagNames = error48.missingKeys.map(secretKeyToFlag);
251381
+ throw new InvalidInputError(`Missing required fields for ${error48.provider}: ${flagNames.join(", ")}`, {
251382
+ hints: [
251383
+ {
251384
+ message: `Example: ${exampleCommand(provider)}`,
251385
+ command: exampleCommand(provider)
251386
+ }
251387
+ ]
251388
+ });
251389
+ }
251390
+ throw error48;
251391
+ }
251392
+ const { project: project2 } = await readProjectConfig();
251393
+ const configDir = dirname11(project2.configPath);
251394
+ const authDir = join16(configDir, project2.authDir);
251395
+ await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
251396
+ await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
251397
+ return {
251398
+ outroMessage: `SSO configured with ${provider} in local config. Run \`base44 auth push\` or \`base44 deploy\` to apply.`
251399
+ };
251400
+ }
251401
+ function hasEnableOnlyOptions(options) {
251402
+ return Boolean(options.provider || options.clientId || options.clientSecret || options.clientSecretStdin || options.envFile || options.file || options.scope || options.discoveryUrl || options.tenantId || options.oktaDomain || options.authEndpoint || options.tokenEndpoint || options.userinfoEndpoint || options.jwksUri || options.ssoName);
251403
+ }
251404
+ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
251405
+ if (hasEnableOnlyOptions(options)) {
251406
+ throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
251407
+ }
251408
+ const { project: project2 } = await readProjectConfig();
251409
+ const configDir = dirname11(project2.configPath);
251410
+ const authDir = join16(configDir, project2.authDir);
251411
+ const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
251412
+ await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
251413
+ if (!hasAnyLoginMethod(updated)) {
251414
+ log.warn("Disabling SSO will leave no login methods enabled. Users will be locked out.");
251415
+ }
251416
+ return {
251417
+ outroMessage: "SSO disabled in local config and credentials removed. Run `base44 auth push` or `base44 deploy` to apply."
251418
+ };
251419
+ }
251420
+ async function ssoAction(context, action, options) {
251421
+ if (action === "disable") {
251422
+ return ssoDisableAction(context, options);
251423
+ }
251424
+ return ssoEnableAction(context, options);
251425
+ }
251426
+ function getSSOCommand() {
251427
+ return new Base44Command("sso").description("Configure SSO identity provider (google, microsoft, github, okta, custom). SSO and social login are mutually exclusive — enabling one disables the other in the local auth config.").addArgument(new Argument("<action>", "enable or disable SSO").choices([
251428
+ "enable",
251429
+ "disable"
251430
+ ])).addOption(new Option("--provider <provider>", "SSO provider").choices(Object.values(KNOWN_SSO_PROVIDERS))).option("--client-id <id>", "OAuth client ID").option("--client-secret <secret>", "OAuth client secret").option("--client-secret-stdin", "Read client secret from stdin").option("--env-file <path>", "Read client secret from a .env file (key: sso_client_secret)").option("--file <path>", "JSON config file with all SSO settings").option("--scope <scope>", "OAuth scope (defaults per provider)").option("--discovery-url <url>", "OIDC discovery URL").option("--tenant-id <id>", "Microsoft tenant ID (required for microsoft)").option("--okta-domain <domain>", "Okta domain (required for okta)").option("--auth-endpoint <url>", "Authorization endpoint (required for custom)").option("--token-endpoint <url>", "Token endpoint (required for custom)").option("--userinfo-endpoint <url>", "Userinfo endpoint (required for custom)").option("--jwks-uri <url>", "JWKS URI (required for custom)").option("--sso-name <name>", "Provider display name (required for custom)").action(ssoAction);
251431
+ }
251432
+
251084
251433
  // src/cli/commands/auth/index.ts
251085
251434
  function getAuthCommand() {
251086
- return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getSocialLoginCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
251435
+ return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getSocialLoginCommand()).addCommand(getSSOCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
251087
251436
  }
251088
251437
 
251089
251438
  // src/cli/commands/auth/login.ts
@@ -251145,14 +251494,14 @@ function getConnectorsListAvailableCommand() {
251145
251494
  }
251146
251495
 
251147
251496
  // src/cli/commands/connectors/pull.ts
251148
- import { dirname as dirname11, join as join16 } from "node:path";
251497
+ import { dirname as dirname12, join as join17 } from "node:path";
251149
251498
  async function pullConnectorsAction({
251150
251499
  log,
251151
251500
  runTask: runTask2
251152
251501
  }) {
251153
251502
  const { project: project2 } = await readProjectConfig();
251154
- const configDir = dirname11(project2.configPath);
251155
- const connectorsDir = join16(configDir, project2.connectorsDir);
251503
+ const configDir = dirname12(project2.configPath);
251504
+ const connectorsDir = join17(configDir, project2.connectorsDir);
251156
251505
  const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
251157
251506
  return await pullAllConnectors();
251158
251507
  }, {
@@ -252156,6 +252505,11 @@ async function deployFunctionsAction({ log }, names, options) {
252156
252505
  formatDeployResult(result, log);
252157
252506
  }
252158
252507
  });
252508
+ const hasFailures = results.some((r) => r.status === "error");
252509
+ if (hasFailures) {
252510
+ log.message(buildDeploySummary(results));
252511
+ throw new CLIExitError(1);
252512
+ }
252159
252513
  if (options.force) {
252160
252514
  const allLocalNames = functions.map((f) => f.name);
252161
252515
  let pruneCompleted = 0;
@@ -252207,11 +252561,11 @@ function getListCommand() {
252207
252561
  }
252208
252562
 
252209
252563
  // src/cli/commands/functions/pull.ts
252210
- import { dirname as dirname12, join as join17 } from "node:path";
252564
+ import { dirname as dirname13, join as join18 } from "node:path";
252211
252565
  async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
252212
252566
  const { project: project2 } = await readProjectConfig();
252213
- const configDir = dirname12(project2.configPath);
252214
- const functionsDir = join17(configDir, project2.functionsDir);
252567
+ const configDir = dirname13(project2.configPath);
252568
+ const functionsDir = join18(configDir, project2.functionsDir);
252215
252569
  const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
252216
252570
  const { functions } = await listDeployedFunctions();
252217
252571
  return functions;
@@ -252254,7 +252608,7 @@ function getFunctionsCommand() {
252254
252608
  }
252255
252609
 
252256
252610
  // src/cli/commands/project/create.ts
252257
- import { basename as basename3, join as join18, resolve as resolve4 } from "node:path";
252611
+ import { basename as basename3, join as join19, resolve as resolve4 } from "node:path";
252258
252612
  var import_kebabCase = __toESM(require_kebabCase(), 1);
252259
252613
  var DEFAULT_TEMPLATE_ID = "backend-only";
252260
252614
  async function getTemplateById(templateId) {
@@ -252391,7 +252745,7 @@ async function executeCreate({
252391
252745
  updateMessage("Building project...");
252392
252746
  await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
252393
252747
  updateMessage("Deploying site...");
252394
- return await deploySite(join18(resolvedPath, outputDirectory));
252748
+ return await deploySite(join19(resolvedPath, outputDirectory));
252395
252749
  }, {
252396
252750
  successMessage: theme.colors.base44Orange("Site deployed successfully"),
252397
252751
  errorMessage: "Failed to deploy site"
@@ -253057,10 +253411,10 @@ function toPascalCase(name2) {
253057
253411
  return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
253058
253412
  }
253059
253413
  // src/core/types/update-project.ts
253060
- import { join as join21 } from "node:path";
253414
+ import { join as join22 } from "node:path";
253061
253415
  var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
253062
253416
  async function updateProjectConfig(projectRoot) {
253063
- const tsconfigPath = join21(projectRoot, "tsconfig.json");
253417
+ const tsconfigPath = join22(projectRoot, "tsconfig.json");
253064
253418
  if (!await pathExists(tsconfigPath)) {
253065
253419
  return false;
253066
253420
  }
@@ -253108,7 +253462,7 @@ import process21 from "node:process";
253108
253462
  // src/cli/dev/dev-server/main.ts
253109
253463
  var import_cors = __toESM(require_lib4(), 1);
253110
253464
  var import_express6 = __toESM(require_express(), 1);
253111
- import { dirname as dirname17, join as join24 } from "node:path";
253465
+ import { dirname as dirname18, join as join25 } from "node:path";
253112
253466
 
253113
253467
  // ../../node_modules/get-port/index.js
253114
253468
  import net from "node:net";
@@ -253450,9 +253804,7 @@ function createFunctionRouter(manager, logger2) {
253450
253804
  if (xAppId) {
253451
253805
  proxyReq.setHeader("Base44-App-Id", xAppId);
253452
253806
  }
253453
- if (authorization) {
253454
- proxyReq.setHeader("Base44-Service-Authorization", authorization);
253455
- }
253807
+ proxyReq.setHeader("Base44-Service-Authorization", authorization ?? "Bearer base44-dev-service-token");
253456
253808
  proxyReq.setHeader("Base44-Api-Url", `${req.protocol}://${req.headers.host}`);
253457
253809
  },
253458
253810
  error: (err, _req, res) => {
@@ -255346,9 +255698,9 @@ class NodeFsHandler {
255346
255698
  if (this.fsw.closed) {
255347
255699
  return;
255348
255700
  }
255349
- const dirname16 = sp2.dirname(file2);
255701
+ const dirname17 = sp2.dirname(file2);
255350
255702
  const basename5 = sp2.basename(file2);
255351
- const parent = this.fsw._getWatchedDir(dirname16);
255703
+ const parent = this.fsw._getWatchedDir(dirname17);
255352
255704
  let prevStats = stats;
255353
255705
  if (parent.has(basename5))
255354
255706
  return;
@@ -255375,7 +255727,7 @@ class NodeFsHandler {
255375
255727
  prevStats = newStats2;
255376
255728
  }
255377
255729
  } catch (error48) {
255378
- this.fsw._remove(dirname16, basename5);
255730
+ this.fsw._remove(dirname17, basename5);
255379
255731
  }
255380
255732
  } else if (parent.has(basename5)) {
255381
255733
  const at13 = newStats.atimeMs;
@@ -256402,8 +256754,8 @@ async function createDevServer(options8) {
256402
256754
  broadcastEntityEvent(io6, appId, entityName, event);
256403
256755
  };
256404
256756
  const base44ConfigWatcher = new WatchBase44({
256405
- functions: join24(dirname17(project2.configPath), project2.functionsDir),
256406
- entities: join24(dirname17(project2.configPath), project2.entitiesDir)
256757
+ functions: join25(dirname18(project2.configPath), project2.functionsDir),
256758
+ entities: join25(dirname18(project2.configPath), project2.entitiesDir)
256407
256759
  }, devLogger);
256408
256760
  base44ConfigWatcher.on("change", async (name2) => {
256409
256761
  try {
@@ -256692,7 +257044,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
256692
257044
  import { release, type } from "node:os";
256693
257045
 
256694
257046
  // ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
256695
- import { dirname as dirname18, posix, sep } from "path";
257047
+ import { dirname as dirname19, posix, sep } from "path";
256696
257048
  function createModulerModifier() {
256697
257049
  const getModuleFromFileName = createGetModuleFromFilename();
256698
257050
  return async (frames) => {
@@ -256701,7 +257053,7 @@ function createModulerModifier() {
256701
257053
  return frames;
256702
257054
  };
256703
257055
  }
256704
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
257056
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname19(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
256705
257057
  const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
256706
257058
  return (filename) => {
256707
257059
  if (!filename)
@@ -260890,9 +261242,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
260890
261242
  });
260891
261243
  }
260892
261244
  // src/cli/index.ts
260893
- var __dirname4 = dirname19(fileURLToPath6(import.meta.url));
261245
+ var __dirname4 = dirname20(fileURLToPath6(import.meta.url));
260894
261246
  async function runCLI(options8) {
260895
- ensureNpmAssets(join25(__dirname4, "../assets"));
261247
+ ensureNpmAssets(join26(__dirname4, "../assets"));
260896
261248
  const errorReporter = new ErrorReporter;
260897
261249
  errorReporter.registerProcessErrorHandlers();
260898
261250
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
@@ -260929,4 +261281,4 @@ export {
260929
261281
  CLIExitError
260930
261282
  };
260931
261283
 
260932
- //# debugId=9C297F3E77E38E4B64756E2164756E21
261284
+ //# debugId=1A2210510CD4F25D64756E2164756E21