bruce-models 3.2.0 → 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.
Files changed (195) hide show
  1. package/dist/bruce-models.es5.js +2670 -838
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +2606 -803
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account-invite.js +40 -1
  6. package/dist/lib/account/account-invite.js.map +1 -1
  7. package/dist/lib/account/account.js +60 -5
  8. package/dist/lib/account/account.js.map +1 -1
  9. package/dist/lib/ann-document/ann-document.js +36 -3
  10. package/dist/lib/ann-document/ann-document.js.map +1 -1
  11. package/dist/lib/api/abstract-api.js +78 -1
  12. package/dist/lib/api/abstract-api.js.map +1 -1
  13. package/dist/lib/api/api-getters.js +68 -94
  14. package/dist/lib/api/api-getters.js.map +1 -1
  15. package/dist/lib/api/api.js +20 -3
  16. package/dist/lib/api/api.js.map +1 -1
  17. package/dist/lib/api/bruce-api.js +68 -27
  18. package/dist/lib/api/bruce-api.js.map +1 -1
  19. package/dist/lib/api/global-api.js +46 -4
  20. package/dist/lib/api/global-api.js.map +1 -1
  21. package/dist/lib/api/guardian-api.js +42 -1
  22. package/dist/lib/api/guardian-api.js.map +1 -1
  23. package/dist/lib/bruce-models.js +1 -3
  24. package/dist/lib/bruce-models.js.map +1 -1
  25. package/dist/lib/calculator/calculator.js +42 -1
  26. package/dist/lib/calculator/calculator.js.map +1 -1
  27. package/dist/lib/client-file/client-file.js +71 -7
  28. package/dist/lib/client-file/client-file.js.map +1 -1
  29. package/dist/lib/common/bounds.js +1 -1
  30. package/dist/lib/common/bounds.js.map +1 -1
  31. package/dist/lib/common/bruce-event.js +19 -0
  32. package/dist/lib/common/bruce-event.js.map +1 -1
  33. package/dist/lib/common/bruce-variable.js +5 -0
  34. package/dist/lib/common/bruce-variable.js.map +1 -1
  35. package/dist/lib/common/color-css-defaults.js +157 -0
  36. package/dist/lib/common/color-css-defaults.js.map +1 -0
  37. package/dist/lib/common/color.js +18 -4
  38. package/dist/lib/common/color.js.map +1 -1
  39. package/dist/lib/common/delay-queue.js +7 -0
  40. package/dist/lib/common/delay-queue.js.map +1 -1
  41. package/dist/lib/common/geometry.js +5 -0
  42. package/dist/lib/common/geometry.js.map +1 -1
  43. package/dist/lib/common/lru-cache.js +14 -0
  44. package/dist/lib/common/lru-cache.js.map +1 -1
  45. package/dist/lib/custom-form/custom-form.js +49 -7
  46. package/dist/lib/custom-form/custom-form.js.map +1 -1
  47. package/dist/lib/data-lab/data-lab.js +10 -0
  48. package/dist/lib/data-lab/data-lab.js.map +1 -1
  49. package/dist/lib/data-source/data-source.js +41 -0
  50. package/dist/lib/data-source/data-source.js.map +1 -1
  51. package/dist/lib/entity/entity-attachment-type.js +37 -1
  52. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  53. package/dist/lib/entity/entity-attachment.js +65 -18
  54. package/dist/lib/entity/entity-attachment.js.map +1 -1
  55. package/dist/lib/entity/entity-attribute.js +17 -1
  56. package/dist/lib/entity/entity-attribute.js.map +1 -1
  57. package/dist/lib/entity/entity-comment.js +44 -7
  58. package/dist/lib/entity/entity-comment.js.map +1 -1
  59. package/dist/lib/entity/entity-coords.js +38 -0
  60. package/dist/lib/entity/entity-coords.js.map +1 -1
  61. package/dist/lib/entity/entity-link.js +45 -11
  62. package/dist/lib/entity/entity-link.js.map +1 -1
  63. package/dist/lib/entity/entity-lod-category.js +52 -9
  64. package/dist/lib/entity/entity-lod-category.js.map +1 -1
  65. package/dist/lib/entity/entity-lod.js +78 -16
  66. package/dist/lib/entity/entity-lod.js.map +1 -1
  67. package/dist/lib/entity/entity-relation-type.js +48 -10
  68. package/dist/lib/entity/entity-relation-type.js.map +1 -1
  69. package/dist/lib/entity/entity-relation.js +69 -16
  70. package/dist/lib/entity/entity-relation.js.map +1 -1
  71. package/dist/lib/entity/entity-source.js +56 -15
  72. package/dist/lib/entity/entity-source.js.map +1 -1
  73. package/dist/lib/entity/entity-tag.js +56 -10
  74. package/dist/lib/entity/entity-tag.js.map +1 -1
  75. package/dist/lib/entity/entity-type-visual-settings.js +4 -0
  76. package/dist/lib/entity/entity-type-visual-settings.js.map +1 -1
  77. package/dist/lib/entity/entity-type.js +45 -7
  78. package/dist/lib/entity/entity-type.js.map +1 -1
  79. package/dist/lib/entity/entity.js +122 -18
  80. package/dist/lib/entity/entity.js.map +1 -1
  81. package/dist/lib/environment.js +12 -0
  82. package/dist/lib/environment.js.map +1 -1
  83. package/dist/lib/import/imported-file.js +53 -0
  84. package/dist/lib/import/imported-file.js.map +1 -1
  85. package/dist/lib/internal/uploader.js +8 -0
  86. package/dist/lib/internal/uploader.js.map +1 -1
  87. package/dist/lib/markup/markup.js +1 -1
  88. package/dist/lib/markup/markup.js.map +1 -1
  89. package/dist/lib/plugin/plugin.js +51 -9
  90. package/dist/lib/plugin/plugin.js.map +1 -1
  91. package/dist/lib/program-key/program-key.js +55 -10
  92. package/dist/lib/program-key/program-key.js.map +1 -1
  93. package/dist/lib/project/menu-item.js +22 -0
  94. package/dist/lib/project/menu-item.js.map +1 -1
  95. package/dist/lib/project/project-view-bookmark.js +55 -11
  96. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  97. package/dist/lib/project/project-view-tile.js +9 -0
  98. package/dist/lib/project/project-view-tile.js.map +1 -1
  99. package/dist/lib/project/project-view.js +45 -7
  100. package/dist/lib/project/project-view.js.map +1 -1
  101. package/dist/lib/project/zoom-control.js +7 -0
  102. package/dist/lib/project/zoom-control.js.map +1 -1
  103. package/dist/lib/server/hosting-location.js +30 -9
  104. package/dist/lib/server/hosting-location.js.map +1 -1
  105. package/dist/lib/server/message-broker.js +3 -0
  106. package/dist/lib/server/message-broker.js.map +1 -1
  107. package/dist/lib/server/pending-action.js +25 -4
  108. package/dist/lib/server/pending-action.js.map +1 -1
  109. package/dist/lib/server/task.js +17 -0
  110. package/dist/lib/server/task.js.map +1 -1
  111. package/dist/lib/style/style.js +56 -7
  112. package/dist/lib/style/style.js.map +1 -1
  113. package/dist/lib/tileset/tileset.js +128 -34
  114. package/dist/lib/tileset/tileset.js.map +1 -1
  115. package/dist/lib/user/permission.js +20 -0
  116. package/dist/lib/user/permission.js.map +1 -1
  117. package/dist/lib/user/session.js +46 -1
  118. package/dist/lib/user/session.js.map +1 -1
  119. package/dist/lib/user/user-group.js +49 -19
  120. package/dist/lib/user/user-group.js.map +1 -1
  121. package/dist/lib/user/user.js +134 -37
  122. package/dist/lib/user/user.js.map +1 -1
  123. package/dist/lib/util/path-utils.js +16 -1
  124. package/dist/lib/util/path-utils.js.map +1 -1
  125. package/dist/lib/util/url-utils.js +12 -85
  126. package/dist/lib/util/url-utils.js.map +1 -1
  127. package/dist/types/account/account-invite.d.ts +44 -8
  128. package/dist/types/account/account-settings.d.ts +3 -0
  129. package/dist/types/account/account.d.ts +68 -11
  130. package/dist/types/ann-document/ann-document.d.ts +43 -0
  131. package/dist/types/api/abstract-api.d.ts +76 -1
  132. package/dist/types/api/api-getters.d.ts +62 -24
  133. package/dist/types/api/api.d.ts +19 -4
  134. package/dist/types/api/bruce-api.d.ts +48 -4
  135. package/dist/types/api/global-api.d.ts +46 -8
  136. package/dist/types/api/guardian-api.d.ts +42 -5
  137. package/dist/types/bruce-models.d.ts +1 -3
  138. package/dist/types/calculator/calculator.d.ts +57 -1
  139. package/dist/types/client-file/client-file.d.ts +69 -6
  140. package/dist/types/common/bounds.d.ts +3 -3
  141. package/dist/types/common/bruce-event.d.ts +19 -0
  142. package/dist/types/common/color-css-defaults.d.ts +153 -0
  143. package/dist/types/common/color.d.ts +6 -1
  144. package/dist/types/common/delay-queue.d.ts +7 -0
  145. package/dist/types/common/geometry.d.ts +5 -0
  146. package/dist/types/common/lru-cache.d.ts +14 -0
  147. package/dist/types/custom-form/custom-form-content.d.ts +3 -0
  148. package/dist/types/custom-form/custom-form.d.ts +46 -1
  149. package/dist/types/data-lab/data-lab.d.ts +10 -0
  150. package/dist/types/data-source/data-source.d.ts +41 -0
  151. package/dist/types/entity/entity-attachment-type.d.ts +38 -1
  152. package/dist/types/entity/entity-attachment.d.ts +49 -2
  153. package/dist/types/entity/entity-attribute.d.ts +31 -12
  154. package/dist/types/entity/entity-comment.d.ts +41 -1
  155. package/dist/types/entity/entity-coords.d.ts +54 -1
  156. package/dist/types/entity/entity-link.d.ts +39 -2
  157. package/dist/types/entity/entity-lod-category.d.ts +46 -0
  158. package/dist/types/entity/entity-lod.d.ts +72 -1
  159. package/dist/types/entity/entity-relation-type.d.ts +42 -1
  160. package/dist/types/entity/entity-relation.d.ts +57 -1
  161. package/dist/types/entity/entity-source.d.ts +38 -4
  162. package/dist/types/entity/entity-tag.d.ts +48 -1
  163. package/dist/types/entity/entity-type-visual-settings.d.ts +4 -0
  164. package/dist/types/entity/entity-type.d.ts +45 -4
  165. package/dist/types/entity/entity.d.ts +89 -3
  166. package/dist/types/environment.d.ts +9 -0
  167. package/dist/types/import/imported-file.d.ts +64 -8
  168. package/dist/types/internal/uploader.d.ts +8 -0
  169. package/dist/types/markup/markup.d.ts +7 -1
  170. package/dist/types/plugin/plugin.d.ts +45 -0
  171. package/dist/types/program-key/program-key.d.ts +45 -1
  172. package/dist/types/project/menu-item.d.ts +73 -1
  173. package/dist/types/project/project-view-bookmark.d.ts +64 -2
  174. package/dist/types/project/project-view-tile.d.ts +30 -0
  175. package/dist/types/project/project-view.d.ts +52 -2
  176. package/dist/types/project/zoom-control.d.ts +7 -0
  177. package/dist/types/server/hosting-location.d.ts +24 -0
  178. package/dist/types/server/message-broker.d.ts +3 -0
  179. package/dist/types/server/pending-action.d.ts +28 -1
  180. package/dist/types/server/task.d.ts +20 -0
  181. package/dist/types/style/style.d.ts +69 -2
  182. package/dist/types/tileset/tileset.d.ts +92 -1
  183. package/dist/types/user/permission.d.ts +11 -0
  184. package/dist/types/user/session.d.ts +48 -5
  185. package/dist/types/user/user-group.d.ts +40 -8
  186. package/dist/types/user/user.d.ts +117 -17
  187. package/dist/types/util/path-utils.d.ts +16 -1
  188. package/dist/types/util/url-utils.d.ts +5 -22
  189. package/package.json +1 -1
  190. package/dist/lib/api/cam-api.js +0 -84
  191. package/dist/lib/api/cam-api.js.map +0 -1
  192. package/dist/lib/api/idm-api.js +0 -86
  193. package/dist/lib/api/idm-api.js.map +0 -1
  194. package/dist/types/api/cam-api.d.ts +0 -26
  195. 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
- * Helper to get and set url params for a given window.
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
- class Handler {
29
- get window() {
30
- return this._window;
31
- }
32
- get document() {
33
- var _a;
34
- return (_a = this.window) === null || _a === void 0 ? void 0 : _a.document;
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.Handler = Handler;
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":";;;AAEA;;GAEG;AACH,IAAiB,QAAQ,CA8FxB;AA9FD,WAAiB,QAAQ;IACrB,SAAgB,cAAc,CAAC,GAAa;QACxC,MAAM,EAAE,GAAQ,EAAE,CAAC;QACnB,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,EAAE,IAAI,CAAC,EAAE;YACT,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,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AAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;qBAChC;iBACJ;aACJ;YACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;gBACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAO,IAAI,EAAE,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aAC3E;iBACI;gBACD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAO,IAAI,EAAE,EAAE,CAAC,CAAC;aACvD;QACL,CAAC;KACJ;IAzEY,gBAAO,UAyEnB,CAAA;AACL,CAAC,EA9FgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA8FxB"}
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
- SMS = "SMS",
27
- Manual = "Manual"
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?: IdmApi.Api | GuardianApi.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?: IdmApi.Api | GuardianApi.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?: IdmApi.Api | GuardianApi.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?: IdmApi.Api | GuardianApi.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,3 +1,6 @@
1
+ /**
2
+ * Account settings are arbitrary JSON blobs for storing settings for particular applications.
3
+ */
1
4
  export declare namespace AccountSettings {
2
5
  type Settings = IBruceApi | INavigator | any;
3
6
  interface IBruceApi {
@@ -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 Bruce.
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
- "ClientAccount.ID"?: string;
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?: CamApi.Api | GuardianApi.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?: IdmApi.Api | GuardianApi.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?: CamApi.Api | GuardianApi.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?: CamApi.Api | GuardianApi.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 Bruce account using given details.
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 Bruce Api.
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
- import { IdmApi } from "./idm-api";
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
- * Deprecated: Use GetGuardianApi instead.
67
+ * Returns the session ID.
35
68
  * @returns
36
69
  */
37
- GetIdmApi(params?: {
38
- env?: Api.EEnv;
39
- }): IdmApi.Api;
70
+ GetSessionId(): string;
40
71
  /**
41
- * Deprecated: Use GetGuardianGetter instead.
72
+ * Returns a BruceApi instance.
73
+ * @param params
42
74
  * @returns
43
75
  */
44
- GetIdmGetter(): IdmApi.IGetter;
76
+ GetBruceApi(params?: {
77
+ accountId?: string;
78
+ env?: Api.EEnv;
79
+ }): BruceApi.Api;
45
80
  /**
46
- * Deprecated: Use GetGuardianApi instead.
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
- GetCamApi(params?: {
50
- env?: Api.EEnv;
51
- }): CamApi.Api;
86
+ GetBruceGetter(): BruceApi.IGetter;
52
87
  /**
53
- * Deprecated: Use GetGuardianGetter instead.
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
- GetGlobalGetter(): GlobalApi.IGetter;
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
  }