bruce-models 3.8.3 → 3.8.5
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 +225 -10
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +223 -9
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-features.js +2 -0
- package/dist/lib/account/account-features.js.map +1 -1
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/api/api.js +1 -0
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/bruce-models.js +2 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/entity/entity-historic-data.js +141 -0
- package/dist/lib/entity/entity-historic-data.js.map +1 -0
- package/dist/lib/entity/entity-type.js +47 -0
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js +48 -8
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/types/account/account.d.ts +1 -0
- package/dist/types/api/api.d.ts +2 -1
- package/dist/types/bruce-models.d.ts +2 -1
- package/dist/types/entity/entity-historic-data.d.ts +74 -0
- package/dist/types/entity/entity-type.d.ts +24 -0
- package/dist/types/entity/entity.d.ts +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Api } from "../api/api";
|
|
2
|
+
import { BruceApi } from "../api/bruce-api";
|
|
3
|
+
import { IDictionary } from "../common/dictionary";
|
|
4
|
+
export declare namespace EntityHistoricData {
|
|
5
|
+
interface IData {
|
|
6
|
+
attrKey: string;
|
|
7
|
+
dateTime: string;
|
|
8
|
+
entityId?: string;
|
|
9
|
+
data: any;
|
|
10
|
+
}
|
|
11
|
+
interface IStats {
|
|
12
|
+
attrKey: string;
|
|
13
|
+
dateTimeMax: string;
|
|
14
|
+
dateTimeMin: string;
|
|
15
|
+
count: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns historic data for an array of Entity IDs.
|
|
19
|
+
* A maximum number of records will be returned per Entity ID, this information is returned in the response.
|
|
20
|
+
* @param params
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
function GetList(params: {
|
|
24
|
+
entityIds: string[];
|
|
25
|
+
attrKey: string | string[];
|
|
26
|
+
dateTimeFrom: string;
|
|
27
|
+
dateTimeTo: string;
|
|
28
|
+
api?: BruceApi.Api;
|
|
29
|
+
req?: Api.IReqParams;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
recordsByIds: IDictionary<IData[]>;
|
|
32
|
+
limitPerEntity: number;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Returns historic data statistics for an array of Entity IDs.
|
|
36
|
+
* @param params
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
function GetStats(params: {
|
|
40
|
+
entityIds: string[];
|
|
41
|
+
api?: BruceApi.Api;
|
|
42
|
+
req?: Api.IReqParams;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
stats: IDictionary<IStats>;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates or updates historic data records.
|
|
48
|
+
* Please note that the expected input/output does not include internal fields found inside the "Bruce" attribute.
|
|
49
|
+
* @param params
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
function Update(params: {
|
|
53
|
+
records: IData[];
|
|
54
|
+
api?: BruceApi.Api;
|
|
55
|
+
req?: Api.IReqParams;
|
|
56
|
+
}): Promise<{
|
|
57
|
+
records: IData[];
|
|
58
|
+
errors?: string[];
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Deletes historic data records for an array of Entity IDs.
|
|
62
|
+
* This deletes all records within a provided key + range.
|
|
63
|
+
* @param params
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
function Delete(params: {
|
|
67
|
+
entityIds: string[];
|
|
68
|
+
attrKey: string | string[];
|
|
69
|
+
dateTimeFrom: string;
|
|
70
|
+
dateTimeTo: string;
|
|
71
|
+
api?: BruceApi.Api;
|
|
72
|
+
req?: Api.IReqParams;
|
|
73
|
+
}): Promise<void>;
|
|
74
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Api } from "../api/api";
|
|
2
2
|
import { BruceApi } from "../api/bruce-api";
|
|
3
|
+
import { PendingAction } from "../bruce-models";
|
|
3
4
|
import { UTC } from "../common/utc";
|
|
4
5
|
import { Entity } from "./entity";
|
|
5
6
|
import { EntityAttribute } from "./entity-attribute";
|
|
@@ -84,6 +85,29 @@ export declare namespace EntityType {
|
|
|
84
85
|
}): Promise<{
|
|
85
86
|
entityType: IType;
|
|
86
87
|
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Starts a re-index background action on a specified Entity Type.
|
|
90
|
+
* This will ensure searchable data follows the current schema version.
|
|
91
|
+
* This will also perform certain data cleanup so that the data is consistent.
|
|
92
|
+
* @param params
|
|
93
|
+
* @returns
|
|
94
|
+
*/
|
|
95
|
+
function ReIndex(params: {
|
|
96
|
+
api?: BruceApi.Api;
|
|
97
|
+
entityTypeId: string;
|
|
98
|
+
dataTransformId?: number;
|
|
99
|
+
req?: Api.IReqParams;
|
|
100
|
+
}): Promise<PendingAction.IAction>;
|
|
101
|
+
/**
|
|
102
|
+
* Counts the total number of Entities in an Entity Type.
|
|
103
|
+
* @param params
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
function Count(params: {
|
|
107
|
+
entityTypeId: string;
|
|
108
|
+
api?: BruceApi.Api;
|
|
109
|
+
req?: Api.IReqParams;
|
|
110
|
+
}): Promise<number>;
|
|
87
111
|
/**
|
|
88
112
|
* Returns cache identifier for an entity type.
|
|
89
113
|
* Example: {
|
|
@@ -26,6 +26,8 @@ export declare namespace Entity {
|
|
|
26
26
|
ID?: string;
|
|
27
27
|
"Layer.ID"?: number[];
|
|
28
28
|
relations?: IRelationData[];
|
|
29
|
+
historicAttrKey?: string;
|
|
30
|
+
historicDateTime?: string;
|
|
29
31
|
};
|
|
30
32
|
location?: Carto.ICarto;
|
|
31
33
|
boundaries?: Bounds.IBounds;
|
|
@@ -55,6 +57,9 @@ export declare namespace Entity {
|
|
|
55
57
|
entityTypeId?: string;
|
|
56
58
|
expandLocation?: boolean;
|
|
57
59
|
expandRelations?: boolean;
|
|
60
|
+
historicKey?: string;
|
|
61
|
+
historicFrom?: string;
|
|
62
|
+
historicTo?: string;
|
|
58
63
|
req?: Api.IReqParams;
|
|
59
64
|
}): Promise<{
|
|
60
65
|
entity: IEntity;
|
|
@@ -69,6 +74,9 @@ export declare namespace Entity {
|
|
|
69
74
|
entityIds: string[];
|
|
70
75
|
expandLocation?: boolean;
|
|
71
76
|
expandRelations?: boolean;
|
|
77
|
+
historicKey?: string;
|
|
78
|
+
historicFrom?: string;
|
|
79
|
+
historicTo?: string;
|
|
72
80
|
req?: Api.IReqParams;
|
|
73
81
|
}): Promise<{
|
|
74
82
|
entities: IEntity[];
|
|
@@ -199,6 +207,9 @@ export declare namespace Entity {
|
|
|
199
207
|
analysis?: boolean;
|
|
200
208
|
viaCdn?: boolean;
|
|
201
209
|
viaCdnCacheToken?: number | string;
|
|
210
|
+
historicKey?: string;
|
|
211
|
+
historicFrom?: string;
|
|
212
|
+
historicTo?: string;
|
|
202
213
|
req?: Api.IReqParams;
|
|
203
214
|
}): Promise<{
|
|
204
215
|
entities?: IEntity[];
|
|
@@ -226,6 +237,9 @@ export declare namespace Entity {
|
|
|
226
237
|
entityTypeId?: string;
|
|
227
238
|
expandLocation?: boolean;
|
|
228
239
|
expandRelations?: boolean;
|
|
240
|
+
historicKey?: string;
|
|
241
|
+
historicFrom?: string;
|
|
242
|
+
historicTo?: string;
|
|
229
243
|
}): string;
|
|
230
244
|
/**
|
|
231
245
|
* Returns cache identifier for an entity record.
|
|
@@ -238,5 +252,11 @@ export declare namespace Entity {
|
|
|
238
252
|
* @returns
|
|
239
253
|
*/
|
|
240
254
|
function GetContainsKey(entityId: string): string;
|
|
255
|
+
/**
|
|
256
|
+
* Returns cache identifier for entity records that have historic data.
|
|
257
|
+
* @param attrKey
|
|
258
|
+
* @returns
|
|
259
|
+
*/
|
|
260
|
+
function GetHistoricContainsKey(attrKey: string): string;
|
|
241
261
|
}
|
|
242
262
|
export {};
|