bruce-models 3.1.9 → 3.2.1
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 +2683 -845
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +2612 -803
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-invite.js +40 -1
- package/dist/lib/account/account-invite.js.map +1 -1
- package/dist/lib/account/account.js +60 -5
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/ann-document/ann-document.js +36 -3
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/api/abstract-api.js +78 -1
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/api/api-getters.js +68 -94
- package/dist/lib/api/api-getters.js.map +1 -1
- package/dist/lib/api/api.js +20 -3
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/api/bruce-api.js +68 -27
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/api/global-api.js +46 -4
- package/dist/lib/api/global-api.js.map +1 -1
- package/dist/lib/api/guardian-api.js +42 -1
- package/dist/lib/api/guardian-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -3
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/calculator/calculator.js +42 -1
- package/dist/lib/calculator/calculator.js.map +1 -1
- package/dist/lib/client-file/client-file.js +71 -7
- package/dist/lib/client-file/client-file.js.map +1 -1
- package/dist/lib/common/bounds.js +1 -1
- package/dist/lib/common/bounds.js.map +1 -1
- package/dist/lib/common/bruce-event.js +19 -0
- package/dist/lib/common/bruce-event.js.map +1 -1
- package/dist/lib/common/bruce-variable.js +5 -0
- package/dist/lib/common/bruce-variable.js.map +1 -1
- package/dist/lib/common/color-css-defaults.js +157 -0
- package/dist/lib/common/color-css-defaults.js.map +1 -0
- package/dist/lib/common/color.js +18 -4
- package/dist/lib/common/color.js.map +1 -1
- package/dist/lib/common/delay-queue.js +7 -0
- package/dist/lib/common/delay-queue.js.map +1 -1
- package/dist/lib/common/geometry.js +5 -0
- package/dist/lib/common/geometry.js.map +1 -1
- package/dist/lib/common/lru-cache.js +20 -0
- package/dist/lib/common/lru-cache.js.map +1 -1
- package/dist/lib/custom-form/custom-form.js +49 -7
- package/dist/lib/custom-form/custom-form.js.map +1 -1
- package/dist/lib/data-lab/data-lab.js +10 -0
- package/dist/lib/data-lab/data-lab.js.map +1 -1
- package/dist/lib/data-source/data-source.js +41 -0
- package/dist/lib/data-source/data-source.js.map +1 -1
- package/dist/lib/entity/entity-attachment-type.js +37 -1
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/lib/entity/entity-attachment.js +65 -18
- package/dist/lib/entity/entity-attachment.js.map +1 -1
- package/dist/lib/entity/entity-attribute.js +17 -1
- package/dist/lib/entity/entity-attribute.js.map +1 -1
- package/dist/lib/entity/entity-comment.js +44 -7
- package/dist/lib/entity/entity-comment.js.map +1 -1
- package/dist/lib/entity/entity-coords.js +38 -0
- package/dist/lib/entity/entity-coords.js.map +1 -1
- package/dist/lib/entity/entity-link.js +45 -11
- package/dist/lib/entity/entity-link.js.map +1 -1
- package/dist/lib/entity/entity-lod-category.js +52 -9
- package/dist/lib/entity/entity-lod-category.js.map +1 -1
- package/dist/lib/entity/entity-lod.js +78 -16
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/lib/entity/entity-relation-type.js +48 -10
- package/dist/lib/entity/entity-relation-type.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +69 -16
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/entity/entity-source.js +56 -15
- package/dist/lib/entity/entity-source.js.map +1 -1
- package/dist/lib/entity/entity-tag.js +56 -10
- package/dist/lib/entity/entity-tag.js.map +1 -1
- package/dist/lib/entity/entity-type-visual-settings.js +4 -0
- package/dist/lib/entity/entity-type-visual-settings.js.map +1 -1
- package/dist/lib/entity/entity-type.js +45 -7
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js +122 -18
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/environment.js +12 -0
- package/dist/lib/environment.js.map +1 -1
- package/dist/lib/import/imported-file.js +53 -0
- package/dist/lib/import/imported-file.js.map +1 -1
- package/dist/lib/internal/uploader.js +8 -0
- package/dist/lib/internal/uploader.js.map +1 -1
- package/dist/lib/markup/markup.js +1 -1
- package/dist/lib/markup/markup.js.map +1 -1
- package/dist/lib/plugin/plugin.js +51 -9
- package/dist/lib/plugin/plugin.js.map +1 -1
- package/dist/lib/program-key/program-key.js +55 -10
- package/dist/lib/program-key/program-key.js.map +1 -1
- package/dist/lib/project/menu-item.js +22 -0
- package/dist/lib/project/menu-item.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js +55 -11
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view-tile.js +9 -0
- package/dist/lib/project/project-view-tile.js.map +1 -1
- package/dist/lib/project/project-view.js +45 -7
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/project/zoom-control.js +7 -0
- package/dist/lib/project/zoom-control.js.map +1 -1
- package/dist/lib/server/hosting-location.js +30 -9
- package/dist/lib/server/hosting-location.js.map +1 -1
- package/dist/lib/server/message-broker.js +3 -0
- package/dist/lib/server/message-broker.js.map +1 -1
- package/dist/lib/server/pending-action.js +25 -4
- package/dist/lib/server/pending-action.js.map +1 -1
- package/dist/lib/server/task.js +17 -0
- package/dist/lib/server/task.js.map +1 -1
- package/dist/lib/style/style.js +56 -7
- package/dist/lib/style/style.js.map +1 -1
- package/dist/lib/tileset/tileset.js +128 -34
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/lib/user/permission.js +20 -0
- package/dist/lib/user/permission.js.map +1 -1
- package/dist/lib/user/session.js +46 -1
- package/dist/lib/user/session.js.map +1 -1
- package/dist/lib/user/user-group.js +49 -19
- package/dist/lib/user/user-group.js.map +1 -1
- package/dist/lib/user/user.js +134 -37
- package/dist/lib/user/user.js.map +1 -1
- package/dist/lib/util/path-utils.js +16 -1
- package/dist/lib/util/path-utils.js.map +1 -1
- package/dist/lib/util/url-utils.js +12 -85
- package/dist/lib/util/url-utils.js.map +1 -1
- package/dist/types/account/account-invite.d.ts +44 -8
- package/dist/types/account/account-settings.d.ts +3 -0
- package/dist/types/account/account.d.ts +68 -11
- package/dist/types/ann-document/ann-document.d.ts +43 -0
- package/dist/types/api/abstract-api.d.ts +76 -1
- package/dist/types/api/api-getters.d.ts +62 -24
- package/dist/types/api/api.d.ts +19 -4
- package/dist/types/api/bruce-api.d.ts +48 -4
- package/dist/types/api/global-api.d.ts +46 -8
- package/dist/types/api/guardian-api.d.ts +42 -5
- package/dist/types/bruce-models.d.ts +1 -3
- package/dist/types/calculator/calculator.d.ts +57 -1
- package/dist/types/client-file/client-file.d.ts +69 -6
- package/dist/types/common/bounds.d.ts +3 -3
- package/dist/types/common/bruce-event.d.ts +19 -0
- package/dist/types/common/color-css-defaults.d.ts +153 -0
- package/dist/types/common/color.d.ts +6 -1
- package/dist/types/common/delay-queue.d.ts +7 -0
- package/dist/types/common/geometry.d.ts +5 -0
- package/dist/types/common/lru-cache.d.ts +16 -0
- package/dist/types/custom-form/custom-form-content.d.ts +3 -0
- package/dist/types/custom-form/custom-form.d.ts +46 -1
- package/dist/types/data-lab/data-lab.d.ts +10 -0
- package/dist/types/data-source/data-source.d.ts +41 -0
- package/dist/types/entity/entity-attachment-type.d.ts +38 -1
- package/dist/types/entity/entity-attachment.d.ts +49 -2
- package/dist/types/entity/entity-attribute.d.ts +31 -12
- package/dist/types/entity/entity-comment.d.ts +41 -1
- package/dist/types/entity/entity-coords.d.ts +54 -1
- package/dist/types/entity/entity-link.d.ts +39 -2
- package/dist/types/entity/entity-lod-category.d.ts +46 -0
- package/dist/types/entity/entity-lod.d.ts +72 -1
- package/dist/types/entity/entity-relation-type.d.ts +42 -1
- package/dist/types/entity/entity-relation.d.ts +57 -1
- package/dist/types/entity/entity-source.d.ts +38 -4
- package/dist/types/entity/entity-tag.d.ts +48 -1
- package/dist/types/entity/entity-type-visual-settings.d.ts +4 -0
- package/dist/types/entity/entity-type.d.ts +45 -4
- package/dist/types/entity/entity.d.ts +89 -3
- package/dist/types/environment.d.ts +9 -0
- package/dist/types/import/imported-file.d.ts +64 -8
- package/dist/types/internal/uploader.d.ts +8 -0
- package/dist/types/markup/markup.d.ts +7 -1
- package/dist/types/plugin/plugin.d.ts +45 -0
- package/dist/types/program-key/program-key.d.ts +45 -1
- package/dist/types/project/menu-item.d.ts +73 -1
- package/dist/types/project/project-view-bookmark.d.ts +64 -2
- package/dist/types/project/project-view-tile.d.ts +30 -0
- package/dist/types/project/project-view.d.ts +52 -2
- package/dist/types/project/zoom-control.d.ts +7 -0
- package/dist/types/server/hosting-location.d.ts +24 -0
- package/dist/types/server/message-broker.d.ts +3 -0
- package/dist/types/server/pending-action.d.ts +28 -1
- package/dist/types/server/task.d.ts +20 -0
- package/dist/types/style/style.d.ts +69 -2
- package/dist/types/tileset/tileset.d.ts +92 -1
- package/dist/types/user/permission.d.ts +11 -0
- package/dist/types/user/session.d.ts +48 -5
- package/dist/types/user/user-group.d.ts +40 -8
- package/dist/types/user/user.d.ts +117 -17
- package/dist/types/util/path-utils.d.ts +16 -1
- package/dist/types/util/url-utils.d.ts +5 -22
- package/package.json +1 -1
- package/dist/lib/api/cam-api.js +0 -84
- package/dist/lib/api/cam-api.js.map +0 -1
- package/dist/lib/api/idm-api.js +0 -86
- package/dist/lib/api/idm-api.js.map +0 -1
- package/dist/types/api/cam-api.d.ts +0 -26
- package/dist/types/api/idm-api.d.ts +0 -28
|
@@ -1,95 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UrlUtils = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Utility to help with url manipulation.
|
|
6
|
-
*/
|
|
7
4
|
var UrlUtils;
|
|
8
5
|
(function (UrlUtils) {
|
|
9
|
-
function GetQueryString(doc) {
|
|
10
|
-
const qs = {};
|
|
11
|
-
const p0 = doc.location.href.indexOf("?");
|
|
12
|
-
if (p0 >= 0) {
|
|
13
|
-
const str = doc.location.href.substring(p0 + 1);
|
|
14
|
-
const tokens = str.split("&");
|
|
15
|
-
tokens.forEach(token => {
|
|
16
|
-
const p = token.split("=");
|
|
17
|
-
if (p.length == 2) {
|
|
18
|
-
qs[p[0]] = p[1];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return qs;
|
|
23
|
-
}
|
|
24
|
-
UrlUtils.GetQueryString = GetQueryString;
|
|
25
6
|
/**
|
|
26
|
-
*
|
|
7
|
+
* Returns a url-safe string that is human readable.
|
|
8
|
+
* Eg: 'My Project View!' into 'My-Project-View'.
|
|
9
|
+
* @param str
|
|
10
|
+
* @returns
|
|
27
11
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
get allowedKeys() {
|
|
37
|
-
return this._allowedKeys;
|
|
38
|
-
}
|
|
39
|
-
constructor(window, allowedKeys) {
|
|
40
|
-
this._allowedKeys = null;
|
|
41
|
-
this._window = window;
|
|
42
|
-
this._allowedKeys = allowedKeys;
|
|
43
|
-
}
|
|
44
|
-
UpdateAllowedKeys(allowedKeys) {
|
|
45
|
-
this._allowedKeys = allowedKeys;
|
|
46
|
-
let params = this.GetParams();
|
|
47
|
-
this.refresh(params);
|
|
48
|
-
}
|
|
49
|
-
UpdateParam(key, value) {
|
|
50
|
-
let params = this.GetParams();
|
|
51
|
-
params[key + ""] = value + "";
|
|
52
|
-
this.refresh(params);
|
|
53
|
-
}
|
|
54
|
-
RemoveParam(key) {
|
|
55
|
-
let params = this.GetParams();
|
|
56
|
-
params[key + ""] = null;
|
|
57
|
-
this.refresh(params);
|
|
58
|
-
}
|
|
59
|
-
GetParamKeys() {
|
|
60
|
-
let params = GetQueryString(this.document);
|
|
61
|
-
return Object.keys(params);
|
|
62
|
-
}
|
|
63
|
-
GetParams() {
|
|
64
|
-
return GetQueryString(this.document);
|
|
65
|
-
}
|
|
66
|
-
GetParam(key) {
|
|
67
|
-
let params = this.GetParams();
|
|
68
|
-
return params[key + ""];
|
|
69
|
-
}
|
|
70
|
-
Clear() {
|
|
71
|
-
this.refresh({});
|
|
72
|
-
}
|
|
73
|
-
refresh(urlParams) {
|
|
74
|
-
const params = [];
|
|
75
|
-
const keys = Object.keys(urlParams);
|
|
76
|
-
for (let i = 0; i < keys.length; i++) {
|
|
77
|
-
const key = keys[i];
|
|
78
|
-
if (this._allowedKeys == null || this._allowedKeys.includes(key)) {
|
|
79
|
-
const val = urlParams[key];
|
|
80
|
-
if (!!val || val == 0) {
|
|
81
|
-
params.push(`${key}=${val}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (params.length > 0) {
|
|
86
|
-
this.window.history.replaceState({}, null, "?" + params.join("&"));
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.window.history.replaceState({}, null, "");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
12
|
+
function ToHumanReadable(str) {
|
|
13
|
+
str = str.replace(/[^a-zA-Z0-9]/gi, "-");
|
|
14
|
+
// Dedupe underscores.
|
|
15
|
+
str = str.replace(/-+/g, "-");
|
|
16
|
+
// Trim underscores.
|
|
17
|
+
str = str.replace(/^-+|-+$/g, "");
|
|
18
|
+
return str;
|
|
92
19
|
}
|
|
93
|
-
UrlUtils.
|
|
20
|
+
UrlUtils.ToHumanReadable = ToHumanReadable;
|
|
94
21
|
})(UrlUtils = exports.UrlUtils || (exports.UrlUtils = {}));
|
|
95
22
|
//# sourceMappingURL=url-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-utils.js","sourceRoot":"","sources":["../../../src/util/url-utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"url-utils.js","sourceRoot":"","sources":["../../../src/util/url-utils.ts"],"names":[],"mappings":";;;AAAA,IAAiB,QAAQ,CAexB;AAfD,WAAiB,QAAQ;IACrB;;;;;OAKG;IACH,SAAgB,eAAe,CAAC,GAAW;QACvC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;QACzC,sBAAsB;QACtB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9B,oBAAoB;QACpB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAClC,OAAO,GAAG,CAAC;IACf,CAAC;IAPe,wBAAe,kBAO9B,CAAA;AACL,CAAC,EAfgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAexB"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Api } from "../api/api";
|
|
2
2
|
import { GuardianApi } from "../api/guardian-api";
|
|
3
|
-
import { IdmApi } from "../api/idm-api";
|
|
4
3
|
import { UTC } from "../common/utc";
|
|
5
4
|
import { User } from "../user/user";
|
|
5
|
+
/**
|
|
6
|
+
* An account-invite is an invitation to a user to join a client account.
|
|
7
|
+
* New users to Nextspace will setup their user account within the invitation process.
|
|
8
|
+
*/
|
|
6
9
|
export declare namespace AccountInvite {
|
|
10
|
+
/**
|
|
11
|
+
* Describes an account-invite record.
|
|
12
|
+
*/
|
|
7
13
|
interface IInvite {
|
|
8
14
|
ID: number;
|
|
9
15
|
"Account.ID": string;
|
|
@@ -14,6 +20,9 @@ export declare namespace AccountInvite {
|
|
|
14
20
|
IsExpired: boolean;
|
|
15
21
|
Status: EStatus;
|
|
16
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Possible invite statuses.
|
|
25
|
+
*/
|
|
17
26
|
enum EStatus {
|
|
18
27
|
Denied = "Denied",
|
|
19
28
|
Cancelled = "Cancelled",
|
|
@@ -21,20 +30,34 @@ export declare namespace AccountInvite {
|
|
|
21
30
|
NotSent = "NotSent",
|
|
22
31
|
Accepted = "Accepted"
|
|
23
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Possible invite methods.
|
|
35
|
+
*/
|
|
24
36
|
enum EInviteMethod {
|
|
25
37
|
Email = "Email",
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
Manual = "Manual",
|
|
39
|
+
SMS = "SMS"
|
|
28
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns an invite matching a provided invite code.
|
|
43
|
+
* @param params
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
29
46
|
function GetByCode(params: {
|
|
30
|
-
api?:
|
|
47
|
+
api?: GuardianApi.Api;
|
|
31
48
|
code: string;
|
|
32
49
|
req?: Api.IReqParams;
|
|
33
50
|
}): Promise<{
|
|
34
51
|
invite: IInvite;
|
|
35
52
|
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns a list of invites matching provided criteria.
|
|
55
|
+
* For example you can get a list of invites for a specific account or user (or both).
|
|
56
|
+
* @param params
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
36
59
|
function GetList(params: {
|
|
37
|
-
api?:
|
|
60
|
+
api?: GuardianApi.Api;
|
|
38
61
|
accountId?: string;
|
|
39
62
|
userId?: string;
|
|
40
63
|
req?: Api.IReqParams;
|
|
@@ -42,15 +65,28 @@ export declare namespace AccountInvite {
|
|
|
42
65
|
invites: IInvite[];
|
|
43
66
|
warnings?: string[];
|
|
44
67
|
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Updates an invite's status.
|
|
70
|
+
* Once an invite is accepted or denied it cannot be changed.
|
|
71
|
+
* @param params
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
45
74
|
function Update(params: {
|
|
46
|
-
api?:
|
|
75
|
+
api?: GuardianApi.Api;
|
|
47
76
|
code: string;
|
|
48
77
|
status: string;
|
|
49
78
|
user?: User.IUser;
|
|
50
79
|
req?: Api.IReqParams;
|
|
51
80
|
}): Promise<any>;
|
|
81
|
+
/**
|
|
82
|
+
* Creates a new invite.
|
|
83
|
+
* Please validate the response invitation records to ensure the desired contact method was used and worked.
|
|
84
|
+
* Eg: It will tell you if the email was sent successfully.
|
|
85
|
+
* @param params
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
52
88
|
function Create(params: {
|
|
53
|
-
api?:
|
|
89
|
+
api?: GuardianApi.Api;
|
|
54
90
|
accountId: string;
|
|
55
91
|
login?: string;
|
|
56
92
|
userId?: string;
|
|
@@ -62,8 +98,8 @@ export declare namespace AccountInvite {
|
|
|
62
98
|
}): Promise<{
|
|
63
99
|
warnings?: string[];
|
|
64
100
|
user: User.IUser;
|
|
65
|
-
manualInviteCode?: string;
|
|
66
101
|
invite: IInvite;
|
|
67
102
|
manualInvite?: IInvite;
|
|
103
|
+
manualInviteCode?: string;
|
|
68
104
|
}>;
|
|
69
105
|
}
|
|
@@ -1,51 +1,107 @@
|
|
|
1
1
|
import { Api } from "../api/api";
|
|
2
2
|
import { BruceApi } from "../api/bruce-api";
|
|
3
|
-
import { CamApi } from "../api/cam-api";
|
|
4
3
|
import { GuardianApi } from "../api/guardian-api";
|
|
5
|
-
import { IdmApi } from "../api/idm-api";
|
|
6
4
|
import { AccountSettings } from "./account-settings";
|
|
7
5
|
/**
|
|
8
|
-
* Describes the "Client Account" concept within
|
|
6
|
+
* Describes the "Client Account" concept within Nextspace.
|
|
9
7
|
* A client account is a database instance that holds one or many users.
|
|
10
8
|
*/
|
|
11
9
|
export declare namespace Account {
|
|
10
|
+
/**
|
|
11
|
+
* Returns cache identifier for an account by ID.
|
|
12
|
+
* Example: {
|
|
13
|
+
* const api: BruceApi.Api = ...;
|
|
14
|
+
* const key = GetCacheKey(1);
|
|
15
|
+
* api.Cache.Remove(key);
|
|
16
|
+
* }
|
|
17
|
+
* @param accountId
|
|
18
|
+
* @param appSettingsId
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
12
21
|
function GetCacheKey(accountId: string, appSettingsId?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Returns cache identifier for a list of accounts by session ID.
|
|
24
|
+
* Example: {
|
|
25
|
+
* const api: BruceApi.Api = ...;
|
|
26
|
+
* const key = GetListCacheKey(api.GetSessionId());
|
|
27
|
+
* api.Cache.Remove(key);
|
|
28
|
+
* }
|
|
29
|
+
* @param ssid
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
13
32
|
function GetListCacheKey(ssid: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Returns cache identifier for a list of database regions.
|
|
35
|
+
* Example: {
|
|
36
|
+
* const api: BruceApi.Api = ...;
|
|
37
|
+
* const key = GetDbRegionListCacheKey();
|
|
38
|
+
* api.Cache.Remove(key);
|
|
39
|
+
* }
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
14
42
|
function GetDbRegionListCacheKey(): Api.ECacheKey;
|
|
43
|
+
/**
|
|
44
|
+
* Known Nextspace applications we store settings for.
|
|
45
|
+
*/
|
|
15
46
|
enum EAppId {
|
|
16
47
|
BruceApi = "BruceAPI",
|
|
17
48
|
Navigator = "Navigator"
|
|
18
49
|
}
|
|
19
50
|
type AppId = EAppId | string;
|
|
51
|
+
/**
|
|
52
|
+
* Possible starter content options.
|
|
53
|
+
* When creating a new account you can populate it with certain default data.
|
|
54
|
+
*/
|
|
20
55
|
enum EStarterContent {
|
|
21
56
|
Default = "default",
|
|
22
57
|
None = "none"
|
|
23
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Describes a Nextspace client account record.
|
|
61
|
+
*/
|
|
24
62
|
interface IAccount {
|
|
25
63
|
ID?: string;
|
|
64
|
+
Subdomain?: string;
|
|
26
65
|
Name?: string;
|
|
27
|
-
"
|
|
66
|
+
"Client.ID": string;
|
|
67
|
+
"OwnerUser.ID"?: string;
|
|
28
68
|
"Application.ID"?: string;
|
|
69
|
+
"Application.Settings"?: AccountSettings.Settings;
|
|
70
|
+
"HostingLocation.Key"?: string;
|
|
71
|
+
"ClientAccount.ID"?: string;
|
|
29
72
|
"BruceAPI"?: string;
|
|
30
73
|
"Settings"?: any;
|
|
31
|
-
"OwnerUser.ID"?: string;
|
|
32
|
-
"Application.Settings"?: AccountSettings.Settings;
|
|
33
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Gets a client account record by ID.
|
|
77
|
+
* @param params
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
34
80
|
function Get(params: {
|
|
35
|
-
api?:
|
|
81
|
+
api?: GuardianApi.Api;
|
|
36
82
|
accountId: string;
|
|
37
83
|
req?: Api.IReqParams;
|
|
38
84
|
}): Promise<{
|
|
39
85
|
account: IAccount;
|
|
40
86
|
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Gets a list of client accounts related to the current session user.
|
|
89
|
+
* @param params
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
41
92
|
function GetRelatedList(params: {
|
|
42
|
-
api?:
|
|
93
|
+
api?: GuardianApi.Api;
|
|
43
94
|
req?: Api.IReqParams;
|
|
44
95
|
}): Promise<{
|
|
45
96
|
accounts: IAccount[];
|
|
46
97
|
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Gets application settings for a specific client account.
|
|
100
|
+
* @param params
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
47
103
|
function GetAppSettings(params: {
|
|
48
|
-
api?:
|
|
104
|
+
api?: GuardianApi.Api;
|
|
49
105
|
accountId: string;
|
|
50
106
|
appId: AppId;
|
|
51
107
|
req?: Api.IReqParams;
|
|
@@ -53,12 +109,13 @@ export declare namespace Account {
|
|
|
53
109
|
settings: AccountSettings.Settings;
|
|
54
110
|
}>;
|
|
55
111
|
/**
|
|
112
|
+
* Updates application settings for a specific client account + application.
|
|
56
113
|
* WARNING: Do not update API settings without knowing what you're doing.
|
|
57
114
|
* @param params
|
|
58
115
|
* @returns
|
|
59
116
|
*/
|
|
60
117
|
function UpdateAppSettings(params: {
|
|
61
|
-
api?:
|
|
118
|
+
api?: GuardianApi.Api;
|
|
62
119
|
accountId: string;
|
|
63
120
|
appId: string;
|
|
64
121
|
settings: AccountSettings.Settings;
|
|
@@ -67,7 +124,7 @@ export declare namespace Account {
|
|
|
67
124
|
settings: AccountSettings.Settings;
|
|
68
125
|
}>;
|
|
69
126
|
/**
|
|
70
|
-
* Creates a new
|
|
127
|
+
* Creates a new Nextspace account using given details.
|
|
71
128
|
* @param params
|
|
72
129
|
* @returns
|
|
73
130
|
*/
|
|
@@ -6,8 +6,32 @@ type Type = AnnDocument.EType | string;
|
|
|
6
6
|
* Annotated documents are files with hotspots that can link to Entity records.
|
|
7
7
|
*/
|
|
8
8
|
export declare namespace AnnDocument {
|
|
9
|
+
/**
|
|
10
|
+
* Returns cache identifier for an annotated document by ID.
|
|
11
|
+
* Example: {
|
|
12
|
+
* const api: BruceApi.Api = ...;
|
|
13
|
+
* const key = GetCacheKey(1);
|
|
14
|
+
* api.Cache.Remove(key);
|
|
15
|
+
* }
|
|
16
|
+
* @param id
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
9
19
|
function GetCacheKey(id: number): string;
|
|
20
|
+
/**
|
|
21
|
+
* Returns cache identifier for a list of annotated documents by type.
|
|
22
|
+
* Example: {
|
|
23
|
+
* const api: BruceApi.Api = ...;
|
|
24
|
+
* const key = GetListCacheKey("SVG");
|
|
25
|
+
* api.Cache.Remove(key);
|
|
26
|
+
* }
|
|
27
|
+
* @param type
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
10
30
|
function GetListCacheKey(type: Type): string;
|
|
31
|
+
/**
|
|
32
|
+
* Describes a hotspot on an annotated document.
|
|
33
|
+
* Hotspots are areas of interest on the document that can be linked to Entity records.
|
|
34
|
+
*/
|
|
11
35
|
interface IHotspot {
|
|
12
36
|
X: number;
|
|
13
37
|
Y: number;
|
|
@@ -17,11 +41,17 @@ export declare namespace AnnDocument {
|
|
|
17
41
|
"Entity.ID": string;
|
|
18
42
|
};
|
|
19
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Describes settings for an annotated document.
|
|
46
|
+
*/
|
|
20
47
|
interface ISettings {
|
|
21
48
|
Hotspots?: IHotspot[];
|
|
22
49
|
DrawingScaleFactorX?: number;
|
|
23
50
|
DrawingScaleFactorY?: number;
|
|
24
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Describes an annotated document record.
|
|
54
|
+
*/
|
|
25
55
|
interface IDocument {
|
|
26
56
|
ID?: number;
|
|
27
57
|
Type: Type;
|
|
@@ -29,9 +59,17 @@ export declare namespace AnnDocument {
|
|
|
29
59
|
"ClientFile.ID": string;
|
|
30
60
|
Settings?: ISettings;
|
|
31
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The types of supported annotated documents.
|
|
64
|
+
*/
|
|
32
65
|
enum EType {
|
|
33
66
|
SVG = "SVG"
|
|
34
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Returns an annotated document by ID.
|
|
70
|
+
* @param params
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
35
73
|
function Get(params: {
|
|
36
74
|
api?: BruceApi.Api;
|
|
37
75
|
docId: number;
|
|
@@ -39,6 +77,11 @@ export declare namespace AnnDocument {
|
|
|
39
77
|
}): Promise<{
|
|
40
78
|
document: IDocument;
|
|
41
79
|
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Returns a list of annotated documents by type.
|
|
82
|
+
* @param params
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
42
85
|
function GetList(params: {
|
|
43
86
|
api?: BruceApi.Api;
|
|
44
87
|
docType?: Type;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CacheControl } from "../common/cache";
|
|
2
2
|
import { Api } from "./api";
|
|
3
3
|
/**
|
|
4
|
-
* This is a base class for communication with an arbitrary
|
|
4
|
+
* This is a base class for communication with an arbitrary Nextspace API.
|
|
5
5
|
*/
|
|
6
6
|
export declare class AbstractApi {
|
|
7
7
|
private ssidHeader;
|
|
@@ -12,25 +12,100 @@ export declare class AbstractApi {
|
|
|
12
12
|
ssidHeader?: string;
|
|
13
13
|
cacheId?: string;
|
|
14
14
|
});
|
|
15
|
+
/**
|
|
16
|
+
* Returns the base URL for the API.
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
15
19
|
GetBaseUrl(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Sets the base URL for the API.
|
|
22
|
+
* @param url
|
|
23
|
+
*/
|
|
16
24
|
SetBaseUrl(url: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Returns a cache item matching the provided key.
|
|
27
|
+
* If the reqParams specify that caching is disabled, null is returned.
|
|
28
|
+
* @param key
|
|
29
|
+
* @param reqParams
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
17
32
|
GetCacheItem(key: string, reqParams?: Api.IReqParams): {
|
|
18
33
|
data: any;
|
|
19
34
|
found: boolean;
|
|
20
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Sets a cache item matching the provided key.
|
|
38
|
+
* If the reqParams specify that caching is disabled, then no action is taken.
|
|
39
|
+
* @param params
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
21
42
|
SetCacheItem(params: {
|
|
22
43
|
key: string;
|
|
23
44
|
value: any;
|
|
24
45
|
duration?: number;
|
|
25
46
|
req?: Api.IReqParams;
|
|
26
47
|
}): void;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the session ID.
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
27
52
|
GetSessionId(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Sets the session ID.
|
|
55
|
+
* @param value
|
|
56
|
+
*/
|
|
28
57
|
SetSessionId(value: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the session header.
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
29
62
|
GetSessionHeader(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Sets the session header.
|
|
65
|
+
* @param value
|
|
66
|
+
*/
|
|
30
67
|
SetSessionHeader(value: string): void;
|
|
68
|
+
/**
|
|
69
|
+
* Performs a GET request.
|
|
70
|
+
* This will NOT prepend the base URL to the provided URL.
|
|
71
|
+
* @param url
|
|
72
|
+
* @param params
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
31
75
|
get(url: string, params?: Api.IReqParams): Promise<any>;
|
|
76
|
+
/**
|
|
77
|
+
* Performs a DELETE request.
|
|
78
|
+
* This will NOT prepend the base URL to the provided URL.
|
|
79
|
+
* @param url
|
|
80
|
+
* @param params
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
32
83
|
delete(url: string, params?: Api.IReqParams): Promise<any>;
|
|
84
|
+
/**
|
|
85
|
+
* Performs a POST request.
|
|
86
|
+
* This will NOT prepend the base URL to the provided URL.
|
|
87
|
+
* @param url
|
|
88
|
+
* @param data
|
|
89
|
+
* @param params
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
33
92
|
post(url: string, data: any, params?: Api.IReqParams): Promise<any>;
|
|
93
|
+
/**
|
|
94
|
+
* Performs a PUT request.
|
|
95
|
+
* This will NOT prepend the base URL to the provided URL.
|
|
96
|
+
* @param url
|
|
97
|
+
* @param data
|
|
98
|
+
* @param params
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
34
101
|
put(url: string, data: any, params?: Api.IReqParams): Promise<any>;
|
|
102
|
+
/**
|
|
103
|
+
* Performs a file upload (POST) request.
|
|
104
|
+
* This will NOT prepend the base URL to the provided URL.
|
|
105
|
+
* @param url
|
|
106
|
+
* @param blob
|
|
107
|
+
* @param params
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
35
110
|
upload(url: string, blob: Blob, params?: Api.IUploadReqParams): Promise<any>;
|
|
36
111
|
}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import { Api } from "./api";
|
|
2
2
|
import { BruceApi } from "./bruce-api";
|
|
3
|
-
import { CamApi } from "./cam-api";
|
|
4
3
|
import { GlobalApi } from "./global-api";
|
|
5
4
|
import { GuardianApi } from "./guardian-api";
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Utility for managing multiple API instances.
|
|
7
|
+
* Example: {
|
|
8
|
+
* const api = new ApiGetters({
|
|
9
|
+
* accountId: "123",
|
|
10
|
+
* env: Api.EEnv.PROD
|
|
11
|
+
* });
|
|
12
|
+
*
|
|
13
|
+
* // Returns default API instance specified in constructor.
|
|
14
|
+
* const bruce1 = api.GetBruceApi();
|
|
15
|
+
* // Returns API instance for account 456.
|
|
16
|
+
* const bruce2 = api.GetBruceApi({
|
|
17
|
+
* accountId: "456"
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* const global = api.GetGlobalApi();
|
|
21
|
+
* const guardian = api.GetGuardianApi();
|
|
22
|
+
* }
|
|
23
|
+
*/
|
|
7
24
|
export declare class ApiGetters {
|
|
8
25
|
private bruce;
|
|
9
|
-
private idm;
|
|
10
|
-
private cam;
|
|
11
26
|
private guardian;
|
|
12
27
|
private global;
|
|
13
28
|
private accountId;
|
|
@@ -18,48 +33,71 @@ export declare class ApiGetters {
|
|
|
18
33
|
env?: Api.EEnv;
|
|
19
34
|
sessionId?: string;
|
|
20
35
|
});
|
|
36
|
+
/**
|
|
37
|
+
* Clears all cache items in all API instances.
|
|
38
|
+
*/
|
|
21
39
|
ClearCache(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the default account ID to use when one is unspecified.
|
|
42
|
+
* @param accountId
|
|
43
|
+
*/
|
|
22
44
|
SetAccountId(accountId: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the default account ID to use when one is unspecified.
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
23
49
|
GetAccountId(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Sets the default environment to use when one is unspecified.
|
|
52
|
+
* @param env
|
|
53
|
+
*/
|
|
24
54
|
SetEnv(env: Api.EEnv): void;
|
|
55
|
+
/**
|
|
56
|
+
* Returns the default environment to use when one is unspecified.
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
25
59
|
GetEnv(): Api.EEnv;
|
|
60
|
+
/**
|
|
61
|
+
* Updates the session ID for all API instances.
|
|
62
|
+
* This will auto-clear all cache items.
|
|
63
|
+
* @param sessionId
|
|
64
|
+
*/
|
|
26
65
|
SetSessionId(sessionId: string): void;
|
|
27
|
-
GetSessionId(): string;
|
|
28
|
-
GetBruceApi(params?: {
|
|
29
|
-
accountId?: string;
|
|
30
|
-
env?: Api.EEnv;
|
|
31
|
-
}): BruceApi.Api;
|
|
32
|
-
GetBruceGetter(): BruceApi.IGetter;
|
|
33
66
|
/**
|
|
34
|
-
*
|
|
67
|
+
* Returns the session ID.
|
|
35
68
|
* @returns
|
|
36
69
|
*/
|
|
37
|
-
|
|
38
|
-
env?: Api.EEnv;
|
|
39
|
-
}): IdmApi.Api;
|
|
70
|
+
GetSessionId(): string;
|
|
40
71
|
/**
|
|
41
|
-
*
|
|
72
|
+
* Returns a BruceApi instance.
|
|
73
|
+
* @param params
|
|
42
74
|
* @returns
|
|
43
75
|
*/
|
|
44
|
-
|
|
76
|
+
GetBruceApi(params?: {
|
|
77
|
+
accountId?: string;
|
|
78
|
+
env?: Api.EEnv;
|
|
79
|
+
}): BruceApi.Api;
|
|
45
80
|
/**
|
|
46
|
-
*
|
|
81
|
+
* Returns a BruceApi getter instance.
|
|
82
|
+
* This is a micro-utility that is used to request the bruce-api specifically for various client accounts.
|
|
83
|
+
* @deprecated: use the full api-getters instance instead.
|
|
47
84
|
* @returns
|
|
48
85
|
*/
|
|
49
|
-
|
|
50
|
-
env?: Api.EEnv;
|
|
51
|
-
}): CamApi.Api;
|
|
86
|
+
GetBruceGetter(): BruceApi.IGetter;
|
|
52
87
|
/**
|
|
53
|
-
*
|
|
88
|
+
* Returns a GlobalApi instance.
|
|
89
|
+
* @param params
|
|
54
90
|
* @returns
|
|
55
91
|
*/
|
|
56
|
-
GetCamGetter(): CamApi.IGetter;
|
|
57
92
|
GetGlobalApi(params?: {
|
|
58
93
|
env?: Api.EEnv;
|
|
59
94
|
}): GlobalApi.Api;
|
|
60
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Returns a GuardianApi instance.
|
|
97
|
+
* @param params
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
61
100
|
GetGuardianApi(params?: {
|
|
62
101
|
env?: Api.EEnv;
|
|
63
102
|
}): GuardianApi.Api;
|
|
64
|
-
GetGuardianGetter(): GuardianApi.IGetter;
|
|
65
103
|
}
|