@base44-preview/cli 0.1.29-pr.655.1f8f35a → 0.1.29-pr.656.27ddd8f

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
@@ -261311,7 +261311,7 @@ function shardOf(group, response, verdict, options) {
261311
261311
  gzipBytes: verdict.gzipBytes,
261312
261312
  ...response.activation ? { activation: response.activation } : {},
261313
261313
  wrapper: {
261314
- secrets: response.activation ? `blob_${response.activation}` : "binding",
261314
+ secrets: response.activation ? `blob-${response.activation}` : "binding",
261315
261315
  postResponseTelemetry: options.postResponseTelemetry ?? false,
261316
261316
  staticEgress: STATIC_EGRESS_ARTIFACT_MARKER
261317
261317
  }
@@ -264322,12 +264322,31 @@ class FLSWriteError extends Error {
264322
264322
  super(`You're not allowed to ${verb} the following fields: ${deniedFields.join(", ")}`);
264323
264323
  }
264324
264324
  }
264325
+ var isPlainObject4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
264326
+ var flattenToDataPaths = (record, prefix = "data") => Object.entries(record).flatMap(([key, value]) => isPlainObject4(value) ? flattenToDataPaths(value, `${prefix}.${key}`) : [[`${prefix}.${key}`, value]]);
264327
+ var collectFieldRules = (properties, prefix = "data") => Object.entries(properties).flatMap(([key, property]) => {
264328
+ const path = `${prefix}.${key}`;
264329
+ const own = property.rls ? [[path, property.rls]] : [];
264330
+ return [...own, ...collectFieldRules(property.properties ?? {}, path)];
264331
+ });
264332
+ var findClosestRule = (rules, path) => {
264333
+ const segments = path.split(".");
264334
+ for (let length = segments.length;length > 1; length--) {
264335
+ const rule = rules.get(segments.slice(0, length).join("."));
264336
+ if (rule)
264337
+ return rule;
264338
+ }
264339
+ return;
264340
+ };
264341
+ var isUnchanged = (before, after) => isDeepStrictEqual5(before ?? null, after ?? null);
264325
264342
  function assertFLSWrite(changes, context, schema, user, operation) {
264326
- const denied = Object.entries(changes).filter(([key, value]) => {
264327
- const rls = schema.properties[key]?.rls;
264343
+ const rules = new Map(collectFieldRules(schema.properties));
264344
+ const before = new Map(flattenToDataPaths(context));
264345
+ const denied = flattenToDataPaths(changes).filter(([path, value]) => {
264346
+ const rls = findClosestRule(rules, path);
264328
264347
  const rule = rls?.[operation] ?? rls?.write;
264329
- return rule !== undefined && !isDeepStrictEqual5(context[key], value) && !checkRLS(rule, context, user);
264330
- }).map(([key]) => `data.${key}`);
264348
+ return rule !== undefined && !isUnchanged(before.get(path), value) && !checkRLS(rule, context, user);
264349
+ }).map(([path]) => path);
264331
264350
  if (denied.length > 0) {
264332
264351
  throw new FLSWriteError(operation, denied);
264333
264352
  }
@@ -267647,7 +267666,7 @@ function isBuiltin4(candidate, className) {
267647
267666
  function isEvent(candidate) {
267648
267667
  return !isUndefined(Event) && isInstanceOf(candidate, Event);
267649
267668
  }
267650
- function isPlainObject4(candidate) {
267669
+ function isPlainObject5(candidate) {
267651
267670
  return isBuiltin4(candidate, "Object");
267652
267671
  }
267653
267672
  function isInstanceOf(candidate, base) {
@@ -270783,7 +270802,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
270783
270802
  const personProperties = {};
270784
270803
  const groupProperties = {};
270785
270804
  for (const [key, value] of Object.entries(eventProperties))
270786
- if (isPlainObject4(value) && groups && key in groups) {
270805
+ if (isPlainObject5(value) && groups && key in groups) {
270787
270806
  const groupProps = {};
270788
270807
  for (const [groupKey, groupValue] of Object.entries(value))
270789
270808
  groupProps[String(groupKey)] = String(groupValue);
@@ -271260,4 +271279,4 @@ export {
271260
271279
  runCLI
271261
271280
  };
271262
271281
 
271263
- //# debugId=E5E7C98F673394D264756E2164756E21
271282
+ //# debugId=8D0F048D7514751E64756E2164756E21