@thatopen/services 0.35.1 → 0.36.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/README.md +66 -66
- package/dist/built-in/index.d.ts +13 -13
- package/dist/cli/lib/browser-session.d.ts +17 -0
- package/dist/cli/lib/config.d.ts +6 -0
- package/dist/cli.js +334 -38
- package/dist/cli.js.map +1 -1
- package/dist/core/browser-sign-in.d.ts +50 -0
- package/dist/core/browser-sign-in.test.d.ts +1 -0
- package/dist/core/builtin-recipes/index.d.ts +2 -2
- package/dist/core/builtin-recipes/layer-to-native.d.ts +19 -0
- package/dist/core/builtin-recipes/records-to-native.d.ts +43 -0
- package/dist/core/builtin-recipes/shapes-to-families.d.ts +9 -4
- package/dist/core/builtin-recipes/shared.d.ts +8 -11
- package/dist/core/channel.d.ts +1 -1
- package/dist/core/client.d.ts +46 -2
- package/dist/core/frag-items.d.ts +1 -1
- package/dist/core/history.d.ts +9 -9
- package/dist/core/op-builder.d.ts +2 -2
- package/dist/core/platform-client.d.ts +6 -3
- package/dist/core/project-recipes.d.ts +1 -1
- package/dist/core/recipes.d.ts +31 -5
- package/dist/index.cjs.js +23 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4284 -3455
- package/dist/index.es.js.map +1 -1
- package/dist/vite-env.d.ts +1 -1
- package/docs/ai-quickstart.md +548 -548
- package/docs/builtin/paths.json +130 -130
- package/docs/cli/create.md +29 -29
- package/docs/cli/local-server.md +38 -38
- package/docs/cli/login.md +35 -32
- package/docs/cli/mcp.md +46 -46
- package/docs/cli/publish.md +31 -31
- package/docs/cli/run.md +26 -26
- package/docs/cli/serve.md +43 -43
- package/docs/cli/swap.md +30 -30
- package/docs/client/paths.json +2 -2
- package/docs/cloud/GaussianSplatConverter.md +43 -43
- package/docs/cloud/PointCloudConverter.md +53 -53
- package/docs/flow-architecture.md +393 -393
- package/docs/flow-plugin-guide.md +354 -354
- package/docs/platform-token.md +81 -81
- package/docs/rate-limits.md +133 -133
- package/docs/recipes-guide.md +243 -243
- package/docs/revit-collab-quickstart.md +445 -445
- package/docs/rhino-interop-quickstart.md +387 -387
- package/docs/sheet-sets-guide.md +69 -69
- package/package.json +1 -1
- package/resources/AGENTS.md +57 -57
- package/src/built-in/CDEManager/example.ts +214 -214
- package/src/built-in/CDEManager/examples/FileEditing/example.ts +226 -226
- package/src/built-in/CDEManager/examples/FileMoves/example.ts +186 -186
- package/src/built-in/CDEManager/examples/FileOperations/example.ts +295 -295
- package/src/built-in/CDEManager/examples/FileTransfers/example.ts +210 -210
- package/src/built-in/CDEManager/examples/FolderManagement/example.ts +230 -230
- package/src/built-in/CDEManager/examples/MetadataSchema/example.ts +230 -230
- package/src/built-in/CDEManager/examples/MetadataViews/example.ts +166 -166
- package/src/built-in/CDEManager/examples/ProjectConfig/example.ts +177 -177
- package/src/built-in/ClashesManager/example.ts +283 -283
- package/src/built-in/GISManager/example.ts +355 -355
- package/src/built-in/ProjectManager/example.ts +124 -124
- package/src/built-in/UIManager/src/app/example.ts +97 -97
- package/src/built-in/UIManager/src/app/examples/AppState/example.ts +140 -140
- package/src/built-in/UIManager/src/app/examples/Banner/example.ts +159 -159
- package/src/built-in/UIManager/src/app/examples/Contexts/example.ts +123 -123
- package/src/built-in/UIManager/src/app/examples/FileDrop/example.ts +124 -124
- package/src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts +90 -90
- package/src/built-in/UIManager/src/app/examples/Modal/example.ts +163 -163
- package/src/built-in/UIManager/src/app/examples/Notifications/example.ts +133 -133
- package/src/built-in/UIManager/src/app/examples/ProjectFileStorage/example.ts +150 -150
- package/src/built-in/UIManager/src/app/examples/Sidebar/example.ts +105 -105
- package/src/built-in/UIManager/src/clashes-panel/example.ts +183 -183
- package/src/built-in/UIManager/src/gis-panel/example.ts +163 -163
- package/src/built-in/UIManager/src/gis-properties-panel/example.ts +168 -168
- package/src/built-in/UIManager/src/git-history-panel/example.ts +70 -70
- package/src/built-in/UIManager/src/map-panel/example.ts +189 -189
- package/src/built-in/UIManager/src/models-list/example.ts +181 -181
- package/src/built-in/UIManager/src/settings-panel/example.ts +303 -303
- package/src/built-in/UIManager/src/topics-panel/example.ts +170 -170
- package/src/built-in/UIManager/src/viewer/example.ts +182 -182
- package/src/built-in/UIManager/src/viewer-toolbar/example.ts +376 -376
- package/src/built-in/index.ts +2995 -2995
- package/src/cli/templates/app/README.md +250 -250
- package/src/cli/templates/app/index.html +35 -35
- package/src/cli/templates/app/package.json +32 -32
- package/src/cli/templates/app/src/app.ts +37 -37
- package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -50
- package/src/cli/templates/app/src/bim-components/CloudRunner/index.ts +95 -95
- package/src/cli/templates/app/src/bim-components/CloudRunner/src/index.ts +1 -1
- package/src/cli/templates/app/src/bim-components/CloudRunner/src/types.ts +5 -5
- package/src/cli/templates/app/src/bim-components/index.ts +1 -1
- package/src/cli/templates/app/src/globals.ts +1 -1
- package/src/cli/templates/app/src/main.history.ts +191 -191
- package/src/cli/templates/app/src/main.ts +226 -226
- package/src/cli/templates/app/src/setups/channel.ts +76 -76
- package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -88
- package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -166
- package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -31
- package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -51
- package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -1383
- package/src/cli/templates/app/src/ui-components/app-info-section/index.ts +26 -26
- package/src/cli/templates/app/src/ui-components/app-info-section/src/index.ts +1 -1
- package/src/cli/templates/app/src/ui-components/app-info-section/src/types.ts +15 -15
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/index.ts +37 -37
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/index.ts +1 -1
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/types.ts +14 -14
- package/src/cli/templates/app/src/ui-components/index.ts +2 -2
- package/src/cli/templates/app/tsconfig.json +16 -16
- package/src/cli/templates/app/vite.config.js +57 -57
- package/src/cli/templates/cloud-component/README.md +205 -205
- package/src/cli/templates/cloud-component/_thatopen +5 -5
- package/src/cli/templates/cloud-component/declarations.json +4 -4
- package/src/cli/templates/cloud-component/package.json +21 -21
- package/src/cli/templates/cloud-component/src/main.ts +70 -70
- package/src/cli/templates/cloud-component/tsconfig.json +16 -16
- package/src/cli/templates/cloud-component/vite.config.js +46 -46
- package/src/cli/templates/shared/AGENTS.md +8 -8
- package/src/cli/templates/shared/CLAUDE.md +1 -1
- package/src/cli/templates/shared/_gitignore +5 -5
- package/src/core/examples/.env.example +7 -7
- package/src/core/examples/apps.ts +67 -67
- package/src/core/examples/batch-reads.ts +99 -99
- package/src/core/examples/channel.ts +65 -65
- package/src/core/examples/components.ts +91 -91
- package/src/core/examples/execution.ts +75 -75
- package/src/core/examples/file-metadata.ts +94 -94
- package/src/core/examples/files.ts +81 -81
- package/src/core/examples/folders.ts +82 -82
- package/src/core/examples/hidden-files.ts +88 -88
- package/src/core/examples/history.ts +103 -103
- package/src/core/examples/icons.ts +68 -68
- package/src/core/examples/permissions.ts +87 -87
- package/dist/core/builtin-recipes/records-to-revit.d.ts +0 -28
- package/dist/core/builtin-recipes/rhino-to-revit.d.ts +0 -16
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `signInWithBrowser` leaves: enough to call the platform now, and to keep
|
|
3
|
+
* doing so after the access token expires.
|
|
4
|
+
*/
|
|
5
|
+
export interface BrowserSession {
|
|
6
|
+
apiUrl: string;
|
|
7
|
+
accessToken: string;
|
|
8
|
+
/** When the access token stops working, in milliseconds since the epoch. */
|
|
9
|
+
expiresAt: number;
|
|
10
|
+
installId: string;
|
|
11
|
+
refreshToken: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SignInWithBrowserOptions {
|
|
14
|
+
/** The platform to sign in to. */
|
|
15
|
+
apiUrl: string;
|
|
16
|
+
/**
|
|
17
|
+
* Shown to the person with the code, so they can tell it is theirs: what is
|
|
18
|
+
* asking and where. For example `That Open CLI` and the machine's name.
|
|
19
|
+
*/
|
|
20
|
+
application: string;
|
|
21
|
+
machine: string;
|
|
22
|
+
/** This package's version. The platform refuses a version it no longer supports. */
|
|
23
|
+
version: string;
|
|
24
|
+
/**
|
|
25
|
+
* Called once with the address to open and the code it should show. The
|
|
26
|
+
* person compares that code and confirms it there.
|
|
27
|
+
*/
|
|
28
|
+
onVerification: (verification: BrowserVerification) => void | Promise<void>;
|
|
29
|
+
/** Stops waiting for the person. */
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
}
|
|
32
|
+
export interface BrowserVerification {
|
|
33
|
+
url: string;
|
|
34
|
+
userCode: string;
|
|
35
|
+
/** Where to type the code, for somebody who cannot follow `url`. */
|
|
36
|
+
manualUrl: string;
|
|
37
|
+
}
|
|
38
|
+
/** What this package connects to the platform as. */
|
|
39
|
+
export declare const SERVICES_SDK_CONNECTOR_ID = "services-sdk";
|
|
40
|
+
/**
|
|
41
|
+
* Signs in through the browser, as the plugins do (RFC 8628): the
|
|
42
|
+
* platform gives a code, the person confirms it in their browser, and this waits
|
|
43
|
+
* for the answer. No token is ever pasted.
|
|
44
|
+
*/
|
|
45
|
+
export declare function signInWithBrowser(options: SignInWithBrowserOptions): Promise<BrowserSession>;
|
|
46
|
+
/**
|
|
47
|
+
* A new access token for a session. The refresh token rotates, so the session
|
|
48
|
+
* returned replaces the one given: keep this one, wherever it is stored.
|
|
49
|
+
*/
|
|
50
|
+
export declare function refreshBrowserSession(session: BrowserSession): Promise<BrowserSession>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EngineServicesClient } from '../client';
|
|
2
2
|
import { Recipe } from '../recipes';
|
|
3
3
|
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { platformModelToNative, ifcToNative } from './records-to-native';
|
|
5
|
+
export { layerToNative } from './layer-to-native';
|
|
6
6
|
/** The built-in recipes, in catalog order. */
|
|
7
7
|
export declare const builtinRecipes: Recipe<any>[];
|
|
8
8
|
/** Registers every built-in recipe on the client's registry. */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Recipe } from '../recipes';
|
|
2
|
+
|
|
3
|
+
/** A family type of the target, as the target publishes it. */
|
|
4
|
+
interface NativeType {
|
|
5
|
+
categoryId: string;
|
|
6
|
+
family: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}
|
|
9
|
+
interface Settings {
|
|
10
|
+
/** The other modelling tool layer that drives placement. */
|
|
11
|
+
layer: string;
|
|
12
|
+
/**
|
|
13
|
+
* The modelling tool type every placed object becomes. Unsaid: each object is made as a family of its own shape (one per
|
|
14
|
+
* shape; a prism, one per profile with its length an instance parameter), standing where the other modelling tool has it.
|
|
15
|
+
*/
|
|
16
|
+
instanceType?: NativeType;
|
|
17
|
+
}
|
|
18
|
+
export declare const layerToNative: Recipe<Settings>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Recipe } from '../recipes';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The native family and type a record's element had where it was authored, when the file says:
|
|
5
|
+
* an IFC exported from the modelling tool names every element "Family:Type:ElementId". A model that came FROM
|
|
6
|
+
* the modelling tool goes back with its own type names; anything else keeps the record's style name.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* 🔴 THE UNION OF LOOPS THAT TOUCH (a client's model 13-11: a ceiling written as two rectangles side by side, «CL-UB03.02», read as its
|
|
10
|
+
* first, 13.6 m of its 32.2): each loop turned counter-clockwise, every side split where another's corner lies on it, the sides
|
|
11
|
+
* met once each way taken away (they are inside), the rest chained again; corners that do not turn dropped. Plan points; the
|
|
12
|
+
* loops that come out, the outer ones counter-clockwise and any hole clockwise.
|
|
13
|
+
*/
|
|
14
|
+
export declare function unionOfLoops(loops: number[][][]): number[][][];
|
|
15
|
+
/** A family type of the target, as the target publishes it. */
|
|
16
|
+
interface NativeType {
|
|
17
|
+
categoryId: string;
|
|
18
|
+
family: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}
|
|
21
|
+
interface Settings {
|
|
22
|
+
/** The modelling tool type columns get, when style names are not trusted. */
|
|
23
|
+
columnType?: NativeType;
|
|
24
|
+
/** The modelling tool door and window types the model's hosted doors and windows get, when style names are not trusted. */
|
|
25
|
+
doorType?: NativeType;
|
|
26
|
+
windowType?: NativeType;
|
|
27
|
+
/**
|
|
28
|
+
* Trust the records' own style names: `lookRef` "Family:Type" becomes the
|
|
29
|
+
* change's Family and Type verbatim, for columns and instances. the modelling tool
|
|
30
|
+
* matches a type exactly and refuses the whole request when one is missing
|
|
31
|
+
* - right for a model that came FROM this the modelling tool, wrong for anything else.
|
|
32
|
+
* (Walls and floors always go by their style name: system types are named
|
|
33
|
+
* identity, and the applier makes a missing one from the carried width.)
|
|
34
|
+
*/
|
|
35
|
+
trustStyleNames?: boolean;
|
|
36
|
+
/** Also bring free-standing family instances (furniture, equipment). Needs trustStyleNames. */
|
|
37
|
+
includeInstances?: boolean;
|
|
38
|
+
/** Carry the model's levels (ensured by name on the target). Default true. */
|
|
39
|
+
createLevels?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare const platformModelToNative: Recipe<Settings>;
|
|
42
|
+
export declare const ifcToNative: Recipe<Settings>;
|
|
43
|
+
export {};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { SourceShapes } from '../recipes';
|
|
2
2
|
|
|
3
3
|
export declare const FEET: number;
|
|
4
|
-
/** The class of an IFC element → the category (
|
|
4
|
+
/** The class of an IFC element → the category (the modelling tool's built-in category name) its family is made in. */
|
|
5
5
|
export declare const SHAPE_CATEGORY: Readonly<Record<string, string>>;
|
|
6
|
+
/** The loadable-family category a «Category : Family : Type» name says, or none. */
|
|
7
|
+
export declare const categoryOfName: (name: string | null | undefined) => string | undefined;
|
|
8
|
+
export declare const categoryOfUniformat: (code: string | null | undefined) => string | undefined;
|
|
9
|
+
/** Whether a name starts with a the modelling tool category label («Structural Foundations : M_Pile : 500mm»). */
|
|
10
|
+
export declare const startsWithACategory: (name: string | null | undefined) => boolean;
|
|
6
11
|
export interface ShapedInstance {
|
|
7
12
|
key: string;
|
|
8
13
|
attrs: Record<string, string>;
|
|
@@ -43,7 +48,7 @@ export declare function prismOf(piece: {
|
|
|
43
48
|
/**
|
|
44
49
|
* The rooms: each IfcSpace as a point inside its floor (the middle of the largest triangle of its bottom), its bottom
|
|
45
50
|
* and its height (metres, the file's frame), its number (Name) and name (LongName). A room is the walls' to bound, as
|
|
46
|
-
* in
|
|
51
|
+
* in the modelling tool: placed at that point after them, it takes their outline.
|
|
47
52
|
*/
|
|
48
53
|
export declare function roomsFromShapes(shapes: SourceShapes, fileId: string): {
|
|
49
54
|
key: string;
|
|
@@ -66,7 +71,7 @@ export declare function extentAcross(shapes: SourceShapes, gid: string, origin:
|
|
|
66
71
|
export declare function pointsOf(shapes: SourceShapes, gid: string, only?: number): number[][];
|
|
67
72
|
/**
|
|
68
73
|
* 🔴 A CURTAIN WALL'S PANELS THAT ARE NO PLAIN SHEET (24-10: DACH's 155 louvre panels, «Lamellenelement», and the
|
|
69
|
-
* Conference Center's 158 came out as
|
|
74
|
+
* Conference Center's 158 came out as the modelling tool's flat glass): each with the point its shape is centred on, for the
|
|
70
75
|
* curtain wall to leave its cell empty and the panel to be made as a family of its own shape. Plain: one box (12
|
|
71
76
|
* triangles); `sheet`, the panel's own thickness, kept for when one box is not enough to tell.
|
|
72
77
|
*/
|
|
@@ -75,7 +80,7 @@ export declare function shapedPanelsOf(shapes: SourceShapes, curtainGid: string,
|
|
|
75
80
|
centre: number[];
|
|
76
81
|
}[];
|
|
77
82
|
/**
|
|
78
|
-
* 🔴 A WALL'S TOP AS ITS SHAPE DRAWS IT (24-10:
|
|
83
|
+
* 🔴 A WALL'S TOP AS ITS SHAPE DRAWS IT (24-10: the modelling tool exports an edited profile as the wall's box less polygonal
|
|
79
84
|
* openings with nothing in them, which the converter does not read as an elevation; racbasic's 530178 came out 6.3 m³
|
|
80
85
|
* for 1.2, Savoyvilla's walls twice their volume). Read off the wall's own mesh, its holes already cut: the face that
|
|
81
86
|
* looks out along its normal, outermost, flattened onto [along, z] from `from`; its outline's upper chain, from its
|
|
@@ -4,7 +4,7 @@ import { FragItem } from '../frag-items';
|
|
|
4
4
|
/** The modeling engine's attribute names (its `element-attributes.ts`). */
|
|
5
5
|
export declare const ELEMENT_FIELD = "Element";
|
|
6
6
|
export declare const CARRIED_FIELD = "Carried";
|
|
7
|
-
/**
|
|
7
|
+
/** the modelling tool's internal length unit: where every position has to end up. */
|
|
8
8
|
export declare const FEET_PER_METRE: number;
|
|
9
9
|
/** One semantic record, as saved: `params` carries the kind-specific fields. */
|
|
10
10
|
export interface OurRecord {
|
|
@@ -44,14 +44,11 @@ prints?: Map<string, string>): Map<string, string>;
|
|
|
44
44
|
export declare function printOf(value: unknown): string;
|
|
45
45
|
/** The project file the person picked as a recipe's source. */
|
|
46
46
|
export type PickedFile = PickedSource;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* file they uploaded and nothing else.
|
|
53
|
-
*/
|
|
54
|
-
export declare function readPickedFrag(context: RecipeContext<unknown>, picked: PickedFile | undefined): Promise<{
|
|
47
|
+
export declare function readPickedFrag(context: RecipeContext<unknown>, picked: PickedFile | undefined,
|
|
48
|
+
/** Also a whole .frag's shapes, when the host reads them (`provideShapes('frag')`): a the other modelling tool model's objects made as families. */
|
|
49
|
+
options?: {
|
|
50
|
+
shapes?: boolean;
|
|
51
|
+
}): Promise<{
|
|
55
52
|
picked: PickedSource;
|
|
56
53
|
contents: import('../frag-items').FragContents;
|
|
57
54
|
site: SiteLocation | null;
|
|
@@ -60,8 +57,8 @@ export declare function readPickedFrag(context: RecipeContext<unknown>, picked:
|
|
|
60
57
|
/**
|
|
61
58
|
* Where an IFC's site stands in the coordinates it was written in: its origin
|
|
62
59
|
* (metres) and the angle of its X axis (degrees, counter-clockwise). An IFC
|
|
63
|
-
*
|
|
64
|
-
* model's shared location (racbasic: -19.82 m, -18.81 m, 37°), so a
|
|
60
|
+
* the modelling tool writes in shared coordinates places its site exactly at the source
|
|
61
|
+
* model's shared location (racbasic: -19.82 m, -18.81 m, 37°), so a the modelling tool
|
|
65
62
|
* document that shares no coordinates yet can be given the same location and
|
|
66
63
|
* receive the building square to its own axes.
|
|
67
64
|
*/
|
package/dist/core/channel.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ export declare class CollabRoom<E extends object = AnyChannelEvents> extends Cha
|
|
|
132
132
|
handle(message: ChannelIncomingMessage): Promise<ChannelOutcome>;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Commands from this account's external tools — a CLI, an MCP server,
|
|
135
|
+
* Commands from this account's external tools — a CLI, an MCP server, an authoring-tool
|
|
136
136
|
* plugin — of one `kind`, or of every kind when none is given.
|
|
137
137
|
*
|
|
138
138
|
* `C` maps each command name to `{ payload, reply }`, so a handler's argument
|
package/dist/core/client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BrowserSession, SignInWithBrowserOptions } from './browser-sign-in';
|
|
1
2
|
import { ProjectDocuments } from './documents';
|
|
2
3
|
import { ProjectHistory } from './history';
|
|
3
4
|
import { Recipes } from './recipes';
|
|
@@ -193,6 +194,49 @@ export declare class EngineServicesClient {
|
|
|
193
194
|
* @param props - Optional configuration (retry count, auth mode, etc.).
|
|
194
195
|
*/
|
|
195
196
|
constructor(accessToken: string, apiUrl: string, props?: EngineServicesClientProps);
|
|
197
|
+
/**
|
|
198
|
+
* Signs in through the browser, as the plugins do, and returns a client
|
|
199
|
+
* that keeps its access token fresh while the process lives. For a program
|
|
200
|
+
* outside the platform; an app inside it uses {@link fromPlatformContext}.
|
|
201
|
+
*
|
|
202
|
+
* Keep the session given to `onSession` to start again without asking the
|
|
203
|
+
* person, with {@link fromBrowserSession}. Its refresh token rotates, so each
|
|
204
|
+
* one replaces the last.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```ts
|
|
208
|
+
* const client = await EngineServicesClient.signInWithBrowser({
|
|
209
|
+
* apiUrl: 'https://platform.thatopen.com',
|
|
210
|
+
* application: 'My tool',
|
|
211
|
+
* machine: os.hostname(),
|
|
212
|
+
* version: '1.0.0',
|
|
213
|
+
* onVerification: ({ url, userCode }) => {
|
|
214
|
+
* console.log(`Confirm ${userCode} at ${url}`);
|
|
215
|
+
* },
|
|
216
|
+
* onSession: (session) => save(session),
|
|
217
|
+
* });
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
static signInWithBrowser(options: SignInWithBrowserOptions & {
|
|
221
|
+
onSession?: (session: BrowserSession) => void;
|
|
222
|
+
}): Promise<EngineServicesClient>;
|
|
223
|
+
/**
|
|
224
|
+
* A client from a session kept earlier. It renews the access token shortly
|
|
225
|
+
* before it expires, without keeping the process alive for it; call
|
|
226
|
+
* {@link stopRenewing} when done with a client in a process that goes on.
|
|
227
|
+
*/
|
|
228
|
+
static fromBrowserSession(session: BrowserSession, options?: {
|
|
229
|
+
onSession?: (session: BrowserSession) => void;
|
|
230
|
+
}): EngineServicesClient;
|
|
231
|
+
private renewal;
|
|
232
|
+
private renewFrom;
|
|
233
|
+
/** Stops renewing the access token of a client from a browser session. */
|
|
234
|
+
stopRenewing(): void;
|
|
235
|
+
/**
|
|
236
|
+
* Replaces the access token used by every call from now on.
|
|
237
|
+
* @param accessToken - The new token.
|
|
238
|
+
*/
|
|
239
|
+
setAccessToken(accessToken: string): void;
|
|
196
240
|
/**
|
|
197
241
|
* Sets the number of automatic retries for failed requests. Retries use
|
|
198
242
|
* exponential backoff with jitter and honour `Retry-After`; only network
|
|
@@ -294,7 +338,7 @@ export declare class EngineServicesClient {
|
|
|
294
338
|
* (`GET /item/export`): a row per file with its folder path, its live
|
|
295
339
|
* version and every metadata field of that version as a `meta.<key>`
|
|
296
340
|
* column. Only what the caller may read. As JSON rows by default; as CSV
|
|
297
|
-
* text (RFC 4180) with `format: 'csv'`, ready for
|
|
341
|
+
* text (RFC 4180) with `format: 'csv'`, ready for BI and spreadsheet tools. A
|
|
298
342
|
* platform from before the route answers 404.
|
|
299
343
|
*
|
|
300
344
|
* @example
|
|
@@ -709,7 +753,7 @@ export declare class EngineServicesClient {
|
|
|
709
753
|
*/
|
|
710
754
|
documents(projectId: string): ProjectDocuments;
|
|
711
755
|
/**
|
|
712
|
-
* A project's history of connected documents (
|
|
756
|
+
* A project's history of connected documents (authoring-tool models, CAD
|
|
713
757
|
* drawings…): their version timelines and their change requests. See
|
|
714
758
|
* `src/core/history.ts` — this surface is the only supported way to read
|
|
715
759
|
* or write it; the storage underneath is private and will move.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export interface FragItem {
|
|
16
16
|
localId: number;
|
|
17
|
-
/** The publisher's own id for this thing — a
|
|
17
|
+
/** The publisher's own id for this thing — a modelling tool's object guid, an authoring tool's UniqueId. */
|
|
18
18
|
guid: string | null;
|
|
19
19
|
category: string | null;
|
|
20
20
|
attrs: Record<string, string>;
|
package/dist/core/history.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { DocumentDescriptor, DocumentView } from './documents';
|
|
|
5
5
|
export interface FlowChange {
|
|
6
6
|
/** create | update | delete. */
|
|
7
7
|
type: 'create' | 'update' | 'delete' | string;
|
|
8
|
-
/** The native application's own id for the element (
|
|
8
|
+
/** The native application's own id for the element (the authoring tool's UniqueId, a CAD handle). */
|
|
9
9
|
uniqueId: string;
|
|
10
10
|
}
|
|
11
11
|
/** Per-version change tallies. */
|
|
@@ -55,7 +55,7 @@ export interface FlowVersion {
|
|
|
55
55
|
* Absent: a sync.
|
|
56
56
|
*/
|
|
57
57
|
kind?: 'upload' | 'sync' | 'recipe' | 'restore' | string;
|
|
58
|
-
/** On a 'restore' (
|
|
58
|
+
/** On a 'restore' (the authoring tool's That Open > History > Restore this version): the version it went back to. */
|
|
59
59
|
restoredFrom?: {
|
|
60
60
|
guid: string;
|
|
61
61
|
version: number;
|
|
@@ -97,11 +97,11 @@ export interface FlowOrigin {
|
|
|
97
97
|
/** The file's storage version the recipe read. */
|
|
98
98
|
version: string;
|
|
99
99
|
};
|
|
100
|
-
/** What it wrote, in a line: «IFC to
|
|
100
|
+
/** What it wrote, in a line: «IFC to the authoring tool: 12 wall(s), 3 floor(s)». */
|
|
101
101
|
title?: string;
|
|
102
102
|
/** The settings it ran with, as the person chose them. */
|
|
103
103
|
settings?: Record<string, unknown>;
|
|
104
|
-
/** The recipe's name for people ("IFC to
|
|
104
|
+
/** The recipe's name for people ("IFC to the authoring tool"). */
|
|
105
105
|
recipeTitle?: string;
|
|
106
106
|
}
|
|
107
107
|
/** A connected document, as listed from the project. */
|
|
@@ -128,8 +128,8 @@ export interface FlowDocInfo {
|
|
|
128
128
|
/**
|
|
129
129
|
* One person's current hold on a document's elements, read from the lock
|
|
130
130
|
* registry the native plugins arbitrate through. Element keys are the native
|
|
131
|
-
* application's own ids (
|
|
132
|
-
*
|
|
131
|
+
* application's own ids (the authoring tool's UniqueIds). Workset-level ownership lives in
|
|
132
|
+
* the authoring tool's own binary worksharing files (the ownership mirror) and is not
|
|
133
133
|
* readable here — what IS here is every element-level claim.
|
|
134
134
|
*/
|
|
135
135
|
export interface FlowOwner {
|
|
@@ -231,7 +231,7 @@ export declare class ProjectHistory {
|
|
|
231
231
|
* @internal The documents' folders (the root's children), listed ONCE and
|
|
232
232
|
* shared by every document. Each document listing them for itself was ~150
|
|
233
233
|
* requests on one Coordinator load with ~30 documents, and the platform
|
|
234
|
-
* answers 429 past 100 a minute: the app then showed no
|
|
234
|
+
* answers 429 past 100 a minute: the app then showed no authoring-tool document and
|
|
235
235
|
* a queued request never arrived (13-10). Listed again after 30 s, when a
|
|
236
236
|
* folder is made, or when asked `fresh`.
|
|
237
237
|
*/
|
|
@@ -284,8 +284,8 @@ export declare class FlowDoc {
|
|
|
284
284
|
* takes the fragments engine, which this package deliberately does not
|
|
285
285
|
* carry.
|
|
286
286
|
*
|
|
287
|
-
* UniqueIds are the native application's own stable element ids (
|
|
288
|
-
* UniqueId survives syncs, machines and full exports), which is what makes
|
|
287
|
+
* UniqueIds are the native application's own stable element ids (the authoring
|
|
288
|
+
* tool's UniqueId survives syncs, machines and full exports), which is what makes
|
|
289
289
|
* replace-by-uniqueId the whole composition rule.
|
|
290
290
|
*
|
|
291
291
|
* When the baseline is NEWER than the asked version (somebody published
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* as given, in the TARGET application's own terms and units, because data
|
|
18
18
|
* that gets translated on the way in has to be untranslated on the way out
|
|
19
19
|
* and the day somebody forgets a field nothing complains. Deciding what a
|
|
20
|
-
*
|
|
20
|
+
* modelling tool's layer means in the authoring tool is the recipe's job; this only carries the
|
|
21
21
|
* answer.
|
|
22
22
|
*
|
|
23
23
|
* DEPENDENCIES, loaded at build() time and declared as OPTIONAL PEERS:
|
|
@@ -59,7 +59,7 @@ export interface Placement {
|
|
|
59
59
|
rotationDeg?: number;
|
|
60
60
|
/**
|
|
61
61
|
* The id of the object that caused this change, in the AUTHOR's own terms —
|
|
62
|
-
* a
|
|
62
|
+
* a modelling tool's guid, a row of a spreadsheet, whatever asked for it. Optional, and
|
|
63
63
|
* only useful to whoever wrote it: pass it when you expect to come back and
|
|
64
64
|
* find what you created.
|
|
65
65
|
*/
|
|
@@ -101,14 +101,17 @@ export declare class PlatformClient extends EngineServicesClient {
|
|
|
101
101
|
/**
|
|
102
102
|
* Creates a client from the platform context injected into
|
|
103
103
|
* `window.__THATOPEN_CONTEXT__` by the That Open Platform. Recommended
|
|
104
|
-
* entry point for apps running inside the platform's iframe
|
|
105
|
-
*
|
|
104
|
+
* entry point for apps running inside the platform's iframe.
|
|
105
|
+
*
|
|
106
|
+
* The token is read from the context on every request, not copied once:
|
|
107
|
+
* the platform renews it in the context while the app is open, so an app
|
|
108
|
+
* left open past the token's life keeps working.
|
|
106
109
|
*/
|
|
107
110
|
static fromPlatformContext(props?: Omit<EngineServicesClientProps, 'useBearer'>): PlatformClient;
|
|
108
111
|
/**
|
|
109
112
|
* The platform channel, from inside an app: a collaboration room shared with
|
|
110
113
|
* other users of the app, and rooms for commands from external tools (a CLI,
|
|
111
|
-
* an MCP server,
|
|
114
|
+
* an MCP server, an authoring-tool plugin). Typed, and built on the `postMessage`
|
|
112
115
|
* contract with the platform shell — the app never opens a socket.
|
|
113
116
|
*
|
|
114
117
|
* Only available in an app running in the platform's iframe; reading it
|
|
@@ -101,7 +101,7 @@ export declare function compileRecipe(manifest: RecipeManifest, code: string): P
|
|
|
101
101
|
/**
|
|
102
102
|
* The changes a run asks for, as data a person (or an AI checking its recipe) can read: one entry per
|
|
103
103
|
* change, in order, with its verb, the element it targets (for set and remove), the source it answers to,
|
|
104
|
-
* and what it writes. No
|
|
104
|
+
* and what it writes. No the modelling tool needed: this is what the plugin would apply.
|
|
105
105
|
*/
|
|
106
106
|
export declare function describeChanges(payload: Blob | Uint8Array): Promise<{
|
|
107
107
|
envelope: Record<string, unknown>;
|
package/dist/core/recipes.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EngineServicesClient } from './client';
|
|
2
2
|
import { ProjectRecipes, CatalogEntry, RecipeKit } from './project-recipes';
|
|
3
|
+
import { FragContents } from './frag-items';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* How a settings property says "this names something that EXISTS". Put it on
|
|
@@ -20,7 +21,7 @@ export interface ExistingLookup {
|
|
|
20
21
|
* Narrows the candidates: attribute equals value, against the attribute
|
|
21
22
|
* names EXACTLY as the native application publishes them, no case
|
|
22
23
|
* normalization. Prefer the stable machine fields over display names —
|
|
23
|
-
*
|
|
24
|
+
* the modelling tool's `Category` text is localized per install ("Armazón estructural"),
|
|
24
25
|
* so a column filter is `{ CategoryId: '-2001330' }`, never
|
|
25
26
|
* `{ Category: 'Columns' }`.
|
|
26
27
|
*/
|
|
@@ -28,15 +29,15 @@ export interface ExistingLookup {
|
|
|
28
29
|
}
|
|
29
30
|
/** What a recipe declares about itself. Shown in catalogs, checked by apps. */
|
|
30
31
|
export interface RecipeManifest {
|
|
31
|
-
/** Machine name, unique in a catalog: '
|
|
32
|
+
/** Machine name, unique in a catalog: 'points-to-columns'. */
|
|
32
33
|
name: string;
|
|
33
|
-
/** The human name a list shows: '
|
|
34
|
+
/** The human name a list shows: 'the other modelling tool points to the modelling tool columns'. */
|
|
34
35
|
title?: string;
|
|
35
36
|
/** The one sentence a non-programmer reads: what it converts into what. */
|
|
36
37
|
description: string;
|
|
37
38
|
/** The long-form explanation an app renders, as markdown. */
|
|
38
39
|
doc?: string;
|
|
39
|
-
/** The native application whose language it writes: 'revit', '
|
|
40
|
+
/** The native application whose language it writes: 'revit', 'a drawing tool'… */
|
|
40
41
|
to: string;
|
|
41
42
|
/** The input kinds it understands: 'rhino-model', 'platform-elements', 'points', 'csv'… */
|
|
42
43
|
inputs: string[];
|
|
@@ -73,7 +74,7 @@ export interface RecipeManifest {
|
|
|
73
74
|
}
|
|
74
75
|
/** One thing this recipe made in the target before, as the target remembers it. */
|
|
75
76
|
export interface RecipeMade {
|
|
76
|
-
/** The target's id of what was made (
|
|
77
|
+
/** The target's id of what was made (the modelling tool's UniqueId). */
|
|
77
78
|
id: string;
|
|
78
79
|
/** The fingerprint of what it was made from (`flow:print`): unchanged source, nothing to do. */
|
|
79
80
|
print?: string;
|
|
@@ -175,6 +176,14 @@ export interface SourceShapes {
|
|
|
175
176
|
host: string | null;
|
|
176
177
|
/** A column the file says bears load (Pset_ColumnCommon.LoadBearing). */
|
|
177
178
|
loadBearing?: boolean;
|
|
179
|
+
/** Its classification's code (Uniformat, as the modelling tool writes its assembly code). */
|
|
180
|
+
classification?: string;
|
|
181
|
+
/** A reinforcing bar's axis (world metres, z up) and its radius: made a native rebar. */
|
|
182
|
+
rebar?: {
|
|
183
|
+
path: readonly (readonly [number, number, number])[];
|
|
184
|
+
paths?: readonly (readonly (readonly [number, number, number])[])[];
|
|
185
|
+
radius: number;
|
|
186
|
+
};
|
|
178
187
|
opening?: string | null;
|
|
179
188
|
pieces: {
|
|
180
189
|
geometry: number;
|
|
@@ -190,6 +199,19 @@ export interface SourceShapes {
|
|
|
190
199
|
}>;
|
|
191
200
|
}
|
|
192
201
|
export type ShapesReader = (bytes: Uint8Array, name: string) => Promise<SourceShapes>;
|
|
202
|
+
/**
|
|
203
|
+
* 🔴 A STREAMED .frag READ AS A WHOLE ONE IS (15-11, the modelling tool video: Designer saves every new document streamed, and a
|
|
204
|
+
* recipe pointed at it downloaded its version record — a small JSON naming the pieces — and choked on it). The pieces
|
|
205
|
+
* are gathered here (`readPickedFrag`); what they SAY needs the fragments library, which the SDK does not carry: the
|
|
206
|
+
* host that has it provides this, answering what `readFrag` answers for a whole file.
|
|
207
|
+
*/
|
|
208
|
+
export interface StreamedPieces {
|
|
209
|
+
entry: Uint8Array;
|
|
210
|
+
container: Uint8Array;
|
|
211
|
+
sidecar: Uint8Array;
|
|
212
|
+
lod: Uint8Array;
|
|
213
|
+
}
|
|
214
|
+
export type StreamedReader = (pieces: StreamedPieces, name: string) => Promise<FragContents>;
|
|
193
215
|
/**
|
|
194
216
|
* The local recipe registry and runner. Reach it as `client.recipes`.
|
|
195
217
|
*/
|
|
@@ -212,6 +234,10 @@ export declare class Recipes {
|
|
|
212
234
|
shapesFor(extension: string): ShapesReader | undefined;
|
|
213
235
|
/** The importer provided for an extension, or undefined. */
|
|
214
236
|
importerFor(extension: string): RecordsImporter | undefined;
|
|
237
|
+
/** Says how this host reads a streamed .frag's pieces ({@link StreamedReader}). */
|
|
238
|
+
provideStreamedReader(reader: StreamedReader): void;
|
|
239
|
+
/** The streamed reader provided, or undefined. */
|
|
240
|
+
streamedReader(): StreamedReader | undefined;
|
|
215
241
|
/** Registers a recipe. One per name; a second with the same name throws. */
|
|
216
242
|
register<S>(recipe: Recipe<S>): void;
|
|
217
243
|
/** The registered recipes, optionally filtered by target application. */
|