@thatopen/services 0.33.0 → 0.34.2

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.
@@ -15,7 +15,7 @@ export interface ShapedInstance {
15
15
  * The family instances for every element of `shapes` that nothing in `written` (source keys of what other steps
16
16
  * build: `<file>:<gid>:<kind>`) builds, and that is not part of something written (a curtain wall's mullions).
17
17
  */
18
- export declare function familiesFromShapes(shapes: SourceShapes, written: ReadonlySet<string>, fileId: string): ShapedInstance[];
18
+ export declare function familiesFromShapes(shapes: SourceShapes, written: ReadonlySet<string>, fileId: string, alsoParts?: ReadonlySet<string>): ShapedInstance[];
19
19
  /** World points of an element of `shapes` (metres). */
20
20
  /**
21
21
  * The openings nothing fills (a niche, a pass-through), in the walls that `written` builds: each its points flat
@@ -54,7 +54,43 @@ export declare function roomsFromShapes(shapes: SourceShapes, fileId: string): {
54
54
  }[];
55
55
  /** An element's enclosed volume (m³), its triangles placed: the divergence sum. */
56
56
  export declare function volumeOf(shapes: SourceShapes, gid: string, only?: number): number;
57
+ /**
58
+ * Its shape's extent ACROSS a line at one spot: cut by the vertical plane `t` along `d` from `origin` (plan, metres), at
59
+ * height `z`, the least and most it reaches along the line's normal (left of `d`). Null where the plane misses it. What a
60
+ * box's corners cannot say: a wall notched over part of its length is as thick as its type at the notch's ends.
61
+ */
62
+ export declare function extentAcross(shapes: SourceShapes, gid: string, origin: number[], d: number[], t: number, z: number): {
63
+ lo: number;
64
+ hi: number;
65
+ } | null;
57
66
  export declare function pointsOf(shapes: SourceShapes, gid: string, only?: number): number[][];
67
+ /**
68
+ * 🔴 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 Revit's flat glass): each with the point its shape is centred on, for the
70
+ * 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
+ * triangles); `sheet`, the panel's own thickness, kept for when one box is not enough to tell.
72
+ */
73
+ export declare function shapedPanelsOf(shapes: SourceShapes, curtainGid: string, _sheet: number, wallNormal?: number[]): {
74
+ gid: string;
75
+ centre: number[];
76
+ }[];
77
+ /**
78
+ * 🔴 A WALL'S TOP AS ITS SHAPE DRAWS IT (24-10: Revit exports an edited profile as the wall's box less polygonal
79
+ * openings with nothing in them, which the converter does not read as an elevation; racbasic's 530178 came out 6.3 m³
80
+ * for 1.2, Savoyvilla's walls twice their volume). Read off the wall's own mesh, its holes already cut: the face that
81
+ * looks out along its normal, outermost, flattened onto [along, z] from `from`; its outline's upper chain, from its
82
+ * highest point at one end to its highest at the other. Null when that top is flat and level (a box's), or the shape
83
+ * says nothing clear. Bottom notches (doors) and holes (windows) are not read: they cut their own openings.
84
+ */
85
+ export declare function wallTopOf(shapes: SourceShapes, gid: string, from: number[], to: number[], wholeOutline?: boolean): {
86
+ lo: number;
87
+ hi: number;
88
+ bottom: number;
89
+ chain: [number, number][];
90
+ outline?: [number, number][];
91
+ holes?: [number, number][][];
92
+ pieces?: [number, number][][];
93
+ } | null;
58
94
  /**
59
95
  * 🔴 A WALL WHOSE TOP THE FILE SHOWS CUT BY A ROOF, ATTACHED TO IT (21-10: racbasic's partitions under its roof stood
60
96
  * flat-topped, 6-30 % more wall than the IFC, because the converter had not said they were attached). The wall's top
@@ -274,6 +274,27 @@ export declare class EngineServicesClient {
274
274
  }[];
275
275
  unread: number;
276
276
  }>;
277
+ /**
278
+ * A project's documents as one flat table, for BI and spreadsheets
279
+ * (`GET /item/export`): a row per file with its folder path, its live
280
+ * version and every metadata field of that version as a `meta.<key>`
281
+ * column. Only what the caller may read. As JSON rows by default; as CSV
282
+ * text (RFC 4180) with `format: 'csv'`, ready for Power BI or Excel. A
283
+ * platform from before the route answers 404.
284
+ *
285
+ * @example
286
+ * ```ts
287
+ * const { columns, value } = await client.exportProjectDocuments(projectId);
288
+ * const csv = await client.exportProjectDocuments(projectId, { format: 'csv' });
289
+ * ```
290
+ */
291
+ exportProjectDocuments(projectId: string): Promise<{
292
+ columns: string[];
293
+ value: Record<string, string | number | boolean | null>[];
294
+ }>;
295
+ exportProjectDocuments(projectId: string, options: {
296
+ format: 'csv';
297
+ }): Promise<string>;
277
298
  /**
278
299
  * Gets a single file by ID, optionally including version history.
279
300
  * @param fileId - The file's unique identifier.
@@ -0,0 +1 @@
1
+ export {};
@@ -52,6 +52,10 @@ export interface DocumentDescriptor {
52
52
  };
53
53
  /** The renderable representations, in no particular order. */
54
54
  views: DocumentView[];
55
+ /** The document this one is made from, when it is made from another (a drawing set's PDF). */
56
+ source?: {
57
+ folderId: string;
58
+ };
55
59
  }
56
60
  export declare const DOCUMENT_SCHEMA = "thatopen/document@1";
57
61
  export declare const DOCUMENT_FILE = "document.json";
@@ -18,6 +18,8 @@ export interface FragItem {
18
18
  guid: string | null;
19
19
  category: string | null;
20
20
  attrs: Record<string, string>;
21
+ /** Its name, when the reader keeps one (the recipes' traces print it). */
22
+ name?: string;
21
23
  }
22
24
  export interface FragContents {
23
25
  /** Whatever the publisher declared: units, axes, application. Parsed, or `{}` if unreadable. */
@@ -174,6 +174,8 @@ export interface FlowModelParts {
174
174
  /** What `sync` needs: the change list plus whatever the writer knows. */
175
175
  export interface SyncInput {
176
176
  author: string;
177
+ /** When it happened, ISO UTC, when not now (a tutorial's «Ana, yesterday»). */
178
+ timestamp?: string;
177
179
  /** Which application/tool is writing: 'revit', 'rhino', 'recipe'… */
178
180
  source: string;
179
181
  changes: FlowChange[];
@@ -1,5 +1,6 @@
1
1
  import { EngineServicesClient, EngineServicesClientProps } from './client';
2
- import { Project, ProjectData, ProjectWithRole } from '../types/projects';
2
+ import { Permission, Project, ProjectData, ProjectDataMember, ProjectInvitation, ProjectPermissionMatrixRow, ProjectRole, ProjectWithRole } from '../types/projects';
3
+ import { AccessToken, NewAccessToken } from '../types/tokens';
3
4
  import { ChannelClient } from './channel';
4
5
  import { MarkNotificationsReadResultDto, NotificationPageDto, NotificationSubscriptionView } from '../types/notifications';
5
6
 
@@ -155,6 +156,74 @@ export declare class PlatformClient extends EngineServicesClient {
155
156
  * User data is stripped of sensitive fields server-side.
156
157
  */
157
158
  getProjectData(projectId: string): Promise<ProjectData>;
159
+ /** The project's members, each with their role. */
160
+ listMembers(projectId: string): Promise<ProjectDataMember[]>;
161
+ /** Adds an existing account to the project, with a role (the project's default when not given). */
162
+ addMember(projectId: string, accountId: string, roleId?: string): Promise<unknown>;
163
+ /** Gives a member another role (`null`: the project's default). `projectUserId` is the member's, from {@link listMembers}. */
164
+ setMemberRole(projectId: string, projectUserId: string, roleId: string | null): Promise<unknown>;
165
+ /** Takes a member out of the project. */
166
+ removeMember(projectId: string, projectUserId: string): Promise<unknown>;
167
+ /**
168
+ * Invites a person to the project by email, with a role. They get the
169
+ * platform's invitation; on accepting it they join with that role, whether
170
+ * or not they had an account.
171
+ */
172
+ inviteMember(projectId: string, email: string, roleId?: string): Promise<ProjectInvitation>;
173
+ /** The project's invitations. */
174
+ listInvitations(projectId: string): Promise<ProjectInvitation[]>;
175
+ /** Withdraws an invitation that has not been accepted. */
176
+ cancelInvitation(projectId: string, invitationId: string): Promise<unknown>;
177
+ /** The project's roles, each with its permissions. */
178
+ listRoles(projectId: string): Promise<ProjectRole[]>;
179
+ /**
180
+ * Makes a role. Its `permissions` are subject × action, each optionally
181
+ * narrowed or widened on given files and folders (`resourcePermissions`):
182
+ * the grant a role has on one folder and what is under it.
183
+ *
184
+ * @example A role that only reads one folder and everything in it
185
+ * ```ts
186
+ * await client.createRole(projectId, {
187
+ * name: 'Observer — structure',
188
+ * permissions: [
189
+ * { subject: 'STORAGE', action: 'READ',
190
+ * resourcePermissions: [{ resourceId: structureFolderId, appliesToDescendants: true }] },
191
+ * ],
192
+ * });
193
+ * ```
194
+ */
195
+ createRole(projectId: string, role: {
196
+ name: string;
197
+ description?: string;
198
+ permissions: Permission[];
199
+ }): Promise<ProjectRole>;
200
+ /** Changes a role: its name, description or permissions (grants and revocations alike). */
201
+ updateRole(roleId: string, changes: {
202
+ name?: string;
203
+ description?: string;
204
+ permissions?: Permission[];
205
+ }): Promise<ProjectRole>;
206
+ /** Deletes a role. */
207
+ deleteRole(roleId: string): Promise<unknown>;
208
+ /**
209
+ * The project's permission matrix in one call: every role, what it may do
210
+ * (folder grants included) and who has it — for an admin screen that shows
211
+ * and changes it, instead of probing permission by permission.
212
+ */
213
+ getPermissionMatrix(projectId: string): Promise<ProjectPermissionMatrixRow[]>;
214
+ /** The caller's API tokens (without their secret). */
215
+ listTokens(): Promise<AccessToken[]>;
216
+ /** A token's secret, to hand to the integration that will use it. */
217
+ getTokenSecret(tokenId: string): Promise<string>;
218
+ /**
219
+ * Creates an API token. `projectIds` limits it to those projects; without
220
+ * them it may act on every project its owner can reach.
221
+ */
222
+ createToken(token: NewAccessToken): Promise<AccessToken>;
223
+ /** Changes a token. `projectIds: []` lifts its project limit; leaving it out keeps it. */
224
+ updateToken(tokenId: string, changes: Partial<NewAccessToken>): Promise<AccessToken>;
225
+ /** Revokes a token: it stops working at once. */
226
+ revokeToken(tokenId: string): Promise<unknown>;
158
227
  /**
159
228
  * Fetches a user's profile picture as raw image bytes, for showing member
160
229
  * avatars inside an app. The route is bearer-authed, so it can't be used as
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -173,6 +173,8 @@ export interface SourceShapes {
173
173
  typeName: string | null;
174
174
  parent: string | null;
175
175
  host: string | null;
176
+ /** A column the file says bears load (Pset_ColumnCommon.LoadBearing). */
177
+ loadBearing?: boolean;
176
178
  opening?: string | null;
177
179
  pieces: {
178
180
  geometry: number;