@thatopen/services 0.26.1 → 0.28.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.
@@ -7,17 +7,21 @@ interface RevitType {
7
7
  type: string;
8
8
  }
9
9
  interface Settings {
10
- /** The Revit type every proposed column gets. */
10
+ /** The Revit type proposed columns get, when style names are not trusted. */
11
11
  columnType?: RevitType;
12
12
  /**
13
- * Trust the records' own style names instead: `lookRef`
14
- * "Family:Type" becomes the proposal's Family and Type verbatim. Revit
13
+ * Trust the records' own style names: `lookRef` "Family:Type" becomes the
14
+ * proposal's Family and Type verbatim, for columns and instances. Revit
15
15
  * matches a type exactly and refuses the whole request when one is missing
16
16
  * - right for a model that came FROM this Revit, wrong for anything else.
17
+ * (Walls and floors always go by their style name: system types are named
18
+ * identity, and the applier makes a missing one from the carried width.)
17
19
  */
18
20
  trustStyleNames?: boolean;
19
21
  /** Also propose free-standing family instances (furniture, equipment). Needs trustStyleNames. */
20
22
  includeInstances?: boolean;
23
+ /** Carry the model's levels (ensured by name on the target). Default true. */
24
+ createLevels?: boolean;
21
25
  }
22
26
  export declare const fragToRevit: Recipe<Settings>;
23
27
  export declare const ifcToRevit: Recipe<Settings>;
@@ -23,6 +23,13 @@ export declare function recordsOf(items: FragItem[]): OurRecord[];
23
23
  export declare function innerJson<T>(record: OurRecord, param: string): T | null;
24
24
  /** Level id (`datum:N`) -> its name, from the document's datum records. */
25
25
  export declare function levelNames(records: OurRecord[]): Map<string, string>;
26
+ /** Level id -> name and elevation (metres), from the datum records. */
27
+ export declare function levelsOf(records: OurRecord[]): Map<string, {
28
+ name: string;
29
+ at: number;
30
+ }>;
31
+ /** Styles by name (`lookRef` points here): the record, for thickness hints. */
32
+ export declare function stylesOf(records: OurRecord[]): Map<string, OurRecord>;
26
33
  /**
27
34
  * Source id -> what this recipe already made for it, read back from its own
28
35
  * APPLIED suggestions: the i-th id the target answered with is what the i-th
@@ -117,6 +117,37 @@ export interface FlowOwner {
117
117
  /** The element keys this person currently holds, arbitration applied. */
118
118
  elements: string[];
119
119
  }
120
+ /**
121
+ * The ordered recipe {@link FlowDoc.modelParts} answers: a baseline plus the
122
+ * steps that bring it to the asked version. See that method for the
123
+ * composition rule.
124
+ */
125
+ export interface FlowModelParts {
126
+ baseline: {
127
+ /** The visible model file. */
128
+ fileId: string;
129
+ /** The version whose full export it is. */
130
+ guid: string;
131
+ /**
132
+ * True when the visible file's CURRENT content is this baseline. False
133
+ * when a later publish rewrote it — then download the file at
134
+ * `storageVersion` (when recorded) instead of its head.
135
+ */
136
+ current: boolean;
137
+ /** The CDE storage version the baseline landed in, when the history recorded it. */
138
+ storageVersion?: number;
139
+ };
140
+ /** One per version after the baseline, oldest first. */
141
+ steps: {
142
+ guid: string;
143
+ /** Hidden-file id of the delta .frag; absent on geometry-less versions. */
144
+ deltaId?: string;
145
+ /** Elements this version removed, by the native app's own stable ids. */
146
+ removedUniqueIds: string[];
147
+ }[];
148
+ /** The version the recipe reaches (the asked one, or the head). */
149
+ at: string;
150
+ }
120
151
  /** What `sync` needs: the change list plus whatever the writer knows. */
121
152
  export interface SyncInput {
122
153
  author: string;
@@ -207,8 +238,37 @@ export declare class FlowDoc {
207
238
  * no delta: their geometry IS the model file — use {@link model}.
208
239
  */
209
240
  delta(version: FlowVersion): Promise<Blob>;
210
- /** The visible model .frag as last fully exported. */
241
+ /**
242
+ * The visible model .frag AS LAST FULLY EXPORTED — the first commit, or the
243
+ * last explicit publish. Ordinary syncs only add hidden deltas, so this is
244
+ * NOT necessarily the head: anything computed on it (a clash run) is as of
245
+ * the last `full: true` version. For the model at a specific version, read
246
+ * {@link modelParts} and compose.
247
+ */
211
248
  model(): Promise<Blob>;
249
+ /**
250
+ * The ordered recipe for the model AT a version: the baseline full export
251
+ * at-or-before it, then one step per later version up to it — each step's
252
+ * delta .frag (absent on geometry-less versions) and the element uniqueIds
253
+ * it removed. The consumer composes with its geometry engine: load the
254
+ * baseline, then per step replace elements by uniqueId from the delta and
255
+ * drop the removed. Composing is NOT done here: writing a merged .frag
256
+ * takes the fragments engine, which this package deliberately does not
257
+ * carry.
258
+ *
259
+ * UniqueIds are the native application's own stable element ids (a Revit
260
+ * UniqueId survives syncs, machines and full exports), which is what makes
261
+ * replace-by-uniqueId the whole composition rule.
262
+ *
263
+ * When the baseline is NEWER than the asked version (somebody published
264
+ * after it), the visible file no longer shows that moment: `baseline`
265
+ * then carries the older version's `storageVersion` when the history
266
+ * recorded one, so the consumer can download that stored file version
267
+ * instead of the current one.
268
+ */
269
+ modelParts(options?: {
270
+ at?: string;
271
+ }): Promise<FlowModelParts>;
212
272
  /** The document folder's item id — the id the CDE knows this document by. */
213
273
  folderId(): Promise<string>;
214
274
  /**
@@ -228,6 +288,15 @@ export declare class FlowDoc {
228
288
  * One view per format: a same-format view is replaced, not accumulated.
229
289
  */
230
290
  addView(view: DocumentView): Promise<void>;
291
+ /**
292
+ * Makes sure the folder carries a descriptor, WRITING one when it predates
293
+ * them: the visible model .frag becomes the 'frag' view. The explicit form
294
+ * of what {@link addView} does implicitly — reads like `descriptor()` never
295
+ * write, so migrating an old folder is this deliberate call. Returns the
296
+ * descriptor either way, or null when there is nothing to describe yet (no
297
+ * model file).
298
+ */
299
+ ensureDescriptor(): Promise<DocumentDescriptor | null>;
231
300
  /**
232
301
  * Who currently holds which elements, read from the lock registry the
233
302
  * native plugins arbitrate through. Read-only: claiming and releasing stay