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,58 +1,90 @@
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 { Permission } from "./permission";
5
4
  import { User } from "./user";
6
5
  /**
7
- * Describes the "User Group" concept within Bruce.
6
+ * Describes the "User Group" concept within Nextspace.
8
7
  * A user group is a collection of permissions ("Features") and what users should be in the group.
9
8
  */
10
9
  export declare namespace UserGroup {
10
+ /**
11
+ * Describes a user group record.
12
+ */
11
13
  interface IGroup {
12
14
  "ClientAccount.ID"?: string;
13
15
  "Features": Permission.Perm[];
14
16
  "ID": string;
15
17
  "Name"?: string;
16
18
  }
19
+ /**
20
+ * Returns a user group by its name.
21
+ * @param params
22
+ * @returns
23
+ */
17
24
  function GetByName(params: {
18
- api?: IdmApi.Api | GuardianApi.Api;
25
+ api?: GuardianApi.Api;
19
26
  accountId: string;
20
27
  name: string;
21
28
  req?: Api.IReqParams;
22
29
  }): Promise<{
23
30
  group: IGroup;
24
31
  }>;
32
+ /**
33
+ * Returns all users in a user group.
34
+ * @param params
35
+ * @returns
36
+ */
25
37
  function GetUsers(params: {
26
- api?: IdmApi.Api | GuardianApi.Api;
38
+ api?: GuardianApi.Api;
27
39
  accountId: string;
28
40
  groupId: string;
29
41
  req?: Api.IReqParams;
30
42
  }): Promise<{
31
43
  users: User.IUser[];
32
44
  }>;
45
+ /**
46
+ * Returns list of user groups that have a specific permission enabled.
47
+ * @param params
48
+ * @returns
49
+ */
33
50
  function GetListByPerm(params: {
34
- api?: IdmApi.Api | GuardianApi.Api;
51
+ api?: GuardianApi.Api;
35
52
  accountId: string;
36
53
  perm: Permission.Perm;
37
54
  req?: Api.IReqParams;
38
55
  }): Promise<{
39
56
  groups: IGroup[];
40
57
  }>;
58
+ /**
59
+ * Returns all user groups for an account.
60
+ * @param params
61
+ * @returns
62
+ */
41
63
  function GetList(params: {
42
- api?: IdmApi.Api | GuardianApi.Api;
64
+ api?: GuardianApi.Api;
43
65
  accountId: string;
44
66
  req?: Api.IReqParams;
45
67
  }): Promise<{
46
68
  groups: IGroup[];
47
69
  }>;
70
+ /**
71
+ * Deletes a user group.
72
+ * @param params
73
+ * @returns
74
+ */
48
75
  function Delete(params: {
49
- api?: IdmApi.Api | GuardianApi.Api;
76
+ api?: GuardianApi.Api;
50
77
  accountId: string;
51
78
  groupId: string;
52
79
  req?: Api.IReqParams;
53
80
  }): Promise<void>;
81
+ /**
82
+ * Creates or updates a user group.
83
+ * @param params
84
+ * @returns
85
+ */
54
86
  function Update(params: {
55
- api?: IdmApi.Api | GuardianApi.Api;
87
+ api?: GuardianApi.Api;
56
88
  group: IGroup;
57
89
  reqParams?: Api.IReqParams;
58
90
  }): Promise<{
@@ -1,18 +1,53 @@
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 { UserGroup } from "./user-group";
5
4
  /**
6
- * Describes the "User" concept within Bruce.
5
+ * Describes the "User" concept within Nextspace.
7
6
  * A user is either a login-user or an access-token.
8
7
  *
9
8
  * You cannot login using an access-token, but both concepts are-
10
9
  * treated the same way in terms of permissions and user groups.
11
10
  */
12
11
  export declare namespace User {
12
+ /**
13
+ * Returns cache identifier for a user.
14
+ * Example: {
15
+ * const api: BruceApi.Api = ...;
16
+ * const key = GetCacheKey("abc", "def");
17
+ * api.Cache.Remove(key);
18
+ * }
19
+ * @param userId
20
+ * @param accountId
21
+ * @returns
22
+ */
13
23
  function GetCacheKey(userId: string, accountId?: string): string;
24
+ /**
25
+ * Returns cache identifier for a user.
26
+ * Example: {
27
+ * const api: BruceApi.Api = ...;
28
+ * const key = GetCacheKey("abc", "def");
29
+ * api.Cache.Remove(key);
30
+ * }
31
+ * @param email
32
+ * @param accountId
33
+ * @returns
34
+ */
14
35
  function GetEmailCacheKey(email: string, accountId?: string): string;
36
+ /**
37
+ * Returns cache identifier for a user's settings.
38
+ * Example: {
39
+ * const api: BruceApi.Api = ...;
40
+ * const key = GetCacheKey("abc", "def");
41
+ * api.Cache.Remove(key);
42
+ * }
43
+ * @param userId
44
+ * @param appId
45
+ * @returns
46
+ */
15
47
  function GetSettingsCacheKey(userId: string, appId: string): string;
48
+ /**
49
+ * Describes a user record.
50
+ */
16
51
  interface IUser {
17
52
  AccessPermissions?: IAccessPermission[];
18
53
  Email?: string;
@@ -26,25 +61,41 @@ export declare namespace User {
26
61
  Password?: string;
27
62
  Type?: EType;
28
63
  }
64
+ /**
65
+ * Available user types.
66
+ */
29
67
  enum EType {
30
68
  User = "LOGIN_USER",
31
69
  AccessToken = "ACCESS_TOKEN"
32
70
  }
71
+ /**
72
+ * Describes a set of permissions for an account.
73
+ */
33
74
  interface IAccessPermission {
34
75
  "ClientAccount.ID": string;
35
76
  "UserGroup.ID"?: string[];
36
77
  "UserGroups"?: UserGroup.IGroup[];
37
78
  }
79
+ /**
80
+ * Gets a user record.
81
+ * @param params
82
+ * @returns
83
+ */
38
84
  function Get(params: {
39
- api?: IdmApi.Api | GuardianApi.Api;
85
+ api?: GuardianApi.Api;
40
86
  userId: string;
41
87
  accountId?: string;
42
88
  req?: Api.IReqParams;
43
89
  }): Promise<{
44
90
  user: IUser;
45
91
  }>;
92
+ /**
93
+ * Updates a user record.
94
+ * @param params
95
+ * @returns
96
+ */
46
97
  function Update(params: {
47
- api?: IdmApi.Api | GuardianApi.Api;
98
+ api?: GuardianApi.Api;
48
99
  user: IUser;
49
100
  req?: Api.IReqParams;
50
101
  }): Promise<{
@@ -56,7 +107,7 @@ export declare namespace User {
56
107
  * @param params
57
108
  */
58
109
  function GetSettings(params: {
59
- api?: IdmApi.Api | GuardianApi.Api;
110
+ api?: GuardianApi.Api;
60
111
  userId: string;
61
112
  appId: string;
62
113
  req?: Api.IReqParams;
@@ -70,15 +121,20 @@ export declare namespace User {
70
121
  * @param params
71
122
  */
72
123
  function UpdateSettings(params: {
73
- api?: IdmApi.Api | GuardianApi.Api;
124
+ api?: GuardianApi.Api;
74
125
  accId?: string;
75
126
  userId: string;
76
127
  appId: string;
77
128
  settings: any;
78
129
  req?: Api.IReqParams;
79
130
  }): Promise<void>;
131
+ /**
132
+ * Returns if a username is available.
133
+ * @param params
134
+ * @returns
135
+ */
80
136
  function GetUsernameAvailable(params: {
81
- api?: IdmApi.Api | GuardianApi.Api;
137
+ api?: GuardianApi.Api;
82
138
  username: string;
83
139
  excludeUserId?: string;
84
140
  req?: Api.IReqParams;
@@ -86,17 +142,37 @@ export declare namespace User {
86
142
  isAvailable: boolean;
87
143
  }>;
88
144
  namespace LoginUser {
145
+ /**
146
+ * Returns cache identifier for a list of users.
147
+ * Example: {
148
+ * const api: BruceApi.Api = ...;
149
+ * const key = GetListCacheKey("abc");
150
+ * api.Cache.Remove(key);
151
+ * }
152
+ * @param accountId
153
+ * @returns
154
+ */
89
155
  function GetListCacheKey(accountId: string): string;
156
+ /**
157
+ * Returns a user by their email address.
158
+ * @param params
159
+ * @returns
160
+ */
90
161
  function GetByEmail(params: {
91
- api?: IdmApi.Api | GuardianApi.Api;
162
+ api?: GuardianApi.Api;
92
163
  email: string;
93
164
  accountId?: string;
94
165
  req?: Api.IReqParams;
95
166
  }): Promise<{
96
167
  user: IUser;
97
168
  }>;
169
+ /**
170
+ * Returns a list of users for an account.
171
+ * @param params
172
+ * @returns
173
+ */
98
174
  function GetList(params: {
99
- api?: IdmApi.Api | GuardianApi.Api;
175
+ api?: GuardianApi.Api;
100
176
  accountId: string;
101
177
  exclusive?: boolean;
102
178
  req?: Api.IReqParams;
@@ -109,7 +185,7 @@ export declare namespace User {
109
185
  * @returns
110
186
  */
111
187
  function Signup(params: {
112
- api?: IdmApi.Api | GuardianApi.Api;
188
+ api?: GuardianApi.Api;
113
189
  email: string;
114
190
  req?: Api.IReqParams;
115
191
  }): Promise<void>;
@@ -119,7 +195,7 @@ export declare namespace User {
119
195
  * @returns
120
196
  */
121
197
  function SignupResend(params: {
122
- api?: IdmApi.Api | GuardianApi.Api;
198
+ api?: GuardianApi.Api;
123
199
  expiredCode: string;
124
200
  req?: Api.IReqParams;
125
201
  }): Promise<void>;
@@ -129,7 +205,7 @@ export declare namespace User {
129
205
  * @returns
130
206
  */
131
207
  function SignupComplete(params: {
132
- api?: IdmApi.Api | GuardianApi.Api;
208
+ api?: GuardianApi.Api;
133
209
  code: string;
134
210
  user: IUser;
135
211
  accountId?: string;
@@ -143,7 +219,7 @@ export declare namespace User {
143
219
  * @returns user id associated with provided email.
144
220
  */
145
221
  function ForgotPassword(params: {
146
- api?: IdmApi.Api | GuardianApi.Api;
222
+ api?: GuardianApi.Api;
147
223
  accountId: string;
148
224
  email: string;
149
225
  req?: Api.IReqParams;
@@ -156,7 +232,7 @@ export declare namespace User {
156
232
  * @returns
157
233
  */
158
234
  function ForgotPasswordComplete(params: {
159
- api?: IdmApi.Api | GuardianApi.Api;
235
+ api?: GuardianApi.Api;
160
236
  code: string;
161
237
  userId: string;
162
238
  password: string;
@@ -166,21 +242,45 @@ export declare namespace User {
166
242
  }>;
167
243
  }
168
244
  namespace AccessToken {
245
+ /**
246
+ * Returns cache identifier for a list of users.
247
+ * Example: {
248
+ * const api: BruceApi.Api = ...;
249
+ * const key = GetListCacheKey("abc");
250
+ * api.Cache.Remove(key);
251
+ * }
252
+ * @param accountId
253
+ * @returns
254
+ */
169
255
  function GetListCacheKey(accountId: string): string;
256
+ /**
257
+ * Returns a list of access tokens for an account.
258
+ * @param params
259
+ * @returns
260
+ */
170
261
  function GetList(params: {
171
- api?: IdmApi.Api | GuardianApi.Api;
262
+ api?: GuardianApi.Api;
172
263
  accountId: string;
173
264
  req?: Api.IReqParams;
174
265
  }): Promise<{
175
266
  users: IUser[];
176
267
  }>;
268
+ /**
269
+ * Deletes an access token.
270
+ * @param params
271
+ */
177
272
  function Delete(params: {
178
- api?: IdmApi.Api | GuardianApi.Api;
273
+ api?: GuardianApi.Api;
179
274
  tokenId: string;
180
275
  req?: Api.IReqParams;
181
276
  }): Promise<void>;
277
+ /**
278
+ * Creates a new access token.
279
+ * @param params
280
+ * @returns
281
+ */
182
282
  function Create(params: {
183
- api?: IdmApi.Api | GuardianApi.Api;
283
+ api?: GuardianApi.Api;
184
284
  token: IUser;
185
285
  req?: Api.IReqParams;
186
286
  }): Promise<{
@@ -1,8 +1,23 @@
1
1
  /**
2
- * Utility to help with parsing and wrapping Bruce paths.
2
+ * Utility to help with parsing and wrapping Nextspace paths.
3
3
  */
4
4
  export declare namespace PathUtils {
5
+ /**
6
+ * Parses a string path into an array of strings.
7
+ * @param str
8
+ * @returns
9
+ */
5
10
  function Parse(str: string): string[];
11
+ /**
12
+ * Wraps an array of strings into a Nextspace string path.
13
+ * @param path
14
+ * @returns
15
+ */
6
16
  function Wrap(path: string[]): string;
17
+ /**
18
+ * Parses a Nextspace legacy string path into an array of strings.
19
+ * @param str
20
+ * @returns
21
+ */
7
22
  function ParseLegacy(str: string): string[];
8
23
  }
@@ -1,26 +1,9 @@
1
- import { IDictionary } from "../common/dictionary";
2
- /**
3
- * Utility to help with url manipulation.
4
- */
5
1
  export declare namespace UrlUtils {
6
- function GetQueryString(doc: Document): IDictionary<string>;
7
2
  /**
8
- * Helper to get and set url params for a given window.
3
+ * Returns a url-safe string that is human readable.
4
+ * Eg: 'My Project View!' into 'My-Project-View'.
5
+ * @param str
6
+ * @returns
9
7
  */
10
- class Handler {
11
- private _window;
12
- get window(): Window;
13
- private get document();
14
- private _allowedKeys;
15
- get allowedKeys(): string[];
16
- constructor(window: Window, allowedKeys?: string[]);
17
- UpdateAllowedKeys(allowedKeys: string[]): void;
18
- UpdateParam(key: string, value: string | number): void;
19
- RemoveParam(key: string): void;
20
- GetParamKeys(): string[];
21
- GetParams(): IDictionary<string>;
22
- GetParam(key: string): string;
23
- Clear(): void;
24
- private refresh;
25
- }
8
+ function ToHumanReadable(str: string): string;
26
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bruce-models",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/bruce-models.umd.js",
@@ -1,84 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CamApi = void 0;
13
- const abstract_api_1 = require("./abstract-api");
14
- const api_1 = require("./api");
15
- /**
16
- * This is the request handler for Cam Api,
17
- * it should be passed to any method that wants to communicate with this particular api.
18
- * @deprecated Please use GuardianApi instead.
19
- */
20
- var CamApi;
21
- (function (CamApi) {
22
- class Api extends abstract_api_1.AbstractApi {
23
- constructor(params) {
24
- super({
25
- ssidHeader: "x-sessionid",
26
- cacheId: `CAM_API_${params === null || params === void 0 ? void 0 : params.env}_`
27
- });
28
- this.env = (params === null || params === void 0 ? void 0 : params.env) ? params.env : api_1.Api.EEnv.PROD;
29
- this.setBaseUrl();
30
- }
31
- setBaseUrl() {
32
- let url = "https://guardian.nextspace";
33
- const env = this.env.toUpperCase();
34
- switch (env) {
35
- case api_1.Api.EEnv.DEV:
36
- url += "-dev.net/";
37
- break;
38
- case api_1.Api.EEnv.STG:
39
- url += "-stg.net/";
40
- break;
41
- case api_1.Api.EEnv.UAT:
42
- url += "-uat.net/";
43
- break;
44
- case api_1.Api.EEnv.PROD:
45
- url += ".host/";
46
- break;
47
- default:
48
- throw ("Specified Environment is not valid. SuppliedEnv=" + env);
49
- }
50
- this.baseUrl = url;
51
- }
52
- GetBaseUrl() {
53
- return this.baseUrl;
54
- }
55
- SetBaseUrl(url) {
56
- this.baseUrl = url;
57
- if (!this.baseUrl.endsWith("/")) {
58
- this.baseUrl += "/";
59
- }
60
- }
61
- GET(url, params) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- return this.get(this.baseUrl + url, params);
64
- });
65
- }
66
- DELETE(url, params) {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- return this.delete(this.baseUrl + url, params);
69
- });
70
- }
71
- POST(url, data, params) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- return this.post(this.baseUrl + url, data, params);
74
- });
75
- }
76
- UPLOAD(url, blob, params) {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- return this.upload(this.baseUrl + url, blob, params);
79
- });
80
- }
81
- }
82
- CamApi.Api = Api;
83
- })(CamApi = exports.CamApi || (exports.CamApi = {}));
84
- //# sourceMappingURL=cam-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cam-api.js","sourceRoot":"","sources":["../../../src/api/cam-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA6C;AAC7C,+BAAiC;AAEjC;;;;GAIG;AACH,IAAiB,MAAM,CAuEtB;AAvED,WAAiB,MAAM;IAQnB,MAAa,GAAI,SAAQ,0BAAW;QAGhC,YAAY,MAEX;YACG,KAAK,CAAC;gBACF,UAAU,EAAE,aAAa;gBACzB,OAAO,EAAE,WAAW,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,GAAG;aACrC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,EAAC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AAO,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC;YACnD,CAAC;SAAA;QAEY,IAAI,CAAC,GAAW,EAAE,IAAS,EAAE,MAAqB;;gBAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACvD,CAAC;SAAA;QAEY,MAAM,CAAC,GAAW,EAAE,IAAU,EAAE,MAA2B;;gBACpE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACzD,CAAC;SAAA;KACJ;IA9DY,UAAG,MA8Df,CAAA;AACL,CAAC,EAvEgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAuEtB"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.IdmApi = void 0;
13
- const abstract_api_1 = require("./abstract-api");
14
- const api_1 = require("./api");
15
- /**
16
- * * @deprecated Please use GuardianApi instead.
17
- */
18
- var IdmApi;
19
- (function (IdmApi) {
20
- /**
21
- * This is the request handler for Idm Api,
22
- * it should be passed to any method that wants to communicate with this particular api.
23
- */
24
- class Api extends abstract_api_1.AbstractApi {
25
- constructor(params) {
26
- super({
27
- ssidHeader: "SSID",
28
- cacheId: `IDM_API_${params === null || params === void 0 ? void 0 : params.env}_`
29
- });
30
- this.env = (params === null || params === void 0 ? void 0 : params.env) ? params.env : api_1.Api.EEnv.PROD;
31
- this.setBaseUrl();
32
- }
33
- setBaseUrl() {
34
- let url = "https://guardian.nextspace";
35
- const env = this.env.toUpperCase();
36
- switch (env) {
37
- case api_1.Api.EEnv.DEV:
38
- url += "-dev.net/";
39
- break;
40
- case api_1.Api.EEnv.STG:
41
- url += "-stg.net/";
42
- break;
43
- case api_1.Api.EEnv.UAT:
44
- url += "-uat.net/";
45
- break;
46
- case api_1.Api.EEnv.PROD:
47
- url += ".host/";
48
- break;
49
- default:
50
- throw ("Specified Environment is not valid. SuppliedEnv=" + env);
51
- }
52
- this.baseUrl = url;
53
- }
54
- GetBaseUrl() {
55
- return this.baseUrl;
56
- }
57
- SetBaseUrl(url) {
58
- this.baseUrl = url;
59
- if (!this.baseUrl.endsWith("/")) {
60
- this.baseUrl += "/";
61
- }
62
- }
63
- GET(url, params) {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- return this.get(this.baseUrl + url, params);
66
- });
67
- }
68
- DELETE(url, params) {
69
- return __awaiter(this, void 0, void 0, function* () {
70
- return this.delete(this.baseUrl + url, params);
71
- });
72
- }
73
- POST(url, data, params) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- return this.post(this.baseUrl + url, data, params);
76
- });
77
- }
78
- UPLOAD(url, blob, params) {
79
- return __awaiter(this, void 0, void 0, function* () {
80
- return this.upload(this.baseUrl + url, blob, params);
81
- });
82
- }
83
- }
84
- IdmApi.Api = Api;
85
- })(IdmApi = exports.IdmApi || (exports.IdmApi = {}));
86
- //# sourceMappingURL=idm-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idm-api.js","sourceRoot":"","sources":["../../../src/api/idm-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA6C;AAC7C,+BAAiC;AAEjC;;GAEG;AACH,IAAiB,MAAM,CA2EtB;AA3ED,WAAiB,MAAM;IAQnB;;;OAGG;IACH,MAAa,GAAI,SAAQ,0BAAW;QAGhC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AG,CAAC,GAAW,EAAE,MAAqB;;gBAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC;YAChD,CAAC;SAAA;QAEY,MAAM,CAAC,GAAW,EAAE,MAAqB;;gBAClD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC;YACnD,CAAC;SAAA;QAEY,IAAI,CAAC,GAAW,EAAE,IAAS,EAAE,MAAqB;;gBAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACvD,CAAC;SAAA;QAEY,MAAM,CAAC,GAAW,EAAE,IAAU,EAAE,MAA2B;;gBACpE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACzD,CAAC;SAAA;KACJ;IA9DY,UAAG,MA8Df,CAAA;AACL,CAAC,EA3EgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA2EtB"}
@@ -1,26 +0,0 @@
1
- import { AbstractApi } from "./abstract-api";
2
- import { Api as A } from "./api";
3
- /**
4
- * This is the request handler for Cam Api,
5
- * it should be passed to any method that wants to communicate with this particular api.
6
- * @deprecated Please use GuardianApi instead.
7
- */
8
- export declare namespace CamApi {
9
- interface IGetter {
10
- env: A.EEnv;
11
- getApi: (env?: A.EEnv) => CamApi.Api;
12
- }
13
- class Api extends AbstractApi {
14
- private env;
15
- constructor(params: {
16
- env?: A.Env;
17
- });
18
- private setBaseUrl;
19
- GetBaseUrl(): string;
20
- SetBaseUrl(url: string): void;
21
- GET(url: string, params?: A.IReqParams): Promise<any>;
22
- DELETE(url: string, params?: A.IReqParams): Promise<any>;
23
- POST(url: string, data: any, params?: A.IReqParams): Promise<any>;
24
- UPLOAD(url: string, blob: Blob, params?: A.IUploadReqParams): Promise<any>;
25
- }
26
- }
@@ -1,28 +0,0 @@
1
- import { AbstractApi } from "./abstract-api";
2
- import { Api as A } from "./api";
3
- /**
4
- * * @deprecated Please use GuardianApi instead.
5
- */
6
- export declare namespace IdmApi {
7
- interface IGetter {
8
- env: A.EEnv;
9
- getApi: (env?: A.EEnv) => IdmApi.Api;
10
- }
11
- /**
12
- * This is the request handler for Idm Api,
13
- * it should be passed to any method that wants to communicate with this particular api.
14
- */
15
- class Api extends AbstractApi {
16
- private env;
17
- constructor(params: {
18
- env?: A.Env;
19
- });
20
- private setBaseUrl;
21
- GetBaseUrl(): string;
22
- SetBaseUrl(url: string): void;
23
- GET(url: string, params?: A.IReqParams): Promise<any>;
24
- DELETE(url: string, params?: A.IReqParams): Promise<any>;
25
- POST(url: string, data: any, params?: A.IReqParams): Promise<any>;
26
- UPLOAD(url: string, blob: Blob, params?: A.IUploadReqParams): Promise<any>;
27
- }
28
- }