@thatopen/services 0.34.2 → 0.34.4

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,6 +15,16 @@ declare global {
15
15
  ThatOpenCompany?: Record<string, unknown>;
16
16
  }
17
17
  }
18
+ /** What `GET /item/documents` answers: every document descriptor of a project. */
19
+ type DocumentDescriptors = {
20
+ documents: {
21
+ folderId: string;
22
+ fileId: string;
23
+ versionTag: string | null;
24
+ descriptor: Record<string, unknown>;
25
+ }[];
26
+ unread: number;
27
+ };
18
28
  /**
19
29
  * Minimal shape of an OBC.Components-like object.
20
30
  * Avoids hard-coupling to `@thatopen/components` at the public API level.
@@ -257,6 +267,11 @@ export declare class EngineServicesClient {
257
267
  * 403. Per-entity permission overrides are applied server-side.
258
268
  */
259
269
  projectId?: string;
270
+ /**
271
+ * With a `folderId`: each file with its `versions`, as the project's
272
+ * listing has them. A folder's listing leaves them out unless asked.
273
+ */
274
+ versions?: boolean;
260
275
  }): Promise<Item[]>;
261
276
  /**
262
277
  * Every document descriptor of a project in one request, read by the
@@ -265,15 +280,7 @@ export declare class EngineServicesClient {
265
280
  * `documents` for an item id), which `documents.list()` reads as "ask one
266
281
  * by one".
267
282
  */
268
- listDocumentDescriptors(projectId: string): Promise<{
269
- documents: {
270
- folderId: string;
271
- fileId: string;
272
- versionTag: string | null;
273
- descriptor: Record<string, unknown>;
274
- }[];
275
- unread: number;
276
- }>;
283
+ listDocumentDescriptors(projectId: string): Promise<DocumentDescriptors>;
277
284
  /**
278
285
  * A project's documents as one flat table, for BI and spreadsheets
279
286
  * (`GET /item/export`): a row per file with its folder path, its live
@@ -879,3 +886,4 @@ export declare class EngineServicesClient {
879
886
  success: boolean;
880
887
  }>;
881
888
  }
889
+ export {};
@@ -156,6 +156,14 @@ export declare class PlatformClient extends EngineServicesClient {
156
156
  * User data is stripped of sensitive fields server-side.
157
157
  */
158
158
  getProjectData(projectId: string): Promise<ProjectData>;
159
+ /** Every other request this client makes to the project routes may change what `getProjectData` answers. */
160
+ protected request<T = object>(method: string, path: string, requestData?: {
161
+ body?: BodyInit;
162
+ query?: object;
163
+ contentType?: 'application/json' | 'multipart/form-data' | 'application/x-www-form-urlencoded';
164
+ retries?: number;
165
+ responseType?: 'json' | 'blob';
166
+ }): Promise<T>;
159
167
  /** The project's members, each with their role. */
160
168
  listMembers(projectId: string): Promise<ProjectDataMember[]>;
161
169
  /** Adds an existing account to the project, with a role (the project's default when not given). */