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
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Dictionary of CSS color names and their hex values.
3
+ */
4
+ export declare const COLOR_CSS_DEFAULTS: {
5
+ aliceblue: string;
6
+ antiquewhite: string;
7
+ aqua: string;
8
+ aquamarine: string;
9
+ azure: string;
10
+ beige: string;
11
+ bisque: string;
12
+ black: string;
13
+ blanchedalmond: string;
14
+ blue: string;
15
+ blueviolet: string;
16
+ brown: string;
17
+ burlywood: string;
18
+ cadetblue: string;
19
+ chartreuse: string;
20
+ chocolate: string;
21
+ coral: string;
22
+ cornflowerblue: string;
23
+ cornsilk: string;
24
+ crimson: string;
25
+ cyan: string;
26
+ darkblue: string;
27
+ darkcyan: string;
28
+ darkgoldenrod: string;
29
+ darkgray: string;
30
+ darkgreen: string;
31
+ darkgrey: string;
32
+ darkkhaki: string;
33
+ darkmagenta: string;
34
+ darkolivegreen: string;
35
+ darkorange: string;
36
+ darkorchid: string;
37
+ darkred: string;
38
+ darksalmon: string;
39
+ darkseagreen: string;
40
+ darkslateblue: string;
41
+ darkslategray: string;
42
+ darkslategrey: string;
43
+ darkturquoise: string;
44
+ darkviolet: string;
45
+ deeppink: string;
46
+ deepskyblue: string;
47
+ dimgray: string;
48
+ dimgrey: string;
49
+ dodgerblue: string;
50
+ firebrick: string;
51
+ floralwhite: string;
52
+ forestgreen: string;
53
+ fuchsia: string;
54
+ gainsboro: string;
55
+ ghostwhite: string;
56
+ gold: string;
57
+ goldenrod: string;
58
+ gray: string;
59
+ green: string;
60
+ greenyellow: string;
61
+ grey: string;
62
+ honeydew: string;
63
+ hotpink: string;
64
+ indianred: string;
65
+ indigo: string;
66
+ ivory: string;
67
+ khaki: string;
68
+ lavender: string;
69
+ lavenderblush: string;
70
+ lawngreen: string;
71
+ lemonchiffon: string;
72
+ lightblue: string;
73
+ lightcoral: string;
74
+ lightcyan: string;
75
+ lightgoldenrodyellow: string;
76
+ lightgray: string;
77
+ lightgreen: string;
78
+ lightgrey: string;
79
+ lightpink: string;
80
+ lightsalmon: string;
81
+ lightseagreen: string;
82
+ lightskyblue: string;
83
+ lightslategray: string;
84
+ lightslategrey: string;
85
+ lightsteelblue: string;
86
+ lightyellow: string;
87
+ lime: string;
88
+ limegreen: string;
89
+ linen: string;
90
+ magenta: string;
91
+ maroon: string;
92
+ mediumaquamarine: string;
93
+ mediumblue: string;
94
+ mediumorchid: string;
95
+ mediumpurple: string;
96
+ mediumseagreen: string;
97
+ mediumslateblue: string;
98
+ mediumspringgreen: string;
99
+ mediumturquoise: string;
100
+ mediumvioletred: string;
101
+ midnightblue: string;
102
+ mintcream: string;
103
+ mistyrose: string;
104
+ moccasin: string;
105
+ navajowhite: string;
106
+ navy: string;
107
+ oldlace: string;
108
+ olive: string;
109
+ olivedrab: string;
110
+ orange: string;
111
+ orangered: string;
112
+ orchid: string;
113
+ palegoldenrod: string;
114
+ palegreen: string;
115
+ paleturquoise: string;
116
+ palevioletred: string;
117
+ papayawhip: string;
118
+ peachpuff: string;
119
+ peru: string;
120
+ pink: string;
121
+ plum: string;
122
+ powderblue: string;
123
+ purple: string;
124
+ rebeccapurple: string;
125
+ red: string;
126
+ rosybrown: string;
127
+ royalblue: string;
128
+ saddlebrown: string;
129
+ salmon: string;
130
+ sandybrown: string;
131
+ seagreen: string;
132
+ seashell: string;
133
+ sienna: string;
134
+ silver: string;
135
+ skyblue: string;
136
+ slateblue: string;
137
+ slategray: string;
138
+ slategrey: string;
139
+ snow: string;
140
+ springgreen: string;
141
+ steelblue: string;
142
+ tan: string;
143
+ teal: string;
144
+ thistle: string;
145
+ tomato: string;
146
+ turquoise: string;
147
+ violet: string;
148
+ wheat: string;
149
+ white: string;
150
+ whitesmoke: string;
151
+ yellow: string;
152
+ yellowgreen: string;
153
+ };
@@ -5,6 +5,10 @@ export declare namespace Color {
5
5
  blue: number;
6
6
  alpha: number;
7
7
  }
8
+ /**
9
+ * Setting for how a colour should be applied in certain contexts.
10
+ * For example should a 3D model's colour be replaced or blended with?
11
+ */
8
12
  enum EBlendMode {
9
13
  HIGHLIGHT = 0,
10
14
  REPLACE = 1,
@@ -16,7 +20,8 @@ export declare namespace Color {
16
20
  }
17
21
  function RandomColor(): IColor;
18
22
  /**
19
- * Attempts to parse a given color string into a model.
23
+ * Attempts to parse a given css-color.
24
+ * On failure null is returned.
20
25
  * @param str
21
26
  * @returns
22
27
  */
@@ -8,7 +8,14 @@ export declare class DelayQueue {
8
8
  private lastCallTime;
9
9
  private delayTimeout;
10
10
  constructor(callback: () => void, delay?: number);
11
+ /**
12
+ * Request a call on the callback.
13
+ * @param force If true, the callback will be called immediately.
14
+ */
11
15
  Call(force?: boolean): void;
12
16
  private doCall;
17
+ /**
18
+ * Dispose of this object.
19
+ */
13
20
  Dispose(): void;
14
21
  }
@@ -33,6 +33,11 @@ export declare namespace Geometry {
33
33
  * @returns
34
34
  */
35
35
  function RemoveRepeatPoints(positions: Carto.ICarto[]): Carto.ICarto[];
36
+ /**
37
+ * Parses a string of points into an array of points.
38
+ * @param pointsStr
39
+ * @returns
40
+ */
36
41
  function ParsePoints(pointsStr: string): Carto.ICarto[];
37
42
  /**
38
43
  * Parses both string and object Bruce geometry.
@@ -1,8 +1,22 @@
1
+ /**
2
+ * A simple LRU cache implementation.
3
+ * LRU cache is a cache that evicts the least recently used item when it is full.
4
+ */
1
5
  export declare class LRUCache<TKey, TValue> {
2
6
  private readonly capacity;
3
7
  private readonly cache;
4
8
  constructor(capacity: number);
9
+ /**
10
+ * Get a value from the cache.
11
+ * @param key
12
+ * @returns
13
+ */
5
14
  Get(key: TKey): TValue | undefined;
15
+ /**
16
+ * Set a value in the cache.
17
+ * @param key
18
+ * @param value
19
+ */
6
20
  Set(key: TKey, value: TValue): void;
7
21
  Entries(): IterableIterator<[TKey, TValue]>;
8
22
  Clear(): void;
@@ -10,6 +10,9 @@ export declare namespace CustomFormContent {
10
10
  includeTitle?: boolean;
11
11
  includeTools?: boolean;
12
12
  }
13
+ /**
14
+ * A stack item is a single component that is displayed in the stack.
15
+ */
13
16
  interface IStackItem {
14
17
  component: Component;
15
18
  params: StackItemParams;
@@ -2,12 +2,35 @@ import { Api } from "../api/api";
2
2
  import { BruceApi } from "../api/bruce-api";
3
3
  import { CustomFormContent } from "./custom-form-content";
4
4
  /**
5
- * Describes the "Custom Form" concept within Bruce.
5
+ * Describes the "Custom Form" concept within Nextspace.
6
6
  * Custom forms are dynamic dialogs that get populated with Entity data.
7
7
  */
8
8
  export declare namespace CustomForm {
9
+ /**
10
+ * Returns cache identifier for a Custom Form 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 Custom Forms by Entity Type ID.
22
+ * Example: {
23
+ * const api: BruceApi.Api = ...;
24
+ * const key = GetListCacheKey("123");
25
+ * api.Cache.Remove(key);
26
+ * }
27
+ * @param typeId
28
+ * @returns
29
+ */
10
30
  function GetListCacheKey(typeId: string): string;
31
+ /**
32
+ * Describes a custom form record.
33
+ */
11
34
  interface IForm {
12
35
  ID?: number;
13
36
  "EntityType.ID"?: string;
@@ -15,11 +38,19 @@ export declare namespace CustomForm {
15
38
  Settings?: CustomFormContent.IContent | any;
16
39
  Type?: EType;
17
40
  }
41
+ /**
42
+ * Types of custom forms available.
43
+ */
18
44
  enum EType {
19
45
  Form = "GENERIC",
20
46
  Markup = "MARKUP",
21
47
  ComponentStack = "COMPONENT_STACK"
22
48
  }
49
+ /**
50
+ * Gets a custom form by ID.
51
+ * @param params
52
+ * @returns
53
+ */
23
54
  function Get(params: {
24
55
  api?: BruceApi.Api;
25
56
  formId: number;
@@ -27,11 +58,20 @@ export declare namespace CustomForm {
27
58
  }): Promise<{
28
59
  form: IForm;
29
60
  }>;
61
+ /**
62
+ * Deletes a custom form by ID.
63
+ * @param params
64
+ */
30
65
  function Delete(params: {
31
66
  api?: BruceApi.Api;
32
67
  formId: number;
33
68
  req?: Api.IReqParams;
34
69
  }): Promise<void>;
70
+ /**
71
+ * Gets a list of custom forms by entity type ID.
72
+ * @param params
73
+ * @returns
74
+ */
35
75
  function GetList(params: {
36
76
  api?: BruceApi.Api;
37
77
  entityTypeId: string;
@@ -39,6 +79,11 @@ export declare namespace CustomForm {
39
79
  }): Promise<{
40
80
  forms: IForm[];
41
81
  }>;
82
+ /**
83
+ * Creates or updates a custom form record.
84
+ * @param params
85
+ * @returns
86
+ */
42
87
  function Update(params: {
43
88
  api?: BruceApi.Api;
44
89
  form: IForm;
@@ -1,6 +1,11 @@
1
1
  import { Api } from "../api/api";
2
2
  import { BruceApi } from "../api/bruce-api";
3
3
  import { Entity as E } from "../entity/entity";
4
+ /**
5
+ * Describes the "Data Lab" concept within Nextspace.
6
+ * Data lab is a query tool that allows users to search for entities.
7
+ * Data lab queries can be saved for reuse.
8
+ */
4
9
  export declare namespace DataLab {
5
10
  enum EReqKey {
6
11
  Primary = "PrimarySelection",
@@ -15,6 +20,11 @@ export declare namespace DataLab {
15
20
  PrimaryEntityTypeID?: string;
16
21
  PrimaryEntityID?: string;
17
22
  }
23
+ /**
24
+ * Runs a DataLab query.
25
+ * @param params
26
+ * @returns
27
+ */
18
28
  function Run(params: {
19
29
  api?: BruceApi.Api;
20
30
  query: IQuery;
@@ -2,8 +2,30 @@ import { Api } from "../api/api";
2
2
  import { BruceApi } from "../api/bruce-api";
3
3
  import { EntityAttribute } from "../entity/entity-attribute";
4
4
  export declare namespace DataSource {
5
+ /**
6
+ * Returns cache identifier for a data source by ID.
7
+ * Example: {
8
+ * const api: BruceApi.Api = ...;
9
+ * const key = GetCacheKey(1);
10
+ * api.Cache.Remove(key);
11
+ * }
12
+ * @param id
13
+ * @returns
14
+ */
5
15
  function GetCacheKey(id: number): string;
16
+ /**
17
+ * Returns cache identifier for a list of data sources.
18
+ * Example: {
19
+ * const api: BruceApi.Api = ...;
20
+ * const key = GetListCacheKey();
21
+ * api.Cache.Remove(key);
22
+ * }
23
+ * @returns
24
+ */
6
25
  function GetListCacheKey(): string;
26
+ /**
27
+ * Describes a data source record.
28
+ */
7
29
  interface ISource {
8
30
  ID?: number;
9
31
  Name: string;
@@ -20,6 +42,11 @@ export declare namespace DataSource {
20
42
  IDMapping = "IDMapping"
21
43
  }
22
44
  type Type = EType | string;
45
+ /**
46
+ * Creates or updates a data source.
47
+ * @param params
48
+ * @returns
49
+ */
23
50
  function Update(params: {
24
51
  source: ISource;
25
52
  api?: BruceApi.Api;
@@ -27,16 +54,30 @@ export declare namespace DataSource {
27
54
  }): Promise<{
28
55
  source: any;
29
56
  }>;
57
+ /**
58
+ * Deletes a data source.
59
+ * @param params
60
+ */
30
61
  function Delete(params: {
31
62
  id: number;
32
63
  api?: BruceApi.Api;
33
64
  req?: Api.IReqParams;
34
65
  }): Promise<void>;
66
+ /**
67
+ * Gets a data source by ID.
68
+ * @param params
69
+ * @returns
70
+ */
35
71
  function Get(params: {
36
72
  id: number;
37
73
  api?: BruceApi.Api;
38
74
  req?: Api.IReqParams;
39
75
  }): Promise<any>;
76
+ /**
77
+ * Gets a list of data sources.
78
+ * @param params
79
+ * @returns
80
+ */
40
81
  function GetList(params: {
41
82
  api?: BruceApi.Api;
42
83
  req?: Api.IReqParams;
@@ -2,12 +2,35 @@ import { Api } from "../api/api";
2
2
  import { BruceApi } from "../api/bruce-api";
3
3
  type Type = EntityAttachmentType.EType | string;
4
4
  /**
5
- * Describes the "Entity Attachment Type" concept within Bruce.
5
+ * Describes the "Entity Attachment Type" concept within Nextspace.
6
6
  * It is a record that describes the purpose of an attachment.
7
7
  */
8
8
  export declare namespace EntityAttachmentType {
9
+ /**
10
+ * Returns cache identifier for an attachment type by ID.
11
+ * Example: {
12
+ * const api: BruceApi.Api = ...;
13
+ * const key = GetCacheKey("123");
14
+ * api.Cache.Remove(key);
15
+ * }
16
+ * @param id
17
+ * @returns
18
+ */
9
19
  function GetCacheKey(id: Type): string;
20
+ /**
21
+ * Returns cache identifier for a list of attachment types.
22
+ * Example: {
23
+ * const api: BruceApi.Api = ...;
24
+ * const key = GetListCacheKey();
25
+ * api.Cache.Remove(key);
26
+ * }
27
+ * @param typeId
28
+ * @returns
29
+ */
10
30
  function GetListCacheKey(): string;
31
+ /**
32
+ * Describes an attachment type record.
33
+ */
11
34
  interface IType {
12
35
  Description: string;
13
36
  ID: string | EType;
@@ -17,11 +40,20 @@ export declare namespace EntityAttachmentType {
17
40
  Photo = "photo",
18
41
  Document = "document"
19
42
  }
43
+ /**
44
+ * Deletes an attachment type.
45
+ * @param params
46
+ */
20
47
  function Delete(params: {
21
48
  api?: BruceApi.Api;
22
49
  attachmentTypeId: Type;
23
50
  req?: Api.IReqParams;
24
51
  }): Promise<void>;
52
+ /**
53
+ * Creates or updates an attachment type.
54
+ * @param params
55
+ * @returns
56
+ */
25
57
  function Update(params: {
26
58
  api?: BruceApi.Api;
27
59
  attachmentType: IType;
@@ -29,6 +61,11 @@ export declare namespace EntityAttachmentType {
29
61
  }): Promise<{
30
62
  attachmentType: IType;
31
63
  }>;
64
+ /**
65
+ * Gets a list of all attachment types.
66
+ * @param params
67
+ * @returns
68
+ */
32
69
  function GetList(params: {
33
70
  api?: BruceApi.Api;
34
71
  reqParams?: Api.IReqParams;
@@ -4,22 +4,50 @@ import { ClientFile } from "../client-file/client-file";
4
4
  import { EntityAttachmentType } from "./entity-attachment-type";
5
5
  type Type = EntityAttachmentType.EType | string;
6
6
  /**
7
- * Describes the "Entity Attachment" concept within Bruce.
7
+ * Describes the "Entity Attachment" concept within Nextspace.
8
8
  * An entity attachment is an arbitrary file record that is linked to an entity record.
9
9
  * The same file can be attached to multiple entities.
10
10
  */
11
11
  export declare namespace EntityAttachment {
12
+ /**
13
+ * Returns cache identifier for an attachment by ID.
14
+ * Example: {
15
+ * const api: BruceApi.Api = ...;
16
+ * const key = GetCacheKey("123");
17
+ * api.Cache.Remove(key);
18
+ * }
19
+ * @param id
20
+ * @returns
21
+ */
12
22
  function GetCacheKey(id: number): string;
23
+ /**
24
+ * Returns cache identifier for a list of attachments for an entity.
25
+ * Example: {
26
+ * const api: BruceApi.Api = ...;
27
+ * const key = GetListCacheKey("abc");
28
+ * api.Cache.Remove(key);
29
+ * }
30
+ * @param typeId
31
+ * @returns
32
+ */
13
33
  function GetListCacheKey(entityId: string): string;
34
+ /**
35
+ * Describes an attachment record.
36
+ */
14
37
  interface IAttachment {
15
38
  ID: number;
16
39
  ClientFile?: ClientFile.IFile;
17
- Group?: string;
18
40
  "ClientFile.ID": string;
19
41
  DisplayOrder?: number;
20
42
  "Entity.ID": string;
21
43
  "EntityAttachmentType.ID": Type;
44
+ Group?: string;
22
45
  }
46
+ /**
47
+ * Updates one or many attachment records.
48
+ * @param params
49
+ * @returns
50
+ */
23
51
  function Update(params: {
24
52
  api?: BruceApi.Api;
25
53
  entityId: string;
@@ -28,6 +56,10 @@ export declare namespace EntityAttachment {
28
56
  }): Promise<{
29
57
  attachments: IAttachment[];
30
58
  }>;
59
+ /**
60
+ * Updates the display order of attachments.
61
+ * @param params
62
+ */
31
63
  function UpdateOrder(params: {
32
64
  api?: BruceApi.Api;
33
65
  entityId: string;
@@ -35,12 +67,21 @@ export declare namespace EntityAttachment {
35
67
  attachments: IAttachment[];
36
68
  req?: Api.IReqParams;
37
69
  }): Promise<void>;
70
+ /**
71
+ * Deletes an attachment record.
72
+ * @param params
73
+ */
38
74
  function Delete(params: {
39
75
  api?: BruceApi.Api;
40
76
  entityId: string;
41
77
  attachmentId: number;
42
78
  req?: Api.IReqParams;
43
79
  }): Promise<void>;
80
+ /**
81
+ * Gets a list of attachments for an entity.
82
+ * @param params
83
+ * @returns
84
+ */
44
85
  function GetListByEntityId(params: {
45
86
  api?: BruceApi.Api;
46
87
  entityId: string;
@@ -48,6 +89,12 @@ export declare namespace EntityAttachment {
48
89
  }): Promise<{
49
90
  attachments: IAttachment[];
50
91
  }>;
92
+ /**
93
+ * Uploads a file as an attachment to an entity.
94
+ * This will create a client file record for the file.
95
+ * @param params
96
+ * @returns
97
+ */
51
98
  function Upload(params: {
52
99
  api?: BruceApi.Api;
53
100
  file: Blob;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Describes an entity type schema attribute.
3
+ */
1
4
  export declare namespace EntityAttribute {
2
5
  enum EType {
3
6
  String = "String",
@@ -6,34 +9,50 @@ export declare namespace EntityAttribute {
6
9
  Datetime = "Datetime",
7
10
  Structure = "Structure",
8
11
  Geometry = "Geometry",
9
- Dictionary = "Dictionary",
10
12
  Boolean = "Boolean"
11
13
  }
14
+ /**
15
+ * Describes an entity attribute.
16
+ * This sits within an entity type schema.
17
+ */
12
18
  interface IAttribute {
13
19
  Key: string;
14
20
  Name?: string;
15
21
  Type?: EType;
16
- Size?: number;
17
22
  IsIndexed?: boolean;
18
- IsArray?: boolean;
19
23
  IsImportant?: boolean;
20
- Description?: string;
21
- Metadata?: IMetadata;
24
+ IsArray?: boolean;
22
25
  Structure?: IAttribute[];
26
+ Size?: number;
27
+ Metadata?: IMetadata;
23
28
  IsFamilyAttribute?: boolean;
24
29
  IsFamilyAttributeDefault?: boolean;
25
30
  Sources?: string[];
26
31
  }
32
+ /**
33
+ * Describes additional metadata for an attribute.
34
+ */
27
35
  interface IMetadata {
28
- Description?: string;
29
- Mandatory?: boolean;
30
- Dictionary?: IDictionary;
36
+ dictionary?: IDictionary;
37
+ maxLength?: number;
38
+ min?: number;
39
+ max?: number;
40
+ unit?: string;
31
41
  }
42
+ /**
43
+ * Describes a dictionary of values for an attribute.
44
+ */
32
45
  interface IDictionary {
33
- UseAttribute?: boolean;
34
- EntityTypeID?: string;
35
- SourceAttributePath?: string;
36
- SourceAttribute?: IAttribute;
46
+ enabled?: boolean;
47
+ entityTypeId?: string;
48
+ attrPath?: string;
37
49
  }
50
+ /**
51
+ * Returns an attribute from a provided hierarchy of attributes.
52
+ * Eg: Use the path: ["Bruce", "ID"] to find the "ID" attribute.
53
+ * @param items
54
+ * @param path
55
+ * @returns
56
+ */
38
57
  function GetAttribute(items: IAttribute[], path: string[]): IAttribute;
39
58
  }