@platforma-sdk/model 1.86.5 → 1.87.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.
@@ -6,7 +6,6 @@ import {
6
6
  isPlRef,
7
7
  PlRef,
8
8
  PObjectId,
9
- type ColumnUniversalId,
10
9
  type LeafEntry,
11
10
  type PColumn,
12
11
  type PColumnSpec,
@@ -53,24 +52,6 @@ export interface DataColumnRecipe<
53
52
  getData(): ColumnData;
54
53
  }
55
54
 
56
- /**
57
- * Thrown by leaf-recipe factories when the requested column is provably
58
- * absent in the active render ctx — i.e. every relevant accessor reports
59
- * `inputsLocked` and the column did not appear. Distinct from the
60
- * `undefined` return that the factories still use for the "resolving" case
61
- * (the column may still appear later).
62
- *
63
- * Catch at the boundary (resolver / filter+sort wiring / data-table assembly)
64
- * when partial absence should be surfaced to the user rather than silently
65
- * producing an empty result.
66
- */
67
- export class ColumnAbsentError extends Error {
68
- constructor(public readonly id: ColumnUniversalId) {
69
- super(`Column is absent in the active render ctx and will not appear: ${id}`);
70
- this.name = "ColumnAbsentError";
71
- }
72
- }
73
-
74
55
  /**
75
56
  * The leaf-recipe building block: a {@link DataColumnRecipe} whose `id` is a bare
76
57
  * {@link PObjectId} and whose readers are bound to a single tree-accessor
@@ -134,22 +115,17 @@ export class DataColumnImpl implements DataColumnRecipe<PObjectId> {
134
115
 
135
116
  /**
136
117
  * Resolve via the ambient {@link ColumnRegistry}. Spec is resolved eagerly:
137
- * returns `undefined` if the leaf isn't reachable yet (resolving). Throws
138
- * {@link ColumnAbsentError} when every relevant accessor is `inputsLocked`
139
- * and the column did not appear, or when the id names an export that is not
140
- * a column (a `kind: "File"` object, for example) — the column will not
141
- * exist in this ctx. Data and dataStatus stay lazy.
118
+ * returns `undefined` unless the id names a column whose spec is readable in
119
+ * this ctx — while it is resolving, when it is absent, and when the id names
120
+ * an export that is not a column (a `kind: "File"` object, for example).
121
+ * Data and dataStatus stay lazy.
142
122
  */
143
123
  static fromId(
144
124
  id: PObjectId,
145
125
  { ctx }: { ctx?: GlobalCfgRenderCtx } = {},
146
126
  ): undefined | DataColumnRecipe<PObjectId> {
147
- const registry = new ColumnRegistry(getCtxProviders({ ctx }));
148
- const leaf = registry.resolve(id);
149
- if (isNil(leaf)) {
150
- if (registry.isFinal()) throw new ColumnAbsentError(id);
151
- return undefined;
152
- }
127
+ const leaf = new ColumnRegistry(getCtxProviders({ ctx })).resolve(id);
128
+ if (isNil(leaf)) return undefined;
153
129
  return DataColumnImpl.fromAccessor(leaf);
154
130
  }
155
131
 
@@ -160,18 +136,13 @@ export class DataColumnImpl implements DataColumnRecipe<PObjectId> {
160
136
 
161
137
  /**
162
138
  * Bind directly to an accessor-backed {@link LeafEntry} — no registry.
163
- * Throws {@link ColumnAbsentError} if the leaf has no spec field and its
164
- * accessor is `inputsLocked`, or if it names an export that is not a column.
165
- * Returns `undefined` while still resolving.
139
+ * Returns `undefined` unless the leaf's spec is readable and is a column
140
+ * spec: while the spec is resolving, when it is absent, and for an export
141
+ * that is not a column.
166
142
  */
167
143
  static fromAccessor(entry: LeafEntry<TreeNodeAccessor>): undefined | DataColumnRecipe<PObjectId> {
168
- if (isNil(readSpecAccessor(entry))) {
169
- if (entry.accessor.getInputsLocked()) throw new ColumnAbsentError(entry.id);
170
- return undefined;
171
- }
172
144
  const spec = readSpec(entry);
173
- if (spec === undefined) return undefined;
174
- if (!isPColumnSpec(spec)) throw new ColumnAbsentError(entry.id);
145
+ if (spec === undefined || !isPColumnSpec(spec)) return undefined;
175
146
  return new DataColumnImpl(entry.id, {
176
147
  getSpec: () => spec,
177
148
  getData: () => readDataAccessor(entry),
@@ -204,8 +175,8 @@ export class DataColumnImpl implements DataColumnRecipe<PObjectId> {
204
175
  * in the active render ctx. Falls back to the registry's `isFinal()`
205
176
  * when the id has no entry — only then we can say `absent` instead of
206
177
  * `resolving`. The status tells only whether the spec is readable: for an
207
- * export that is not a column it is `present`, and the factories throw
208
- * {@link ColumnAbsentError}.
178
+ * export that is not a column it is `present`, and the factories return
179
+ * `undefined`.
209
180
  */
210
181
  static getStatusById(
211
182
  id: PObjectId,