bruce-models 7.1.126 → 7.1.127

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.
Files changed (31) hide show
  1. package/README.md +2 -97
  2. package/dist/bruce-models.es5.js +216 -29
  3. package/dist/bruce-models.es5.js.map +1 -1
  4. package/dist/bruce-models.umd.js +233 -29
  5. package/dist/bruce-models.umd.js.map +1 -1
  6. package/dist/lib/account/account-audit.js.map +1 -1
  7. package/dist/lib/bruce-models.js +1 -1
  8. package/dist/lib/data-lab/data-lab.js +2 -2
  9. package/dist/lib/data-lab/data-lab.js.map +1 -1
  10. package/dist/lib/mcp/navigator-chat-contract.js +90 -0
  11. package/dist/lib/mcp/navigator-chat-contract.js.map +1 -0
  12. package/dist/lib/mcp/navigator-chat.js +18 -3
  13. package/dist/lib/mcp/navigator-chat.js.map +1 -1
  14. package/dist/lib/mcp/navigator-mcp-websocket.js +18 -23
  15. package/dist/lib/mcp/navigator-mcp-websocket.js.map +1 -1
  16. package/dist/lib/project/project-view-bookmark.js +4 -0
  17. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  18. package/dist/lib/style/style.js +10 -0
  19. package/dist/lib/style/style.js.map +1 -1
  20. package/dist/lib/workflow/workflow-item.js +98 -0
  21. package/dist/lib/workflow/workflow-item.js.map +1 -1
  22. package/dist/types/account/account-audit.d.ts +2 -1
  23. package/dist/types/bruce-models.d.ts +1 -1
  24. package/dist/types/data-lab/data-lab.d.ts +2 -1
  25. package/dist/types/mcp/navigator-chat-contract.d.ts +68 -0
  26. package/dist/types/mcp/navigator-chat.d.ts +17 -4
  27. package/dist/types/project/project-view-bookmark.d.ts +6 -2
  28. package/dist/types/project/project-view.d.ts +1 -1
  29. package/dist/types/style/style.d.ts +15 -0
  30. package/dist/types/workflow/workflow-item.d.ts +47 -0
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -2,100 +2,5 @@
2
2
 
3
3
  This is a library which defines data-models for the Nextspace API and provides functions for communicating with the endpoints.
4
4
 
5
- ### Workflow Item priority and parent
6
-
7
- `WorkflowItem.IItem` and `WorkflowItem.ICreateItem` represent `Priority` as an optional
8
- `number | null` (signed int32) and `"Parent.Item.ID"` as an optional `number | null`
9
- (the API's int64 parent reference). Use parent IDs that JavaScript can represent
10
- as safe integers. Priority accepts zero and negative values; the API defines no
11
- fixed priority scale.
12
-
13
- `Create` and `Update` accept both fields. On update, omit a field to preserve it or
14
- send `null` to clear it. The API checks that the parent exists and prevents circular
15
- parent chains. The focused helpers update existing items through
16
- `POST workflow/item/{id}` and invalidate Workflow Item caches after success.
17
-
18
- ```ts
19
- import { WorkflowItem } from "bruce-models";
20
-
21
- // Update one attribute while preserving other item fields.
22
- await WorkflowItem.UpdatePriority({ api, workflowItemId: 9, priority: 3 });
23
- await WorkflowItem.UpdateParent({ api, workflowItemId: 9, parentItemId: 5 });
24
-
25
- // Clear priority or detach from the parent.
26
- await WorkflowItem.UpdatePriority({ api, workflowItemId: 9, priority: null });
27
- await WorkflowItem.UpdateParent({ api, workflowItemId: 9, parentItemId: null });
28
-
29
- // Change both attributes in one request.
30
- await WorkflowItem.Update({
31
- api,
32
- workflowItem: { ID: 9, Priority: 0, "Parent.Item.ID": 5 }
33
- });
34
-
35
- // List direct children, filtered and sorted by priority.
36
- const { items } = await WorkflowItem.GetList({
37
- api,
38
- parentItemId: 5,
39
- priority: [-2, 0, 3],
40
- orderBy: WorkflowItem.EOrderBy.PRIORITY,
41
- sortOrder: "DESC"
42
- });
43
- ```
44
-
45
- `GetList` uses `GET workflow/itemsquery` with `Priority` and `ParentItemID` query
46
- parameters. Both filters accept a single value or an array. Use
47
- `WorkflowItem.EOrderBy.PARENT_ITEM_ID` to sort by parent instead.
48
-
49
- <br>
50
-
51
- ### Client File folders
52
-
53
- `ClientFileFolder` manages virtual folders through `Get`, `GetList`, `Create`, `Update`, and `Delete`.
54
- Deleting a folder moves its files and immediate subfolders into its parent, or the top level; it preserves file data.
55
-
56
- ```ts
57
- const { folder } = await ClientFileFolder.Create({ api, folder: { Name: "Plans" } });
58
- await ClientFile.Upload({ api, file, folderId: folder.ID, purpose: "Import" });
59
- await ClientFile.Update({ api, fileId, folderId: folder.ID });
60
- const { clientFiles } = await ClientFile.GetList({
61
- api, filter: { "ClientFileFolder.ID": folder.ID, Purpose: "Import" }
62
- });
63
- const { folders } = await ClientFileFolder.GetList({ api, parentFolderId: folder.ID });
64
- ```
65
-
66
- Omit the folder filter to include all folders; use `0` (or `null` in JSON filters) for top-level files.
67
- Folder filters combine with the existing criteria and layer permissions. `ClientFile.GetListByQuery`
68
- wraps `GET files` and also returns `nextPage` and `nextPageUrl`. Existing `GetList` callers keep using
69
- `POST files/filtered` without changes.
70
-
71
- `ClientFile.Update`, `UpdateList`, `ReplaceContent`, and `Upload` support folder membership. On updates,
72
- omit the field to preserve it; set `null` or `0` to clear it. Upload metadata is carried on every multipart request.
73
- All four `GetCounts*` methods accept `folderId`, with separate caches for each folder and the unfiltered result.
74
- Pass bigint IDs outside JavaScript's safe integer range as decimal strings when supplying IDs to these methods.
75
- Folder permissions and record-change events use the `clff` concept code.
76
-
77
- ### Local build
78
-
79
- - `npm i`
80
-
81
- - `npm run build`
82
-
83
- <br>
84
-
85
- ### Running tests
86
-
87
- - `npm i` (ignore if already run)
88
-
89
- - `npm run test` (running all tests)
90
-
91
- - `npx run jest ./test/unit/util` (example for testing just one test folder)
92
-
93
- <br>
94
-
95
- ### Publishing new versions
96
-
97
- - Increase version inside `package.json` and push the change.
98
-
99
- - Bitbucket will run a build and test step.
100
-
101
- - Manually click `NPM Release` in Bitbucket Pipelines.
5
+ To get started, see [Getting started (with web)](https://docs.nextspace.host/webgettingstarted/) in
6
+ the Nextspace developer docs at [docs.nextspace.host](https://docs.nextspace.host).
@@ -14052,7 +14052,7 @@ var DataLab;
14052
14052
  DataLab.Get = Get;
14053
14053
  /**
14054
14054
  * Suggests a DataLab query from natural language prompt.
14055
- * This calls: POST entities/datalab/suggestDataLabQueryByPrompt
14055
+ * This calls: POST entities/datalab/suggestQuery
14056
14056
  */
14057
14057
  function SuggestDataLabQueryByPrompt(params) {
14058
14058
  var _a, _b, _c;
@@ -14064,7 +14064,7 @@ var DataLab;
14064
14064
  if (!api) {
14065
14065
  api = ENVIRONMENT.Api().GetBruceApi();
14066
14066
  }
14067
- const res = yield api.POST("entities/datalab/suggestDataLabQueryByPrompt", body, req ? Api.PrepReqParams(req) : undefined);
14067
+ const res = yield api.POST("entities/datalab/suggestQuery", body, req ? Api.PrepReqParams(req) : undefined);
14068
14068
  const raw = res;
14069
14069
  return {
14070
14070
  query: (_c = (_b = (_a = raw === null || raw === void 0 ? void 0 : raw.Query) !== null && _a !== void 0 ? _a : raw === null || raw === void 0 ? void 0 : raw.SuggestedQuery) !== null && _b !== void 0 ? _b : raw === null || raw === void 0 ? void 0 : raw.DataLabQuery) !== null && _c !== void 0 ? _c : raw,
@@ -14775,6 +14775,16 @@ var Style;
14775
14775
  EEffectType["None"] = "NONE";
14776
14776
  EEffectType["Water"] = "WATER";
14777
14777
  })(EEffectType = Style.EEffectType || (Style.EEffectType = {}));
14778
+ /**
14779
+ * A look a renderer may put over a point, on top of the point or icon itself.
14780
+ * Default is "NONE".
14781
+ */
14782
+ let EPointEffectType;
14783
+ (function (EPointEffectType) {
14784
+ EPointEffectType["None"] = "NONE";
14785
+ // Marks which way the Entity faces, read from its Bruce.Transform.
14786
+ EPointEffectType["Orientation"] = "ORIENTATION";
14787
+ })(EPointEffectType = Style.EPointEffectType || (Style.EPointEffectType = {}));
14778
14788
  /**
14779
14789
  * Returns a list of styles.
14780
14790
  * @param params
@@ -19496,10 +19506,91 @@ var UIMarkup;
19496
19506
  UIMarkup.GetListCacheKey = GetListCacheKey;
19497
19507
  })(UIMarkup || (UIMarkup = {}));
19498
19508
 
19499
- const DEFAULT_JOB_POLL_INTERVAL_MS = 1000;
19500
- const DEFAULT_JOB_POLL_TIMEOUT_MS = 10 * 60 * 1000; // match server timeout (10 minutes)
19509
+ /**
19510
+ * Wire contract of the Navigator chat-event protocol: the JSON-RPC methods, the `eventType` values the
19511
+ * frontend sends, the step types and tracking kinds the backend broadcasts, and the parser for what the
19512
+ * backend sends back. Values are fixed by deployed servers and frontends; the shared fixtures in the
19513
+ * bruce-chat repository (ops/chat-contract-fixtures) pin them for every repository. This module has no
19514
+ * runtime imports so any chat module can depend on it. Exported to consumers through ./navigator-chat.
19515
+ */
19516
+ const NAVIGATOR_CHAT_RPC_METHOD_CHAT_EVENT = "chat/event";
19517
+ const NAVIGATOR_CHAT_RPC_METHOD_SERVER_READY = "server_ready";
19518
+ const NAVIGATOR_CHAT_RPC_METHOD_SERVER_READY_ACK = "server_ready_ack";
19519
+ const NAVIGATOR_CHAT_RPC_METHOD_TOOLS_CALL = "tools/call";
19520
+ const NAVIGATOR_CHAT_RPC_METHOD_TOOL_RESPONSE = "tool_response";
19521
+ /** `eventType` values the frontend sends to the backend inside `chat/event`. */
19501
19522
  const NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED = "entity_highlight_applied";
19502
19523
  const NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED = "scene_context_prefetched";
19524
+ const NAVIGATOR_CHAT_EVENT_PRESENTATION_PLAN_APPLIED = "presentation_plan_applied";
19525
+ /** Legacy bare event (field `event`, no step `type`) the backend broadcasts when a session is cleared. */
19526
+ const NAVIGATOR_CHAT_LEGACY_EVENT_SESSION_CLEARED = "SESSION_CLEARED";
19527
+ /** Step `type` values the backend broadcasts that the frontend routes specially. */
19528
+ const NAVIGATOR_CHAT_STEP_TRACKING_UPDATE = "TRACKING_UPDATE";
19529
+ const NAVIGATOR_CHAT_STEP_JOB_COMPLETE = "JOB_COMPLETE";
19530
+ const NAVIGATOR_CHAT_STEP_QUEUED_INPUT = "QUEUED_INPUT";
19531
+ const NAVIGATOR_CHAT_STEP_LLM_CONTEXT = "LLM_CONTEXT";
19532
+ /** `trackingKind` of the plan step the backend emits; the receipts reuse the event names above. */
19533
+ const NAVIGATOR_CHAT_TRACKING_KIND_PRESENTATION_PLAN = "presentation_plan";
19534
+ /**
19535
+ * Job statuses that mean the job did not run to its end. The WebSocket step path and the streaming
19536
+ * (SSE) path have always recognised slightly different sets - the stream path never treated
19537
+ * INTERRUPTED as cancellation - so each keeps its own list.
19538
+ */
19539
+ const NAVIGATOR_CHAT_CANCELLED_JOB_STATUSES = {
19540
+ chatEvent: ["CANCELLED", "CANCELED", "INTERRUPTED", "PAUSED"],
19541
+ chatStream: ["CANCELLED", "CANCELED", "PAUSED"]
19542
+ };
19543
+ const CLIENT_EVENT_TYPES = [
19544
+ NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED,
19545
+ NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED,
19546
+ NAVIGATOR_CHAT_EVENT_PRESENTATION_PLAN_APPLIED
19547
+ ];
19548
+ /** True for an `eventType` the backend acts on. Matching is exact and case-sensitive. */
19549
+ function isNavigatorChatClientEventType(value) {
19550
+ return typeof value === "string" && CLIENT_EVENT_TYPES.indexOf(value) !== -1;
19551
+ }
19552
+ /** True when a job status means the job was cancelled, interrupted or paused on that path. */
19553
+ function isNavigatorChatCancelledJobStatus(status, path = "chatEvent") {
19554
+ return typeof status === "string"
19555
+ && NAVIGATOR_CHAT_CANCELLED_JOB_STATUSES[path].indexOf(status) !== -1;
19556
+ }
19557
+ /** The JSON-RPC message that carries a frontend chat event to the backend. */
19558
+ function buildNavigatorChatEventMessage(event) {
19559
+ return {
19560
+ jsonrpc: "2.0",
19561
+ method: NAVIGATOR_CHAT_RPC_METHOD_CHAT_EVENT,
19562
+ params: event
19563
+ };
19564
+ }
19565
+ /**
19566
+ * Classifies a raw WebSocket message from the backend. A string is parsed as JSON and a parse failure
19567
+ * throws, so the caller keeps deciding how to report an invalid message. A `chat/event` without params
19568
+ * is delivered as an empty event rather than dropped, as older servers relied on.
19569
+ */
19570
+ function parseNavigatorChatServerMessage(raw) {
19571
+ var _a, _b, _c;
19572
+ const message = typeof raw === "string" ? JSON.parse(raw) : raw;
19573
+ const method = message === null || message === void 0 ? void 0 : message.method;
19574
+ if (method === NAVIGATOR_CHAT_RPC_METHOD_CHAT_EVENT) {
19575
+ return { kind: "chat_event", event: ((_a = message === null || message === void 0 ? void 0 : message.params) !== null && _a !== void 0 ? _a : {}) };
19576
+ }
19577
+ if (method !== NAVIGATOR_CHAT_RPC_METHOD_TOOLS_CALL) {
19578
+ return { kind: "ignored", method, message };
19579
+ }
19580
+ const name = (_b = message === null || message === void 0 ? void 0 : message.params) === null || _b === void 0 ? void 0 : _b.name;
19581
+ if (!name) {
19582
+ return { kind: "invalid_tool_call", message };
19583
+ }
19584
+ return {
19585
+ kind: "tool_call",
19586
+ name,
19587
+ args: (_c = message === null || message === void 0 ? void 0 : message.params) === null || _c === void 0 ? void 0 : _c.arguments,
19588
+ messageId: message === null || message === void 0 ? void 0 : message.id
19589
+ };
19590
+ }
19591
+
19592
+ const DEFAULT_JOB_POLL_INTERVAL_MS = 1000;
19593
+ const DEFAULT_JOB_POLL_TIMEOUT_MS = 10 * 60 * 1000; // match server timeout (10 minutes)
19503
19594
  const DEFAULT_BASE_URL = "http://localhost:8888";
19504
19595
  /**
19505
19596
  * Lightweight client for the Navigator MCP chat HTTP endpoints.
@@ -19756,7 +19847,7 @@ class NavigatorMcpWebSocketClient {
19756
19847
  return;
19757
19848
  (_b = (_a = this.logger()).log) === null || _b === void 0 ? void 0 : _b.call(_a, "[NavigatorMcpWS] Connected");
19758
19849
  this.isConnecting = false;
19759
- this.send({ method: "server_ready" });
19850
+ this.send({ method: NAVIGATOR_CHAT_RPC_METHOD_SERVER_READY });
19760
19851
  this.flushResponses();
19761
19852
  (_d = (_c = this.options).onOpen) === null || _d === void 0 ? void 0 : _d.call(_c, event);
19762
19853
  };
@@ -19822,11 +19913,7 @@ class NavigatorMcpWebSocketClient {
19822
19913
  this.currentAuth = auth;
19823
19914
  }
19824
19915
  sendChatEvent(event) {
19825
- this.send({
19826
- jsonrpc: "2.0",
19827
- method: "chat/event",
19828
- params: event
19829
- });
19916
+ this.send(buildNavigatorChatEventMessage(event));
19830
19917
  }
19831
19918
  logger() {
19832
19919
  var _a;
@@ -19863,27 +19950,25 @@ class NavigatorMcpWebSocketClient {
19863
19950
  return urlInstance.toString();
19864
19951
  }
19865
19952
  handleMessage(raw) {
19866
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
19953
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
19867
19954
  return __awaiter(this, void 0, void 0, function* () {
19868
19955
  try {
19869
- const message = typeof raw === "string" ? JSON.parse(raw) : raw;
19870
- const method = message === null || message === void 0 ? void 0 : message.method;
19871
- if (method === "chat/event") {
19872
- const payload = ((_a = message === null || message === void 0 ? void 0 : message.params) !== null && _a !== void 0 ? _a : {});
19873
- (_c = (_b = this.options).onChatEvent) === null || _c === void 0 ? void 0 : _c.call(_b, payload);
19956
+ const parsed = parseNavigatorChatServerMessage(raw);
19957
+ if (parsed.kind === "chat_event") {
19958
+ (_b = (_a = this.options).onChatEvent) === null || _b === void 0 ? void 0 : _b.call(_a, parsed.event);
19874
19959
  return;
19875
19960
  }
19876
- if (method !== "tools/call") {
19877
- (_e = (_d = this.logger()).debug) === null || _e === void 0 ? void 0 : _e.call(_d, "[NavigatorMcpWS] Ignoring unsupported message", message);
19961
+ if (parsed.kind === "ignored") {
19962
+ (_d = (_c = this.logger()).debug) === null || _d === void 0 ? void 0 : _d.call(_c, "[NavigatorMcpWS] Ignoring unsupported message", parsed.message);
19878
19963
  return;
19879
19964
  }
19880
- const toolName = (_f = message === null || message === void 0 ? void 0 : message.params) === null || _f === void 0 ? void 0 : _f.name;
19881
- const toolArgs = (_g = message === null || message === void 0 ? void 0 : message.params) === null || _g === void 0 ? void 0 : _g.arguments;
19882
- const messageId = message === null || message === void 0 ? void 0 : message.id;
19883
- if (!toolName) {
19884
- (_j = (_h = this.logger()).warn) === null || _j === void 0 ? void 0 : _j.call(_h, "[NavigatorMcpWS] Received tool call without name", message);
19965
+ if (parsed.kind === "invalid_tool_call") {
19966
+ (_f = (_e = this.logger()).warn) === null || _f === void 0 ? void 0 : _f.call(_e, "[NavigatorMcpWS] Received tool call without name", parsed.message);
19885
19967
  return;
19886
19968
  }
19969
+ const toolName = parsed.name;
19970
+ const toolArgs = parsed.args;
19971
+ const messageId = parsed.messageId;
19887
19972
  let result;
19888
19973
  const generation = this.responseGeneration;
19889
19974
  try {
@@ -19894,21 +19979,21 @@ class NavigatorMcpWebSocketClient {
19894
19979
  });
19895
19980
  }
19896
19981
  catch (error) {
19897
- (_l = (_k = this.logger()).error) === null || _l === void 0 ? void 0 : _l.call(_k, "[NavigatorMcpWS] Tool handler threw", error);
19982
+ (_h = (_g = this.logger()).error) === null || _h === void 0 ? void 0 : _h.call(_g, "[NavigatorMcpWS] Tool handler threw", error);
19898
19983
  result = `Error: ${error instanceof Error ? error.message : String(error)}`;
19899
19984
  }
19900
19985
  if (generation !== this.responseGeneration) {
19901
- (_o = (_m = this.logger()).warn) === null || _o === void 0 ? void 0 : _o.call(_m, "[NavigatorMcpWS] Discarding result from a previous session", messageId);
19986
+ (_k = (_j = this.logger()).warn) === null || _k === void 0 ? void 0 : _k.call(_j, "[NavigatorMcpWS] Discarding result from a previous session", messageId);
19902
19987
  return;
19903
19988
  }
19904
19989
  this.sendResponse({
19905
- method: "tool_response",
19990
+ method: NAVIGATOR_CHAT_RPC_METHOD_TOOL_RESPONSE,
19906
19991
  id: messageId,
19907
19992
  result
19908
19993
  });
19909
19994
  }
19910
19995
  catch (error) {
19911
- (_q = (_p = this.logger()).error) === null || _q === void 0 ? void 0 : _q.call(_p, "[NavigatorMcpWS] Invalid message", error);
19996
+ (_m = (_l = this.logger()).error) === null || _m === void 0 ? void 0 : _m.call(_l, "[NavigatorMcpWS] Invalid message", error);
19912
19997
  }
19913
19998
  });
19914
19999
  }
@@ -22133,6 +22218,10 @@ var ProjectViewBookmark;
22133
22218
  EContentType["WEB_3D_MODEL_SPACE"] = "WEB_3D_MODEL_SPACE";
22134
22219
  EContentType["WEB_3D_SPLIT_PLUGIN"] = "WEB_3D_SPLIT_PLUGIN";
22135
22220
  EContentType["IFRAME"] = "IFRAME";
22221
+ // Renders a dashboard in place of the scene.
22222
+ EContentType["DASHBOARD"] = "DASHBOARD";
22223
+ // Renders a diagram (2D graph view) in place of the scene.
22224
+ EContentType["DIAGRAM"] = "DIAGRAM";
22136
22225
  })(EContentType = ProjectViewBookmark.EContentType || (ProjectViewBookmark.EContentType = {}));
22137
22226
  /**
22138
22227
  * Gets a bookmark record.
@@ -24868,6 +24957,73 @@ var WorkflowItem;
24868
24957
  EOrderBy["THUMBNAIL_CLIENT_FILE_ID"] = "ThumbnailClientFileID";
24869
24958
  EOrderBy["RANDOM"] = "RANDOM";
24870
24959
  })(EOrderBy = WorkflowItem.EOrderBy || (WorkflowItem.EOrderBy = {}));
24960
+ /**
24961
+ * Gets the history timeline of a Workflow Item, newest first.
24962
+ * Route: GET workflow/item/{workflow_item_id}/history
24963
+ */
24964
+ function GetHistoryList(params) {
24965
+ return __awaiter(this, void 0, void 0, function* () {
24966
+ let { api, workflowItemId, req } = params;
24967
+ if (isInvalidId(workflowItemId)) {
24968
+ throw ("Workflow Item ID is required.");
24969
+ }
24970
+ if (!api) {
24971
+ api = ENVIRONMENT.Api().GetBruceApi();
24972
+ }
24973
+ const key = GetHistoryListCacheKey(workflowItemId);
24974
+ const cache = api.GetCacheItem(key, req);
24975
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
24976
+ return cache.data;
24977
+ }
24978
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24979
+ try {
24980
+ const data = yield api.GET(`workflow/item/${workflowItemId}/history`, Api.PrepReqParams(req));
24981
+ res(ParseHistoryListResponse(data));
24982
+ }
24983
+ catch (e) {
24984
+ rej(e);
24985
+ }
24986
+ }));
24987
+ api.SetCacheItem({ key, value: request, req });
24988
+ return request;
24989
+ });
24990
+ }
24991
+ WorkflowItem.GetHistoryList = GetHistoryList;
24992
+ /**
24993
+ * Gets one history record of a Workflow Item.
24994
+ * Route: GET workflow/item/{workflow_item_id}/history/{workflow_item_history_id}
24995
+ */
24996
+ function GetHistory(params) {
24997
+ return __awaiter(this, void 0, void 0, function* () {
24998
+ let { api, workflowItemId, workflowItemHistoryId, req } = params;
24999
+ if (isInvalidId(workflowItemId)) {
25000
+ throw ("Workflow Item ID is required.");
25001
+ }
25002
+ if (isInvalidId(workflowItemHistoryId)) {
25003
+ throw ("Workflow Item History ID is required.");
25004
+ }
25005
+ if (!api) {
25006
+ api = ENVIRONMENT.Api().GetBruceApi();
25007
+ }
25008
+ const key = GetHistoryCacheKey(workflowItemId, workflowItemHistoryId);
25009
+ const cache = api.GetCacheItem(key, req);
25010
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
25011
+ return cache.data;
25012
+ }
25013
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
25014
+ try {
25015
+ const data = yield api.GET(`workflow/item/${workflowItemId}/history/${workflowItemHistoryId}`, Api.PrepReqParams(req));
25016
+ res({ history: ParseHistoryResponse(data) });
25017
+ }
25018
+ catch (e) {
25019
+ rej(e);
25020
+ }
25021
+ }));
25022
+ api.SetCacheItem({ key, value: request, req });
25023
+ return request;
25024
+ });
25025
+ }
25026
+ WorkflowItem.GetHistory = GetHistory;
24871
25027
  function Get(params) {
24872
25028
  return __awaiter(this, void 0, void 0, function* () {
24873
25029
  let { api, workflowItemId, req } = params;
@@ -25152,10 +25308,41 @@ var WorkflowItem;
25152
25308
  return result;
25153
25309
  }
25154
25310
  WorkflowItem.ParseStatisticsResponse = ParseStatisticsResponse;
25311
+ function ParseHistoryResponse(response) {
25312
+ var _a;
25313
+ const parsed = parseObject$5(response);
25314
+ const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
25315
+ return parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed;
25316
+ }
25317
+ WorkflowItem.ParseHistoryResponse = ParseHistoryResponse;
25318
+ function ParseHistoryListResponse(response) {
25319
+ var _a;
25320
+ const parsed = parseObject$5(response);
25321
+ const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
25322
+ const source = parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed;
25323
+ const items = Array.isArray(source)
25324
+ ? source
25325
+ : Array.isArray(source === null || source === void 0 ? void 0 : source.Items)
25326
+ ? source.Items
25327
+ : [];
25328
+ return {
25329
+ items,
25330
+ totalCount: source === null || source === void 0 ? void 0 : source.TotalCount
25331
+ };
25332
+ }
25333
+ WorkflowItem.ParseHistoryListResponse = ParseHistoryListResponse;
25155
25334
  function GetCacheKey(id) {
25156
25335
  return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.Id}${id}`;
25157
25336
  }
25158
25337
  WorkflowItem.GetCacheKey = GetCacheKey;
25338
+ function GetHistoryListCacheKey(workflowItemId) {
25339
+ return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.Id}${workflowItemId}${Api.ECacheKey.ListId}history`;
25340
+ }
25341
+ WorkflowItem.GetHistoryListCacheKey = GetHistoryListCacheKey;
25342
+ function GetHistoryCacheKey(workflowItemId, workflowItemHistoryId) {
25343
+ return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.Id}${workflowItemId}${Api.ECacheKey.ListId}history${Api.ECacheKey.Id}${workflowItemHistoryId}`;
25344
+ }
25345
+ WorkflowItem.GetHistoryCacheKey = GetHistoryCacheKey;
25159
25346
  function GetListCacheKey(params) {
25160
25347
  return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.ListId}${BuildListUrl(params)}`;
25161
25348
  }
@@ -25682,7 +25869,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
25682
25869
  }
25683
25870
 
25684
25871
  // This is updated with the package.json version on build.
25685
- const VERSION = "7.1.126";
25872
+ const VERSION = "7.1.127";
25686
25873
 
25687
- export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, ClientFileFolder, ClientFileValueMap, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, RequestLane, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeRelation, EntityTypeSource, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportNsx, ExportUsd, Hexbin, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportTif, ImportedFile, Uploader, Markup, UIMarkup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, PluginAiTool, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
25874
+ export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, ClientFileFolder, ClientFileValueMap, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, RequestLane, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeRelation, EntityTypeSource, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportNsx, ExportUsd, Hexbin, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportTif, ImportedFile, Uploader, Markup, UIMarkup, NavigatorChatClient, NAVIGATOR_CHAT_RPC_METHOD_CHAT_EVENT, NAVIGATOR_CHAT_RPC_METHOD_SERVER_READY, NAVIGATOR_CHAT_RPC_METHOD_SERVER_READY_ACK, NAVIGATOR_CHAT_RPC_METHOD_TOOLS_CALL, NAVIGATOR_CHAT_RPC_METHOD_TOOL_RESPONSE, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NAVIGATOR_CHAT_EVENT_PRESENTATION_PLAN_APPLIED, NAVIGATOR_CHAT_LEGACY_EVENT_SESSION_CLEARED, NAVIGATOR_CHAT_STEP_TRACKING_UPDATE, NAVIGATOR_CHAT_STEP_JOB_COMPLETE, NAVIGATOR_CHAT_STEP_QUEUED_INPUT, NAVIGATOR_CHAT_STEP_LLM_CONTEXT, NAVIGATOR_CHAT_TRACKING_KIND_PRESENTATION_PLAN, NAVIGATOR_CHAT_CANCELLED_JOB_STATUSES, isNavigatorChatClientEventType, isNavigatorChatCancelledJobStatus, buildNavigatorChatEventMessage, parseNavigatorChatServerMessage, NavigatorMcpWebSocketClient, Plugin, PluginAiTool, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
25688
25875
  //# sourceMappingURL=bruce-models.es5.js.map