@thatopen/services 0.26.0 → 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.
- package/dist/cli.js +91 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/builtin-recipes/records-to-revit.d.ts +1 -1
- package/dist/core/builtin-recipes/shared.d.ts +3 -3
- package/dist/core/history.d.ts +70 -1
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +465 -384
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ interface Settings {
|
|
|
13
13
|
* Trust the records' own style names instead: `lookRef`
|
|
14
14
|
* "Family:Type" becomes the proposal's Family and Type verbatim. 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
17
|
*/
|
|
18
18
|
trustStyleNames?: boolean;
|
|
19
19
|
/** Also propose free-standing family instances (furniture, equipment). Needs trustStyleNames. */
|
|
@@ -18,13 +18,13 @@ export interface OurRecord {
|
|
|
18
18
|
export declare function recordsOf(items: FragItem[]): OurRecord[];
|
|
19
19
|
/**
|
|
20
20
|
* A param the converter double-encodes (`params.run`, `params.member`,
|
|
21
|
-
* `params.definition
|
|
21
|
+
* `params.definition`... are JSON IN TEXT inside the record's JSON).
|
|
22
22
|
*/
|
|
23
23
|
export declare function innerJson<T>(record: OurRecord, param: string): T | null;
|
|
24
|
-
/** Level id (`datum:N`)
|
|
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
26
|
/**
|
|
27
|
-
* Source id
|
|
27
|
+
* Source id -> what this recipe already made for it, read back from its own
|
|
28
28
|
* APPLIED suggestions: the i-th id the target answered with is what the i-th
|
|
29
29
|
* change made. It keeps nothing of its own, so it behaves the same whoever
|
|
30
30
|
* runs it and wherever (the pattern the first end-to-end conversion proved).
|
package/dist/core/history.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|