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.
- package/dist/bruce-models.es5.js +204 -2
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +202 -1
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-concept.js +196 -0
- package/dist/lib/account/account-concept.js.map +1 -0
- package/dist/lib/ann-document/ann-document.js +19 -0
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/bruce-models.js +2 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/dashboard/dashboard-view.js.map +1 -1
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/lib/entity/entity-table-view.js.map +1 -1
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/program-key/program-key.js.map +1 -1
- package/dist/lib/project/project-view-bookmark-group.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/tileset/tileset.js +1 -0
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/types/account/account-concept.d.ts +90 -0
- package/dist/types/ann-document/ann-document.d.ts +12 -0
- package/dist/types/bruce-models.d.ts +2 -1
- package/dist/types/dashboard/dashboard-view.d.ts +2 -0
- package/dist/types/entity/entity-lod.d.ts +2 -0
- package/dist/types/entity/entity-table-view.d.ts +2 -0
- package/dist/types/entity/entity-type.d.ts +2 -0
- package/dist/types/entity/entity.d.ts +2 -0
- package/dist/types/program-key/program-key.d.ts +2 -0
- package/dist/types/project/project-view-bookmark-group.d.ts +2 -0
- package/dist/types/project/project-view-bookmark.d.ts +2 -0
- package/dist/types/project/project-view.d.ts +2 -0
- package/dist/types/tileset/tileset.d.ts +2 -0
- package/package.json +1 -2
package/dist/bruce-models.umd.js
CHANGED
|
@@ -2292,6 +2292,25 @@
|
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
2294
2294
|
AnnDocument.Get = Get;
|
|
2295
|
+
/**
|
|
2296
|
+
* Returns the client files available for downloading from an annotated document.
|
|
2297
|
+
*/
|
|
2298
|
+
function GetFiles(params) {
|
|
2299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2300
|
+
let { api, docId, req: reqParams } = params;
|
|
2301
|
+
if (!docId) {
|
|
2302
|
+
throw ("Doc ID is required.");
|
|
2303
|
+
}
|
|
2304
|
+
if (!api) {
|
|
2305
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
2306
|
+
}
|
|
2307
|
+
const data = yield api.GET(`documentView/${docId}/files`, exports.Api.PrepReqParams(reqParams));
|
|
2308
|
+
return {
|
|
2309
|
+
clientFiles: data.Items
|
|
2310
|
+
};
|
|
2311
|
+
});
|
|
2312
|
+
}
|
|
2313
|
+
AnnDocument.GetFiles = GetFiles;
|
|
2295
2314
|
/**
|
|
2296
2315
|
* Returns a list of annotated documents by type.
|
|
2297
2316
|
* @param params
|
|
@@ -10754,6 +10773,7 @@
|
|
|
10754
10773
|
ExternalTilesetURL: (_l = (_k = record.Settings) === null || _k === void 0 ? void 0 : _k.etc) === null || _l === void 0 ? void 0 : _l.ExternalTilesetURL,
|
|
10755
10774
|
showAdvancedSettings: (_o = (_m = record.Settings) === null || _m === void 0 ? void 0 : _m.etc) === null || _o === void 0 ? void 0 : _o.showAdvancedSettings
|
|
10756
10775
|
},
|
|
10776
|
+
permission: record.Permission,
|
|
10757
10777
|
// Not returned in legacy data.
|
|
10758
10778
|
creationTime: newer === null || newer === void 0 ? void 0 : newer.creationTime,
|
|
10759
10779
|
// Not returned in legacy data.
|
|
@@ -14548,6 +14568,187 @@
|
|
|
14548
14568
|
UserMfaMethod.Verify = Verify;
|
|
14549
14569
|
})(exports.UserMfaMethod || (exports.UserMfaMethod = {}));
|
|
14550
14570
|
|
|
14571
|
+
(function (AccountConcept) {
|
|
14572
|
+
let EConcept;
|
|
14573
|
+
(function (EConcept) {
|
|
14574
|
+
EConcept["ASSEMBLY"] = "a";
|
|
14575
|
+
EConcept["ATTACHMENT_TYPE"] = "at";
|
|
14576
|
+
EConcept["CHANGE_SET"] = "cs";
|
|
14577
|
+
EConcept["CLIENT_FILE"] = "clf";
|
|
14578
|
+
EConcept["CUSTOM_FORM"] = "csf";
|
|
14579
|
+
EConcept["DATA_FEED"] = "df";
|
|
14580
|
+
EConcept["DATA_LAB_QUERY"] = "q";
|
|
14581
|
+
EConcept["DATA_LAB_QUERY_GROUP"] = "qg";
|
|
14582
|
+
EConcept["DATA_SOURCE"] = "ds";
|
|
14583
|
+
EConcept["DATA_TRANSFORM"] = "dt";
|
|
14584
|
+
EConcept["DATA_VALIDATION"] = "dval";
|
|
14585
|
+
EConcept["DOCUMENT_VIEW"] = "dv";
|
|
14586
|
+
EConcept["ENTITY"] = "e";
|
|
14587
|
+
EConcept["ENTITY_LOD"] = "el";
|
|
14588
|
+
EConcept["ENTITY_RELATION"] = "er";
|
|
14589
|
+
EConcept["ENTITY_TYPE"] = "et";
|
|
14590
|
+
EConcept["ENTITY_TYPE_LOD"] = "etl";
|
|
14591
|
+
EConcept["LAYER"] = "l";
|
|
14592
|
+
EConcept["LOD_CATEGORY"] = "lc";
|
|
14593
|
+
EConcept["PROGRAM_KEY"] = "pk";
|
|
14594
|
+
EConcept["PROJECT_VIEW"] = "pv";
|
|
14595
|
+
EConcept["RELATION_TYPE"] = "rt";
|
|
14596
|
+
EConcept["SCENARIO"] = "sc";
|
|
14597
|
+
EConcept["TILESET"] = "ts";
|
|
14598
|
+
EConcept["UI_DASHBOARD_VIEW"] = "dbv";
|
|
14599
|
+
EConcept["UI_ENTITY_DISPLAY_SETTING"] = "s";
|
|
14600
|
+
EConcept["UI_PLUGIN"] = "pg";
|
|
14601
|
+
EConcept["UI_SLIDE"] = "pvs";
|
|
14602
|
+
EConcept["UI_SLIDE_GROUP"] = "sg";
|
|
14603
|
+
EConcept["UI_TABLE_VIEW"] = "tv";
|
|
14604
|
+
})(EConcept = AccountConcept.EConcept || (AccountConcept.EConcept = {}));
|
|
14605
|
+
let EAction;
|
|
14606
|
+
(function (EAction) {
|
|
14607
|
+
// Manage is a squashed version of all CRUD perms.
|
|
14608
|
+
// Helps avoid specifying all 4 CRUD perms as separate permission strings in a User Group.
|
|
14609
|
+
EAction["MANAGE"] = "MANAGE";
|
|
14610
|
+
// Manage own records only (eg: own draft bookmarks within a Project View).
|
|
14611
|
+
// Only implemented for Bookmarks at the moment.
|
|
14612
|
+
EAction["MANAGE_OWN"] = "MANAGE_OWN";
|
|
14613
|
+
EAction["VIEW"] = "VIEW";
|
|
14614
|
+
EAction["CREATE"] = "CREATE";
|
|
14615
|
+
EAction["EDIT"] = "EDIT";
|
|
14616
|
+
EAction["DELETE"] = "DELETE";
|
|
14617
|
+
})(EAction = AccountConcept.EAction || (AccountConcept.EAction = {}));
|
|
14618
|
+
function canCreate(perm) {
|
|
14619
|
+
var _a;
|
|
14620
|
+
return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("C")) !== null && _a !== void 0 ? _a : false;
|
|
14621
|
+
}
|
|
14622
|
+
AccountConcept.canCreate = canCreate;
|
|
14623
|
+
function canRead(perm) {
|
|
14624
|
+
var _a;
|
|
14625
|
+
return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("R")) !== null && _a !== void 0 ? _a : false;
|
|
14626
|
+
}
|
|
14627
|
+
AccountConcept.canRead = canRead;
|
|
14628
|
+
function canUpdate(perm) {
|
|
14629
|
+
var _a;
|
|
14630
|
+
return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("U")) !== null && _a !== void 0 ? _a : false;
|
|
14631
|
+
}
|
|
14632
|
+
AccountConcept.canUpdate = canUpdate;
|
|
14633
|
+
function canDelete(perm) {
|
|
14634
|
+
var _a;
|
|
14635
|
+
return (_a = perm === null || perm === void 0 ? void 0 : perm.includes("D")) !== null && _a !== void 0 ? _a : false;
|
|
14636
|
+
}
|
|
14637
|
+
AccountConcept.canDelete = canDelete;
|
|
14638
|
+
AccountConcept.CONCEPTS = [
|
|
14639
|
+
{ concept: EConcept.ASSEMBLY, label: "Assembly", description: undefined },
|
|
14640
|
+
{ concept: EConcept.ATTACHMENT_TYPE, label: "Attachment Type", description: undefined },
|
|
14641
|
+
{ concept: EConcept.CHANGE_SET, label: "Change Set", description: undefined },
|
|
14642
|
+
{ concept: EConcept.CLIENT_FILE, label: "Client File", description: undefined },
|
|
14643
|
+
{ concept: EConcept.CUSTOM_FORM, label: "Custom Form", description: undefined },
|
|
14644
|
+
{ concept: EConcept.DATA_FEED, label: "Data Feed", description: undefined },
|
|
14645
|
+
{ concept: EConcept.DATA_LAB_QUERY, label: "DataLab Query", description: undefined },
|
|
14646
|
+
{ concept: EConcept.DATA_LAB_QUERY_GROUP, label: "DataLab Query Group", description: undefined },
|
|
14647
|
+
{ concept: EConcept.DATA_SOURCE, label: "Data Source", description: undefined },
|
|
14648
|
+
{ concept: EConcept.DATA_TRANSFORM, label: "Data Transform", description: undefined },
|
|
14649
|
+
{ concept: EConcept.DATA_VALIDATION, label: "Data Validation", description: undefined },
|
|
14650
|
+
{ concept: EConcept.DOCUMENT_VIEW, label: "Document View", description: undefined },
|
|
14651
|
+
{ concept: EConcept.ENTITY, label: "Entity", description: "Entities and their owned records (Attachments, Links, LODs, Relationships)" },
|
|
14652
|
+
{ concept: EConcept.ENTITY_LOD, label: "Entity LOD", description: undefined },
|
|
14653
|
+
{ concept: EConcept.ENTITY_RELATION, label: "Entity Relation", description: undefined },
|
|
14654
|
+
{ concept: EConcept.ENTITY_TYPE, label: "Entity Type", description: "Entity Types and their owned records (Entities, Relationships, LODs)" },
|
|
14655
|
+
{ concept: EConcept.ENTITY_TYPE_LOD, label: "Entity Type LOD", description: undefined },
|
|
14656
|
+
{ concept: EConcept.LAYER, label: "Tag", description: undefined },
|
|
14657
|
+
{ concept: EConcept.LOD_CATEGORY, label: "LOD Category", description: undefined },
|
|
14658
|
+
{ concept: EConcept.PROGRAM_KEY, label: "Third Party Key", description: undefined },
|
|
14659
|
+
{ concept: EConcept.RELATION_TYPE, label: "Relation Type", description: undefined },
|
|
14660
|
+
{ concept: EConcept.SCENARIO, label: "Scenario", description: undefined },
|
|
14661
|
+
{ concept: EConcept.PROJECT_VIEW, label: "Project View", description: undefined },
|
|
14662
|
+
{ concept: EConcept.TILESET, label: "Tileset", description: undefined },
|
|
14663
|
+
{ concept: EConcept.UI_DASHBOARD_VIEW, label: "Dashboard View", description: undefined },
|
|
14664
|
+
{ concept: EConcept.UI_ENTITY_DISPLAY_SETTING, label: "Style", description: undefined },
|
|
14665
|
+
{ concept: EConcept.UI_PLUGIN, label: "Plugin", description: undefined },
|
|
14666
|
+
{ concept: EConcept.UI_SLIDE, label: "Bookmark", description: undefined },
|
|
14667
|
+
{ concept: EConcept.UI_SLIDE_GROUP, label: "Bookmark Group", description: undefined },
|
|
14668
|
+
{ concept: EConcept.UI_TABLE_VIEW, label: "Tabular View", description: undefined },
|
|
14669
|
+
];
|
|
14670
|
+
/**
|
|
14671
|
+
* Builds a concept permission string.
|
|
14672
|
+
* Omit recordId for an account-wide permission, eg: "view:pv".
|
|
14673
|
+
* Pass recordId for a record-specific permission, eg: "view:pv:abc123".
|
|
14674
|
+
*/
|
|
14675
|
+
function buildPermission(action, concept, recordId) {
|
|
14676
|
+
const base = `${action.toLowerCase()}:${concept}`;
|
|
14677
|
+
return recordId ? `${base}:${recordId}` : base;
|
|
14678
|
+
}
|
|
14679
|
+
AccountConcept.buildPermission = buildPermission;
|
|
14680
|
+
/**
|
|
14681
|
+
* Parses a concept permission string back to its components.
|
|
14682
|
+
* Returns null for legacy permissions (no ':') or unrecognised strings.
|
|
14683
|
+
*/
|
|
14684
|
+
function parsePermission(perm) {
|
|
14685
|
+
if (!perm || !perm.includes(":")) {
|
|
14686
|
+
return null;
|
|
14687
|
+
}
|
|
14688
|
+
const lower = perm.toLowerCase().trim();
|
|
14689
|
+
const firstColon = lower.indexOf(":");
|
|
14690
|
+
const actionStr = lower.substring(0, firstColon);
|
|
14691
|
+
let matchedAction;
|
|
14692
|
+
for (const a of Object.values(EAction)) {
|
|
14693
|
+
if (a.toLowerCase() === actionStr) {
|
|
14694
|
+
matchedAction = a;
|
|
14695
|
+
break;
|
|
14696
|
+
}
|
|
14697
|
+
}
|
|
14698
|
+
if (!matchedAction) {
|
|
14699
|
+
return null;
|
|
14700
|
+
}
|
|
14701
|
+
const rest = lower.substring(firstColon + 1);
|
|
14702
|
+
// Longest-match prevents "e" matching the start of "el:abc".
|
|
14703
|
+
let matchedConcept;
|
|
14704
|
+
let matchedLen = 0;
|
|
14705
|
+
for (const token of Object.values(EConcept)) {
|
|
14706
|
+
if (token.length > matchedLen && (rest === token || rest.startsWith(token + ":"))) {
|
|
14707
|
+
matchedConcept = token;
|
|
14708
|
+
matchedLen = token.length;
|
|
14709
|
+
}
|
|
14710
|
+
}
|
|
14711
|
+
if (!matchedConcept) {
|
|
14712
|
+
return null;
|
|
14713
|
+
}
|
|
14714
|
+
const recordId = rest.length > matchedLen ? rest.substring(matchedLen + 1) : undefined;
|
|
14715
|
+
return {
|
|
14716
|
+
action: matchedAction,
|
|
14717
|
+
concept: matchedConcept,
|
|
14718
|
+
recordId
|
|
14719
|
+
};
|
|
14720
|
+
}
|
|
14721
|
+
AccountConcept.parsePermission = parsePermission;
|
|
14722
|
+
/**
|
|
14723
|
+
* Returns the concept-level CRUD permission rubric for the current session.
|
|
14724
|
+
* Only concepts where the user has at least one permission are included.
|
|
14725
|
+
*/
|
|
14726
|
+
function GetPermissions(params) {
|
|
14727
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14728
|
+
if (!params)
|
|
14729
|
+
params = {};
|
|
14730
|
+
let { api, req } = params;
|
|
14731
|
+
if (!api) {
|
|
14732
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
14733
|
+
}
|
|
14734
|
+
req = exports.Api.PrepReqParams(req);
|
|
14735
|
+
const rubric = {};
|
|
14736
|
+
const data = yield api.GET("permissions", req);
|
|
14737
|
+
if (data) {
|
|
14738
|
+
for (const [token, permStr] of Object.entries(data)) {
|
|
14739
|
+
if (typeof permStr === "string") {
|
|
14740
|
+
rubric[token] = permStr;
|
|
14741
|
+
}
|
|
14742
|
+
}
|
|
14743
|
+
}
|
|
14744
|
+
return {
|
|
14745
|
+
rubric
|
|
14746
|
+
};
|
|
14747
|
+
});
|
|
14748
|
+
}
|
|
14749
|
+
AccountConcept.GetPermissions = GetPermissions;
|
|
14750
|
+
})(exports.AccountConcept || (exports.AccountConcept = {}));
|
|
14751
|
+
|
|
14551
14752
|
(function (AccountInvite) {
|
|
14552
14753
|
/**
|
|
14553
14754
|
* Possible invite statuses.
|
|
@@ -17974,7 +18175,7 @@
|
|
|
17974
18175
|
})(exports.ChangeSet || (exports.ChangeSet = {}));
|
|
17975
18176
|
|
|
17976
18177
|
// This is updated with the package.json version on build.
|
|
17977
|
-
const VERSION = "7.1.
|
|
18178
|
+
const VERSION = "7.1.40";
|
|
17978
18179
|
|
|
17979
18180
|
exports.VERSION = VERSION;
|
|
17980
18181
|
exports.AbstractApi = AbstractApi;
|