bruce-models 2.9.4 → 2.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-models.es5.js +50 -2944
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +50 -2944
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/common/cache.js +48 -127
- package/dist/lib/common/cache.js.map +1 -1
- package/dist/lib/style/style.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/common/cache.d.ts +8 -11
- package/dist/types/style/style.d.ts +5 -2
- package/package.json +1 -2
package/dist/lib/bruce-models.js
CHANGED
|
@@ -98,5 +98,5 @@ __exportStar(require("./internal/uploader"), exports);
|
|
|
98
98
|
__exportStar(require("./plugin/plugin"), exports);
|
|
99
99
|
__exportStar(require("./environment"), exports);
|
|
100
100
|
__exportStar(require("./data-source/data-source"), exports);
|
|
101
|
-
exports.VERSION = "2.9.
|
|
101
|
+
exports.VERSION = "2.9.6";
|
|
102
102
|
//# sourceMappingURL=bruce-models.js.map
|
package/dist/lib/common/cache.js
CHANGED
|
@@ -1,37 +1,15 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.CacheControl = void 0;
|
|
13
|
-
|
|
14
|
-
const DEFAULT_DURATION = 60 * 1000;
|
|
15
|
-
const VERSION = 4;
|
|
4
|
+
// 1 minute.
|
|
5
|
+
const DEFAULT_DURATION = 60 * 1000;
|
|
16
6
|
class CacheControl {
|
|
17
|
-
getStorageKeys() {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
if (this._storageKeys == null) {
|
|
20
|
-
this._storageKeys = yield this.storage.keys();
|
|
21
|
-
}
|
|
22
|
-
return this._storageKeys;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
7
|
constructor(id) {
|
|
26
|
-
this._storageKeys = null;
|
|
27
8
|
this.memory = new Map();
|
|
28
9
|
this.Disabled = false;
|
|
29
10
|
if (!id) {
|
|
30
11
|
id = "default";
|
|
31
12
|
}
|
|
32
|
-
this.storage = localforage_1.default.createInstance({
|
|
33
|
-
name: `v${VERSION}_${id}`,
|
|
34
|
-
});
|
|
35
13
|
}
|
|
36
14
|
/**
|
|
37
15
|
* Sets item to cache.
|
|
@@ -40,49 +18,21 @@ class CacheControl {
|
|
|
40
18
|
* @param duration
|
|
41
19
|
*/
|
|
42
20
|
Set(params) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
if (persistence == "storage") {
|
|
60
|
-
let putIntoStorage = true;
|
|
61
|
-
// Cannot store promises, so will need to wait for them to resolve.
|
|
62
|
-
if (data instanceof Promise) {
|
|
63
|
-
// Store in memory until resolved, that way we can return the data if requested again.
|
|
64
|
-
this.memory.set(id, record);
|
|
65
|
-
try {
|
|
66
|
-
data = yield data;
|
|
67
|
-
record.data = data;
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
// If it failed then we keep it in memory so that requesting it will retain the promise exception.
|
|
71
|
-
putIntoStorage = false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (putIntoStorage) {
|
|
75
|
-
yield this.storage.setItem(id, record);
|
|
76
|
-
if (this.memory.has(id)) {
|
|
77
|
-
this.memory.delete(id);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this.memory.set(id, record);
|
|
83
|
-
yield this.storage.removeItem(id);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
21
|
+
if (this.Disabled) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
let { id, data, duration } = params;
|
|
25
|
+
if (!duration || duration < 0) {
|
|
26
|
+
duration = DEFAULT_DURATION;
|
|
27
|
+
}
|
|
28
|
+
id = String(id);
|
|
29
|
+
const expires = Date.now() + duration;
|
|
30
|
+
const record = {
|
|
31
|
+
id,
|
|
32
|
+
data,
|
|
33
|
+
expires
|
|
34
|
+
};
|
|
35
|
+
this.memory.set(id, record);
|
|
86
36
|
}
|
|
87
37
|
/**
|
|
88
38
|
* Returns the item with the given id.
|
|
@@ -90,59 +40,43 @@ class CacheControl {
|
|
|
90
40
|
* @returns
|
|
91
41
|
*/
|
|
92
42
|
Get(id) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (!record) {
|
|
101
|
-
record = yield this.storage.getItem(id);
|
|
102
|
-
}
|
|
103
|
-
if (!record) {
|
|
104
|
-
return {
|
|
105
|
-
data: null,
|
|
106
|
-
found: false
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
if (record.expires < Date.now()) {
|
|
110
|
-
if (this.memory.has(id)) {
|
|
111
|
-
this.memory.delete(id);
|
|
112
|
-
}
|
|
113
|
-
yield this.storage.removeItem(id);
|
|
114
|
-
return {
|
|
115
|
-
data: null,
|
|
116
|
-
found: false
|
|
117
|
-
};
|
|
118
|
-
}
|
|
43
|
+
if (this.Disabled) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
id = String(id);
|
|
47
|
+
// Prioritize memory over storage because it's faster to access.
|
|
48
|
+
let record = this.memory.get(id);
|
|
49
|
+
if (!record) {
|
|
119
50
|
return {
|
|
120
|
-
data:
|
|
121
|
-
found:
|
|
51
|
+
data: null,
|
|
52
|
+
found: false
|
|
122
53
|
};
|
|
123
|
-
}
|
|
54
|
+
}
|
|
55
|
+
if (record.expires < Date.now()) {
|
|
56
|
+
this.memory.delete(id);
|
|
57
|
+
return {
|
|
58
|
+
data: null,
|
|
59
|
+
found: false
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
data: record.data,
|
|
64
|
+
found: true
|
|
65
|
+
};
|
|
124
66
|
}
|
|
125
67
|
/**
|
|
126
68
|
* Removes all items from the cache.
|
|
127
69
|
*/
|
|
128
70
|
Clear() {
|
|
129
|
-
|
|
130
|
-
this.memory.clear();
|
|
131
|
-
yield this.storage.clear();
|
|
132
|
-
this._storageKeys = null;
|
|
133
|
-
});
|
|
71
|
+
this.memory.clear();
|
|
134
72
|
}
|
|
135
73
|
/**
|
|
136
74
|
* Removes the item with the given id.
|
|
137
75
|
* @param id
|
|
138
76
|
*/
|
|
139
77
|
Remove(id) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
this.memory.delete(id);
|
|
143
|
-
yield this.storage.removeItem(id);
|
|
144
|
-
this._storageKeys = null;
|
|
145
|
-
});
|
|
78
|
+
id = String(id);
|
|
79
|
+
this.memory.delete(id);
|
|
146
80
|
}
|
|
147
81
|
/**
|
|
148
82
|
* Removes all items that match the callback.
|
|
@@ -150,39 +84,26 @@ class CacheControl {
|
|
|
150
84
|
* @param callback
|
|
151
85
|
*/
|
|
152
86
|
RemoveBy(callback) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
yield this.storage.removeItem(key);
|
|
158
|
-
}
|
|
87
|
+
const memoryKeys = Array.from(this.memory.keys());
|
|
88
|
+
for (const key of memoryKeys) {
|
|
89
|
+
if (callback(key)) {
|
|
90
|
+
this.memory.delete(key);
|
|
159
91
|
}
|
|
160
|
-
|
|
161
|
-
for (const key of memoryKeys) {
|
|
162
|
-
if (callback(key)) {
|
|
163
|
-
this.memory.delete(key);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
this._storageKeys = null;
|
|
167
|
-
});
|
|
92
|
+
}
|
|
168
93
|
}
|
|
169
94
|
/**
|
|
170
95
|
* Removes all items that start with the given text.
|
|
171
96
|
* @param text
|
|
172
97
|
*/
|
|
173
98
|
RemoveByStartsWith(text) {
|
|
174
|
-
|
|
175
|
-
yield this.RemoveBy(key => String(key).startsWith(String(text)));
|
|
176
|
-
});
|
|
99
|
+
this.RemoveBy(key => String(key).startsWith(String(text)));
|
|
177
100
|
}
|
|
178
101
|
/**
|
|
179
102
|
* Removes all items that contain the given text.
|
|
180
103
|
* @param text
|
|
181
104
|
*/
|
|
182
105
|
RemoveByContains(text) {
|
|
183
|
-
|
|
184
|
-
yield this.RemoveBy(key => String(key).includes(String(text)));
|
|
185
|
-
});
|
|
106
|
+
this.RemoveBy(key => String(key).includes(String(text)));
|
|
186
107
|
}
|
|
187
108
|
}
|
|
188
109
|
exports.CacheControl = CacheControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/common/cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/common/cache.ts"],"names":[],"mappings":";;;AAGA,YAAY;AACZ,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC;AAWnC,MAAa,YAAY;IAIrB,YAAY,EAAU;QAHd,WAAM,GAAsB,IAAI,GAAG,EAAgB,CAAC;QACrD,aAAQ,GAAY,KAAK,CAAC;QAG7B,IAAI,CAA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ED;;OAEG;IACI,KAAK;QACR,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,EAAO;QACjB,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;QAChB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,QAA+B;QAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;YAC1B,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACf,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aAC3B;SACJ;IACL,CAAC;IAED;;;OAGG;IACI,kBAAkB,CAAC,IAAS;QAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACI,gBAAgB,CAAC,IAAS;QAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;CACJ;AA3HD,oCA2HC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/style/style.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAiC;AAGjC,gDAA6C;AAE7C;;;;;;GAMG;AACH,IAAiB,KAAK,
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/style/style.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAiC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MAAM,CAAC;YAClD,IAAI,CAAC,GAAG,EAAE;gBACN,GAAG,GAAG,yBAAW,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;aACzC;YAED,IAAI,CAAC,EAAE,EAAE;gBACL,MAAK,CAAC,uBAAuB,CAAC,CAAC;aAClC;YACD,MAAM,GAAG,CAAC,MAAM,CAAC,2BAA2B,EAAE,EAAE,EAAE,SAAG,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;YAChF,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;YAClC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC;QACxC,CAAC;KAAA;IAhBqB,YAAM,SAgB3B,CAAA;AACL,CAAC,EA1NgB,KAAK,GAAL,aAAK,KAAL,aAAK,QA0NrB"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
type Key = string | number;
|
|
2
2
|
type Persistence = "memory" | "storage";
|
|
3
3
|
export declare class CacheControl<T> {
|
|
4
|
-
private storage;
|
|
5
|
-
private _storageKeys;
|
|
6
|
-
private getStorageKeys;
|
|
7
4
|
private memory;
|
|
8
5
|
Disabled: boolean;
|
|
9
6
|
constructor(id: string);
|
|
@@ -18,40 +15,40 @@ export declare class CacheControl<T> {
|
|
|
18
15
|
data: any;
|
|
19
16
|
persistence?: Persistence;
|
|
20
17
|
duration?: number;
|
|
21
|
-
}):
|
|
18
|
+
}): void;
|
|
22
19
|
/**
|
|
23
20
|
* Returns the item with the given id.
|
|
24
21
|
* @param id
|
|
25
22
|
* @returns
|
|
26
23
|
*/
|
|
27
|
-
Get(id: Key):
|
|
24
|
+
Get(id: Key): {
|
|
28
25
|
data: T;
|
|
29
26
|
found: boolean;
|
|
30
|
-
}
|
|
27
|
+
};
|
|
31
28
|
/**
|
|
32
29
|
* Removes all items from the cache.
|
|
33
30
|
*/
|
|
34
|
-
Clear():
|
|
31
|
+
Clear(): void;
|
|
35
32
|
/**
|
|
36
33
|
* Removes the item with the given id.
|
|
37
34
|
* @param id
|
|
38
35
|
*/
|
|
39
|
-
Remove(id: Key):
|
|
36
|
+
Remove(id: Key): void;
|
|
40
37
|
/**
|
|
41
38
|
* Removes all items that match the callback.
|
|
42
39
|
* If callback returns true then the item is removed.
|
|
43
40
|
* @param callback
|
|
44
41
|
*/
|
|
45
|
-
RemoveBy(callback: (key: Key) => boolean):
|
|
42
|
+
RemoveBy(callback: (key: Key) => boolean): void;
|
|
46
43
|
/**
|
|
47
44
|
* Removes all items that start with the given text.
|
|
48
45
|
* @param text
|
|
49
46
|
*/
|
|
50
|
-
RemoveByStartsWith(text: Key):
|
|
47
|
+
RemoveByStartsWith(text: Key): void;
|
|
51
48
|
/**
|
|
52
49
|
* Removes all items that contain the given text.
|
|
53
50
|
* @param text
|
|
54
51
|
*/
|
|
55
|
-
RemoveByContains(text: Key):
|
|
52
|
+
RemoveByContains(text: Key): void;
|
|
56
53
|
}
|
|
57
54
|
export {};
|
|
@@ -27,9 +27,8 @@ export declare namespace Style {
|
|
|
27
27
|
iconUrl: Calculator.IField[];
|
|
28
28
|
iconScale: Calculator.IField[];
|
|
29
29
|
altitudeOption?: any;
|
|
30
|
-
ClusterNearbyEntities?: boolean;
|
|
31
|
-
MinimumEntitiesCountForClustering?: Calculator.IField[];
|
|
32
30
|
Type: EPointType;
|
|
31
|
+
renderOnTop?: boolean;
|
|
33
32
|
CylinderFillColor?: Calculator.IField[];
|
|
34
33
|
CylinderFillExtrusion?: Calculator.IField[];
|
|
35
34
|
CylinderRadius?: Calculator.IField[];
|
|
@@ -37,6 +36,8 @@ export declare namespace Style {
|
|
|
37
36
|
CylinderBorderExtrusion?: Calculator.IField[];
|
|
38
37
|
CylinderBorderWidth?: Calculator.IField[];
|
|
39
38
|
CylinderBorderColor?: Calculator.IField[];
|
|
39
|
+
ClusterNearbyEntities?: boolean;
|
|
40
|
+
MinimumEntitiesCountForClustering?: Calculator.IField[];
|
|
40
41
|
}
|
|
41
42
|
interface IPolygonSettings {
|
|
42
43
|
useExtrusion: boolean;
|
|
@@ -46,6 +47,7 @@ export declare namespace Style {
|
|
|
46
47
|
lineWidth: Calculator.IField[];
|
|
47
48
|
altitudeOption?: any;
|
|
48
49
|
zIndex?: Calculator.IField[];
|
|
50
|
+
drapeOver?: "TERRAIN" | "ALL";
|
|
49
51
|
}
|
|
50
52
|
interface IPolylineSettings {
|
|
51
53
|
lineColor: Calculator.IField[];
|
|
@@ -53,6 +55,7 @@ export declare namespace Style {
|
|
|
53
55
|
lineWidthUnits?: "px" | "m";
|
|
54
56
|
altitudeOption?: any;
|
|
55
57
|
zIndex?: Calculator.IField[];
|
|
58
|
+
drapeOver?: "TERRAIN" | "ALL";
|
|
56
59
|
}
|
|
57
60
|
interface IModelSettings {
|
|
58
61
|
customize: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bruce-models",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/bruce-models.umd.js",
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"husky": "^1.0.1",
|
|
54
54
|
"jest": "^23.6.0",
|
|
55
55
|
"jest-config": "^23.6.0",
|
|
56
|
-
"localforage": "^1.10.0",
|
|
57
56
|
"lodash.camelcase": "^4.3.0",
|
|
58
57
|
"prompt": "^1.0.0",
|
|
59
58
|
"replace-in-file": "^3.4.2",
|