@velastack/patterns 0.0.49 → 0.0.50

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/index.js CHANGED
@@ -26,7 +26,7 @@ var ue = Object.create, de = Object.defineProperty, fe = Object.getOwnPropertyDe
26
26
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
27
27
  }), be = {
28
28
  name: "@velastack/patterns",
29
- version: "0.0.49",
29
+ version: "0.0.50",
30
30
  description: "Registry of VelaStack patterns: generators and modifications applied to SvelteKit projects by the VelaStack CLI.",
31
31
  type: "module",
32
32
  private: !1,
@@ -1290,7 +1290,7 @@ function Ot(t, n, r, i, a) {
1290
1290
  type: "relation",
1291
1291
  name: t,
1292
1292
  title: o,
1293
- required: c,
1293
+ required: !0,
1294
1294
  collectionId: n.collectionId,
1295
1295
  maxSelect: 1,
1296
1296
  displayField: n.displayField,
@@ -1309,7 +1309,7 @@ function Ot(t, n, r, i, a) {
1309
1309
  type: "relation",
1310
1310
  name: t,
1311
1311
  title: o,
1312
- required: c,
1312
+ required: !0,
1313
1313
  collectionId: n.collectionId,
1314
1314
  maxSelect: 1,
1315
1315
  displayField: n.displayField,
@@ -1977,9 +1977,13 @@ function B(e, n, r) {
1977
1977
  });
1978
1978
  continue;
1979
1979
  }
1980
+ let t = r.forForm && e.type === "relation" && (e.isCurrentUser || e.isCurrentTeam);
1980
1981
  i.push({
1981
1982
  name: e.name,
1982
- schema: R(e, r)
1983
+ schema: R(t ? {
1984
+ ...e,
1985
+ required: !1
1986
+ } : e, r)
1983
1987
  });
1984
1988
  }
1985
1989
  let a = i.map((e) => `${Gt(e.name)}: ${e.schema}`).join(",\n "), o = r.includeModelFields ? "\nimport type { Schemas } from \"@velastack/pocketbase\";" : "", s = r.includeModelFields ? ` satisfies Schemas["${e.tableName}"]` : "";