bruce-models 3.5.1 → 3.5.3

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 (46) hide show
  1. package/README.md +31 -0
  2. package/dist/bruce-models.es5.js +275 -248
  3. package/dist/bruce-models.es5.js.map +1 -1
  4. package/dist/bruce-models.umd.js +264 -237
  5. package/dist/bruce-models.umd.js.map +1 -1
  6. package/dist/lib/account/account.js +45 -45
  7. package/dist/lib/account/account.js.map +1 -1
  8. package/dist/lib/ann-document/ann-document.js +28 -28
  9. package/dist/lib/ann-document/ann-document.js.map +1 -1
  10. package/dist/lib/api/api.js +1 -0
  11. package/dist/lib/api/api.js.map +1 -1
  12. package/dist/lib/bruce-models.js +2 -1
  13. package/dist/lib/bruce-models.js.map +1 -1
  14. package/dist/lib/client-file/client-file.js +14 -14
  15. package/dist/lib/client-file/client-file.js.map +1 -1
  16. package/dist/lib/custom-form/custom-form.js +31 -31
  17. package/dist/lib/custom-form/custom-form.js.map +1 -1
  18. package/dist/lib/data-lab/data-lab.js.map +1 -1
  19. package/dist/lib/data-source/data-source.js +27 -27
  20. package/dist/lib/data-source/data-source.js.map +1 -1
  21. package/dist/lib/entity/entity-attachment-type.js +28 -28
  22. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  23. package/dist/lib/entity/entity-attachment.js +28 -28
  24. package/dist/lib/entity/entity-attachment.js.map +1 -1
  25. package/dist/lib/entity/entity-attribute.js.map +1 -1
  26. package/dist/lib/entity/entity-tag.js +17 -2
  27. package/dist/lib/entity/entity-tag.js.map +1 -1
  28. package/dist/lib/plugin/plugin.js +32 -32
  29. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  30. package/dist/lib/project/project-view.js +42 -32
  31. package/dist/lib/project/project-view.js.map +1 -1
  32. package/dist/lib/project/zoom-control.js.map +1 -1
  33. package/dist/types/account/account.d.ts +47 -47
  34. package/dist/types/ann-document/ann-document.d.ts +42 -42
  35. package/dist/types/api/api.d.ts +1 -0
  36. package/dist/types/bruce-models.d.ts +1 -1
  37. package/dist/types/client-file/client-file.d.ts +11 -11
  38. package/dist/types/custom-form/custom-form.d.ts +22 -22
  39. package/dist/types/data-lab/data-lab.d.ts +4 -4
  40. package/dist/types/data-source/data-source.d.ts +21 -21
  41. package/dist/types/entity/entity-attachment-type.d.ts +22 -22
  42. package/dist/types/entity/entity-attachment.d.ts +22 -22
  43. package/dist/types/entity/entity-attribute.d.ts +9 -9
  44. package/dist/types/project/project-view.d.ts +27 -21
  45. package/dist/types/project/zoom-control.d.ts +9 -9
  46. package/package.json +78 -78
@@ -7,17 +7,6 @@ import { Uploader } from "../internal/uploader";
7
7
  * A client file is a record of a file uploaded to Bruce.
8
8
  */
9
9
  export declare namespace ClientFile {
10
- /**
11
- * Returns cache identifier for a client file by ID.
12
- * Example: {
13
- * const api: BruceApi.Api = ...;
14
- * const key = GetCacheKey("123");
15
- * api.Cache.Remove(key);
16
- * }
17
- * @param fileId
18
- * @returns
19
- */
20
- function GetCacheKey(fileId: string): string;
21
10
  /**
22
11
  * Describes a client file record.
23
12
  */
@@ -192,4 +181,15 @@ export declare namespace ClientFile {
192
181
  req?: Api.IReqParams;
193
182
  }): Promise<IResult>;
194
183
  }
184
+ /**
185
+ * Returns cache identifier for a client file by ID.
186
+ * Example: {
187
+ * const api: BruceApi.Api = ...;
188
+ * const key = GetCacheKey("123");
189
+ * api.Cache.Remove(key);
190
+ * }
191
+ * @param fileId
192
+ * @returns
193
+ */
194
+ function GetCacheKey(fileId: string): string;
195
195
  }
@@ -6,28 +6,6 @@ import { CustomFormContent } from "./custom-form-content";
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
- */
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
- */
30
- function GetListCacheKey(typeId: string): string;
31
9
  /**
32
10
  * Describes a custom form record.
33
11
  */
@@ -91,4 +69,26 @@ export declare namespace CustomForm {
91
69
  }): Promise<{
92
70
  form: IForm;
93
71
  }>;
72
+ /**
73
+ * Returns cache identifier for a Custom Form by ID.
74
+ * Example: {
75
+ * const api: BruceApi.Api = ...;
76
+ * const key = GetCacheKey(1);
77
+ * api.Cache.Remove(key);
78
+ * }
79
+ * @param id
80
+ * @returns
81
+ */
82
+ function GetCacheKey(id: number): string;
83
+ /**
84
+ * Returns cache identifier for a list of Custom Forms by Entity Type ID.
85
+ * Example: {
86
+ * const api: BruceApi.Api = ...;
87
+ * const key = GetListCacheKey("123");
88
+ * api.Cache.Remove(key);
89
+ * }
90
+ * @param typeId
91
+ * @returns
92
+ */
93
+ function GetListCacheKey(typeId: string): string;
94
94
  }
@@ -7,10 +7,6 @@ import { Entity as E } from "../entity/entity";
7
7
  * Data lab queries can be saved for reuse.
8
8
  */
9
9
  export declare namespace DataLab {
10
- enum EReqKey {
11
- Primary = "PrimarySelection",
12
- Secondary = "SecondarySelection"
13
- }
14
10
  interface IQuery {
15
11
  [EReqKey.Primary]: {
16
12
  Items: any[];
@@ -20,6 +16,10 @@ export declare namespace DataLab {
20
16
  PrimaryEntityTypeID?: string;
21
17
  PrimaryEntityID?: string;
22
18
  }
19
+ enum EReqKey {
20
+ Primary = "PrimarySelection",
21
+ Secondary = "SecondarySelection"
22
+ }
23
23
  /**
24
24
  * Runs a DataLab query.
25
25
  * @param params
@@ -2,27 +2,6 @@ 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
- */
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
- */
25
- function GetListCacheKey(): string;
26
5
  /**
27
6
  * Describes a data source record.
28
7
  */
@@ -82,4 +61,25 @@ export declare namespace DataSource {
82
61
  api?: BruceApi.Api;
83
62
  req?: Api.IReqParams;
84
63
  }): Promise<any>;
64
+ /**
65
+ * Returns cache identifier for a data source by ID.
66
+ * Example: {
67
+ * const api: BruceApi.Api = ...;
68
+ * const key = GetCacheKey(1);
69
+ * api.Cache.Remove(key);
70
+ * }
71
+ * @param id
72
+ * @returns
73
+ */
74
+ function GetCacheKey(id: number): string;
75
+ /**
76
+ * Returns cache identifier for a list of data sources.
77
+ * Example: {
78
+ * const api: BruceApi.Api = ...;
79
+ * const key = GetListCacheKey();
80
+ * api.Cache.Remove(key);
81
+ * }
82
+ * @returns
83
+ */
84
+ function GetListCacheKey(): string;
85
85
  }
@@ -6,28 +6,6 @@ type Type = EntityAttachmentType.EType | string;
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
- */
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
- */
30
- function GetListCacheKey(): string;
31
9
  /**
32
10
  * Describes an attachment type record.
33
11
  */
@@ -72,5 +50,27 @@ export declare namespace EntityAttachmentType {
72
50
  }): Promise<{
73
51
  attachmentTypes: IType[];
74
52
  }>;
53
+ /**
54
+ * Returns cache identifier for an attachment type by ID.
55
+ * Example: {
56
+ * const api: BruceApi.Api = ...;
57
+ * const key = GetCacheKey("123");
58
+ * api.Cache.Remove(key);
59
+ * }
60
+ * @param id
61
+ * @returns
62
+ */
63
+ function GetCacheKey(id: Type): string;
64
+ /**
65
+ * Returns cache identifier for a list of attachment types.
66
+ * Example: {
67
+ * const api: BruceApi.Api = ...;
68
+ * const key = GetListCacheKey();
69
+ * api.Cache.Remove(key);
70
+ * }
71
+ * @param typeId
72
+ * @returns
73
+ */
74
+ function GetListCacheKey(): string;
75
75
  }
76
76
  export {};
@@ -9,28 +9,6 @@ type Type = EntityAttachmentType.EType | string;
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
- */
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
- */
33
- function GetListCacheKey(entityId: string): string;
34
12
  /**
35
13
  * Describes an attachment record.
36
14
  */
@@ -104,5 +82,27 @@ export declare namespace EntityAttachment {
104
82
  }): Promise<{
105
83
  attachment: IAttachment;
106
84
  }>;
85
+ /**
86
+ * Returns cache identifier for an attachment by ID.
87
+ * Example: {
88
+ * const api: BruceApi.Api = ...;
89
+ * const key = GetCacheKey("123");
90
+ * api.Cache.Remove(key);
91
+ * }
92
+ * @param id
93
+ * @returns
94
+ */
95
+ function GetCacheKey(id: number): string;
96
+ /**
97
+ * Returns cache identifier for a list of attachments for an entity.
98
+ * Example: {
99
+ * const api: BruceApi.Api = ...;
100
+ * const key = GetListCacheKey("abc");
101
+ * api.Cache.Remove(key);
102
+ * }
103
+ * @param typeId
104
+ * @returns
105
+ */
106
+ function GetListCacheKey(entityId: string): string;
107
107
  }
108
108
  export {};
@@ -2,15 +2,6 @@
2
2
  * Describes an entity type schema attribute.
3
3
  */
4
4
  export declare namespace EntityAttribute {
5
- enum EType {
6
- String = "String",
7
- Double = "Double",
8
- Integer = "Integer",
9
- Datetime = "Datetime",
10
- Structure = "Structure",
11
- Geometry = "Geometry",
12
- Boolean = "Boolean"
13
- }
14
5
  /**
15
6
  * Describes an entity attribute.
16
7
  * This sits within an entity type schema.
@@ -30,6 +21,15 @@ export declare namespace EntityAttribute {
30
21
  IsFamilyAttributeDefault?: boolean;
31
22
  Sources?: string[];
32
23
  }
24
+ enum EType {
25
+ String = "String",
26
+ Double = "Double",
27
+ Integer = "Integer",
28
+ Datetime = "Datetime",
29
+ Structure = "Structure",
30
+ Geometry = "Geometry",
31
+ Boolean = "Boolean"
32
+ }
33
33
  /**
34
34
  * Describes additional metadata for an attribute.
35
35
  */
@@ -11,28 +11,10 @@ import { ProjectViewSelection } from "./project-view-selection";
11
11
  * It will describe what panels to show and how, it will also describe all possible ways data can be displayed.
12
12
  */
13
13
  export declare namespace ProjectView {
14
- /**
15
- * Returns cache identifier for a project view.
16
- * Example: {
17
- * const api: BruceApi.Api = ...;
18
- * const key = GetCacheKey("abc");
19
- * api.Cache.Remove(key);
20
- * }
21
- * @param viewId
22
- * @returns
23
- */
24
- function GetCacheKey(viewId: string): string;
25
- /**
26
- * Returns cache identifier for a list of project views.
27
- * Example: {
28
- * const api: BruceApi.Api = ...;
29
- * const key = GetListCacheKey();
30
- * api.Cache.Remove(key);
31
- * }
32
- * @returns
33
- */
34
- function GetListCacheKey(): string;
35
14
  const DEFAULT_DATA_VERSION = 2;
15
+ const TYPE_WEB_3D_NAVIGATOR = "WEB_3D_NAVIGATOR";
16
+ const TYPE_WEB_2D_NAVIGATOR = "WEB_2D_NAVIGATOR";
17
+ const DEFAULT_TYPE = "WEB_3D_NAVIGATOR";
36
18
  /**
37
19
  * Describes a project view record.
38
20
  */
@@ -40,6 +22,7 @@ export declare namespace ProjectView {
40
22
  ID?: string;
41
23
  Name: string;
42
24
  Description?: string;
25
+ Type?: typeof TYPE_WEB_3D_NAVIGATOR | typeof TYPE_WEB_2D_NAVIGATOR | string;
43
26
  "CreatedByUser.ID"?: string;
44
27
  CreatedTime?: UTC.IUTC;
45
28
  DefaultUISlideID?: string;
@@ -117,6 +100,7 @@ export declare namespace ProjectView {
117
100
  */
118
101
  function GetList(params: {
119
102
  api?: BruceApi.Api;
103
+ type?: typeof TYPE_WEB_3D_NAVIGATOR | typeof TYPE_WEB_2D_NAVIGATOR | string;
120
104
  req?: Api.IReqParams;
121
105
  }): Promise<{
122
106
  views: IView[];
@@ -142,4 +126,26 @@ export declare namespace ProjectView {
142
126
  }): Promise<{
143
127
  view: IView;
144
128
  }>;
129
+ /**
130
+ * Returns cache identifier for a project view.
131
+ * Example: {
132
+ * const api: BruceApi.Api = ...;
133
+ * const key = GetCacheKey("abc");
134
+ * api.Cache.Remove(key);
135
+ * }
136
+ * @param viewId
137
+ * @returns
138
+ */
139
+ function GetCacheKey(viewId: string): string;
140
+ /**
141
+ * Returns cache identifier for a list of project views.
142
+ * Example: {
143
+ * const api: BruceApi.Api = ...;
144
+ * const key = GetListCacheKey();
145
+ * api.Cache.Remove(key);
146
+ * }
147
+ * @param type optional filter for the type of project view.
148
+ * @returns
149
+ */
150
+ function GetListCacheKey(type?: string): string;
145
151
  }
@@ -4,15 +4,6 @@ import { Style } from "../bruce-models";
4
4
  * between a min-max distance of an entity to the camera.
5
5
  */
6
6
  export declare namespace ZoomControl {
7
- /**
8
- * Available display types for a menu item.
9
- */
10
- enum EDisplayType {
11
- Hidden = "hidden",
12
- Point = "point",
13
- Geometry = "geometry",
14
- Model3D = "3d"
15
- }
16
7
  /**
17
8
  * Describes a menu item's zoom control row.
18
9
  * Typically there is an array of these for a menu item.
@@ -26,4 +17,13 @@ export declare namespace ZoomControl {
26
17
  LODCategoryID?: string;
27
18
  LODLevel?: number | string;
28
19
  }
20
+ /**
21
+ * Available display types for a menu item.
22
+ */
23
+ enum EDisplayType {
24
+ Hidden = "hidden",
25
+ Point = "point",
26
+ Geometry = "geometry",
27
+ Model3D = "3d"
28
+ }
29
29
  }
package/package.json CHANGED
@@ -1,78 +1,78 @@
1
- {
2
- "name": "bruce-models",
3
- "version": "3.5.1",
4
- "description": "",
5
- "keywords": [],
6
- "main": "dist/bruce-models.umd.js",
7
- "module": "dist/bruce-models.es5.js",
8
- "typings": "dist/types/bruce-models.d.ts",
9
- "files": [
10
- "dist"
11
- ],
12
- "author": "MatveyL <matveylavrinovich@gmail.com>",
13
- "repository": {
14
- "type": "git",
15
- "url": ""
16
- },
17
- "license": "ISC",
18
- "engines": {
19
- "node": ">=6.0.0"
20
- },
21
- "scripts": {
22
- "prebuild": "rimraf dist",
23
- "build": "tsc --module commonjs && rollup -c rollup.config.ts",
24
- "docs": "typedoc ./src/bruce-models.ts --out ./docs",
25
- "start": "rollup -c rollup.config.ts -w",
26
- "test": "jest \"./test/unit\"",
27
- "test-db": "jest \"./test/db\"",
28
- "test:watch": "jest --watch",
29
- "test:prod": "npm run test -- --no-cache"
30
- },
31
- "jest": {
32
- "transform": {
33
- ".(ts|tsx)": "ts-jest"
34
- },
35
- "testEnvironment": "node",
36
- "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
37
- "moduleFileExtensions": [
38
- "ts",
39
- "tsx",
40
- "js"
41
- ],
42
- "setupFiles": [
43
- "./setup-jest.js"
44
- ]
45
- },
46
- "devDependencies": {
47
- "@types/jest": "^23.3.14",
48
- "@types/lodash": "^4.14.195",
49
- "@types/node": "^10.11.0",
50
- "colors": "^1.3.2",
51
- "coveralls": "^3.0.2",
52
- "cross-env": "^5.2.0",
53
- "husky": "^1.0.1",
54
- "jest": "^23.6.0",
55
- "jest-config": "^23.6.0",
56
- "lodash.camelcase": "^4.3.0",
57
- "prompt": "^1.0.0",
58
- "replace-in-file": "^3.4.2",
59
- "rimraf": "^2.6.2",
60
- "rollup": "^0.67.0",
61
- "rollup-plugin-commonjs": "^9.1.8",
62
- "rollup-plugin-json": "^3.1.0",
63
- "rollup-plugin-node-resolve": "^3.4.0",
64
- "rollup-plugin-sourcemaps": "^0.4.2",
65
- "rollup-plugin-typescript2": "^0.18.0",
66
- "shelljs": "^0.8.3",
67
- "ts-jest": "^23.10.2",
68
- "ts-node": "^7.0.1",
69
- "typedoc": "^0.24.8",
70
- "typescript": "^5.0.4",
71
- "ws": "^8.13.0"
72
- },
73
- "dependencies": {
74
- "isomorphic-fetch": "^3.0.0",
75
- "tslib": "^2.4.0",
76
- "util": "^0.12.4"
77
- }
78
- }
1
+ {
2
+ "name": "bruce-models",
3
+ "version": "3.5.3",
4
+ "description": "",
5
+ "keywords": [],
6
+ "main": "dist/bruce-models.umd.js",
7
+ "module": "dist/bruce-models.es5.js",
8
+ "typings": "dist/types/bruce-models.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "author": "MatveyL <matveylavrinovich@gmail.com>",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": ""
16
+ },
17
+ "license": "ISC",
18
+ "engines": {
19
+ "node": ">=6.0.0"
20
+ },
21
+ "scripts": {
22
+ "prebuild": "rimraf dist",
23
+ "build": "node ./pre-build.js && tsc --module commonjs && rollup -c rollup.config.ts",
24
+ "docs": "typedoc ./src/bruce-models.ts --out ./docs",
25
+ "start": "rollup -c rollup.config.ts -w",
26
+ "test": "jest \"./test/unit\"",
27
+ "test-db": "jest \"./test/db\"",
28
+ "test:watch": "jest --watch",
29
+ "test:prod": "npm run test -- --no-cache"
30
+ },
31
+ "jest": {
32
+ "transform": {
33
+ ".(ts|tsx)": "ts-jest"
34
+ },
35
+ "testEnvironment": "node",
36
+ "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
37
+ "moduleFileExtensions": [
38
+ "ts",
39
+ "tsx",
40
+ "js"
41
+ ],
42
+ "setupFiles": [
43
+ "./setup-jest.js"
44
+ ]
45
+ },
46
+ "devDependencies": {
47
+ "@types/jest": "^23.3.14",
48
+ "@types/lodash": "^4.14.195",
49
+ "@types/node": "^10.11.0",
50
+ "colors": "^1.3.2",
51
+ "coveralls": "^3.0.2",
52
+ "cross-env": "^5.2.0",
53
+ "husky": "^1.0.1",
54
+ "jest": "^23.6.0",
55
+ "jest-config": "^23.6.0",
56
+ "lodash.camelcase": "^4.3.0",
57
+ "prompt": "^1.0.0",
58
+ "replace-in-file": "^3.4.2",
59
+ "rimraf": "^2.6.2",
60
+ "rollup": "^0.67.0",
61
+ "rollup-plugin-commonjs": "^9.1.8",
62
+ "rollup-plugin-json": "^3.1.0",
63
+ "rollup-plugin-node-resolve": "^3.4.0",
64
+ "rollup-plugin-sourcemaps": "^0.4.2",
65
+ "rollup-plugin-typescript2": "^0.18.0",
66
+ "shelljs": "^0.8.3",
67
+ "ts-jest": "^23.10.2",
68
+ "ts-node": "^7.0.1",
69
+ "typedoc": "^0.24.8",
70
+ "typescript": "^5.0.4",
71
+ "ws": "^8.13.0"
72
+ },
73
+ "dependencies": {
74
+ "isomorphic-fetch": "^3.0.0",
75
+ "tslib": "^2.4.0",
76
+ "util": "^0.12.4"
77
+ }
78
+ }