@thatopen/services 0.26.1 → 0.27.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.
@@ -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