@formant/data-sdk 0.0.132 → 0.0.134

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.
@@ -7,6 +7,9 @@ import { InterventionType } from "./main";
7
7
  import { IInterventionTypeMap } from "./main";
8
8
  import { IInterventionResponse } from "./main";
9
9
  import { RtcStreamType } from "@formant/realtime-sdk/dist/model/RtcStreamType";
10
+ import { IEventQuery } from "./main";
11
+ import { AggregateLevel } from "./main";
12
+ import { EventType } from "./main";
10
13
  export interface ConfigurationDocument {
11
14
  urdfFiles: string[];
12
15
  telemetry?: {
@@ -131,4 +134,17 @@ export declare class Device implements IRealtimeDevice {
131
134
  [key in string]: string[];
132
135
  }): Promise<(id: string) => IInterventionTypeMap[T]["response"]>;
133
136
  addInterventionResponse<T extends InterventionType>(interventionId: string, interventionType: InterventionType, data: IInterventionTypeMap[T]["response"]): Promise<IInterventionResponse>;
137
+ getAnnotationCount(query: IEventQuery, tagKey: string): Promise<{
138
+ [key: string]: number;
139
+ }>;
140
+ getAnnotationCountByIntervals(query: IEventQuery, tagKey: string, aggregate: AggregateLevel): Promise<{
141
+ date: string;
142
+ annotations: {
143
+ [key: string]: number;
144
+ };
145
+ }[]>;
146
+ eventsCounter(eventTypes: EventType[], timeFrame: AggregateLevel, range: number, time: number, query?: IEventQuery): Promise<{
147
+ date: string;
148
+ events: import("./main").IEvent[];
149
+ }[]>;
134
150
  }
@@ -7,8 +7,9 @@ import { IStreamAggregateData } from "./model/IStreamAggregateData";
7
7
  import { IStreamData } from "./model/IStreamData";
8
8
  import { PeerDevice } from "./PeerDevice";
9
9
  import { IDeviceQuery } from "./model/IDeviceQuery";
10
- import { IAnnotationQuery } from "./model/IAnnotationQuery";
11
10
  import { IStream } from "./model/IStream";
11
+ import { AggregateLevel } from "./main";
12
+ import { EventType } from "./main";
12
13
  export interface TelemetryResult {
13
14
  deviceId: string;
14
15
  name: string;
@@ -44,9 +45,19 @@ export declare class Fleet {
44
45
  static getEvent(uuid: string): Promise<IEvent>;
45
46
  static getInterventions(): Promise<IEvent[]>;
46
47
  static getCurrentGroup(): Promise<Device[] | undefined>;
47
- static getAnnotationCount(query: IAnnotationQuery): Promise<{
48
+ static getAnnotationCount(query: IEventQuery, tagKey: string): Promise<{
48
49
  [key: string]: number;
49
50
  }>;
51
+ static getAnnotationCountByIntervals(query: IEventQuery, tagKey: string, aggregate: AggregateLevel): Promise<{
52
+ date: string;
53
+ annotations: {
54
+ [key: string]: number;
55
+ };
56
+ }[]>;
50
57
  static getStreams(): Promise<IStream[]>;
51
58
  static patchStream(stream: IStream): Promise<IStream>;
59
+ static eventsCounter(eventTypes: EventType[], timeFrame: AggregateLevel, range: number, time: number, query?: IEventQuery): Promise<{
60
+ date: string;
61
+ events: IEvent[];
62
+ }[]>;
52
63
  }
@@ -113,5 +113,6 @@ export * from "./model/videoMimeTypes";
113
113
  export * from "./model/VideoMimeType";
114
114
  export * from "./model/IDeviceQuery";
115
115
  export * from "./model/IAnnotationQuery";
116
+ export * from "./model/IStream";
116
117
  export { IRtcSendConfiguration, IRtcStreamMessage, IRtcStreamPayload, } from "@formant/realtime-sdk";
117
118
  export * from "./model/JsonSchema";
@@ -1 +1 @@
1
- export type AggregateLevel = "year" | "month" | "week" | "day" | "hour" | "minute" | "second";
1
+ export type AggregateLevel = "year" | "month" | "week" | "day" | "hour" | "minute" | "quarter";
@@ -1,4 +1,13 @@
1
1
  import { INumericAggregate } from "../model/INumericAggregate";
2
+ import { AggregateLevel } from "../main";
3
+ export type IAggregateByDateFunctions = {
4
+ [key in AggregateLevel]: AggregateFunction;
5
+ };
6
+ export declare const aggregateFunctions: readonly ["interval", "start", "end", "sub", "get"];
7
+ export type AggregateFunctions = typeof aggregateFunctions[number];
8
+ export type AggregateFunction = {
9
+ [key in AggregateFunctions]: any;
10
+ };
2
11
  export declare function getVariance(a: INumericAggregate): number;
3
12
  export declare function getStandardDeviation(a: INumericAggregate): number;
4
13
  export declare function getMax(a: INumericAggregate): number;
@@ -14,3 +23,5 @@ export declare const aggregateFunctionMap: {
14
23
  sum: typeof getSum;
15
24
  count: typeof getCount;
16
25
  };
26
+ export declare const aggregateByDateFunctions: IAggregateByDateFunctions;
27
+ export declare const formatTimeFrameText: (start: string, end: string) => string;
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "require": "./dist/data-sdk.umd.js"
19
19
  }
20
20
  },
21
- "version": "0.0.132",
21
+ "version": "0.0.134",
22
22
  "scripts": {
23
23
  "dev": "vite --port 9146",
24
24
  "build": "tsc && vite build",