@objectstack/objectql 9.5.0 → 9.6.0

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.mjs CHANGED
@@ -1,7 +1,12 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __esm = (fn, res) => function __init() {
4
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
3
+ var __esm = (fn, res, err) => function __init() {
4
+ if (err) throw err[0];
5
+ try {
6
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ } catch (e) {
8
+ throw err = [e], e;
9
+ }
5
10
  };
6
11
  var __export = (target, all) => {
7
12
  for (var name in all)
@@ -6647,9 +6652,7 @@ var SKIP_FIELDS = /* @__PURE__ */ new Set([
6647
6652
  "created_at",
6648
6653
  "created_by",
6649
6654
  "updated_at",
6650
- "updated_by",
6651
- "organization_id",
6652
- "tenant_id"
6655
+ "updated_by"
6653
6656
  ]);
6654
6657
  var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
6655
6658
  var URL_RE = /^[a-z][a-z0-9+.\-]*:\/\/[^\s]+$/i;
@@ -6831,6 +6834,11 @@ function evaluateValidationRules(objectSchema, data, mode, opts = {}) {
6831
6834
  if (!hasRules && !hasFieldRules) return;
6832
6835
  const previous = opts.previous ?? void 0;
6833
6836
  const merged = { ...previous ?? {}, ...data };
6837
+ if (mode === "insert" && fields) {
6838
+ for (const name of Object.keys(fields)) {
6839
+ if (!(name in merged)) merged[name] = null;
6840
+ }
6841
+ }
6834
6842
  const ctx = { data, merged, previous, mode, logger: opts.logger };
6835
6843
  const errors = [];
6836
6844
  if (hasFieldRules && fields) {
@@ -7838,7 +7846,9 @@ var _ObjectQL = class _ObjectQL {
7838
7846
  // Integration Protocol
7839
7847
  "connectors",
7840
7848
  // System Protocol — package documentation (ADR-0046); inert data
7841
- "docs"
7849
+ "docs",
7850
+ // Documentation navigation spine (ADR-0046 §6)
7851
+ "books"
7842
7852
  ];
7843
7853
  for (const key of metadataArrayKeys) {
7844
7854
  const items = manifest[key];
@@ -7975,7 +7985,8 @@ var _ObjectQL = class _ObjectQL {
7975
7985
  "mappings",
7976
7986
  "analyticsCubes",
7977
7987
  "connectors",
7978
- "docs"
7988
+ "docs",
7989
+ "books"
7979
7990
  ];
7980
7991
  for (const key of metadataArrayKeys) {
7981
7992
  const items = plugin[key];