bruce-models 7.1.129 → 7.1.130

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.
@@ -46,6 +46,8 @@ var Api;
46
46
  ECacheKey["DataFeed"] = "datafeed";
47
47
  ECacheKey["ProjectView"] = "projectview";
48
48
  ECacheKey["ProjectViewBookmark"] = "pvbookmark";
49
+ ECacheKey["ReportTemplate"] = "reporttemplate";
50
+ ECacheKey["ReportTemplateSection"] = "reporttemplatesection";
49
51
  ECacheKey["Tileset"] = "tileset";
50
52
  ECacheKey["ClientFile"] = "clientfile";
51
53
  ECacheKey["ClientFileFolder"] = "clientfilefolder";
@@ -362,6 +364,9 @@ var AccountConcept;
362
364
  EConcept["PROJECT_VIEW"] = "pv";
363
365
  EConcept["PENDING_ACTION"] = "pa";
364
366
  EConcept["RELATION_TYPE"] = "rt";
367
+ // Reusable report definitions and their individually permissioned sections.
368
+ EConcept["REPORT_TEMPLATE"] = "rpt";
369
+ EConcept["REPORT_TEMPLATE_SECTION"] = "rpts";
365
370
  EConcept["SCENARIO"] = "sc";
366
371
  EConcept["TILESET"] = "ts";
367
372
  EConcept["UI_DASHBOARD_VIEW"] = "dbv";
@@ -436,6 +441,8 @@ var AccountConcept;
436
441
  { concept: EConcept.LOD_CATEGORY, label: "LOD Category", description: undefined },
437
442
  { concept: EConcept.PROGRAM_KEY, label: "Third Party Key", description: undefined },
438
443
  { concept: EConcept.RELATION_TYPE, label: "Relation Type", description: undefined },
444
+ { concept: EConcept.REPORT_TEMPLATE, label: "Report Template", description: "Reusable report definitions with ordered sections" },
445
+ { concept: EConcept.REPORT_TEMPLATE_SECTION, label: "Report Template Section", description: "Ordered sections belonging to a Report Template" },
439
446
  { concept: EConcept.SCENARIO, label: "Scenario", description: undefined },
440
447
  { concept: EConcept.PROJECT_VIEW, label: "Project View", description: undefined },
441
448
  { concept: EConcept.TILESET, label: "Tileset", description: undefined },
@@ -715,6 +722,10 @@ var RecordChangeFeed;
715
722
  return [Api.ECacheKey.ProjectView, Api.ECacheKey.ProjectViewBookmark];
716
723
  case AccountConcept.EConcept.RELATION_TYPE:
717
724
  return [Api.ECacheKey.RelationType];
725
+ case AccountConcept.EConcept.REPORT_TEMPLATE:
726
+ return [Api.ECacheKey.ReportTemplate, Api.ECacheKey.ReportTemplateSection];
727
+ case AccountConcept.EConcept.REPORT_TEMPLATE_SECTION:
728
+ return [Api.ECacheKey.ReportTemplateSection];
718
729
  case AccountConcept.EConcept.WORKFLOW_ITEM:
719
730
  return [Api.ECacheKey.WorkflowItem];
720
731
  case AccountConcept.EConcept.WORKFLOW_ITEM_STATUS:
@@ -748,6 +759,14 @@ var RecordChangeFeed;
748
759
  if (!cacheKeys.length) {
749
760
  return;
750
761
  }
762
+ if (event.concept === AccountConcept.EConcept.REPORT_TEMPLATE ||
763
+ event.concept === AccountConcept.EConcept.REPORT_TEMPLATE_SECTION) {
764
+ // Events can contain ID ranges and omit section parents; evict the affected namespaces in full.
765
+ for (const cacheKey of cacheKeys) {
766
+ cache.RemoveByCallback(key => key === cacheKey || String(key).startsWith(cacheKey + Api.ECacheKey.Id));
767
+ }
768
+ return;
769
+ }
751
770
  // Entity-concept events use internal ID ranges, not public record IDs,
752
771
  // so individual entity cache entries cannot be matched.
753
772
  const isEntityConcept = event.concept === ENTITY_CONCEPT;
@@ -22786,6 +22805,224 @@ var ProjectViewTile;
22786
22805
  ];
22787
22806
  })(ProjectViewTile || (ProjectViewTile = {}));
22788
22807
 
22808
+ /**
22809
+ * Reusable report definitions whose ordered sections are separate ReportTemplateSection records.
22810
+ * These calls require an API deployment that supports the Report Template concepts.
22811
+ */
22812
+ var ReportTemplate;
22813
+ (function (ReportTemplate) {
22814
+ /**
22815
+ * Validates and normalizes a signed 64-bit identity for routes and cache keys without rounding it.
22816
+ * Zero is accepted only for creation; decimal strings can represent the full positive bigint range.
22817
+ */
22818
+ function NormalizeId(id, allowZero = false) {
22819
+ if (typeof id === "number" && (!Number.isSafeInteger(id) || id < 0)) {
22820
+ throw new Error("Report Template ID must be a safe integer or a decimal string for a larger bigint ID.");
22821
+ }
22822
+ if ((typeof id !== "number" && typeof id !== "string") || !/^\d+$/.test(String(id))) {
22823
+ throw new Error("Report Template ID must be a non-negative decimal integer.");
22824
+ }
22825
+ const value = String(id).replace(/^0+(?=\d)/, "");
22826
+ if ((!allowZero && value === "0") || value.length > 19 ||
22827
+ (value.length === 19 && value > "9223372036854775807")) {
22828
+ throw new Error("Report Template ID must be a positive signed 64-bit integer; use 0 only to create.");
22829
+ }
22830
+ return value;
22831
+ }
22832
+ ReportTemplate.NormalizeId = NormalizeId;
22833
+ /**
22834
+ * Reads a template by ID, subject to the caller's template view permission.
22835
+ */
22836
+ function Get(params) {
22837
+ return __awaiter(this, void 0, void 0, function* () {
22838
+ const id = NormalizeId(params.reportTemplateId);
22839
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
22840
+ const key = GetCacheKey(id);
22841
+ const cache = api.GetCacheItem(key, params.req);
22842
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
22843
+ return cache.data;
22844
+ }
22845
+ const promise = api.GET(`reportTemplate/${id}`, Api.PrepReqParams(params.req))
22846
+ .then(reportTemplate => ({ reportTemplate }));
22847
+ api.SetCacheItem({ key, value: promise, req: params.req });
22848
+ return promise;
22849
+ });
22850
+ }
22851
+ ReportTemplate.Get = Get;
22852
+ /**
22853
+ * Lists visible templates in name order; the server filters out records the caller cannot view.
22854
+ */
22855
+ function GetList(params = {}) {
22856
+ return __awaiter(this, void 0, void 0, function* () {
22857
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
22858
+ const key = GetListCacheKey();
22859
+ const cache = api.GetCacheItem(key, params.req);
22860
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
22861
+ return cache.data;
22862
+ }
22863
+ const promise = api.GET("reportTemplates", Api.PrepReqParams(params.req))
22864
+ .then(data => { var _a; return ({ reportTemplates: (_a = data === null || data === void 0 ? void 0 : data.Items) !== null && _a !== void 0 ? _a : [] }); });
22865
+ api.SetCacheItem({ key, value: promise, req: params.req });
22866
+ return promise;
22867
+ });
22868
+ }
22869
+ ReportTemplate.GetList = GetList;
22870
+ /**
22871
+ * Creates with ID 0 or updates the identified template, preserving omitted fields on the server.
22872
+ * Explicit null clears Description or Settings; identity and creation metadata come from the server.
22873
+ */
22874
+ function Update(params) {
22875
+ var _a;
22876
+ return __awaiter(this, void 0, void 0, function* () {
22877
+ if (!params.reportTemplate) {
22878
+ throw new Error("Report Template data is required.");
22879
+ }
22880
+ const id = NormalizeId(params.reportTemplateId !== undefined
22881
+ ? params.reportTemplateId : (_a = params.reportTemplate.ID) !== null && _a !== void 0 ? _a : 0, true);
22882
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
22883
+ const reportTemplate = yield api.POST(`reportTemplate/${id}`, params.reportTemplate, Api.PrepReqParams(params.req));
22884
+ api.Cache.Remove(GetCacheKey(id));
22885
+ if (reportTemplate === null || reportTemplate === void 0 ? void 0 : reportTemplate.ID) {
22886
+ api.Cache.Remove(GetCacheKey(reportTemplate.ID));
22887
+ }
22888
+ api.Cache.Remove(GetListCacheKey());
22889
+ return { reportTemplate };
22890
+ });
22891
+ }
22892
+ ReportTemplate.Update = Update;
22893
+ /**
22894
+ * Deletes a template and every section it owns; requires template delete permission.
22895
+ */
22896
+ function Delete(params) {
22897
+ return __awaiter(this, void 0, void 0, function* () {
22898
+ const id = NormalizeId(params.reportTemplateId);
22899
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
22900
+ yield api.DELETE(`reportTemplate/${id}`, Api.PrepReqParams(params.req));
22901
+ api.Cache.Remove(GetCacheKey(id));
22902
+ api.Cache.Remove(GetListCacheKey());
22903
+ const sectionsKey = `${Api.ECacheKey.ReportTemplateSection}${Api.ECacheKey.Id}${id}`;
22904
+ api.Cache.Remove(sectionsKey);
22905
+ api.Cache.RemoveByStartsWith(`${sectionsKey}${Api.ECacheKey.Id}`);
22906
+ });
22907
+ }
22908
+ ReportTemplate.Delete = Delete;
22909
+ /**
22910
+ * Cache identifier for one template, shared by numeric IDs and their decimal string equivalents.
22911
+ */
22912
+ function GetCacheKey(reportTemplateId) {
22913
+ return `${Api.ECacheKey.ReportTemplate}${Api.ECacheKey.Id}${NormalizeId(reportTemplateId, true)}`;
22914
+ }
22915
+ ReportTemplate.GetCacheKey = GetCacheKey;
22916
+ /**
22917
+ * Cache identifier for the account's visible template list.
22918
+ */
22919
+ function GetListCacheKey() {
22920
+ return Api.ECacheKey.ReportTemplate;
22921
+ }
22922
+ ReportTemplate.GetListCacheKey = GetListCacheKey;
22923
+ })(ReportTemplate || (ReportTemplate = {}));
22924
+
22925
+ /**
22926
+ * Ordered sections belonging to a single Report Template; every route requires the owning template ID.
22927
+ * Access can be granted directly or inherited through the parent template's permissions.
22928
+ */
22929
+ var ReportTemplateSection;
22930
+ (function (ReportTemplateSection) {
22931
+ /**
22932
+ * Reads one section; a section belonging to another template is rejected by the server.
22933
+ */
22934
+ function Get(params) {
22935
+ return __awaiter(this, void 0, void 0, function* () {
22936
+ const templateId = ReportTemplate.NormalizeId(params.reportTemplateId);
22937
+ const sectionId = ReportTemplate.NormalizeId(params.sectionId);
22938
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
22939
+ const key = GetCacheKey(templateId, sectionId);
22940
+ const cache = api.GetCacheItem(key, params.req);
22941
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
22942
+ return cache.data;
22943
+ }
22944
+ const promise = api.GET(`reportTemplate/${templateId}/section/${sectionId}`, Api.PrepReqParams(params.req))
22945
+ .then(reportTemplateSection => ({ reportTemplateSection }));
22946
+ api.SetCacheItem({ key, value: promise, req: params.req });
22947
+ return promise;
22948
+ });
22949
+ }
22950
+ ReportTemplateSection.Get = Get;
22951
+ /**
22952
+ * Lists visible sections of a template in display order, filtered by the caller's permissions.
22953
+ */
22954
+ function GetList(params) {
22955
+ return __awaiter(this, void 0, void 0, function* () {
22956
+ const templateId = ReportTemplate.NormalizeId(params.reportTemplateId);
22957
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
22958
+ const key = GetListCacheKey(templateId);
22959
+ const cache = api.GetCacheItem(key, params.req);
22960
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
22961
+ return cache.data;
22962
+ }
22963
+ const promise = api.GET(`reportTemplate/${templateId}/sections`, Api.PrepReqParams(params.req))
22964
+ .then(data => { var _a; return ({ reportTemplateSections: (_a = data === null || data === void 0 ? void 0 : data.Items) !== null && _a !== void 0 ? _a : [] }); });
22965
+ api.SetCacheItem({ key, value: promise, req: params.req });
22966
+ return promise;
22967
+ });
22968
+ }
22969
+ ReportTemplateSection.GetList = GetList;
22970
+ /**
22971
+ * Creates with section ID 0 or updates under an existing parent; Settings accepts null to clear it.
22972
+ * The server ignores body IDs, preserves omitted fields and never moves a section to another parent.
22973
+ */
22974
+ function Update(params) {
22975
+ var _a;
22976
+ return __awaiter(this, void 0, void 0, function* () {
22977
+ if (!params.reportTemplateSection) {
22978
+ throw new Error("Report Template Section data is required.");
22979
+ }
22980
+ const section = params.reportTemplateSection;
22981
+ const templateId = ReportTemplate.NormalizeId(params.reportTemplateId !== undefined
22982
+ ? params.reportTemplateId : section["ReportTemplate.ID"]);
22983
+ const sectionId = ReportTemplate.NormalizeId(params.sectionId !== undefined
22984
+ ? params.sectionId : (_a = section.ID) !== null && _a !== void 0 ? _a : 0, true);
22985
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
22986
+ const reportTemplateSection = yield api.POST(`reportTemplate/${templateId}/section/${sectionId}`, section, Api.PrepReqParams(params.req));
22987
+ api.Cache.Remove(GetCacheKey(templateId, sectionId));
22988
+ if (reportTemplateSection === null || reportTemplateSection === void 0 ? void 0 : reportTemplateSection.ID) {
22989
+ api.Cache.Remove(GetCacheKey(templateId, reportTemplateSection.ID));
22990
+ }
22991
+ api.Cache.Remove(GetListCacheKey(templateId));
22992
+ return { reportTemplateSection };
22993
+ });
22994
+ }
22995
+ ReportTemplateSection.Update = Update;
22996
+ /**
22997
+ * Deletes only the identified section, preserving its template and sibling sections.
22998
+ */
22999
+ function Delete(params) {
23000
+ return __awaiter(this, void 0, void 0, function* () {
23001
+ const templateId = ReportTemplate.NormalizeId(params.reportTemplateId);
23002
+ const sectionId = ReportTemplate.NormalizeId(params.sectionId);
23003
+ const api = params.api || ENVIRONMENT.Api().GetBruceApi();
23004
+ yield api.DELETE(`reportTemplate/${templateId}/section/${sectionId}`, Api.PrepReqParams(params.req));
23005
+ api.Cache.Remove(GetCacheKey(templateId, sectionId));
23006
+ api.Cache.Remove(GetListCacheKey(templateId));
23007
+ });
23008
+ }
23009
+ ReportTemplateSection.Delete = Delete;
23010
+ /**
23011
+ * Cache identifier scoped to both parent and section, so another parent's read cannot reuse it.
23012
+ */
23013
+ function GetCacheKey(reportTemplateId, sectionId) {
23014
+ return `${GetListCacheKey(reportTemplateId)}${Api.ECacheKey.Id}${ReportTemplate.NormalizeId(sectionId, true)}`;
23015
+ }
23016
+ ReportTemplateSection.GetCacheKey = GetCacheKey;
23017
+ /**
23018
+ * Cache identifier for one template's visible section list.
23019
+ */
23020
+ function GetListCacheKey(reportTemplateId) {
23021
+ return `${Api.ECacheKey.ReportTemplateSection}${Api.ECacheKey.Id}${ReportTemplate.NormalizeId(reportTemplateId)}`;
23022
+ }
23023
+ ReportTemplateSection.GetListCacheKey = GetListCacheKey;
23024
+ })(ReportTemplateSection || (ReportTemplateSection = {}));
23025
+
22789
23026
  /**
22790
23027
  * A scenario is a way to manage alternative states for Entities.
22791
23028
  * Once a scenario is made, you can use its ID to create/update an Entity record without affecting the primary state.
@@ -25949,7 +26186,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
25949
26186
  }
25950
26187
 
25951
26188
  // This is updated with the package.json version on build.
25952
- const VERSION = "7.1.129";
26189
+ const VERSION = "7.1.130";
25953
26190
 
25954
- 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, UserAccessLog, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
26191
+ 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, ReportTemplate, ReportTemplateSection, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserAccessLog, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
25955
26192
  //# sourceMappingURL=bruce-models.es5.js.map