@formant/data-sdk 0.0.117 → 0.0.119
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/data-sdk.es.js +1693 -1051
- package/dist/data-sdk.umd.js +26 -26
- package/dist/types/common/duration.d.ts +10 -0
- package/dist/types/data-sdk/src/App.d.ts +12 -0
- package/dist/types/data-sdk/src/cache/StoreCache.d.ts +17 -0
- package/dist/types/data-sdk/src/cache/filterDataByTime.d.ts +2 -0
- package/dist/types/data-sdk/src/cache/filterDataByType.d.ts +3 -0
- package/dist/types/data-sdk/src/cache/queryStore.d.ts +11 -0
- package/dist/types/data-sdk/src/{Fleet.d.ts → fleet.d.ts} +0 -0
- package/dist/types/data-sdk/src/main.d.ts +2 -0
- package/dist/types/data-sdk/src/model/JsonSchema.d.ts +38 -0
- package/dist/types/data-sdk/src/utils/numericAggregateUtils.d.ts +1 -2
- package/package.json +5 -4
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { IStreamData, StreamType } from "./main";
|
|
2
|
+
import { JsonSchema } from "./model/JsonSchema";
|
|
1
3
|
export type AppMessage = {
|
|
2
4
|
type: "go_to_time";
|
|
3
5
|
time: number;
|
|
6
|
+
} | {
|
|
7
|
+
type: "prompt";
|
|
8
|
+
promptId: string;
|
|
9
|
+
schema: JsonSchema;
|
|
4
10
|
} | {
|
|
5
11
|
type: "go_to_device";
|
|
6
12
|
deviceId: string;
|
|
@@ -58,6 +64,10 @@ export type EmbeddedAppMessage = {
|
|
|
58
64
|
channel: string;
|
|
59
65
|
source: string;
|
|
60
66
|
data: any;
|
|
67
|
+
} | {
|
|
68
|
+
type: "prompt_response";
|
|
69
|
+
promptId: string;
|
|
70
|
+
data: string;
|
|
61
71
|
} | ModuleConfigurationMessage;
|
|
62
72
|
export interface ModuleData {
|
|
63
73
|
queryRange: QueryRange;
|
|
@@ -105,10 +115,12 @@ export declare class App {
|
|
|
105
115
|
static addMenuListener(handler: (label: string) => void): void;
|
|
106
116
|
static addAccessTokenRefreshListener(handler: (token: string) => void): void;
|
|
107
117
|
static addModuleDataListener(handler: (data: ModuleData) => void): void;
|
|
118
|
+
static addStreamListener<T extends StreamType>(streamName: string, streamType: T, handler: (response: IStreamData<T>[] | "too much data" | undefined) => void): () => void;
|
|
108
119
|
static addModuleConfigurationListener(handler: (event: ModuleConfigurationMessage) => void): void;
|
|
109
120
|
static addChannelDataListener(channel: string, handler: (e: {
|
|
110
121
|
source: string;
|
|
111
122
|
data: any;
|
|
112
123
|
}) => void): void;
|
|
113
124
|
static requestOverviewDevices(handler: (data: any) => void): void;
|
|
125
|
+
static prompt(schema: JsonSchema): Promise<any>;
|
|
114
126
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class StoreCache<Key, Value> {
|
|
2
|
+
private entries;
|
|
3
|
+
private metadata;
|
|
4
|
+
private capacity;
|
|
5
|
+
private timeout;
|
|
6
|
+
constructor({ capacity, timeout, }?: {
|
|
7
|
+
capacity?: number;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
});
|
|
10
|
+
get(key: Key, generator?: () => Promise<Value>): Value | undefined;
|
|
11
|
+
set(key: Key, value: Value): void;
|
|
12
|
+
clear(): void;
|
|
13
|
+
clearKey(key: string): void;
|
|
14
|
+
private keyToCacheKey;
|
|
15
|
+
private deleteOldestEntry;
|
|
16
|
+
private generate;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IStreamData } from "../model/IStreamData";
|
|
2
|
+
import { StreamType } from "../model/StreamType";
|
|
3
|
+
import { IFilter } from "../model/IFilter";
|
|
4
|
+
export declare class QueryStore {
|
|
5
|
+
private queryStoreCache;
|
|
6
|
+
private liveQueryStoreCache;
|
|
7
|
+
moduleQuery<T extends StreamType>(filter: IFilter, name: string, type: T, start: Date, end: Date, latestOnly?: boolean): IStreamData<T>[] | "too much data" | undefined;
|
|
8
|
+
query(filter: IFilter, start: Date, end: Date, latestOnly?: boolean): IStreamData[] | "too much data" | undefined;
|
|
9
|
+
private queryCache;
|
|
10
|
+
private liveQueryCache;
|
|
11
|
+
}
|
|
File without changes
|
|
@@ -111,4 +111,6 @@ export * from "./model/Timestamp";
|
|
|
111
111
|
export * from "./model/Uuid";
|
|
112
112
|
export * from "./model/videoMimeTypes";
|
|
113
113
|
export * from "./model/VideoMimeType";
|
|
114
|
+
export * from "./model/IDeviceQuery";
|
|
114
115
|
export { IRtcSendConfiguration, IRtcStreamMessage, IRtcStreamPayload, } from "@formant/realtime-sdk";
|
|
116
|
+
export * from "./model/JsonSchema";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StreamType } from "./StreamType";
|
|
2
|
+
export type FieldType = "string" | "integer" | "number" | "array" | "object" | "bool" | "boolean" | "$formant.stream";
|
|
3
|
+
export interface IJsonBaseSchema<T extends FieldType> {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
type: T;
|
|
7
|
+
default?: string;
|
|
8
|
+
required?: string[];
|
|
9
|
+
$schema?: string;
|
|
10
|
+
"$formant.visible.when"?: [string, "=", string];
|
|
11
|
+
}
|
|
12
|
+
export interface IPropertyObject {
|
|
13
|
+
[key: string]: JsonSchema;
|
|
14
|
+
}
|
|
15
|
+
export interface IJsonObjectSchema extends IJsonBaseSchema<"object"> {
|
|
16
|
+
items: IPropertyObject;
|
|
17
|
+
properties: IPropertyObject;
|
|
18
|
+
"$formant.documentationUrl"?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface IJsonArraySchema extends IJsonBaseSchema<"array"> {
|
|
21
|
+
items: {
|
|
22
|
+
type: "integer" | "number" | "string" | "object";
|
|
23
|
+
properties: IPropertyObject;
|
|
24
|
+
required?: string[];
|
|
25
|
+
"$formant.itemName"?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface IJsonStringSchema extends IJsonBaseSchema<"string"> {
|
|
29
|
+
enum?: string[];
|
|
30
|
+
"$formant.streams.byType"?: StreamType;
|
|
31
|
+
"$formant.placeholder"?: string;
|
|
32
|
+
"$formant.groups": boolean;
|
|
33
|
+
"$formant.date": boolean;
|
|
34
|
+
}
|
|
35
|
+
export type IJsonBooleanSchema = IJsonBaseSchema<"boolean">;
|
|
36
|
+
export type IJsonIntegerSchema = IJsonBaseSchema<"integer">;
|
|
37
|
+
export type IJsonNumberSchema = IJsonBaseSchema<"number">;
|
|
38
|
+
export type JsonSchema = IJsonObjectSchema | IJsonStringSchema | IJsonArraySchema | IJsonBooleanSchema | IJsonIntegerSchema | IJsonNumberSchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INumericAggregate, IStreamAggregateData, IStreamTypeMap } from "../main";
|
|
2
|
-
type WireINumericSetAggregateMap = {
|
|
2
|
+
export type WireINumericSetAggregateMap = {
|
|
3
3
|
[id: string]: {
|
|
4
4
|
value: INumericAggregate;
|
|
5
5
|
unit?: string;
|
|
@@ -22,4 +22,3 @@ export declare function reduceNumericStreamAggregates(stream: IStreamAggregateDa
|
|
|
22
22
|
export declare function reduceNumericSetStreamAggregates(stream: IStreamAggregateData<keyof IStreamTypeMap>, numericSetKey: string): INumericAggregate;
|
|
23
23
|
export declare function combineNumericAggregates(e1: INumericAggregate, e2: INumericAggregate): INumericAggregate;
|
|
24
24
|
export declare function combineNumericSetAggregates(e1: WireINumericSetAggregateMap, e2: WireINumericSetAggregateMap): WireINumericSetAggregateMap;
|
|
25
|
-
export {};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"require": "./dist/data-sdk.umd.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"version": "0.0.
|
|
21
|
+
"version": "0.0.119",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"dev": "vite --port 9146",
|
|
24
24
|
"build": "tsc && vite build",
|
|
@@ -27,12 +27,13 @@
|
|
|
27
27
|
"docs": "typedoc src/main.ts --theme default --out ../../docs/data-sdk/"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"typedoc": "^0.22.13",
|
|
30
31
|
"typescript": "^4.3.2",
|
|
31
|
-
"vite": "^2.5.4"
|
|
32
|
-
"typedoc": "^0.22.13"
|
|
32
|
+
"vite": "^2.5.4"
|
|
33
33
|
},
|
|
34
34
|
"types": "./dist/types/data-sdk/src/main.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@formant/realtime-sdk": "^0.0.19"
|
|
36
|
+
"@formant/realtime-sdk": "^0.0.19",
|
|
37
|
+
"date-fns": "^2.29.3"
|
|
37
38
|
}
|
|
38
39
|
}
|