@base44-preview/cli 0.0.50-pr.445.8ca0d72 → 0.0.50-pr.445.fbfee87

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
@@ -9671,12 +9671,12 @@ var require_schema = __commonJS((exports, module) => {
9671
9671
  var common = require_common3();
9672
9672
  var YAMLException = require_exception();
9673
9673
  var Type = require_type();
9674
- function compileList(schema6, name2, result) {
9674
+ function compileList(schema7, name2, result) {
9675
9675
  var exclude = [];
9676
- schema6.include.forEach(function(includedSchema) {
9676
+ schema7.include.forEach(function(includedSchema) {
9677
9677
  result = compileList(includedSchema, name2, result);
9678
9678
  });
9679
- schema6[name2].forEach(function(currentType) {
9679
+ schema7[name2].forEach(function(currentType) {
9680
9680
  result.forEach(function(previousType, previousIndex) {
9681
9681
  if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
9682
9682
  exclude.push(previousIndex);
@@ -9733,8 +9733,8 @@ var require_schema = __commonJS((exports, module) => {
9733
9733
  }
9734
9734
  schemas3 = common.toArray(schemas3);
9735
9735
  types = common.toArray(types);
9736
- if (!schemas3.every(function(schema6) {
9737
- return schema6 instanceof Schema;
9736
+ if (!schemas3.every(function(schema7) {
9737
+ return schema7 instanceof Schema;
9738
9738
  })) {
9739
9739
  throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
9740
9740
  }
@@ -11755,7 +11755,7 @@ var require_dumper = __commonJS((exports, module) => {
11755
11755
  "Off",
11756
11756
  "OFF"
11757
11757
  ];
11758
- function compileStyleMap(schema6, map2) {
11758
+ function compileStyleMap(schema7, map2) {
11759
11759
  var result, keys, index, length, tag, style, type;
11760
11760
  if (map2 === null)
11761
11761
  return {};
@@ -11767,7 +11767,7 @@ var require_dumper = __commonJS((exports, module) => {
11767
11767
  if (tag.slice(0, 2) === "!!") {
11768
11768
  tag = "tag:yaml.org,2002:" + tag.slice(2);
11769
11769
  }
11770
- type = schema6.compiledTypeMap["fallback"][tag];
11770
+ type = schema7.compiledTypeMap["fallback"][tag];
11771
11771
  if (type && _hasOwnProperty.call(type.styleAliases, style)) {
11772
11772
  style = type.styleAliases[style];
11773
11773
  }
@@ -18954,7 +18954,7 @@ var require_createNode = __commonJS((exports) => {
18954
18954
  if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
18955
18955
  value = value.valueOf();
18956
18956
  }
18957
- const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema9, sourceObjects } = ctx;
18957
+ const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema10, sourceObjects } = ctx;
18958
18958
  let ref = undefined;
18959
18959
  if (aliasDuplicateObjects && value && typeof value === "object") {
18960
18960
  ref = sourceObjects.get(value);
@@ -18968,7 +18968,7 @@ var require_createNode = __commonJS((exports) => {
18968
18968
  }
18969
18969
  if (tagName?.startsWith("!!"))
18970
18970
  tagName = defaultTagPrefix + tagName.slice(2);
18971
- let tagObj = findTagObject(value, tagName, schema9.tags);
18971
+ let tagObj = findTagObject(value, tagName, schema10.tags);
18972
18972
  if (!tagObj) {
18973
18973
  if (value && typeof value.toJSON === "function") {
18974
18974
  value = value.toJSON();
@@ -18979,7 +18979,7 @@ var require_createNode = __commonJS((exports) => {
18979
18979
  ref.node = node2;
18980
18980
  return node2;
18981
18981
  }
18982
- tagObj = value instanceof Map ? schema9[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema9[identity3.SEQ] : schema9[identity3.MAP];
18982
+ tagObj = value instanceof Map ? schema10[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema10[identity3.SEQ] : schema10[identity3.MAP];
18983
18983
  }
18984
18984
  if (onTagObj) {
18985
18985
  onTagObj(tagObj);
@@ -19002,7 +19002,7 @@ var require_Collection = __commonJS((exports) => {
19002
19002
  var createNode = require_createNode();
19003
19003
  var identity3 = require_identity();
19004
19004
  var Node2 = require_Node();
19005
- function collectionFromPath(schema9, path16, value) {
19005
+ function collectionFromPath(schema10, path16, value) {
19006
19006
  let v = value;
19007
19007
  for (let i2 = path16.length - 1;i2 >= 0; --i2) {
19008
19008
  const k2 = path16[i2];
@@ -19020,27 +19020,27 @@ var require_Collection = __commonJS((exports) => {
19020
19020
  onAnchor: () => {
19021
19021
  throw new Error("This should not happen, please report a bug.");
19022
19022
  },
19023
- schema: schema9,
19023
+ schema: schema10,
19024
19024
  sourceObjects: new Map
19025
19025
  });
19026
19026
  }
19027
19027
  var isEmptyPath = (path16) => path16 == null || typeof path16 === "object" && !!path16[Symbol.iterator]().next().done;
19028
19028
 
19029
19029
  class Collection extends Node2.NodeBase {
19030
- constructor(type, schema9) {
19030
+ constructor(type, schema10) {
19031
19031
  super(type);
19032
19032
  Object.defineProperty(this, "schema", {
19033
- value: schema9,
19033
+ value: schema10,
19034
19034
  configurable: true,
19035
19035
  enumerable: false,
19036
19036
  writable: true
19037
19037
  });
19038
19038
  }
19039
- clone(schema9) {
19039
+ clone(schema10) {
19040
19040
  const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
19041
- if (schema9)
19042
- copy.schema = schema9;
19043
- copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema9) : it3);
19041
+ if (schema10)
19042
+ copy.schema = schema10;
19043
+ copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema10) : it3);
19044
19044
  if (this.range)
19045
19045
  copy.range = this.range.slice();
19046
19046
  return copy;
@@ -19972,12 +19972,12 @@ var require_Pair = __commonJS((exports) => {
19972
19972
  this.key = key;
19973
19973
  this.value = value;
19974
19974
  }
19975
- clone(schema9) {
19975
+ clone(schema10) {
19976
19976
  let { key, value } = this;
19977
19977
  if (identity3.isNode(key))
19978
- key = key.clone(schema9);
19978
+ key = key.clone(schema10);
19979
19979
  if (identity3.isNode(value))
19980
- value = value.clone(schema9);
19980
+ value = value.clone(schema10);
19981
19981
  return new Pair(key, value);
19982
19982
  }
19983
19983
  toJSON(_2, ctx) {
@@ -20162,13 +20162,13 @@ var require_YAMLMap = __commonJS((exports) => {
20162
20162
  static get tagName() {
20163
20163
  return "tag:yaml.org,2002:map";
20164
20164
  }
20165
- constructor(schema9) {
20166
- super(identity3.MAP, schema9);
20165
+ constructor(schema10) {
20166
+ super(identity3.MAP, schema10);
20167
20167
  this.items = [];
20168
20168
  }
20169
- static from(schema9, obj, ctx) {
20169
+ static from(schema10, obj, ctx) {
20170
20170
  const { keepUndefined, replacer } = ctx;
20171
- const map2 = new this(schema9);
20171
+ const map2 = new this(schema10);
20172
20172
  const add = (key, value) => {
20173
20173
  if (typeof replacer === "function")
20174
20174
  value = replacer.call(obj, key, value);
@@ -20184,8 +20184,8 @@ var require_YAMLMap = __commonJS((exports) => {
20184
20184
  for (const key of Object.keys(obj))
20185
20185
  add(key, obj[key]);
20186
20186
  }
20187
- if (typeof schema9.sortMapEntries === "function") {
20188
- map2.items.sort(schema9.sortMapEntries);
20187
+ if (typeof schema10.sortMapEntries === "function") {
20188
+ map2.items.sort(schema10.sortMapEntries);
20189
20189
  }
20190
20190
  return map2;
20191
20191
  }
@@ -20278,7 +20278,7 @@ var require_map2 = __commonJS((exports) => {
20278
20278
  onError("Expected a mapping for this tag");
20279
20279
  return map3;
20280
20280
  },
20281
- createNode: (schema9, obj, ctx) => YAMLMap.YAMLMap.from(schema9, obj, ctx)
20281
+ createNode: (schema10, obj, ctx) => YAMLMap.YAMLMap.from(schema10, obj, ctx)
20282
20282
  };
20283
20283
  exports.map = map2;
20284
20284
  });
@@ -20296,8 +20296,8 @@ var require_YAMLSeq = __commonJS((exports) => {
20296
20296
  static get tagName() {
20297
20297
  return "tag:yaml.org,2002:seq";
20298
20298
  }
20299
- constructor(schema9) {
20300
- super(identity3.SEQ, schema9);
20299
+ constructor(schema10) {
20300
+ super(identity3.SEQ, schema10);
20301
20301
  this.items = [];
20302
20302
  }
20303
20303
  add(value) {
@@ -20351,9 +20351,9 @@ var require_YAMLSeq = __commonJS((exports) => {
20351
20351
  onComment
20352
20352
  });
20353
20353
  }
20354
- static from(schema9, obj, ctx) {
20354
+ static from(schema10, obj, ctx) {
20355
20355
  const { replacer } = ctx;
20356
- const seq = new this(schema9);
20356
+ const seq = new this(schema10);
20357
20357
  if (obj && Symbol.iterator in Object(obj)) {
20358
20358
  let i2 = 0;
20359
20359
  for (let it3 of obj) {
@@ -20390,7 +20390,7 @@ var require_seq2 = __commonJS((exports) => {
20390
20390
  onError("Expected a sequence for this tag");
20391
20391
  return seq2;
20392
20392
  },
20393
- createNode: (schema9, obj, ctx) => YAMLSeq.YAMLSeq.from(schema9, obj, ctx)
20393
+ createNode: (schema10, obj, ctx) => YAMLSeq.YAMLSeq.from(schema10, obj, ctx)
20394
20394
  };
20395
20395
  exports.seq = seq;
20396
20396
  });
@@ -20565,7 +20565,7 @@ var require_schema2 = __commonJS((exports) => {
20565
20565
  var bool = require_bool2();
20566
20566
  var float = require_float2();
20567
20567
  var int2 = require_int2();
20568
- var schema9 = [
20568
+ var schema10 = [
20569
20569
  map2.map,
20570
20570
  seq.seq,
20571
20571
  string4.string,
@@ -20578,7 +20578,7 @@ var require_schema2 = __commonJS((exports) => {
20578
20578
  float.floatExp,
20579
20579
  float.float
20580
20580
  ];
20581
- exports.schema = schema9;
20581
+ exports.schema = schema10;
20582
20582
  });
20583
20583
 
20584
20584
  // ../../node_modules/yaml/dist/schema/json/schema.js
@@ -20641,8 +20641,8 @@ var require_schema3 = __commonJS((exports) => {
20641
20641
  return str;
20642
20642
  }
20643
20643
  };
20644
- var schema9 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
20645
- exports.schema = schema9;
20644
+ var schema10 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
20645
+ exports.schema = schema10;
20646
20646
  });
20647
20647
 
20648
20648
  // ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
@@ -20732,9 +20732,9 @@ ${cn.comment}` : item.comment;
20732
20732
  onError("Expected a sequence for this tag");
20733
20733
  return seq;
20734
20734
  }
20735
- function createPairs(schema9, iterable, ctx) {
20735
+ function createPairs(schema10, iterable, ctx) {
20736
20736
  const { replacer } = ctx;
20737
- const pairs2 = new YAMLSeq.YAMLSeq(schema9);
20737
+ const pairs2 = new YAMLSeq.YAMLSeq(schema10);
20738
20738
  pairs2.tag = "tag:yaml.org,2002:pairs";
20739
20739
  let i2 = 0;
20740
20740
  if (iterable && Symbol.iterator in Object(iterable))
@@ -20813,8 +20813,8 @@ var require_omap2 = __commonJS((exports) => {
20813
20813
  }
20814
20814
  return map2;
20815
20815
  }
20816
- static from(schema9, iterable, ctx) {
20817
- const pairs$1 = pairs.createPairs(schema9, iterable, ctx);
20816
+ static from(schema10, iterable, ctx) {
20817
+ const pairs$1 = pairs.createPairs(schema10, iterable, ctx);
20818
20818
  const omap2 = new this;
20819
20819
  omap2.items = pairs$1.items;
20820
20820
  return omap2;
@@ -20841,7 +20841,7 @@ var require_omap2 = __commonJS((exports) => {
20841
20841
  }
20842
20842
  return Object.assign(new YAMLOMap, pairs$1);
20843
20843
  },
20844
- createNode: (schema9, iterable, ctx) => YAMLOMap.from(schema9, iterable, ctx)
20844
+ createNode: (schema10, iterable, ctx) => YAMLOMap.from(schema10, iterable, ctx)
20845
20845
  };
20846
20846
  exports.YAMLOMap = YAMLOMap;
20847
20847
  exports.omap = omap;
@@ -21005,8 +21005,8 @@ var require_set2 = __commonJS((exports) => {
21005
21005
  var YAMLMap = require_YAMLMap();
21006
21006
 
21007
21007
  class YAMLSet extends YAMLMap.YAMLMap {
21008
- constructor(schema9) {
21009
- super(schema9);
21008
+ constructor(schema10) {
21009
+ super(schema10);
21010
21010
  this.tag = YAMLSet.tag;
21011
21011
  }
21012
21012
  add(key) {
@@ -21046,9 +21046,9 @@ var require_set2 = __commonJS((exports) => {
21046
21046
  else
21047
21047
  throw new Error("Set items must all have null values");
21048
21048
  }
21049
- static from(schema9, iterable, ctx) {
21049
+ static from(schema10, iterable, ctx) {
21050
21050
  const { replacer } = ctx;
21051
- const set3 = new this(schema9);
21051
+ const set3 = new this(schema10);
21052
21052
  if (iterable && Symbol.iterator in Object(iterable))
21053
21053
  for (let value of iterable) {
21054
21054
  if (typeof replacer === "function")
@@ -21065,7 +21065,7 @@ var require_set2 = __commonJS((exports) => {
21065
21065
  nodeClass: YAMLSet,
21066
21066
  default: false,
21067
21067
  tag: "tag:yaml.org,2002:set",
21068
- createNode: (schema9, iterable, ctx) => YAMLSet.from(schema9, iterable, ctx),
21068
+ createNode: (schema10, iterable, ctx) => YAMLSet.from(schema10, iterable, ctx),
21069
21069
  resolve(map2, onError) {
21070
21070
  if (identity3.isMap(map2)) {
21071
21071
  if (map2.hasAllNullValues(true))
@@ -21178,7 +21178,7 @@ var require_schema4 = __commonJS((exports) => {
21178
21178
  var pairs = require_pairs2();
21179
21179
  var set2 = require_set2();
21180
21180
  var timestamp = require_timestamp2();
21181
- var schema9 = [
21181
+ var schema10 = [
21182
21182
  map2.map,
21183
21183
  seq.seq,
21184
21184
  string4.string,
@@ -21201,7 +21201,7 @@ var require_schema4 = __commonJS((exports) => {
21201
21201
  timestamp.floatTime,
21202
21202
  timestamp.timestamp
21203
21203
  ];
21204
- exports.schema = schema9;
21204
+ exports.schema = schema10;
21205
21205
  });
21206
21206
 
21207
21207
  // ../../node_modules/yaml/dist/schema/tags.js
@@ -21213,7 +21213,7 @@ var require_tags = __commonJS((exports) => {
21213
21213
  var bool = require_bool2();
21214
21214
  var float = require_float2();
21215
21215
  var int2 = require_int2();
21216
- var schema9 = require_schema2();
21216
+ var schema10 = require_schema2();
21217
21217
  var schema$1 = require_schema3();
21218
21218
  var binary = require_binary2();
21219
21219
  var merge3 = require_merge3();
@@ -21223,7 +21223,7 @@ var require_tags = __commonJS((exports) => {
21223
21223
  var set2 = require_set2();
21224
21224
  var timestamp = require_timestamp2();
21225
21225
  var schemas3 = new Map([
21226
- ["core", schema9.schema],
21226
+ ["core", schema10.schema],
21227
21227
  ["failsafe", [map2.map, seq.seq, string4.string]],
21228
21228
  ["json", schema$1.schema],
21229
21229
  ["yaml11", schema$2.schema],
@@ -21305,9 +21305,9 @@ var require_Schema = __commonJS((exports) => {
21305
21305
  var sortMapEntriesByKey = (a2, b) => a2.key < b.key ? -1 : a2.key > b.key ? 1 : 0;
21306
21306
 
21307
21307
  class Schema {
21308
- constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema9, sortMapEntries, toStringDefaults }) {
21308
+ constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema10, sortMapEntries, toStringDefaults }) {
21309
21309
  this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
21310
- this.name = typeof schema9 === "string" && schema9 || "core";
21310
+ this.name = typeof schema10 === "string" && schema10 || "core";
21311
21311
  this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
21312
21312
  this.tags = tags.getTags(customTags, this.name, merge3);
21313
21313
  this.toStringOptions = toStringDefaults ?? null;
@@ -22799,11 +22799,11 @@ var require_compose_scalar = __commonJS((exports) => {
22799
22799
  scalar.comment = comment;
22800
22800
  return scalar;
22801
22801
  }
22802
- function findScalarTagByName(schema9, value, tagName, tagToken, onError) {
22802
+ function findScalarTagByName(schema10, value, tagName, tagToken, onError) {
22803
22803
  if (tagName === "!")
22804
- return schema9[identity3.SCALAR];
22804
+ return schema10[identity3.SCALAR];
22805
22805
  const matchWithTest = [];
22806
- for (const tag of schema9.tags) {
22806
+ for (const tag of schema10.tags) {
22807
22807
  if (!tag.collection && tag.tag === tagName) {
22808
22808
  if (tag.default && tag.test)
22809
22809
  matchWithTest.push(tag);
@@ -22814,18 +22814,18 @@ var require_compose_scalar = __commonJS((exports) => {
22814
22814
  for (const tag of matchWithTest)
22815
22815
  if (tag.test?.test(value))
22816
22816
  return tag;
22817
- const kt3 = schema9.knownTags[tagName];
22817
+ const kt3 = schema10.knownTags[tagName];
22818
22818
  if (kt3 && !kt3.collection) {
22819
- schema9.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
22819
+ schema10.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
22820
22820
  return kt3;
22821
22821
  }
22822
22822
  onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
22823
- return schema9[identity3.SCALAR];
22823
+ return schema10[identity3.SCALAR];
22824
22824
  }
22825
- function findScalarTagByTest({ atKey, directives, schema: schema9 }, value, token, onError) {
22826
- const tag = schema9.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema9[identity3.SCALAR];
22827
- if (schema9.compat) {
22828
- const compat2 = schema9.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema9[identity3.SCALAR];
22825
+ function findScalarTagByTest({ atKey, directives, schema: schema10 }, value, token, onError) {
22826
+ const tag = schema10.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema10[identity3.SCALAR];
22827
+ if (schema10.compat) {
22828
+ const compat2 = schema10.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema10[identity3.SCALAR];
22829
22829
  if (tag.tag !== compat2.tag) {
22830
22830
  const ts = directives.tagString(tag.tag);
22831
22831
  const cs = directives.tagString(compat2.tag);
@@ -241786,6 +241786,23 @@ var AppAuthConfigResponseSchema = exports_external.object({
241786
241786
  function hasAnyLoginMethod(config3) {
241787
241787
  return config3.enableUsernamePassword || config3.enableGoogleLogin || config3.enableMicrosoftLogin || config3.enableFacebookLogin || config3.enableAppleLogin || config3.enableSSOLogin;
241788
241788
  }
241789
+ var SOCIAL_PROVIDERS = {
241790
+ google: {
241791
+ field: "enableGoogleLogin",
241792
+ label: "Google",
241793
+ customOAuth: {
241794
+ modeField: "googleOAuthMode",
241795
+ clientIdField: "googleOAuthClientId",
241796
+ secretKey: "google_oauth_client_secret",
241797
+ envVar: "BASE44_GOOGLE_OAUTH_CLIENT_SECRET",
241798
+ promptMessage: "Enter Google OAuth client secret"
241799
+ }
241800
+ },
241801
+ microsoft: { field: "enableMicrosoftLogin", label: "Microsoft" },
241802
+ facebook: { field: "enableFacebookLogin", label: "Facebook" },
241803
+ apple: { field: "enableAppleLogin", label: "Apple" }
241804
+ };
241805
+ var VALID_PROVIDER_NAMES = Object.keys(SOCIAL_PROVIDERS);
241789
241806
  function toAuthConfigPayload(config3) {
241790
241807
  return {
241791
241808
  enable_username_password: config3.enableUsernamePassword,
@@ -241896,6 +241913,94 @@ var authConfigResource = {
241896
241913
  await pushAuthConfig(items[0] ?? null);
241897
241914
  }
241898
241915
  };
241916
+ // src/core/resources/secret/schema.ts
241917
+ var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
241918
+ var SetSecretsResponseSchema = exports_external.object({
241919
+ success: exports_external.boolean()
241920
+ });
241921
+ var DeleteSecretResponseSchema = exports_external.object({
241922
+ success: exports_external.boolean()
241923
+ });
241924
+
241925
+ // src/core/resources/secret/api.ts
241926
+ async function listSecrets() {
241927
+ const appClient = getAppClient();
241928
+ let response;
241929
+ try {
241930
+ response = await appClient.get("secrets");
241931
+ } catch (error48) {
241932
+ throw await ApiError.fromHttpError(error48, "listing secrets");
241933
+ }
241934
+ const result = ListSecretsResponseSchema.safeParse(await response.json());
241935
+ if (!result.success) {
241936
+ throw new SchemaValidationError("Invalid response from server", result.error);
241937
+ }
241938
+ return result.data;
241939
+ }
241940
+ async function setSecrets(secrets) {
241941
+ const appClient = getAppClient();
241942
+ let response;
241943
+ try {
241944
+ response = await appClient.post("secrets", {
241945
+ json: secrets,
241946
+ timeout: false
241947
+ });
241948
+ } catch (error48) {
241949
+ throw await ApiError.fromHttpError(error48, "setting secrets");
241950
+ }
241951
+ const result = SetSecretsResponseSchema.safeParse(await response.json());
241952
+ if (!result.success) {
241953
+ throw new SchemaValidationError("Invalid response from server", result.error);
241954
+ }
241955
+ return result.data;
241956
+ }
241957
+ async function deleteSecret(name2) {
241958
+ const appClient = getAppClient();
241959
+ let response;
241960
+ try {
241961
+ response = await appClient.delete("secrets", {
241962
+ searchParams: { secret_name: name2 },
241963
+ timeout: false
241964
+ });
241965
+ } catch (error48) {
241966
+ throw await ApiError.fromHttpError(error48, "deleting secret");
241967
+ }
241968
+ const result = DeleteSecretResponseSchema.safeParse(await response.json());
241969
+ if (!result.success) {
241970
+ throw new SchemaValidationError("Invalid response from server", result.error);
241971
+ }
241972
+ return result.data;
241973
+ }
241974
+ // src/core/resources/auth-config/social-login.ts
241975
+ async function updateSocialLoginConfig(authDir, provider, enable, customOAuth) {
241976
+ const providerInfo = SOCIAL_PROVIDERS[provider];
241977
+ const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
241978
+ const merged = {
241979
+ ...current,
241980
+ [providerInfo.field]: enable
241981
+ };
241982
+ if (providerInfo.customOAuth) {
241983
+ const oauth = providerInfo.customOAuth;
241984
+ if (enable && customOAuth) {
241985
+ merged[oauth.modeField] = "custom";
241986
+ merged[oauth.clientIdField] = customOAuth.clientId;
241987
+ } else {
241988
+ merged[oauth.modeField] = "default";
241989
+ merged[oauth.clientIdField] = null;
241990
+ }
241991
+ }
241992
+ await writeAuthConfig(authDir, merged);
241993
+ return { config: merged, enabled: enable };
241994
+ }
241995
+ async function pushCustomOAuthSecret(provider, clientSecret) {
241996
+ const providerInfo = SOCIAL_PROVIDERS[provider];
241997
+ if (!providerInfo.customOAuth) {
241998
+ return;
241999
+ }
242000
+ await setSecrets({
242001
+ [providerInfo.customOAuth.secretKey]: clientSecret
242002
+ });
242003
+ }
241899
242004
  // src/core/resources/connector/schema.ts
241900
242005
  var GoogleCalendarConnectorSchema = exports_external.object({
241901
242006
  type: exports_external.literal("googlecalendar"),
@@ -250608,64 +250713,6 @@ function formatYaml(data, options = {}) {
250608
250713
  const replacer = stripEmpty ? stripEmptyReplacer : undefined;
250609
250714
  return $stringify(data, replacer, { indent: YAML_INDENT }).trimEnd();
250610
250715
  }
250611
- // src/core/resources/secret/schema.ts
250612
- var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
250613
- var SetSecretsResponseSchema = exports_external.object({
250614
- success: exports_external.boolean()
250615
- });
250616
- var DeleteSecretResponseSchema = exports_external.object({
250617
- success: exports_external.boolean()
250618
- });
250619
-
250620
- // src/core/resources/secret/api.ts
250621
- async function listSecrets() {
250622
- const appClient = getAppClient();
250623
- let response;
250624
- try {
250625
- response = await appClient.get("secrets");
250626
- } catch (error48) {
250627
- throw await ApiError.fromHttpError(error48, "listing secrets");
250628
- }
250629
- const result = ListSecretsResponseSchema.safeParse(await response.json());
250630
- if (!result.success) {
250631
- throw new SchemaValidationError("Invalid response from server", result.error);
250632
- }
250633
- return result.data;
250634
- }
250635
- async function setSecrets(secrets) {
250636
- const appClient = getAppClient();
250637
- let response;
250638
- try {
250639
- response = await appClient.post("secrets", {
250640
- json: secrets,
250641
- timeout: false
250642
- });
250643
- } catch (error48) {
250644
- throw await ApiError.fromHttpError(error48, "setting secrets");
250645
- }
250646
- const result = SetSecretsResponseSchema.safeParse(await response.json());
250647
- if (!result.success) {
250648
- throw new SchemaValidationError("Invalid response from server", result.error);
250649
- }
250650
- return result.data;
250651
- }
250652
- async function deleteSecret(name2) {
250653
- const appClient = getAppClient();
250654
- let response;
250655
- try {
250656
- response = await appClient.delete("secrets", {
250657
- searchParams: { secret_name: name2 },
250658
- timeout: false
250659
- });
250660
- } catch (error48) {
250661
- throw await ApiError.fromHttpError(error48, "deleting secret");
250662
- }
250663
- const result = DeleteSecretResponseSchema.safeParse(await response.json());
250664
- if (!result.success) {
250665
- throw new SchemaValidationError("Invalid response from server", result.error);
250666
- }
250667
- return result.data;
250668
- }
250669
250716
  // src/core/utils/dependencies.ts
250670
250717
  import { spawnSync as spawnSync2 } from "node:child_process";
250671
250718
  function verifyDenoInstalled(context) {
@@ -250854,23 +250901,6 @@ function getAuthPushCommand() {
250854
250901
 
250855
250902
  // src/cli/commands/auth/social-login.ts
250856
250903
  import { dirname as dirname10, join as join15 } from "node:path";
250857
- var SOCIAL_PROVIDERS = {
250858
- google: {
250859
- field: "enableGoogleLogin",
250860
- label: "Google",
250861
- customOAuth: {
250862
- modeField: "googleOAuthMode",
250863
- clientIdField: "googleOAuthClientId",
250864
- secretKey: "google_oauth_client_secret",
250865
- envVar: "BASE44_GOOGLE_OAUTH_CLIENT_SECRET",
250866
- promptMessage: "Enter Google OAuth client secret"
250867
- }
250868
- },
250869
- microsoft: { field: "enableMicrosoftLogin", label: "Microsoft" },
250870
- facebook: { field: "enableFacebookLogin", label: "Facebook" },
250871
- apple: { field: "enableAppleLogin", label: "Apple" }
250872
- };
250873
- var VALID_PROVIDERS = Object.keys(SOCIAL_PROVIDERS);
250874
250904
  function hasCustomOAuthOptions(options) {
250875
250905
  return Boolean(options.clientId || options.clientSecret || options.clientSecretStdin);
250876
250906
  }
@@ -250884,9 +250914,6 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
250884
250914
  if (hasOAuthOptions && !shouldEnable) {
250885
250915
  throw new InvalidInputError(`Custom OAuth options cannot be used with disable. To disable ${providerInfo.label} login: base44 auth social-login ${provider} disable`);
250886
250916
  }
250887
- const { project: project2 } = await readProjectConfig();
250888
- const configDir = dirname10(project2.configPath);
250889
- const authDir = join15(configDir, project2.authDir);
250890
250917
  const oauth = providerInfo.customOAuth;
250891
250918
  const useCustomOAuth = shouldEnable && hasOAuthOptions && oauth != null;
250892
250919
  let clientSecret;
@@ -250912,30 +250939,12 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
250912
250939
  ]
250913
250940
  });
250914
250941
  }
250915
- const updated = await runTask2("Updating local auth config", async () => {
250916
- const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
250917
- const merged = {
250918
- ...current,
250919
- [providerInfo.field]: shouldEnable
250920
- };
250921
- if (oauth) {
250922
- if (useCustomOAuth) {
250923
- merged[oauth.modeField] = "custom";
250924
- merged[oauth.clientIdField] = options.clientId;
250925
- } else {
250926
- merged[oauth.modeField] = "default";
250927
- merged[oauth.clientIdField] = null;
250928
- }
250929
- }
250930
- await writeAuthConfig(authDir, merged);
250931
- return merged;
250932
- });
250933
- if (clientSecret && oauth) {
250934
- await runTask2("Saving client secret", async () => {
250935
- await setSecrets({
250936
- [oauth.secretKey]: clientSecret
250937
- });
250938
- });
250942
+ const { project: project2 } = await readProjectConfig();
250943
+ const configDir = dirname10(project2.configPath);
250944
+ const authDir = join15(configDir, project2.authDir);
250945
+ const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
250946
+ if (clientSecret) {
250947
+ await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
250939
250948
  }
250940
250949
  if (!shouldEnable && !hasAnyLoginMethod(updated)) {
250941
250950
  log.warn(`Disabling ${providerInfo.label} login will leave no login methods enabled. Users will be locked out.`);
@@ -250947,7 +250956,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
250947
250956
  };
250948
250957
  }
250949
250958
  function getSocialLoginCommand() {
250950
- return new Base44Command("social-login").description("Enable or disable social login providers (google, microsoft, facebook, apple)").addArgument(new Argument("<provider>", "social login provider").choices(VALID_PROVIDERS)).addArgument(new Argument("<action>", "enable or disable the provider").choices([
250959
+ return new Base44Command("social-login").description("Enable or disable social login providers (google, microsoft, facebook, apple)").addArgument(new Argument("<provider>", "social login provider").choices(VALID_PROVIDER_NAMES)).addArgument(new Argument("<action>", "enable or disable the provider").choices([
250951
250960
  "enable",
250952
250961
  "disable"
250953
250962
  ])).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)").action(socialLoginAction);
@@ -255961,6 +255970,17 @@ async function runScript(options8) {
255961
255970
  }
255962
255971
  }
255963
255972
  // src/cli/commands/exec.ts
255973
+ function readStdin2() {
255974
+ return new Promise((resolve8, reject) => {
255975
+ let data = "";
255976
+ process.stdin.setEncoding("utf-8");
255977
+ process.stdin.on("data", (chunk) => {
255978
+ data += chunk;
255979
+ });
255980
+ process.stdin.on("end", () => resolve8(data));
255981
+ process.stdin.on("error", reject);
255982
+ });
255983
+ }
255964
255984
  async function execAction(isNonInteractive) {
255965
255985
  const noInputError = new InvalidInputError("No input provided. Pipe a script to stdin.", {
255966
255986
  hints: [
@@ -255973,7 +255993,7 @@ async function execAction(isNonInteractive) {
255973
255993
  if (!isNonInteractive) {
255974
255994
  throw noInputError;
255975
255995
  }
255976
- const code2 = await readStdin();
255996
+ const code2 = await readStdin2();
255977
255997
  if (!code2.trim()) {
255978
255998
  throw noInputError;
255979
255999
  }
@@ -260370,4 +260390,4 @@ export {
260370
260390
  CLIExitError
260371
260391
  };
260372
260392
 
260373
- //# debugId=E4BE99C33E719ECE64756E2164756E21
260393
+ //# debugId=9A25A3EB5FD3F3E264756E2164756E21