bruce-models 7.1.38 → 7.1.40

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 (35) hide show
  1. package/dist/bruce-models.es5.js +204 -2
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +202 -1
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account-concept.js +196 -0
  6. package/dist/lib/account/account-concept.js.map +1 -0
  7. package/dist/lib/ann-document/ann-document.js +19 -0
  8. package/dist/lib/ann-document/ann-document.js.map +1 -1
  9. package/dist/lib/bruce-models.js +2 -1
  10. package/dist/lib/bruce-models.js.map +1 -1
  11. package/dist/lib/dashboard/dashboard-view.js.map +1 -1
  12. package/dist/lib/entity/entity-lod.js.map +1 -1
  13. package/dist/lib/entity/entity-table-view.js.map +1 -1
  14. package/dist/lib/entity/entity-type.js.map +1 -1
  15. package/dist/lib/entity/entity.js.map +1 -1
  16. package/dist/lib/program-key/program-key.js.map +1 -1
  17. package/dist/lib/project/project-view-bookmark-group.js.map +1 -1
  18. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  19. package/dist/lib/project/project-view.js.map +1 -1
  20. package/dist/lib/tileset/tileset.js +1 -0
  21. package/dist/lib/tileset/tileset.js.map +1 -1
  22. package/dist/types/account/account-concept.d.ts +90 -0
  23. package/dist/types/ann-document/ann-document.d.ts +12 -0
  24. package/dist/types/bruce-models.d.ts +2 -1
  25. package/dist/types/dashboard/dashboard-view.d.ts +2 -0
  26. package/dist/types/entity/entity-lod.d.ts +2 -0
  27. package/dist/types/entity/entity-table-view.d.ts +2 -0
  28. package/dist/types/entity/entity-type.d.ts +2 -0
  29. package/dist/types/entity/entity.d.ts +2 -0
  30. package/dist/types/program-key/program-key.d.ts +2 -0
  31. package/dist/types/project/project-view-bookmark-group.d.ts +2 -0
  32. package/dist/types/project/project-view-bookmark.d.ts +2 -0
  33. package/dist/types/project/project-view.d.ts +2 -0
  34. package/dist/types/tileset/tileset.d.ts +2 -0
  35. package/package.json +1 -2
@@ -2319,6 +2319,25 @@ var AnnDocument;
2319
2319
  });
2320
2320
  }
2321
2321
  AnnDocument.Get = Get;
2322
+ /**
2323
+ * Returns the client files available for downloading from an annotated document.
2324
+ */
2325
+ function GetFiles(params) {
2326
+ return __awaiter(this, void 0, void 0, function* () {
2327
+ let { api, docId, req: reqParams } = params;
2328
+ if (!docId) {
2329
+ throw ("Doc ID is required.");
2330
+ }
2331
+ if (!api) {
2332
+ api = ENVIRONMENT.Api().GetBruceApi();
2333
+ }
2334
+ const data = yield api.GET(`documentView/${docId}/files`, Api.PrepReqParams(reqParams));
2335
+ return {
2336
+ clientFiles: data.Items
2337
+ };
2338
+ });
2339
+ }
2340
+ AnnDocument.GetFiles = GetFiles;
2322
2341
  /**
2323
2342
  * Returns a list of annotated documents by type.
2324
2343
  * @param params
@@ -10933,6 +10952,7 @@ function convertLegacyRec(record, newer) {
10933
10952
  ExternalTilesetURL: (_l = (_k = record.Settings) === null || _k === void 0 ? void 0 : _k.etc) === null || _l === void 0 ? void 0 : _l.ExternalTilesetURL,
10934
10953
  showAdvancedSettings: (_o = (_m = record.Settings) === null || _m === void 0 ? void 0 : _m.etc) === null || _o === void 0 ? void 0 : _o.showAdvancedSettings
10935
10954
  },
10955
+ permission: record.Permission,
10936
10956
  // Not returned in legacy data.
10937
10957
  creationTime: newer === null || newer === void 0 ? void 0 : newer.creationTime,
10938
10958
  // Not returned in legacy data.
@@ -14809,6 +14829,188 @@ var UserMfaMethod;
14809
14829
  UserMfaMethod.Verify = Verify;
14810
14830
  })(UserMfaMethod || (UserMfaMethod = {}));
14811
14831
 
14832
+ var AccountConcept;
14833
+ (function (AccountConcept) {
14834
+ let EConcept;
14835
+ (function (EConcept) {
14836
+ EConcept["ASSEMBLY"] = "a";
14837
+ EConcept["ATTACHMENT_TYPE"] = "at";
14838
+ EConcept["CHANGE_SET"] = "cs";
14839
+ EConcept["CLIENT_FILE"] = "clf";
14840
+ EConcept["CUSTOM_FORM"] = "csf";
14841
+ EConcept["DATA_FEED"] = "df";
14842
+ EConcept["DATA_LAB_QUERY"] = "q";
14843
+ EConcept["DATA_LAB_QUERY_GROUP"] = "qg";
14844
+ EConcept["DATA_SOURCE"] = "ds";
14845
+ EConcept["DATA_TRANSFORM"] = "dt";
14846
+ EConcept["DATA_VALIDATION"] = "dval";
14847
+ EConcept["DOCUMENT_VIEW"] = "dv";
14848
+ EConcept["ENTITY"] = "e";
14849
+ EConcept["ENTITY_LOD"] = "el";
14850
+ EConcept["ENTITY_RELATION"] = "er";
14851
+ EConcept["ENTITY_TYPE"] = "et";
14852
+ EConcept["ENTITY_TYPE_LOD"] = "etl";
14853
+ EConcept["LAYER"] = "l";
14854
+ EConcept["LOD_CATEGORY"] = "lc";
14855
+ EConcept["PROGRAM_KEY"] = "pk";
14856
+ EConcept["PROJECT_VIEW"] = "pv";
14857
+ EConcept["RELATION_TYPE"] = "rt";
14858
+ EConcept["SCENARIO"] = "sc";
14859
+ EConcept["TILESET"] = "ts";
14860
+ EConcept["UI_DASHBOARD_VIEW"] = "dbv";
14861
+ EConcept["UI_ENTITY_DISPLAY_SETTING"] = "s";
14862
+ EConcept["UI_PLUGIN"] = "pg";
14863
+ EConcept["UI_SLIDE"] = "pvs";
14864
+ EConcept["UI_SLIDE_GROUP"] = "sg";
14865
+ EConcept["UI_TABLE_VIEW"] = "tv";
14866
+ })(EConcept = AccountConcept.EConcept || (AccountConcept.EConcept = {}));
14867
+ let EAction;
14868
+ (function (EAction) {
14869
+ // Manage is a squashed version of all CRUD perms.
14870
+ // Helps avoid specifying all 4 CRUD perms as separate permission strings in a User Group.
14871
+ EAction["MANAGE"] = "MANAGE";
14872
+ // Manage own records only (eg: own draft bookmarks within a Project View).
14873
+ // Only implemented for Bookmarks at the moment.
14874
+ EAction["MANAGE_OWN"] = "MANAGE_OWN";
14875
+ EAction["VIEW"] = "VIEW";
14876
+ EAction["CREATE"] = "CREATE";
14877
+ EAction["EDIT"] = "EDIT";
14878
+ EAction["DELETE"] = "DELETE";
14879
+ })(EAction = AccountConcept.EAction || (AccountConcept.EAction = {}));
14880
+ function canCreate(perm) {
14881
+ var _a;
14882
+ return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("C")) !== null && _a !== void 0 ? _a : false;
14883
+ }
14884
+ AccountConcept.canCreate = canCreate;
14885
+ function canRead(perm) {
14886
+ var _a;
14887
+ return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("R")) !== null && _a !== void 0 ? _a : false;
14888
+ }
14889
+ AccountConcept.canRead = canRead;
14890
+ function canUpdate(perm) {
14891
+ var _a;
14892
+ return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("U")) !== null && _a !== void 0 ? _a : false;
14893
+ }
14894
+ AccountConcept.canUpdate = canUpdate;
14895
+ function canDelete(perm) {
14896
+ var _a;
14897
+ return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("D")) !== null && _a !== void 0 ? _a : false;
14898
+ }
14899
+ AccountConcept.canDelete = canDelete;
14900
+ AccountConcept.CONCEPTS = [
14901
+ { concept: EConcept.ASSEMBLY, label: "Assembly", description: undefined },
14902
+ { concept: EConcept.ATTACHMENT_TYPE, label: "Attachment Type", description: undefined },
14903
+ { concept: EConcept.CHANGE_SET, label: "Change Set", description: undefined },
14904
+ { concept: EConcept.CLIENT_FILE, label: "Client File", description: undefined },
14905
+ { concept: EConcept.CUSTOM_FORM, label: "Custom Form", description: undefined },
14906
+ { concept: EConcept.DATA_FEED, label: "Data Feed", description: undefined },
14907
+ { concept: EConcept.DATA_LAB_QUERY, label: "DataLab Query", description: undefined },
14908
+ { concept: EConcept.DATA_LAB_QUERY_GROUP, label: "DataLab Query Group", description: undefined },
14909
+ { concept: EConcept.DATA_SOURCE, label: "Data Source", description: undefined },
14910
+ { concept: EConcept.DATA_TRANSFORM, label: "Data Transform", description: undefined },
14911
+ { concept: EConcept.DATA_VALIDATION, label: "Data Validation", description: undefined },
14912
+ { concept: EConcept.DOCUMENT_VIEW, label: "Document View", description: undefined },
14913
+ { concept: EConcept.ENTITY, label: "Entity", description: "Entities and their owned records (Attachments, Links, LODs, Relationships)" },
14914
+ { concept: EConcept.ENTITY_LOD, label: "Entity LOD", description: undefined },
14915
+ { concept: EConcept.ENTITY_RELATION, label: "Entity Relation", description: undefined },
14916
+ { concept: EConcept.ENTITY_TYPE, label: "Entity Type", description: "Entity Types and their owned records (Entities, Relationships, LODs)" },
14917
+ { concept: EConcept.ENTITY_TYPE_LOD, label: "Entity Type LOD", description: undefined },
14918
+ { concept: EConcept.LAYER, label: "Tag", description: undefined },
14919
+ { concept: EConcept.LOD_CATEGORY, label: "LOD Category", description: undefined },
14920
+ { concept: EConcept.PROGRAM_KEY, label: "Third Party Key", description: undefined },
14921
+ { concept: EConcept.RELATION_TYPE, label: "Relation Type", description: undefined },
14922
+ { concept: EConcept.SCENARIO, label: "Scenario", description: undefined },
14923
+ { concept: EConcept.PROJECT_VIEW, label: "Project View", description: undefined },
14924
+ { concept: EConcept.TILESET, label: "Tileset", description: undefined },
14925
+ { concept: EConcept.UI_DASHBOARD_VIEW, label: "Dashboard View", description: undefined },
14926
+ { concept: EConcept.UI_ENTITY_DISPLAY_SETTING, label: "Style", description: undefined },
14927
+ { concept: EConcept.UI_PLUGIN, label: "Plugin", description: undefined },
14928
+ { concept: EConcept.UI_SLIDE, label: "Bookmark", description: undefined },
14929
+ { concept: EConcept.UI_SLIDE_GROUP, label: "Bookmark Group", description: undefined },
14930
+ { concept: EConcept.UI_TABLE_VIEW, label: "Tabular View", description: undefined },
14931
+ ];
14932
+ /**
14933
+ * Builds a concept permission string.
14934
+ * Omit recordId for an account-wide permission, eg: "view:pv".
14935
+ * Pass recordId for a record-specific permission, eg: "view:pv:abc123".
14936
+ */
14937
+ function buildPermission(action, concept, recordId) {
14938
+ const base = `${action.toLowerCase()}:${concept}`;
14939
+ return recordId ? `${base}:${recordId}` : base;
14940
+ }
14941
+ AccountConcept.buildPermission = buildPermission;
14942
+ /**
14943
+ * Parses a concept permission string back to its components.
14944
+ * Returns null for legacy permissions (no ':') or unrecognised strings.
14945
+ */
14946
+ function parsePermission(perm) {
14947
+ if (!perm || !perm.includes(":")) {
14948
+ return null;
14949
+ }
14950
+ const lower = perm.toLowerCase().trim();
14951
+ const firstColon = lower.indexOf(":");
14952
+ const actionStr = lower.substring(0, firstColon);
14953
+ let matchedAction;
14954
+ for (const a of Object.values(EAction)) {
14955
+ if (a.toLowerCase() === actionStr) {
14956
+ matchedAction = a;
14957
+ break;
14958
+ }
14959
+ }
14960
+ if (!matchedAction) {
14961
+ return null;
14962
+ }
14963
+ const rest = lower.substring(firstColon + 1);
14964
+ // Longest-match prevents "e" matching the start of "el:abc".
14965
+ let matchedConcept;
14966
+ let matchedLen = 0;
14967
+ for (const token of Object.values(EConcept)) {
14968
+ if (token.length > matchedLen && (rest === token || rest.startsWith(token + ":"))) {
14969
+ matchedConcept = token;
14970
+ matchedLen = token.length;
14971
+ }
14972
+ }
14973
+ if (!matchedConcept) {
14974
+ return null;
14975
+ }
14976
+ const recordId = rest.length > matchedLen ? rest.substring(matchedLen + 1) : undefined;
14977
+ return {
14978
+ action: matchedAction,
14979
+ concept: matchedConcept,
14980
+ recordId
14981
+ };
14982
+ }
14983
+ AccountConcept.parsePermission = parsePermission;
14984
+ /**
14985
+ * Returns the concept-level CRUD permission rubric for the current session.
14986
+ * Only concepts where the user has at least one permission are included.
14987
+ */
14988
+ function GetPermissions(params) {
14989
+ return __awaiter(this, void 0, void 0, function* () {
14990
+ if (!params)
14991
+ params = {};
14992
+ let { api, req } = params;
14993
+ if (!api) {
14994
+ api = ENVIRONMENT.Api().GetBruceApi();
14995
+ }
14996
+ req = Api.PrepReqParams(req);
14997
+ const rubric = {};
14998
+ const data = yield api.GET("permissions", req);
14999
+ if (data) {
15000
+ for (const [token, permStr] of Object.entries(data)) {
15001
+ if (typeof permStr === "string") {
15002
+ rubric[token] = permStr;
15003
+ }
15004
+ }
15005
+ }
15006
+ return {
15007
+ rubric
15008
+ };
15009
+ });
15010
+ }
15011
+ AccountConcept.GetPermissions = GetPermissions;
15012
+ })(AccountConcept || (AccountConcept = {}));
15013
+
14812
15014
  /**
14813
15015
  * An account-invite is an invitation to a user to join a client account.
14814
15016
  * New users to Nextspace will setup their user account within the invitation process.
@@ -18309,7 +18511,7 @@ var ChangeSet;
18309
18511
  })(ChangeSet || (ChangeSet = {}));
18310
18512
 
18311
18513
  // This is updated with the package.json version on build.
18312
- const VERSION = "7.1.38";
18514
+ const VERSION = "7.1.40";
18313
18515
 
18314
- export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityTypeTrigger, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, DashboardView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataTransform, DataLabGroup, DataFeed, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportLcc, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, ChangeSet };
18516
+ export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityTypeTrigger, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, DashboardView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountConcept, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataTransform, DataLabGroup, DataFeed, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportLcc, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, ChangeSet };
18315
18517
  //# sourceMappingURL=bruce-models.es5.js.map